2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1993, 1998 The Open Group
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
the above copyright notice appear in all copies and that both that
|
|
|
|
copyright notice and this permission notice appear in supporting
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included
|
|
|
|
in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
Except as contained in this notice, the name of The Open Group shall
|
|
|
|
not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
other dealings in this Software without prior written authorization
|
|
|
|
from The Open Group.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-07-12 02:52:48 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#if defined(WIN32)
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <X11/Xwinsock.h>
|
|
|
|
#endif
|
|
|
|
#include <stdio.h>
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include <X11/Xos.h>
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "servermd.h"
|
|
|
|
#define PSZ 8
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "fb.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "colormapst.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "mipointer.h"
|
2004-08-07 03:19:01 +02:00
|
|
|
#include "micmap.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <sys/types.h>
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <sys/mman.h>
|
|
|
|
#ifndef MAP_FILE
|
|
|
|
#define MAP_FILE 0
|
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAVE_MMAP */
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#ifndef WIN32
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
|
|
|
#include <X11/XWDFile.h>
|
|
|
|
#ifdef HAS_SHM
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAS_SHM */
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "dix.h"
|
|
|
|
#include "miline.h"
|
2012-11-16 18:51:58 +01:00
|
|
|
#include "glx_extinit.h"
|
2015-06-09 00:14:12 +02:00
|
|
|
#include "randrstr.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2005-03-23 21:49:52 +01:00
|
|
|
#define VFB_DEFAULT_WIDTH 1280
|
|
|
|
#define VFB_DEFAULT_HEIGHT 1024
|
2017-02-20 16:24:14 +01:00
|
|
|
#define VFB_DEFAULT_DEPTH 24
|
2005-03-23 21:49:52 +01:00
|
|
|
#define VFB_DEFAULT_WHITEPIXEL 1
|
|
|
|
#define VFB_DEFAULT_BLACKPIXEL 0
|
|
|
|
#define VFB_DEFAULT_LINEBIAS 0
|
|
|
|
#define XWD_WINDOW_NAME_LEN 60
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef struct {
|
2003-11-14 16:54:54 +01:00
|
|
|
int width;
|
2003-11-25 20:29:01 +01:00
|
|
|
int paddedBytesWidth;
|
2003-11-14 16:54:54 +01:00
|
|
|
int paddedWidth;
|
|
|
|
int height;
|
|
|
|
int depth;
|
|
|
|
int bitsPerPixel;
|
|
|
|
int sizeInBytes;
|
|
|
|
int ncolors;
|
|
|
|
char *pfbMemory;
|
|
|
|
XWDColor *pXWDCmap;
|
|
|
|
XWDFileHeader *pXWDHeader;
|
|
|
|
Pixel blackPixel;
|
|
|
|
Pixel whitePixel;
|
|
|
|
unsigned int lineBias;
|
2003-11-25 20:29:01 +01:00
|
|
|
CloseScreenProcPtr closeScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2003-11-14 16:54:54 +01:00
|
|
|
int mmap_fd;
|
|
|
|
char mmap_file[MAXPATHLEN];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAS_SHM
|
|
|
|
int shmid;
|
|
|
|
#endif
|
|
|
|
} vfbScreenInfo, *vfbScreenInfoPtr;
|
|
|
|
|
|
|
|
static int vfbNumScreens;
|
2010-04-27 03:23:27 +02:00
|
|
|
static vfbScreenInfo *vfbScreens;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 03:09:23 +02:00
|
|
|
static vfbScreenInfo defaultScreenInfo = {
|
2012-03-21 20:55:09 +01:00
|
|
|
.width = VFB_DEFAULT_WIDTH,
|
2010-04-27 03:09:23 +02:00
|
|
|
.height = VFB_DEFAULT_HEIGHT,
|
2012-03-21 20:55:09 +01:00
|
|
|
.depth = VFB_DEFAULT_DEPTH,
|
2010-04-27 03:09:23 +02:00
|
|
|
.blackPixel = VFB_DEFAULT_BLACKPIXEL,
|
|
|
|
.whitePixel = VFB_DEFAULT_WHITEPIXEL,
|
|
|
|
.lineBias = VFB_DEFAULT_LINEBIAS,
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
static Bool vfbPixmapDepths[33];
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2003-11-14 16:54:54 +01:00
|
|
|
static char *pfbdir = NULL;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType;
|
|
|
|
static fbMemType fbmemtype = NORMAL_MEMORY_FB;
|
|
|
|
static char needswap = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
static Bool Render = TRUE;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#define swapcopy16(_dst, _src) \
|
|
|
|
if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \
|
|
|
|
else _dst = _src;
|
|
|
|
|
|
|
|
#define swapcopy32(_dst, _src) \
|
|
|
|
if (needswap) { CARD32 _s = _src; cpswapl(_s, _dst); } \
|
|
|
|
else _dst = _src;
|
|
|
|
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbInitializePixmapDepths(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
vfbPixmapDepths[1] = TRUE; /* always need bitmaps */
|
2003-11-14 16:54:54 +01:00
|
|
|
for (i = 2; i <= 32; i++)
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[i] = FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbBitsPerPixel(int depth)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (depth == 1)
|
|
|
|
return 1;
|
|
|
|
else if (depth <= 8)
|
|
|
|
return 8;
|
|
|
|
else if (depth <= 16)
|
|
|
|
return 16;
|
|
|
|
else
|
|
|
|
return 32;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-07-20 05:09:05 +02:00
|
|
|
ddxGiveUp(enum ExitCode error)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* clean up the framebuffers */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
switch (fbmemtype) {
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2012-03-21 20:55:09 +01:00
|
|
|
case MMAPPED_FILE_FB:
|
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
|
|
|
if (-1 == unlink(vfbScreens[i].mmap_file)) {
|
|
|
|
perror("unlink");
|
|
|
|
ErrorF("unlink %s failed, %s",
|
|
|
|
vfbScreens[i].mmap_file, strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#else /* HAVE_MMAP */
|
2003-11-14 17:49:22 +01:00
|
|
|
case MMAPPED_FILE_FB:
|
|
|
|
break;
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAVE_MMAP */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef HAS_SHM
|
|
|
|
case SHARED_MEMORY_FB:
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
|
|
|
if (-1 == shmdt((char *) vfbScreens[i].pXWDHeader)) {
|
|
|
|
perror("shmdt");
|
|
|
|
ErrorF("shmdt failed, %s", strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#else /* HAS_SHM */
|
2003-11-14 17:49:22 +01:00
|
|
|
case SHARED_MEMORY_FB:
|
|
|
|
break;
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAS_SHM */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
case NORMAL_MEMORY_FB:
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
|
|
|
free(vfbScreens[i].pXWDHeader);
|
|
|
|
}
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-08 03:54:58 +01:00
|
|
|
#ifdef __APPLE__
|
2003-11-14 17:49:22 +01:00
|
|
|
void
|
|
|
|
DarwinHandleGUI(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
void
|
2009-01-11 08:28:23 +01:00
|
|
|
OsVendorInit(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
void
|
2012-02-17 21:35:02 +01:00
|
|
|
OsVendorFatalError(const char *f, va_list args)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-06-19 20:50:47 +02:00
|
|
|
#if defined(DDXBEFORERESET)
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
ddxBeforeReset(void)
|
2004-06-21 15:44:14 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2006-06-19 20:50:47 +02:00
|
|
|
#endif
|
2004-06-21 15:44:14 +02:00
|
|
|
|
2019-02-22 00:22:57 +01:00
|
|
|
#if INPUTTHREAD
|
|
|
|
/** This function is called in Xserver/os/inputthread.c when starting
|
|
|
|
the input thread. */
|
|
|
|
void
|
|
|
|
ddxInputThreadInit(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
void
|
2009-01-11 08:28:23 +01:00
|
|
|
ddxUseMsg(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2004-04-23 21:54:30 +02:00
|
|
|
ErrorF("-screen scrn WxHxD set screen's width, height, depth\n");
|
2003-11-14 16:54:54 +01:00
|
|
|
ErrorF("-pixdepths list-of-int support given pixmap depths\n");
|
2010-04-22 01:00:28 +02:00
|
|
|
ErrorF("+/-render turn on/off RENDER extension support"
|
2012-03-21 20:55:09 +01:00
|
|
|
"(default on)\n");
|
2003-11-14 16:54:54 +01:00
|
|
|
ErrorF("-linebias n adjust thin line pixelization\n");
|
|
|
|
ErrorF("-blackpixel n pixel value for black\n");
|
|
|
|
ErrorF("-whitepixel n pixel value for white\n");
|
|
|
|
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF
|
|
|
|
("-fbdir directory put framebuffers in mmap'ed files in directory\n");
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAS_SHM
|
|
|
|
ErrorF("-shmem put framebuffers in shared memory\n");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2003-11-25 20:29:01 +01:00
|
|
|
ddxProcessArgument(int argc, char *argv[], int i)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
static Bool firstTime = TRUE;
|
2010-04-27 03:09:23 +02:00
|
|
|
static int lastScreen = -1;
|
|
|
|
vfbScreenInfo *currentScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (firstTime) {
|
|
|
|
vfbInitializePixmapDepths();
|
2003-11-14 16:54:54 +01:00
|
|
|
firstTime = FALSE;
|
|
|
|
}
|
|
|
|
|
2010-04-27 03:09:23 +02:00
|
|
|
if (lastScreen == -1)
|
2012-03-21 20:55:09 +01:00
|
|
|
currentScreen = &defaultScreenInfo;
|
2010-04-27 03:09:23 +02:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
currentScreen = &vfbScreens[lastScreen];
|
2010-04-27 03:09:23 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-screen") == 0) { /* -screen n WxHxD */
|
|
|
|
int screenNum;
|
|
|
|
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(2);
|
|
|
|
screenNum = atoi(argv[i + 1]);
|
|
|
|
/* The protocol only has a CARD8 for number of screens in the
|
|
|
|
connection setup block, so don't allow more than that. */
|
|
|
|
if ((screenNum < 0) || (screenNum >= 255)) {
|
|
|
|
ErrorF("Invalid screen number %d\n", screenNum);
|
|
|
|
UseMsg();
|
|
|
|
FatalError("Invalid screen number %d passed to -screen\n",
|
|
|
|
screenNum);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vfbNumScreens <= screenNum) {
|
|
|
|
vfbScreens =
|
2015-03-22 01:23:33 +01:00
|
|
|
reallocarray(vfbScreens, screenNum + 1, sizeof(*vfbScreens));
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!vfbScreens)
|
|
|
|
FatalError("Not enough memory for screen %d\n", screenNum);
|
|
|
|
for (; vfbNumScreens <= screenNum; ++vfbNumScreens)
|
|
|
|
vfbScreens[vfbNumScreens] = defaultScreenInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (3 != sscanf(argv[i + 2], "%dx%dx%d",
|
|
|
|
&vfbScreens[screenNum].width,
|
|
|
|
&vfbScreens[screenNum].height,
|
|
|
|
&vfbScreens[screenNum].depth)) {
|
|
|
|
ErrorF("Invalid screen configuration %s\n", argv[i + 2]);
|
|
|
|
UseMsg();
|
|
|
|
FatalError("Invalid screen configuration %s for -screen %d\n",
|
|
|
|
argv[i + 2], screenNum);
|
|
|
|
}
|
|
|
|
|
|
|
|
lastScreen = screenNum;
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(argv[i], "-pixdepths") == 0) { /* -pixdepths list-of-depth */
|
|
|
|
int depth, ret = 1;
|
|
|
|
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
|
|
|
while ((++i < argc) && (depth = atoi(argv[i])) != 0) {
|
|
|
|
if (depth < 0 || depth > 32) {
|
|
|
|
ErrorF("Invalid pixmap depth %d\n", depth);
|
|
|
|
UseMsg();
|
|
|
|
FatalError("Invalid pixmap depth %d passed to -pixdepths\n",
|
|
|
|
depth);
|
|
|
|
}
|
|
|
|
vfbPixmapDepths[depth] = TRUE;
|
|
|
|
ret++;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(argv[i], "+render") == 0) { /* +render */
|
|
|
|
Render = TRUE;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(argv[i], "-render") == 0) { /* -render */
|
|
|
|
Render = FALSE;
|
2006-08-23 20:38:34 +02:00
|
|
|
#ifdef COMPOSITE
|
2012-03-21 20:55:09 +01:00
|
|
|
noCompositeExtension = TRUE;
|
2006-08-23 20:38:34 +02:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
return 1;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-blackpixel") == 0) { /* -blackpixel n */
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
|
|
|
currentScreen->blackPixel = atoi(argv[++i]);
|
|
|
|
return 2;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-whitepixel") == 0) { /* -whitepixel n */
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
|
|
|
currentScreen->whitePixel = atoi(argv[++i]);
|
|
|
|
return 2;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-linebias") == 0) { /* -linebias n */
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
|
|
|
currentScreen->lineBias = atoi(argv[++i]);
|
|
|
|
return 2;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-fbdir") == 0) { /* -fbdir directory */
|
|
|
|
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
|
|
|
pfbdir = argv[++i];
|
|
|
|
fbmemtype = MMAPPED_FILE_FB;
|
|
|
|
return 2;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAVE_MMAP */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#ifdef HAS_SHM
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(argv[i], "-shmem") == 0) { /* -shmem */
|
|
|
|
fbmemtype = SHARED_MEMORY_FB;
|
|
|
|
return 1;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbInstallColormap(ColormapPtr pmap)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2014-06-10 18:54:41 +02:00
|
|
|
ColormapPtr oldpmap = GetInstalledmiColormap(pmap->pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pmap != oldpmap) {
|
|
|
|
int entries;
|
|
|
|
XWDFileHeader *pXWDHeader;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
Pixel *ppix;
|
|
|
|
xrgb *prgb;
|
|
|
|
xColorItem *defs;
|
|
|
|
int i;
|
|
|
|
|
2014-06-10 18:54:41 +02:00
|
|
|
miInstallColormap(pmap);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
entries = pmap->pVisual->ColormapEntries;
|
|
|
|
pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader;
|
|
|
|
pVisual = pmap->pVisual;
|
|
|
|
|
|
|
|
swapcopy32(pXWDHeader->visual_class, pVisual->class);
|
|
|
|
swapcopy32(pXWDHeader->red_mask, pVisual->redMask);
|
|
|
|
swapcopy32(pXWDHeader->green_mask, pVisual->greenMask);
|
|
|
|
swapcopy32(pXWDHeader->blue_mask, pVisual->blueMask);
|
|
|
|
swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
|
|
|
|
swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
|
|
|
|
|
2015-03-22 01:23:33 +01:00
|
|
|
ppix = xallocarray(entries, sizeof(Pixel));
|
|
|
|
prgb = xallocarray(entries, sizeof(xrgb));
|
|
|
|
defs = xallocarray(entries, sizeof(xColorItem));
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
for (i = 0; i < entries; i++)
|
|
|
|
ppix[i] = i;
|
|
|
|
/* XXX truecolor */
|
|
|
|
QueryColors(pmap, entries, ppix, prgb, serverClient);
|
|
|
|
|
|
|
|
for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
|
|
|
|
defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
|
|
|
|
defs[i].red = prgb[i].red;
|
|
|
|
defs[i].green = prgb[i].green;
|
|
|
|
defs[i].blue = prgb[i].blue;
|
|
|
|
defs[i].flags = DoRed | DoGreen | DoBlue;
|
|
|
|
}
|
|
|
|
(*pmap->pScreen->StoreColors) (pmap, entries, defs);
|
|
|
|
|
|
|
|
free(ppix);
|
|
|
|
free(prgb);
|
|
|
|
free(defs);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
XWDColor *pXWDCmap;
|
|
|
|
int i;
|
|
|
|
|
2014-06-10 18:54:41 +02:00
|
|
|
if (pmap != GetInstalledmiColormap(pmap->pScreen)) {
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((pmap->pVisual->class | DynamicClass) == DirectColor) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < ndef; i++) {
|
|
|
|
if (pdefs[i].flags & DoRed) {
|
|
|
|
swapcopy16(pXWDCmap[pdefs[i].pixel].red, pdefs[i].red);
|
|
|
|
}
|
|
|
|
if (pdefs[i].flags & DoGreen) {
|
|
|
|
swapcopy16(pXWDCmap[pdefs[i].pixel].green, pdefs[i].green);
|
|
|
|
}
|
|
|
|
if (pdefs[i].flags & DoBlue) {
|
|
|
|
swapcopy16(pXWDCmap[pdefs[i].pixel].blue, pdefs[i].blue);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* this flushes any changes to the screens out to the mmapped file */
|
|
|
|
static void
|
2015-09-02 03:51:14 +02:00
|
|
|
vfbBlockHandler(void *blockData, void *timeout)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
2003-11-14 16:54:54 +01:00
|
|
|
#ifdef MS_ASYNC
|
2012-03-21 20:55:09 +01:00
|
|
|
if (-1 == msync((caddr_t) vfbScreens[i].pXWDHeader,
|
|
|
|
(size_t) vfbScreens[i].sizeInBytes, MS_ASYNC))
|
2003-11-14 16:54:54 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
/* silly NetBSD and who else? */
|
|
|
|
if (-1 == msync((caddr_t) vfbScreens[i].pXWDHeader,
|
|
|
|
(size_t) vfbScreens[i].sizeInBytes))
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
perror("msync");
|
|
|
|
ErrorF("msync failed, %s", strerror(errno));
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-09-02 03:51:14 +02:00
|
|
|
vfbWakeupHandler(void *blockData, int result)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
#define DUMMY_BUFFER_SIZE 65536
|
|
|
|
char dummyBuffer[DUMMY_BUFFER_SIZE];
|
|
|
|
int currentFileSize, writeThisTime;
|
|
|
|
|
2011-10-29 20:08:17 +02:00
|
|
|
snprintf(pvfb->mmap_file, sizeof(pvfb->mmap_file), "%s/Xvfb_screen%d",
|
2012-03-21 20:55:09 +01:00
|
|
|
pfbdir, (int) (pvfb - vfbScreens));
|
|
|
|
if (-1 == (pvfb->mmap_fd = open(pvfb->mmap_file, O_CREAT | O_RDWR, 0666))) {
|
|
|
|
perror("open");
|
|
|
|
ErrorF("open %s failed, %s", pvfb->mmap_file, strerror(errno));
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Extend the file to be the proper size */
|
|
|
|
|
2010-06-04 10:35:31 +02:00
|
|
|
memset(dummyBuffer, 0, DUMMY_BUFFER_SIZE);
|
2003-11-14 16:54:54 +01:00
|
|
|
for (currentFileSize = 0;
|
2012-03-21 20:55:09 +01:00
|
|
|
currentFileSize < pvfb->sizeInBytes;
|
|
|
|
currentFileSize += writeThisTime) {
|
|
|
|
writeThisTime = min(DUMMY_BUFFER_SIZE,
|
|
|
|
pvfb->sizeInBytes - currentFileSize);
|
|
|
|
if (-1 == write(pvfb->mmap_fd, dummyBuffer, writeThisTime)) {
|
|
|
|
perror("write");
|
|
|
|
ErrorF("write %s failed, %s", pvfb->mmap_file, strerror(errno));
|
|
|
|
return;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* try to mmap the file */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->pXWDHeader = (XWDFileHeader *) mmap((caddr_t) NULL, pvfb->sizeInBytes,
|
|
|
|
PROT_READ | PROT_WRITE,
|
|
|
|
MAP_FILE | MAP_SHARED,
|
|
|
|
pvfb->mmap_fd, 0);
|
|
|
|
if (-1 == (long) pvfb->pXWDHeader) {
|
|
|
|
perror("mmap");
|
|
|
|
ErrorF("mmap %s failed, %s", pvfb->mmap_file, strerror(errno));
|
|
|
|
pvfb->pXWDHeader = NULL;
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!RegisterBlockAndWakeupHandlers(vfbBlockHandler, vfbWakeupHandler,
|
2012-03-21 20:55:09 +01:00
|
|
|
NULL)) {
|
|
|
|
pvfb->pXWDHeader = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAVE_MMAP */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#ifdef HAS_SHM
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
/* create the shared memory segment */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->shmid = shmget(IPC_PRIVATE, pvfb->sizeInBytes, IPC_CREAT | 0777);
|
|
|
|
if (pvfb->shmid < 0) {
|
|
|
|
perror("shmget");
|
|
|
|
ErrorF("shmget %d bytes failed, %s", pvfb->sizeInBytes,
|
|
|
|
strerror(errno));
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* try to attach it */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->pXWDHeader = (XWDFileHeader *) shmat(pvfb->shmid, 0, 0);
|
|
|
|
if (-1 == (long) pvfb->pXWDHeader) {
|
|
|
|
perror("shmat");
|
|
|
|
ErrorF("shmat failed, %s", strerror(errno));
|
|
|
|
pvfb->pXWDHeader = NULL;
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2010-04-27 03:04:25 +02:00
|
|
|
ErrorF("screen %d shmid %d\n", (int) (pvfb - vfbScreens), pvfb->shmid);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* HAS_SHM */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
static char *
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pvfb->pfbMemory)
|
|
|
|
return pvfb->pfbMemory; /* already done */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* Calculate how many entries in colormap. This is rather bogus, because
|
|
|
|
* the visuals haven't even been set up yet, but we need to know because we
|
2005-11-07 22:03:49 +01:00
|
|
|
* have to allocate space in the file for the colormap. The number 10
|
|
|
|
* below comes from the MAX_PSEUDO_DEPTH define in cfbcmap.c.
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pvfb->depth <= 10) { /* single index colormaps */
|
|
|
|
pvfb->ncolors = 1 << pvfb->depth;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else { /* decomposed colormaps */
|
|
|
|
int nplanes_per_color_component = pvfb->depth / 3;
|
|
|
|
|
|
|
|
if (pvfb->depth % 3)
|
|
|
|
nplanes_per_color_component++;
|
|
|
|
pvfb->ncolors = 1 << nplanes_per_color_component;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* add extra bytes for XWDFileHeader, window name, and colormap */
|
|
|
|
|
|
|
|
pvfb->sizeInBytes += SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN +
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->ncolors * SIZEOF(XWDColor);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->pXWDHeader = NULL;
|
|
|
|
switch (fbmemtype) {
|
2011-12-01 07:20:09 +01:00
|
|
|
#ifdef HAVE_MMAP
|
2012-03-21 20:55:09 +01:00
|
|
|
case MMAPPED_FILE_FB:
|
|
|
|
vfbAllocateMmappedFramebuffer(pvfb);
|
|
|
|
break;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
case MMAPPED_FILE_FB:
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAS_SHM
|
2012-03-21 20:55:09 +01:00
|
|
|
case SHARED_MEMORY_FB:
|
|
|
|
vfbAllocateSharedMemoryFramebuffer(pvfb);
|
|
|
|
break;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
case SHARED_MEMORY_FB:
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
case NORMAL_MEMORY_FB:
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->pXWDHeader = (XWDFileHeader *) malloc(pvfb->sizeInBytes);
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pvfb->pXWDHeader) {
|
|
|
|
pvfb->pXWDCmap = (XWDColor *) ((char *) pvfb->pXWDHeader
|
|
|
|
+ SIZEOF(XWDheader) +
|
|
|
|
XWD_WINDOW_NAME_LEN);
|
|
|
|
pvfb->pfbMemory = (char *) (pvfb->pXWDCmap + pvfb->ncolors);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return pvfb->pfbMemory;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
return NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
vfbWriteXWDFileHeader(ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
|
|
|
|
XWDFileHeader *pXWDHeader = pvfb->pXWDHeader;
|
|
|
|
char hostname[XWD_WINDOW_NAME_LEN];
|
|
|
|
unsigned long swaptest = 1;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
needswap = *(char *) &swaptest;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pXWDHeader->header_size =
|
|
|
|
(char *) pvfb->pXWDCmap - (char *) pvfb->pXWDHeader;
|
2003-11-14 16:54:54 +01:00
|
|
|
pXWDHeader->file_version = XWD_FILE_VERSION;
|
|
|
|
|
|
|
|
pXWDHeader->pixmap_format = ZPixmap;
|
|
|
|
pXWDHeader->pixmap_depth = pvfb->depth;
|
|
|
|
pXWDHeader->pixmap_height = pXWDHeader->window_height = pvfb->height;
|
|
|
|
pXWDHeader->xoffset = 0;
|
|
|
|
pXWDHeader->byte_order = IMAGE_BYTE_ORDER;
|
|
|
|
pXWDHeader->bitmap_bit_order = BITMAP_BIT_ORDER;
|
|
|
|
#ifndef INTERNAL_VS_EXTERNAL_PADDING
|
|
|
|
pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->width;
|
|
|
|
pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT;
|
|
|
|
pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD;
|
|
|
|
#else
|
|
|
|
pXWDHeader->pixmap_width = pXWDHeader->window_width = pvfb->paddedWidth;
|
|
|
|
pXWDHeader->bitmap_unit = BITMAP_SCANLINE_UNIT_PROTO;
|
|
|
|
pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO;
|
|
|
|
#endif
|
|
|
|
pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel;
|
2003-11-25 20:29:01 +01:00
|
|
|
pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth;
|
2003-11-14 16:54:54 +01:00
|
|
|
pXWDHeader->ncolors = pvfb->ncolors;
|
|
|
|
|
|
|
|
/* visual related fields are written when colormap is installed */
|
|
|
|
|
|
|
|
pXWDHeader->window_x = pXWDHeader->window_y = 0;
|
|
|
|
pXWDHeader->window_bdrwidth = 0;
|
|
|
|
|
|
|
|
/* write xwd "window" name: Xvfb hostname:server.screen */
|
|
|
|
|
|
|
|
if (-1 == gethostname(hostname, sizeof(hostname)))
|
2012-03-21 20:55:09 +01:00
|
|
|
hostname[0] = 0;
|
2003-11-14 16:54:54 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
hostname[XWD_WINDOW_NAME_LEN - 1] = 0;
|
|
|
|
sprintf((char *) (pXWDHeader + 1), "Xvfb %s:%s.%d", hostname, display,
|
|
|
|
pScreen->myNum);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* write colormap pixel slot values */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < pvfb->ncolors; i++) {
|
|
|
|
pvfb->pXWDCmap[i].pixel = i;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* byte swap to most significant byte first */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (needswap) {
|
|
|
|
SwapLongs((CARD32 *) pXWDHeader, SIZEOF(XWDheader) / 4);
|
|
|
|
for (i = 0; i < pvfb->ncolors; i++) {
|
|
|
|
swapl(&pvfb->pXWDCmap[i].pixel);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbCrossScreen(ScreenPtr pScreen, Bool entering)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static miPointerScreenFuncRec vfbPointerCursorFuncs = {
|
2003-11-14 16:54:54 +01:00
|
|
|
vfbCursorOffScreen,
|
|
|
|
vfbCrossScreen,
|
|
|
|
miPointerWarpCursor
|
|
|
|
};
|
|
|
|
|
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
vfbCloseScreen(ScreenPtr pScreen)
|
2003-11-25 20:29:01 +01:00
|
|
|
{
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pScreen->CloseScreen = pvfb->closeScreen;
|
|
|
|
|
2012-05-11 21:31:50 +02:00
|
|
|
/*
|
|
|
|
* fb overwrites miCloseScreen, so do this here
|
|
|
|
*/
|
|
|
|
if (pScreen->devPrivate)
|
|
|
|
(*pScreen->DestroyPixmap) (pScreen->devPrivate);
|
|
|
|
pScreen->devPrivate = NULL;
|
|
|
|
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
return pScreen->CloseScreen(pScreen);
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
|
|
|
|
2015-06-09 00:14:12 +02:00
|
|
|
static Bool
|
|
|
|
vfbRROutputValidateMode(ScreenPtr pScreen,
|
|
|
|
RROutputPtr output,
|
|
|
|
RRModePtr mode)
|
|
|
|
{
|
|
|
|
rrScrPriv(pScreen);
|
|
|
|
|
|
|
|
if (pScrPriv->minWidth <= mode->mode.width &&
|
|
|
|
pScrPriv->maxWidth >= mode->mode.width &&
|
|
|
|
pScrPriv->minHeight <= mode->mode.height &&
|
|
|
|
pScrPriv->maxHeight >= mode->mode.height)
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
vfbRRScreenSetSize(ScreenPtr pScreen,
|
|
|
|
CARD16 width,
|
|
|
|
CARD16 height,
|
|
|
|
CARD32 mmWidth,
|
|
|
|
CARD32 mmHeight)
|
|
|
|
{
|
|
|
|
// Prevent screen updates while we change things around
|
dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-12 17:36:59 +01:00
|
|
|
SetRootClip(pScreen, ROOT_CLIP_NONE);
|
2015-06-09 00:14:12 +02:00
|
|
|
|
|
|
|
pScreen->width = width;
|
|
|
|
pScreen->height = height;
|
|
|
|
pScreen->mmWidth = mmWidth;
|
|
|
|
pScreen->mmHeight = mmHeight;
|
|
|
|
|
|
|
|
// Restore the ability to update screen, now with new dimensions
|
dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-12 17:36:59 +01:00
|
|
|
SetRootClip(pScreen, ROOT_CLIP_FULL);
|
2015-06-09 00:14:12 +02:00
|
|
|
|
|
|
|
RRScreenSizeNotify (pScreen);
|
|
|
|
RRTellChanged(pScreen);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
vfbRRCrtcSet(ScreenPtr pScreen,
|
|
|
|
RRCrtcPtr crtc,
|
|
|
|
RRModePtr mode,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
Rotation rotation,
|
|
|
|
int numOutput,
|
|
|
|
RROutputPtr *outputs)
|
|
|
|
{
|
|
|
|
return RRCrtcNotify(crtc, mode, x, y, rotation, NULL, numOutput, outputs);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
vfbRRGetInfo(ScreenPtr pScreen, Rotation *rotations)
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
vfbRandRInit(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
#if RANDR_12_INTERFACE
|
|
|
|
RRModePtr mode;
|
|
|
|
RRCrtcPtr crtc;
|
|
|
|
RROutputPtr output;
|
|
|
|
xRRModeInfo modeInfo;
|
|
|
|
char name[64];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!RRScreenInit (pScreen))
|
|
|
|
return FALSE;
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
|
|
|
pScrPriv->rrGetInfo = vfbRRGetInfo;
|
|
|
|
#if RANDR_12_INTERFACE
|
|
|
|
pScrPriv->rrCrtcSet = vfbRRCrtcSet;
|
|
|
|
pScrPriv->rrScreenSetSize = vfbRRScreenSetSize;
|
|
|
|
pScrPriv->rrOutputSetProperty = NULL;
|
|
|
|
#if RANDR_13_INTERFACE
|
|
|
|
pScrPriv->rrOutputGetProperty = NULL;
|
|
|
|
#endif
|
|
|
|
pScrPriv->rrOutputValidateMode = vfbRROutputValidateMode;
|
|
|
|
pScrPriv->rrModeDestroy = NULL;
|
|
|
|
|
|
|
|
RRScreenSetSizeRange (pScreen,
|
|
|
|
1, 1,
|
|
|
|
pScreen->width, pScreen->height);
|
|
|
|
|
|
|
|
sprintf (name, "%dx%d", pScreen->width, pScreen->height);
|
|
|
|
memset (&modeInfo, '\0', sizeof (modeInfo));
|
|
|
|
modeInfo.width = pScreen->width;
|
|
|
|
modeInfo.height = pScreen->height;
|
|
|
|
modeInfo.nameLength = strlen (name);
|
|
|
|
|
|
|
|
mode = RRModeGet (&modeInfo, name);
|
|
|
|
if (!mode)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
crtc = RRCrtcCreate (pScreen, NULL);
|
|
|
|
if (!crtc)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
output = RROutputCreate (pScreen, "screen", 6, NULL);
|
|
|
|
if (!output)
|
|
|
|
return FALSE;
|
|
|
|
if (!RROutputSetClones (output, NULL, 0))
|
|
|
|
return FALSE;
|
|
|
|
if (!RROutputSetModes (output, &mode, 1, 0))
|
|
|
|
return FALSE;
|
|
|
|
if (!RROutputSetCrtcs (output, &crtc, 1))
|
|
|
|
return FALSE;
|
|
|
|
if (!RROutputSetConnection (output, RR_Connected))
|
|
|
|
return FALSE;
|
|
|
|
RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);
|
|
|
|
#endif
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
|
2005-03-23 01:32:49 +01:00
|
|
|
int dpix = monitorResolution, dpiy = monitorResolution;
|
2003-11-14 16:54:54 +01:00
|
|
|
int ret;
|
|
|
|
char *pbits;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2005-03-23 01:32:49 +01:00
|
|
|
if (dpix == 0)
|
2012-03-21 20:55:09 +01:00
|
|
|
dpix = 100;
|
2005-03-23 01:32:49 +01:00
|
|
|
|
|
|
|
if (dpiy == 0)
|
2012-03-21 20:55:09 +01:00
|
|
|
dpiy = 100;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth);
|
2003-11-14 16:54:54 +01:00
|
|
|
pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pvfb->bitsPerPixel >= 8)
|
|
|
|
pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8);
|
2003-11-25 20:29:01 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
pvfb->paddedWidth = pvfb->paddedBytesWidth * 8;
|
2003-11-14 16:54:54 +01:00
|
|
|
pbits = vfbAllocateFramebufferMemory(pvfb);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!pbits)
|
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-08-07 03:19:01 +02:00
|
|
|
switch (pvfb->depth) {
|
2004-08-17 19:55:02 +02:00
|
|
|
case 8:
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetVisualTypesAndMasks(8,
|
|
|
|
((1 << StaticGray) |
|
|
|
|
(1 << GrayScale) |
|
|
|
|
(1 << StaticColor) |
|
|
|
|
(1 << PseudoColor) |
|
|
|
|
(1 << TrueColor) |
|
|
|
|
(1 << DirectColor)), 8, PseudoColor, 0, 0, 0);
|
|
|
|
break;
|
2004-08-07 03:19:01 +02:00
|
|
|
case 15:
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetVisualTypesAndMasks(15,
|
|
|
|
((1 << TrueColor) |
|
|
|
|
(1 << DirectColor)),
|
|
|
|
8, TrueColor, 0x7c00, 0x03e0, 0x001f);
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
case 16:
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetVisualTypesAndMasks(16,
|
|
|
|
((1 << TrueColor) |
|
|
|
|
(1 << DirectColor)),
|
|
|
|
8, TrueColor, 0xf800, 0x07e0, 0x001f);
|
|
|
|
break;
|
2004-08-07 03:19:01 +02:00
|
|
|
case 24:
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetVisualTypesAndMasks(24,
|
|
|
|
((1 << TrueColor) |
|
|
|
|
(1 << DirectColor)),
|
|
|
|
8, TrueColor, 0xff0000, 0x00ff00, 0x0000ff);
|
|
|
|
break;
|
2009-06-11 22:34:06 +02:00
|
|
|
case 30:
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetVisualTypesAndMasks(30,
|
|
|
|
((1 << TrueColor) |
|
|
|
|
(1 << DirectColor)),
|
|
|
|
10, TrueColor, 0x3ff00000, 0x000ffc00,
|
|
|
|
0x000003ff);
|
|
|
|
break;
|
2011-10-25 03:47:06 +02:00
|
|
|
default:
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2009-05-30 00:07:48 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miSetPixmapDepths();
|
2009-05-30 00:07:48 +02:00
|
|
|
|
2004-08-07 03:19:01 +02:00
|
|
|
ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
|
2012-03-21 20:55:09 +01:00
|
|
|
dpix, dpiy, pvfb->paddedWidth, pvfb->bitsPerPixel);
|
|
|
|
if (ret && Render)
|
|
|
|
fbPictureInit(pScreen, 0, 0);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!ret)
|
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2015-06-09 00:14:12 +02:00
|
|
|
if (!vfbRandRInit(pScreen))
|
|
|
|
return FALSE;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->InstallColormap = vfbInstallColormap;
|
|
|
|
pScreen->StoreColors = vfbStoreColors;
|
|
|
|
|
|
|
|
miDCInitialize(pScreen, &vfbPointerCursorFuncs);
|
|
|
|
|
|
|
|
vfbWriteXWDFileHeader(pScreen);
|
|
|
|
|
|
|
|
pScreen->blackPixel = pvfb->blackPixel;
|
|
|
|
pScreen->whitePixel = pvfb->whitePixel;
|
|
|
|
|
2004-08-07 03:19:01 +02:00
|
|
|
ret = fbCreateDefColormap(pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
miSetZeroLineBias(pScreen, pvfb->lineBias);
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pvfb->closeScreen = pScreen->CloseScreen;
|
|
|
|
pScreen->CloseScreen = vfbCloseScreen;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return ret;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
} /* end vfbScreenInit */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
void
|
2013-12-15 10:55:43 +01:00
|
|
|
InitOutput(ScreenInfo * screen_info, int argc, char **argv)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int NumFormats = 0;
|
|
|
|
|
|
|
|
/* initialize pixmap formats */
|
|
|
|
|
|
|
|
/* must have a pixmap depth to match every screen depth */
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
|
|
|
vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
/* RENDER needs a good set of pixmaps. */
|
|
|
|
if (Render) {
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[1] = TRUE;
|
|
|
|
vfbPixmapDepths[4] = TRUE;
|
|
|
|
vfbPixmapDepths[8] = TRUE;
|
2005-07-23 20:16:06 +02:00
|
|
|
#if 0
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[12] = TRUE;
|
2005-07-23 20:16:06 +02:00
|
|
|
#endif
|
2004-08-07 03:19:01 +02:00
|
|
|
/* vfbPixmapDepths[15] = TRUE; */
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[16] = TRUE;
|
|
|
|
vfbPixmapDepths[24] = TRUE;
|
2005-07-23 20:16:06 +02:00
|
|
|
#if 0
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[30] = TRUE;
|
2005-07-23 20:16:06 +02:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
vfbPixmapDepths[32] = TRUE;
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2018-01-10 19:05:45 +01:00
|
|
|
xorgGlxCreateVendor();
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 1; i <= 32; i++) {
|
|
|
|
if (vfbPixmapDepths[i]) {
|
|
|
|
if (NumFormats >= MAXFORMATS)
|
|
|
|
FatalError("MAXFORMATS is too small for this server\n");
|
2013-12-15 10:55:43 +01:00
|
|
|
screen_info->formats[NumFormats].depth = i;
|
|
|
|
screen_info->formats[NumFormats].bitsPerPixel = vfbBitsPerPixel(i);
|
|
|
|
screen_info->formats[NumFormats].scanlinePad = BITMAP_SCANLINE_PAD;
|
2012-03-21 20:55:09 +01:00
|
|
|
NumFormats++;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2013-12-15 10:55:43 +01:00
|
|
|
screen_info->imageByteOrder = IMAGE_BYTE_ORDER;
|
|
|
|
screen_info->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
|
|
|
|
screen_info->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
|
|
|
|
screen_info->bitmapBitOrder = BITMAP_BIT_ORDER;
|
|
|
|
screen_info->numPixmapFormats = NumFormats;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* initialize screens */
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (vfbNumScreens < 1) {
|
|
|
|
vfbScreens = &defaultScreenInfo;
|
|
|
|
vfbNumScreens = 1;
|
2010-04-27 03:09:23 +02:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < vfbNumScreens; i++) {
|
|
|
|
if (-1 == AddScreen(vfbScreenInit, argc, argv)) {
|
|
|
|
FatalError("Couldn't add screen %d", i);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
} /* end InitOutput */
|