Merge branch 'master' into mpx

This commit is contained in:
Peter Hutterer 2008-01-10 13:38:46 +10:30
commit 38bf01bd1c
57 changed files with 926 additions and 551 deletions

View File

@ -14,7 +14,8 @@ AM_CFLAGS = \
-I@MESA_SOURCE@/src/mesa/glapi \ -I@MESA_SOURCE@/src/mesa/glapi \
-I@MESA_SOURCE@/src/mesa/main \ -I@MESA_SOURCE@/src/mesa/main \
-DXFree86Server \ -DXFree86Server \
@GLX_DEFINES@ @GLX_DEFINES@ \
@GLX_ARCH_DEFINES@
# none yet # none yet
#sdk_HEADERS = #sdk_HEADERS =

View File

@ -538,6 +538,7 @@ __glGetBooleanv_size(GLenum e)
case GL_UNPACK_SKIP_IMAGES: case GL_UNPACK_SKIP_IMAGES:
case GL_UNPACK_IMAGE_HEIGHT: case GL_UNPACK_IMAGE_HEIGHT:
case GL_TEXTURE_3D: case GL_TEXTURE_3D:
case GL_MAX_3D_TEXTURE_SIZE:
case GL_VERTEX_ARRAY: case GL_VERTEX_ARRAY:
case GL_NORMAL_ARRAY: case GL_NORMAL_ARRAY:
case GL_COLOR_ARRAY: case GL_COLOR_ARRAY:
@ -612,6 +613,7 @@ __glGetBooleanv_size(GLenum e)
/* case GL_CLIENT_ACTIVE_TEXTURE_ARB:*/ /* case GL_CLIENT_ACTIVE_TEXTURE_ARB:*/
case GL_MAX_TEXTURE_UNITS: case GL_MAX_TEXTURE_UNITS:
/* case GL_MAX_TEXTURE_UNITS_ARB:*/ /* case GL_MAX_TEXTURE_UNITS_ARB:*/
case GL_MAX_RENDERBUFFER_SIZE_EXT:
case GL_TEXTURE_COMPRESSION_HINT: case GL_TEXTURE_COMPRESSION_HINT:
/* case GL_TEXTURE_COMPRESSION_HINT_ARB:*/ /* case GL_TEXTURE_COMPRESSION_HINT_ARB:*/
case GL_TEXTURE_RECTANGLE_ARB: case GL_TEXTURE_RECTANGLE_ARB:
@ -714,6 +716,10 @@ __glGetBooleanv_size(GLenum e)
case GL_ACTIVE_STENCIL_FACE_EXT: case GL_ACTIVE_STENCIL_FACE_EXT:
case GL_TEXTURE_BINDING_1D_ARRAY_EXT: case GL_TEXTURE_BINDING_1D_ARRAY_EXT:
case GL_TEXTURE_BINDING_2D_ARRAY_EXT: case GL_TEXTURE_BINDING_2D_ARRAY_EXT:
case GL_DRAW_FRAMEBUFFER_BINDING_EXT:
case GL_RENDERBUFFER_BINDING_EXT:
case GL_READ_FRAMEBUFFER_BINDING_EXT:
case GL_MAX_COLOR_ATTACHMENTS_EXT:
case GL_RASTER_POSITION_UNCLIPPED_IBM: case GL_RASTER_POSITION_UNCLIPPED_IBM:
return 1; return 1;
case GL_SMOOTH_POINT_SIZE_RANGE: case GL_SMOOTH_POINT_SIZE_RANGE:

View File

@ -61,8 +61,8 @@ in this Software without prior written authorization from The Open Group.
static int MultibufferEventBase; static int MultibufferEventBase;
static int MultibufferErrorBase; static int MultibufferErrorBase;
int MultibufferScreenIndex = -1; static DevPrivateKey MultibufferScreenPrivKey = &MultibufferScreenPrivKey;
int MultibufferWindowIndex = -1; static DevPrivateKey MultibufferWindowPrivKey = &MultibufferWindowPrivKey;
static void PerformDisplayRequest ( static void PerformDisplayRequest (
MultibuffersPtr * /* ppMultibuffers */, MultibuffersPtr * /* ppMultibuffers */,
@ -200,27 +200,16 @@ MultibufferExtensionInit()
ScreenPtr pScreen; ScreenPtr pScreen;
MultibufferScreenPtr pMultibufferScreen; MultibufferScreenPtr pMultibufferScreen;
/*
* allocate private pointers in windows and screens. Allocating
* window privates may seem like an unnecessary expense, but every
* PositionWindow call must check to see if the window is
* multi-buffered; a resource lookup is too expensive.
*/
MultibufferScreenIndex = AllocateScreenPrivateIndex ();
if (MultibufferScreenIndex < 0)
return;
MultibufferWindowIndex = AllocateWindowPrivateIndex ();
for (i = 0; i < screenInfo.numScreens; i++) for (i = 0; i < screenInfo.numScreens; i++)
{ {
pScreen = screenInfo.screens[i]; pScreen = screenInfo.screens[i];
if (!AllocateWindowPrivate (pScreen, MultibufferWindowIndex, 0) || if (!(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
!(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
{ {
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
xfree (screenInfo.screens[j]->devPrivates[MultibufferScreenIndex].ptr); xfree (dixLookupPrivate(&screenInfo.screens[j]->devPrivates, MultibufferScreenPrivKey));
return; return;
} }
pScreen->devPrivates[MultibufferScreenIndex].ptr = (pointer) pMultibufferScreen; dixSetPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey, pMultibufferScreen);
/* /*
* wrap PositionWindow to resize the pixmap when the window * wrap PositionWindow to resize the pixmap when the window
* changes size * changes size
@ -260,14 +249,11 @@ ExtensionEntry *extEntry;
ScreenPtr pScreen; ScreenPtr pScreen;
MultibufferScreenPtr pMultibufferScreen; MultibufferScreenPtr pMultibufferScreen;
if (MultibufferScreenIndex < 0)
return;
for (i = 0; i < screenInfo.numScreens; i++) for (i = 0; i < screenInfo.numScreens; i++)
{ {
pScreen = screenInfo.screens[i]; pScreen = screenInfo.screens[i];
if (pScreen->devPrivates[MultibufferScreenIndex].ptr) if ((pMultibufferScreen = (MultibufferScreenPtr)dixLookupPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey)))
{ {
pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr;
pScreen->PositionWindow = pMultibufferScreen->PositionWindow; pScreen->PositionWindow = pMultibufferScreen->PositionWindow;
xfree (pMultibufferScreen); xfree (pMultibufferScreen);
} }
@ -427,7 +413,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint)
pMultibuffers->lastUpdate.milliseconds = 0; pMultibuffers->lastUpdate.milliseconds = 0;
pMultibuffers->width = width; pMultibuffers->width = width;
pMultibuffers->height = height; pMultibuffers->height = height;
pWin->devPrivates[MultibufferWindowIndex].ptr = (pointer) pMultibuffers; dixSetPrivate(&pWin->devPrivates, MultibufferWindowPrivKey, pMultibuffers);
if (pClearGC) FreeScratchGC(pClearGC); if (pClearGC) FreeScratchGC(pClearGC);
return Success; return Success;
} }
@ -487,7 +473,7 @@ ProcCreateImageBuffers (client)
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.numberBuffer = ((MultibuffersPtr) (pWin->devPrivates[MultibufferWindowIndex].ptr))->numMultibuffer; rep.numberBuffer = ((MultibuffersPtr) (dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))->numMultibuffer;
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
@ -1236,7 +1222,7 @@ GetBufferPointer (pWin, i)
{ {
MultibuffersPtr pMultibuffers; MultibuffersPtr pMultibuffers;
if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr)) if (!(pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))
return NULL; return NULL;
return (DrawablePtr) pMultibuffers->buffers[i].pPixmap; return (DrawablePtr) pMultibuffers->buffers[i].pPixmap;
} }
@ -1475,7 +1461,7 @@ DestroyImageBuffers (pWin)
{ {
FreeResourceByType (pWin->drawable.id, MultibuffersResType, FALSE); FreeResourceByType (pWin->drawable.id, MultibuffersResType, FALSE);
/* Zero out the window's pointer to the buffers so they won't be reused */ /* Zero out the window's pointer to the buffers so they won't be reused */
pWin->devPrivates[MultibufferWindowIndex].ptr = NULL; dixSetPrivate(&pWin->devPrivates, MultibufferWindowPrivKey, NULL);
} }
/* /*
@ -1503,11 +1489,11 @@ MultibufferPositionWindow (pWin, x, y)
Bool clear; Bool clear;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pMultibufferScreen = (MultibufferScreenPtr) pScreen->devPrivates[MultibufferScreenIndex].ptr; pMultibufferScreen = (MultibufferScreenPtr) dixLookupPrivate(&pScreen->devPrivates, MultibufferScreenPrivKey);
(*pMultibufferScreen->PositionWindow) (pWin, x, y); (*pMultibufferScreen->PositionWindow) (pWin, x, y);
/* if this window is not multibuffered, we're done */ /* if this window is not multibuffered, we're done */
if (!(pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr)) if (!(pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey)))
return TRUE; return TRUE;
/* if new size is same as old, we're done */ /* if new size is same as old, we're done */
@ -1620,7 +1606,7 @@ MultibufferDrawableDelete (value, id)
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
{ {
pWin = (WindowPtr) pDrawable; pWin = (WindowPtr) pDrawable;
pMultibuffers = (MultibuffersPtr) pWin->devPrivates[MultibufferWindowIndex].ptr; pMultibuffers = (MultibuffersPtr) dixLookupPrivate(&pWin->devPrivates, MultibufferWindowPrivKey);
pPixmap = pMultibuffers->buffers[pMultibuffers->displayedMultibuffer].pPixmap; pPixmap = pMultibuffers->buffers[pMultibuffers->displayedMultibuffer].pPixmap;
} }
else else

View File

@ -262,10 +262,7 @@ XaceResetProc(ExtensionEntry *extEntry)
int i; int i;
for (i=0; i<XACE_NUM_HOOKS; i++) for (i=0; i<XACE_NUM_HOOKS; i++)
{
DeleteCallbackList(&XaceHooks[i]); DeleteCallbackList(&XaceHooks[i]);
XaceHooks[i] = NULL;
}
} /* XaceResetProc */ } /* XaceResetProc */
@ -448,7 +445,7 @@ XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
/* convert region to list-of-rectangles for PolyFillRect */ /* convert region to list-of-rectangles for PolyFillRect */
pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle *)); pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle));
if (!pRects) if (!pRects)
{ {
failed = TRUE; failed = TRUE;

View File

@ -164,7 +164,6 @@ ProcXCalibrateSetRawMode (ClientPtr client)
return (client->noClientException); return (client->noClientException);
} }
static int static int
SProcXCalibrateSetRawMode (ClientPtr client) SProcXCalibrateSetRawMode (ClientPtr client)
{ {
@ -178,6 +177,47 @@ SProcXCalibrateSetRawMode (ClientPtr client)
return ProcXCalibrateSetRawMode(client); return ProcXCalibrateSetRawMode(client);
} }
static int
ProcXCalibrateScreenToCoord (ClientPtr client)
{
REQUEST(xXCalibrateScreenToCoordReq);
xXCalibrateScreenToCoordReply rep;
REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
memset (&rep, 0, sizeof (rep));
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.x = stuff->x;
rep.y = stuff->y;
KdScreenToPointerCoords(&rep.x, &rep.y);
if (client->swapped)
{
int n;
swaps (&rep.x, n);
swaps (&rep.y, n);
}
WriteToClient(client, sizeof (rep), (char *) &rep);
return (client->noClientException);
}
static int
SProcXCalibrateScreenToCoord (ClientPtr client)
{
REQUEST(xXCalibrateScreenToCoordReq);
int n;
REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
swaps(&stuff->x, n);
swaps(&stuff->y, n);
return ProcXCalibrateScreenToCoord(client);
}
static void static void
XCalibrateResetProc (ExtensionEntry *extEntry) XCalibrateResetProc (ExtensionEntry *extEntry)
{ {
@ -192,6 +232,9 @@ ProcXCalibrateDispatch (ClientPtr client)
return ProcXCalibrateQueryVersion(client); return ProcXCalibrateQueryVersion(client);
case X_XCalibrateRawMode: case X_XCalibrateRawMode:
return ProcXCalibrateSetRawMode(client); return ProcXCalibrateSetRawMode(client);
case X_XCalibrateScreenToCoord:
return ProcXCalibrateScreenToCoord(client);
default: break; default: break;
} }
@ -211,6 +254,8 @@ SProcXCalibrateDispatch (ClientPtr client)
return SProcXCalibrateQueryVersion(client); return SProcXCalibrateQueryVersion(client);
case X_XCalibrateRawMode: case X_XCalibrateRawMode:
return SProcXCalibrateSetRawMode(client); return SProcXCalibrateSetRawMode(client);
case X_XCalibrateScreenToCoord:
return SProcXCalibrateScreenToCoord(client);
default: break; default: break;
} }

View File

@ -175,12 +175,12 @@ SELinuxSelectionToSID(Atom selection, SELinuxStateRec *sid_return)
security_id_t sid; security_id_t sid;
if (selabel_lookup(label_hnd, &con, name, SELABEL_X_SELN) < 0) { if (selabel_lookup(label_hnd, &con, name, SELABEL_X_SELN) < 0) {
ErrorF("XSELinux: a selection label lookup failed!\n"); ErrorF("SELinux: a selection label lookup failed!\n");
return BadValue; return BadValue;
} }
/* Get a SID for context */ /* Get a SID for context */
if (avc_context_to_sid(con, &sid) < 0) { if (avc_context_to_sid(con, &sid) < 0) {
ErrorF("XSELinux: a context_to_SID call failed!\n"); ErrorF("SELinux: a context_to_SID call failed!\n");
return BadAlloc; return BadAlloc;
} }
freecon(con); freecon(con);
@ -216,12 +216,12 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
if (!knownEvents[type]) { if (!knownEvents[type]) {
/* Look in the mappings of event names to contexts */ /* Look in the mappings of event names to contexts */
if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EVENT) < 0) { if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EVENT) < 0) {
ErrorF("XSELinux: an event label lookup failed!\n"); ErrorF("SELinux: an event label lookup failed!\n");
return BadValue; return BadValue;
} }
/* Get a SID for context */ /* Get a SID for context */
if (avc_context_to_sid(con, knownEvents + type) < 0) { if (avc_context_to_sid(con, knownEvents + type) < 0) {
ErrorF("XSELinux: a context_to_SID call failed!\n"); ErrorF("SELinux: a context_to_SID call failed!\n");
return BadAlloc; return BadAlloc;
} }
freecon(con); freecon(con);
@ -230,7 +230,7 @@ SELinuxEventToSID(unsigned type, security_id_t sid_of_window,
/* Perform a transition to obtain the final SID */ /* Perform a transition to obtain the final SID */
if (avc_compute_create(sid_of_window, knownEvents[type], SECCLASS_X_EVENT, if (avc_compute_create(sid_of_window, knownEvents[type], SECCLASS_X_EVENT,
&sid_return->sid) < 0) { &sid_return->sid) < 0) {
ErrorF("XSELinux: a compute_create call failed!\n"); ErrorF("SELinux: a compute_create call failed!\n");
return BadValue; return BadValue;
} }
@ -607,13 +607,13 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Look in the mappings of property names to contexts */ /* Look in the mappings of property names to contexts */
if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EXT) < 0) { if (selabel_lookup(label_hnd, &con, name, SELABEL_X_EXT) < 0) {
ErrorF("XSELinux: a property label lookup failed!\n"); ErrorF("SELinux: a property label lookup failed!\n");
rec->status = BadValue; rec->status = BadValue;
return; return;
} }
/* Get a SID for context */ /* Get a SID for context */
if (avc_context_to_sid(con, &sid) < 0) { if (avc_context_to_sid(con, &sid) < 0) {
ErrorF("XSELinux: a context_to_SID call failed!\n"); ErrorF("SELinux: a context_to_SID call failed!\n");
rec->status = BadAlloc; rec->status = BadAlloc;
return; return;
} }
@ -623,7 +623,7 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Perform a transition to obtain the final SID */ /* Perform a transition to obtain the final SID */
if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION, if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION,
&obj->sid) < 0) { &obj->sid) < 0) {
ErrorF("XSELinux: a SID transition call failed!\n"); ErrorF("SELinux: a SID transition call failed!\n");
freecon(con); freecon(con);
rec->status = BadValue; rec->status = BadValue;
return; return;
@ -658,13 +658,13 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Look in the mappings of property names to contexts */ /* Look in the mappings of property names to contexts */
if (selabel_lookup(label_hnd, &con, name, SELABEL_X_PROP) < 0) { if (selabel_lookup(label_hnd, &con, name, SELABEL_X_PROP) < 0) {
ErrorF("XSELinux: a property label lookup failed!\n"); ErrorF("SELinux: a property label lookup failed!\n");
rec->status = BadValue; rec->status = BadValue;
return; return;
} }
/* Get a SID for context */ /* Get a SID for context */
if (avc_context_to_sid(con, &sid) < 0) { if (avc_context_to_sid(con, &sid) < 0) {
ErrorF("XSELinux: a context_to_SID call failed!\n"); ErrorF("SELinux: a context_to_SID call failed!\n");
rec->status = BadAlloc; rec->status = BadAlloc;
return; return;
} }
@ -674,7 +674,7 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Perform a transition to obtain the final SID */ /* Perform a transition to obtain the final SID */
if (avc_compute_create(subj->sid, sid, SECCLASS_X_PROPERTY, if (avc_compute_create(subj->sid, sid, SECCLASS_X_PROPERTY,
&obj->sid) < 0) { &obj->sid) < 0) {
ErrorF("XSELinux: a SID transition call failed!\n"); ErrorF("SELinux: a SID transition call failed!\n");
freecon(con); freecon(con);
rec->status = BadValue; rec->status = BadValue;
return; return;
@ -732,7 +732,7 @@ SELinuxResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* Perform a transition to obtain the final SID */ /* Perform a transition to obtain the final SID */
if (avc_compute_create(subj->sid, pobj->sid, class, &obj->sid) < 0) { if (avc_compute_create(subj->sid, pobj->sid, class, &obj->sid) < 0) {
ErrorF("XSELinux: a compute_create call failed!\n"); ErrorF("SELinux: a compute_create call failed!\n");
rec->status = BadValue; rec->status = BadValue;
return; return;
} }
@ -766,7 +766,7 @@ SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata)
/* Perform a transition to obtain the final SID */ /* Perform a transition to obtain the final SID */
if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN, if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN,
&obj->sid) < 0) { &obj->sid) < 0) {
ErrorF("XSELinux: a compute_create call failed!\n"); ErrorF("SELinux: a compute_create call failed!\n");
rec->status = BadValue; rec->status = BadValue;
return; return;
} }
@ -883,16 +883,16 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
security_context_t ctx; security_context_t ctx;
int rc = avc_sid_to_context(state->sid, &ctx); int rc = avc_sid_to_context(state->sid, &ctx);
if (rc < 0) if (rc < 0)
FatalError("XSELinux: Failed to get security context!\n"); FatalError("SELinux: Failed to get security context!\n");
rc = dixChangeWindowProperty(serverClient, rc = dixChangeWindowProperty(serverClient,
pWin, atom_client_ctx, XA_STRING, 8, pWin, atom_client_ctx, XA_STRING, 8,
PropModeReplace, strlen(ctx), ctx, FALSE); PropModeReplace, strlen(ctx), ctx, FALSE);
if (rc != Success) if (rc != Success)
FatalError("XSELinux: Failed to set label property on window!\n"); FatalError("SELinux: Failed to set label property on window!\n");
freecon(ctx); freecon(ctx);
} }
else else
FatalError("XSELinux: Unexpected unlabeled client found\n"); FatalError("SELinux: Unexpected unlabeled client found\n");
state = dixLookupPrivate(&pWin->devPrivates, stateKey); state = dixLookupPrivate(&pWin->devPrivates, stateKey);
@ -900,16 +900,16 @@ SELinuxResourceState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
security_context_t ctx; security_context_t ctx;
int rc = avc_sid_to_context(state->sid, &ctx); int rc = avc_sid_to_context(state->sid, &ctx);
if (rc < 0) if (rc < 0)
FatalError("XSELinux: Failed to get security context!\n"); FatalError("SELinux: Failed to get security context!\n");
rc = dixChangeWindowProperty(serverClient, rc = dixChangeWindowProperty(serverClient,
pWin, atom_ctx, XA_STRING, 8, pWin, atom_ctx, XA_STRING, 8,
PropModeReplace, strlen(ctx), ctx, FALSE); PropModeReplace, strlen(ctx), ctx, FALSE);
if (rc != Success) if (rc != Success)
FatalError("XSELinux: Failed to set label property on window!\n"); FatalError("SELinux: Failed to set label property on window!\n");
freecon(ctx); freecon(ctx);
} }
else else
FatalError("XSELinux: Unexpected unlabeled window found\n"); FatalError("SELinux: Unexpected unlabeled window found\n");
} }
static void static void
@ -931,7 +931,7 @@ SELinuxSelectionState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SELECTION, if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SELECTION,
&obj->sid) < 0) { &obj->sid) < 0) {
ErrorF("XSELinux: a compute_create call failed!\n"); ErrorF("SELinux: a compute_create call failed!\n");
obj->sid = unlabeled_sid; obj->sid = unlabeled_sid;
} }
break; break;
@ -998,8 +998,8 @@ ProcSELinuxQueryVersion(ClientPtr client)
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.server_major = XSELINUX_MAJOR_VERSION; rep.server_major = SELINUX_MAJOR_VERSION;
rep.server_minor = XSELINUX_MINOR_VERSION; rep.server_minor = SELINUX_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
int n; int n;
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
@ -1145,31 +1145,31 @@ ProcSELinuxDispatch(ClientPtr client)
REQUEST(xReq); REQUEST(xReq);
switch (stuff->data) { switch (stuff->data) {
case X_SELinuxQueryVersion: case X_SELinuxQueryVersion:
return ProcSELinuxQueryVersion(client); return ProcSELinuxQueryVersion(client);
case X_SELinuxSetSelectionManager: case X_SELinuxSetSelectionManager:
return ProcSELinuxSetSelectionManager(client); return ProcSELinuxSetSelectionManager(client);
case X_SELinuxGetSelectionManager: case X_SELinuxGetSelectionManager:
return ProcSELinuxGetSelectionManager(client); return ProcSELinuxGetSelectionManager(client);
case X_SELinuxSetDeviceCreateContext: case X_SELinuxSetDeviceCreateContext:
return ProcSELinuxSetDeviceCreateContext(client); return ProcSELinuxSetDeviceCreateContext(client);
case X_SELinuxGetDeviceCreateContext: case X_SELinuxGetDeviceCreateContext:
return ProcSELinuxGetDeviceCreateContext(client); return ProcSELinuxGetDeviceCreateContext(client);
case X_SELinuxSetDeviceContext: case X_SELinuxSetDeviceContext:
return ProcSELinuxSetDeviceContext(client); return ProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext: case X_SELinuxGetDeviceContext:
return ProcSELinuxGetDeviceContext(client); return ProcSELinuxGetDeviceContext(client);
case X_SELinuxSetPropertyCreateContext: case X_SELinuxSetPropertyCreateContext:
return ProcSELinuxSetPropertyCreateContext(client); return ProcSELinuxSetPropertyCreateContext(client);
case X_SELinuxGetPropertyCreateContext: case X_SELinuxGetPropertyCreateContext:
return ProcSELinuxGetPropertyCreateContext(client); return ProcSELinuxGetPropertyCreateContext(client);
case X_SELinuxGetPropertyContext: case X_SELinuxGetPropertyContext:
return ProcSELinuxGetPropertyContext(client); return ProcSELinuxGetPropertyContext(client);
case X_SELinuxSetWindowCreateContext: case X_SELinuxSetWindowCreateContext:
return ProcSELinuxSetWindowCreateContext(client); return ProcSELinuxSetWindowCreateContext(client);
case X_SELinuxGetWindowCreateContext: case X_SELinuxGetWindowCreateContext:
return ProcSELinuxGetWindowCreateContext(client); return ProcSELinuxGetWindowCreateContext(client);
case X_SELinuxGetWindowContext: case X_SELinuxGetWindowContext:
return ProcSELinuxGetWindowContext(client); return ProcSELinuxGetWindowContext(client);
default: default:
return BadRequest; return BadRequest;
} }
@ -1198,69 +1198,82 @@ SProcSELinuxSetSelectionManager(ClientPtr client)
return ProcSELinuxSetSelectionManager(client); return ProcSELinuxSetSelectionManager(client);
} }
static int
SProcSELinuxGetSelectionManager(ClientPtr client)
{
return ProcSELinuxGetSelectionManager(client);
}
static int static int
SProcSELinuxSetDeviceCreateContext(ClientPtr client) SProcSELinuxSetDeviceCreateContext(ClientPtr client)
{ {
return ProcSELinuxSetDeviceCreateContext(client); REQUEST(SELinuxSetCreateContextReq);
} int n;
static int REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
SProcSELinuxGetDeviceCreateContext(ClientPtr client) swaps(&stuff->context_len,n);
{ return ProcSELinuxSetDeviceCreateContext(client);
return ProcSELinuxGetDeviceCreateContext(client);
} }
static int static int
SProcSELinuxSetDeviceContext(ClientPtr client) SProcSELinuxSetDeviceContext(ClientPtr client)
{ {
REQUEST(SELinuxSetContextReq);
int n;
REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
swapl(&stuff->id,n);
swaps(&stuff->context_len,n);
return ProcSELinuxSetDeviceContext(client); return ProcSELinuxSetDeviceContext(client);
} }
static int static int
SProcSELinuxGetDeviceContext(ClientPtr client) SProcSELinuxGetDeviceContext(ClientPtr client)
{ {
REQUEST(SELinuxGetContextReq);
int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
swapl(&stuff->id,n);
return ProcSELinuxGetDeviceContext(client); return ProcSELinuxGetDeviceContext(client);
} }
static int static int
SProcSELinuxSetPropertyCreateContext(ClientPtr client) SProcSELinuxSetPropertyCreateContext(ClientPtr client)
{ {
return ProcSELinuxSetPropertyCreateContext(client); REQUEST(SELinuxSetCreateContextReq);
} int n;
static int REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
SProcSELinuxGetPropertyCreateContext(ClientPtr client) swaps(&stuff->context_len,n);
{ return ProcSELinuxSetPropertyCreateContext(client);
return ProcSELinuxGetPropertyCreateContext(client);
} }
static int static int
SProcSELinuxGetPropertyContext(ClientPtr client) SProcSELinuxGetPropertyContext(ClientPtr client)
{ {
REQUEST(SELinuxGetPropertyContextReq);
int n;
REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
swapl(&stuff->window,n);
swapl(&stuff->property,n);
return ProcSELinuxGetPropertyContext(client); return ProcSELinuxGetPropertyContext(client);
} }
static int static int
SProcSELinuxSetWindowCreateContext(ClientPtr client) SProcSELinuxSetWindowCreateContext(ClientPtr client)
{ {
return ProcSELinuxSetWindowCreateContext(client); REQUEST(SELinuxSetCreateContextReq);
} int n;
static int REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
SProcSELinuxGetWindowCreateContext(ClientPtr client) swaps(&stuff->context_len,n);
{ return ProcSELinuxSetWindowCreateContext(client);
return ProcSELinuxGetWindowCreateContext(client);
} }
static int static int
SProcSELinuxGetWindowContext(ClientPtr client) SProcSELinuxGetWindowContext(ClientPtr client)
{ {
REQUEST(SELinuxGetContextReq);
int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
swapl(&stuff->id,n);
return ProcSELinuxGetWindowContext(client); return ProcSELinuxGetWindowContext(client);
} }
@ -1278,11 +1291,11 @@ SProcSELinuxDispatch(ClientPtr client)
case X_SELinuxSetSelectionManager: case X_SELinuxSetSelectionManager:
return SProcSELinuxSetSelectionManager(client); return SProcSELinuxSetSelectionManager(client);
case X_SELinuxGetSelectionManager: case X_SELinuxGetSelectionManager:
return SProcSELinuxGetSelectionManager(client); return ProcSELinuxGetSelectionManager(client);
case X_SELinuxSetDeviceCreateContext: case X_SELinuxSetDeviceCreateContext:
return SProcSELinuxSetDeviceCreateContext(client); return SProcSELinuxSetDeviceCreateContext(client);
case X_SELinuxGetDeviceCreateContext: case X_SELinuxGetDeviceCreateContext:
return SProcSELinuxGetDeviceCreateContext(client); return ProcSELinuxGetDeviceCreateContext(client);
case X_SELinuxSetDeviceContext: case X_SELinuxSetDeviceContext:
return SProcSELinuxSetDeviceContext(client); return SProcSELinuxSetDeviceContext(client);
case X_SELinuxGetDeviceContext: case X_SELinuxGetDeviceContext:
@ -1290,13 +1303,13 @@ SProcSELinuxDispatch(ClientPtr client)
case X_SELinuxSetPropertyCreateContext: case X_SELinuxSetPropertyCreateContext:
return SProcSELinuxSetPropertyCreateContext(client); return SProcSELinuxSetPropertyCreateContext(client);
case X_SELinuxGetPropertyCreateContext: case X_SELinuxGetPropertyCreateContext:
return SProcSELinuxGetPropertyCreateContext(client); return ProcSELinuxGetPropertyCreateContext(client);
case X_SELinuxGetPropertyContext: case X_SELinuxGetPropertyContext:
return SProcSELinuxGetPropertyContext(client); return SProcSELinuxGetPropertyContext(client);
case X_SELinuxSetWindowCreateContext: case X_SELinuxSetWindowCreateContext:
return SProcSELinuxSetWindowCreateContext(client); return SProcSELinuxSetWindowCreateContext(client);
case X_SELinuxGetWindowCreateContext: case X_SELinuxGetWindowCreateContext:
return SProcSELinuxGetWindowCreateContext(client); return ProcSELinuxGetWindowCreateContext(client);
case X_SELinuxGetWindowContext: case X_SELinuxGetWindowContext:
return SProcSELinuxGetWindowContext(client); return SProcSELinuxGetWindowContext(client);
default: default:
@ -1354,7 +1367,7 @@ SELinuxResetProc(ExtensionEntry *extEntry)
} }
void void
XSELinuxExtensionInit(INITARGS) SELinuxExtensionInit(INITARGS)
{ {
ExtensionEntry *extEntry; ExtensionEntry *extEntry;
struct selinux_opt options[] = { { SELABEL_OPT_VALIDATE, (char *)1 } }; struct selinux_opt options[] = { { SELABEL_OPT_VALIDATE, (char *)1 } };
@ -1363,46 +1376,51 @@ XSELinuxExtensionInit(INITARGS)
/* Setup SELinux stuff */ /* Setup SELinux stuff */
if (!is_selinux_enabled()) { if (!is_selinux_enabled()) {
ErrorF("XSELinux: Extension failed to load: SELinux not enabled\n"); ErrorF("SELinux: SELinux not enabled, disabling SELinux support.\n");
return; return;
} }
selinux_set_callback(SELINUX_CB_LOG, (union selinux_callback)SELinuxLog); selinux_set_callback(SELINUX_CB_LOG, (union selinux_callback)SELinuxLog);
selinux_set_callback(SELINUX_CB_AUDIT, (union selinux_callback)SELinuxAudit); selinux_set_callback(SELINUX_CB_AUDIT, (union selinux_callback)SELinuxAudit);
if (selinux_set_mapping(map) < 0) if (selinux_set_mapping(map) < 0) {
FatalError("XSELinux: Failed to set up security class mapping\n"); if (errno == EINVAL) {
ErrorF("SELinux: Invalid object class mapping, disabling SELinux support.\n");
return;
}
FatalError("SELinux: Failed to set up security class mapping\n");
}
if (avc_open(NULL, 0) < 0) if (avc_open(NULL, 0) < 0)
FatalError("XSELinux: Couldn't initialize SELinux userspace AVC\n"); FatalError("SELinux: Couldn't initialize SELinux userspace AVC\n");
avc_active = 1; avc_active = 1;
label_hnd = selabel_open(SELABEL_CTX_X, options, 1); label_hnd = selabel_open(SELABEL_CTX_X, options, 1);
if (!label_hnd) if (!label_hnd)
FatalError("XSELinux: Failed to open x_contexts mapping in policy\n"); FatalError("SELinux: Failed to open x_contexts mapping in policy\n");
if (security_get_initial_context("unlabeled", &con) < 0) if (security_get_initial_context("unlabeled", &con) < 0)
FatalError("XSELinux: Failed to look up unlabeled context\n"); FatalError("SELinux: Failed to look up unlabeled context\n");
if (avc_context_to_sid(con, &unlabeled_sid) < 0) if (avc_context_to_sid(con, &unlabeled_sid) < 0)
FatalError("XSELinux: a context_to_SID call failed!\n"); FatalError("SELinux: a context_to_SID call failed!\n");
freecon(con); freecon(con);
/* Prepare for auditing */ /* Prepare for auditing */
audit_fd = audit_open(); audit_fd = audit_open();
if (audit_fd < 0) if (audit_fd < 0)
FatalError("XSELinux: Failed to open the system audit log\n"); FatalError("SELinux: Failed to open the system audit log\n");
/* Allocate private storage */ /* Allocate private storage */
if (!dixRequestPrivate(stateKey, sizeof(SELinuxStateRec))) if (!dixRequestPrivate(stateKey, sizeof(SELinuxStateRec)))
FatalError("XSELinux: Failed to allocate private storage.\n"); FatalError("SELinux: Failed to allocate private storage.\n");
/* Create atoms for doing window labeling */ /* Create atoms for doing window labeling */
atom_ctx = MakeAtom("_SELINUX_CONTEXT", 16, TRUE); atom_ctx = MakeAtom("_SELINUX_CONTEXT", 16, TRUE);
if (atom_ctx == BAD_RESOURCE) if (atom_ctx == BAD_RESOURCE)
FatalError("XSELinux: Failed to create atom\n"); FatalError("SELinux: Failed to create atom\n");
atom_client_ctx = MakeAtom("_SELINUX_CLIENT_CONTEXT", 23, TRUE); atom_client_ctx = MakeAtom("_SELINUX_CLIENT_CONTEXT", 23, TRUE);
if (atom_client_ctx == BAD_RESOURCE) if (atom_client_ctx == BAD_RESOURCE)
FatalError("XSELinux: Failed to create atom\n"); FatalError("SELinux: Failed to create atom\n");
/* Register callbacks */ /* Register callbacks */
ret &= dixRegisterPrivateInitFunc(stateKey, SELinuxStateInit, NULL); ret &= dixRegisterPrivateInitFunc(stateKey, SELinuxStateInit, NULL);
@ -1425,11 +1443,11 @@ XSELinuxExtensionInit(INITARGS)
ret &= XaceRegisterCallback(XACE_SCREEN_ACCESS, SELinuxScreen, NULL); ret &= XaceRegisterCallback(XACE_SCREEN_ACCESS, SELinuxScreen, NULL);
ret &= XaceRegisterCallback(XACE_SCREENSAVER_ACCESS, SELinuxScreen, truep); ret &= XaceRegisterCallback(XACE_SCREENSAVER_ACCESS, SELinuxScreen, truep);
if (!ret) if (!ret)
FatalError("XSELinux: Failed to register one or more callbacks\n"); FatalError("SELinux: Failed to register one or more callbacks\n");
/* Add extension to server */ /* Add extension to server */
extEntry = AddExtension(XSELINUX_EXTENSION_NAME, extEntry = AddExtension(SELINUX_EXTENSION_NAME,
XSELinuxNumberEvents, XSELinuxNumberErrors, SELinuxNumberEvents, SELinuxNumberErrors,
ProcSELinuxDispatch, SProcSELinuxDispatch, ProcSELinuxDispatch, SProcSELinuxDispatch,
SELinuxResetProc, StandardMinorOpcode); SELinuxResetProc, StandardMinorOpcode);

View File

@ -23,11 +23,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dixaccess.h" #include "dixaccess.h"
/* Extension info */ /* Extension info */
#define XSELINUX_EXTENSION_NAME "SELinux" #define SELINUX_EXTENSION_NAME "SELinux"
#define XSELINUX_MAJOR_VERSION 1 #define SELINUX_MAJOR_VERSION 1
#define XSELINUX_MINOR_VERSION 0 #define SELINUX_MINOR_VERSION 0
#define XSELinuxNumberEvents 0 #define SELinuxNumberEvents 0
#define XSELinuxNumberErrors 0 #define SELinuxNumberErrors 0
/* Extension protocol */ /* Extension protocol */
#define X_SELinuxQueryVersion 0 #define X_SELinuxQueryVersion 0
@ -138,20 +138,6 @@ typedef struct {
CARD32 id; CARD32 id;
} SELinuxGetContextReq; } SELinuxGetContextReq;
typedef struct {
CARD8 type;
CARD8 pad1;
CARD16 sequenceNumber;
CARD32 length;
CARD16 context_len;
CARD16 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
CARD32 pad6;
CARD32 pad7;
} SELinuxGetContextReply;
typedef struct { typedef struct {
CARD8 reqType; CARD8 reqType;
CARD8 SELinuxReqType; CARD8 SELinuxReqType;
@ -172,7 +158,7 @@ typedef struct {
CARD32 pad5; CARD32 pad5;
CARD32 pad6; CARD32 pad6;
CARD32 pad7; CARD32 pad7;
} SELinuxGetPropertyContextReply; } SELinuxGetContextReply;
/* Private Flask definitions */ /* Private Flask definitions */

View File

@ -67,7 +67,7 @@ SWriteQueryExtensionReply(
swaps(&rep->version, n); swaps(&rep->version, n);
swaps(&rep->revision, n); swaps(&rep->revision, n);
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep);
return Success; return Success;
} }
@ -83,7 +83,7 @@ SWriteQueryAdaptorsReply(
swapl(&rep->length, n); swapl(&rep->length, n);
swaps(&rep->num_adaptors, n); swaps(&rep->num_adaptors, n);
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep);
return Success; return Success;
} }
@ -99,7 +99,7 @@ SWriteQueryEncodingsReply(
swapl(&rep->length, n); swapl(&rep->length, n);
swaps(&rep->num_encodings, n); swaps(&rep->num_encodings, n);
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep);
return Success; return Success;
} }
@ -204,7 +204,7 @@ SWriteGrabPortReply(
swaps(&rep->sequenceNumber, n); swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n); swapl(&rep->length, n);
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)&rep); (void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep);
return Success; return Success;
} }
@ -220,7 +220,7 @@ SWriteGetPortAttributeReply(
swapl(&rep->length, n); swapl(&rep->length, n);
swapl(&rep->value, n); swapl(&rep->value, n);
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)&rep); (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep);
return Success; return Success;
} }
@ -237,7 +237,7 @@ SWriteQueryBestSizeReply(
swaps(&rep->actual_width, n); swaps(&rep->actual_width, n);
swaps(&rep->actual_height, n); swaps(&rep->actual_height, n);
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep);
return Success; return Success;
} }
@ -254,7 +254,7 @@ SWriteQueryPortAttributesReply(
swapl(&rep->num_attributes, n); swapl(&rep->num_attributes, n);
swapl(&rep->text_size, n); swapl(&rep->text_size, n);
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep);
return Success; return Success;
} }
@ -273,7 +273,7 @@ SWriteQueryImageAttributesReply(
swaps(&rep->width, n); swaps(&rep->width, n);
swaps(&rep->height, n); swaps(&rep->height, n);
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)&rep); (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep);
return Success; return Success;
} }
@ -289,7 +289,7 @@ SWriteListImageFormatsReply(
swapl(&rep->length, n); swapl(&rep->length, n);
swapl(&rep->num_formats, n); swapl(&rep->num_formats, n);
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)&rep); (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep);
return Success; return Success;
} }
@ -378,6 +378,7 @@ ProcXvQueryAdaptors(ClientPtr client)
xvAdaptorInfo ainfo; xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep; xvQueryAdaptorsReply rep;
int totalSize, na, nf, rc; int totalSize, na, nf, rc;
int nameSize;
XvAdaptorPtr pa; XvAdaptorPtr pa;
XvFormatPtr pf; XvFormatPtr pf;
WindowPtr pWin; WindowPtr pWin;
@ -439,12 +440,12 @@ ProcXvQueryAdaptors(ClientPtr client)
ainfo.base_id = pa->base_id; ainfo.base_id = pa->base_id;
ainfo.num_ports = pa->nPorts; ainfo.num_ports = pa->nPorts;
ainfo.type = pa->type; ainfo.type = pa->type;
ainfo.name_size = strlen(pa->name); ainfo.name_size = nameSize = strlen(pa->name);
ainfo.num_formats = pa->nFormats; ainfo.num_formats = pa->nFormats;
_WriteAdaptorInfo(client, &ainfo); _WriteAdaptorInfo(client, &ainfo);
WriteToClient(client, ainfo.name_size, pa->name); WriteToClient(client, nameSize, pa->name);
nf = pa->nFormats; nf = pa->nFormats;
pf = pa->pFormats; pf = pa->pFormats;
@ -469,6 +470,7 @@ ProcXvQueryEncodings(ClientPtr client)
xvEncodingInfo einfo; xvEncodingInfo einfo;
xvQueryEncodingsReply rep; xvQueryEncodingsReply rep;
int totalSize; int totalSize;
int nameSize;
XvPortPtr pPort; XvPortPtr pPort;
int ne; int ne;
XvEncodingPtr pe; XvEncodingPtr pe;
@ -513,13 +515,13 @@ ProcXvQueryEncodings(ClientPtr client)
while (ne--) while (ne--)
{ {
einfo.encoding = pe->id; einfo.encoding = pe->id;
einfo.name_size = strlen(pe->name); einfo.name_size = nameSize = strlen(pe->name);
einfo.width = pe->width; einfo.width = pe->width;
einfo.height = pe->height; einfo.height = pe->height;
einfo.rate.numerator = pe->rate.numerator; einfo.rate.numerator = pe->rate.numerator;
einfo.rate.denominator = pe->rate.denominator; einfo.rate.denominator = pe->rate.denominator;
_WriteEncodingInfo(client, &einfo); _WriteEncodingInfo(client, &einfo);
WriteToClient(client, einfo.name_size, pe->name); WriteToClient(client, nameSize, pe->name);
pe++; pe++;
} }
@ -984,18 +986,19 @@ ProcXvQueryPortAttributes(ClientPtr client)
rep.text_size = 0; rep.text_size = 0;
for(i = 0, pAtt = pPort->pAdaptor->pAttributes; for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
i < rep.num_attributes; i++, pAtt++) i < pPort->pAdaptor->nAttributes; i++, pAtt++)
{ {
rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L; rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L;
} }
rep.length = (rep.num_attributes * sz_xvAttributeInfo) + rep.text_size; rep.length = (pPort->pAdaptor->nAttributes * sz_xvAttributeInfo)
+ rep.text_size;
rep.length >>= 2; rep.length >>= 2;
_WriteQueryPortAttributesReply(client, &rep); _WriteQueryPortAttributesReply(client, &rep);
for(i = 0, pAtt = pPort->pAdaptor->pAttributes; for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
i < rep.num_attributes; i++, pAtt++) i < pPort->pAdaptor->nAttributes; i++, pAtt++)
{ {
size = strlen(pAtt->name) + 1; /* pass the NULL */ size = strlen(pAtt->name) + 1; /* pass the NULL */
Info.flags = pAtt->flags; Info.flags = pAtt->flags;
@ -1211,6 +1214,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
XvPortPtr pPort; XvPortPtr pPort;
int *offsets; int *offsets;
int *pitches; int *pitches;
int planeLength;
REQUEST(xvQueryImageAttributesReq); REQUEST(xvQueryImageAttributesReq);
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
@ -1250,7 +1254,7 @@ ProcXvQueryImageAttributes(ClientPtr client)
rep.type = X_Reply; rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.length = num_planes << 1; rep.length = planeLength = num_planes << 1;
rep.num_planes = num_planes; rep.num_planes = num_planes;
rep.width = width; rep.width = width;
rep.height = height; rep.height = height;
@ -1258,8 +1262,8 @@ ProcXvQueryImageAttributes(ClientPtr client)
_WriteQueryImageAttributesReply(client, &rep); _WriteQueryImageAttributesReply(client, &rep);
if(client->swapped) if(client->swapped)
SwapLongs((CARD32*)offsets, rep.length); SwapLongs((CARD32*)offsets, planeLength);
WriteToClient(client, rep.length << 2, (char*)offsets); WriteToClient(client, planeLength << 2, (char*)offsets);
xfree(offsets); xfree(offsets);
@ -1287,13 +1291,13 @@ ProcXvListImageFormats(ClientPtr client)
rep.type = X_Reply; rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.num_formats = pPort->pAdaptor->nImages; rep.num_formats = pPort->pAdaptor->nImages;
rep.length = rep.num_formats * sz_xvImageFormatInfo >> 2; rep.length = pPort->pAdaptor->nImages * sz_xvImageFormatInfo >> 2;
_WriteListImageFormatsReply(client, &rep); _WriteListImageFormatsReply(client, &rep);
pImage = pPort->pAdaptor->pImages; pImage = pPort->pAdaptor->pImages;
for(i = 0; i < rep.num_formats; i++, pImage++) { for(i = 0; i < pPort->pAdaptor->nImages; i++, pImage++) {
info.id = pImage->id; info.id = pImage->id;
info.type = pImage->type; info.type = pImage->type;
info.byte_order = pImage->byte_order; info.byte_order = pImage->byte_order;

View File

@ -76,7 +76,7 @@ teardown(void)
struct config_dbus_core_hook *hook; struct config_dbus_core_hook *hook;
if (bus_info.timer) { if (bus_info.timer) {
TimerCancel(bus_info.timer); TimerFree(bus_info.timer);
bus_info.timer = NULL; bus_info.timer = NULL;
} }
@ -116,6 +116,8 @@ message_filter(DBusConnection *connection, DBusMessage *message, void *data)
bus_info.connection = NULL; bus_info.connection = NULL;
teardown(); teardown();
if (bus_info.timer)
TimerFree(bus_info.timer);
bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL); bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
return DBUS_HANDLER_RESULT_HANDLED; return DBUS_HANDLER_RESULT_HANDLED;
@ -186,6 +188,7 @@ static CARD32
reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg) reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg)
{ {
if (connect_to_bus()) { if (connect_to_bus()) {
TimerFree(bus_info.timer);
bus_info.timer = NULL; bus_info.timer = NULL;
return 0; return 0;
} }

View File

@ -92,6 +92,8 @@ add_option(InputOption **options, const char *key, const char *value)
for (; *options; options = &(*options)->next) for (; *options; options = &(*options)->next)
; ;
*options = xcalloc(sizeof(**options), 1); *options = xcalloc(sizeof(**options), 1);
if (!*options) /* Yeesh. */
return;
(*options)->key = xstrdup(key); (*options)->key = xstrdup(key);
(*options)->value = xstrdup(value); (*options)->value = xstrdup(value);
(*options)->next = NULL; (*options)->next = NULL;
@ -156,7 +158,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
char *path = NULL, *driver = NULL, *name = NULL, *xkb_rules = NULL; char *path = NULL, *driver = NULL, *name = NULL, *xkb_rules = NULL;
char *xkb_model = NULL, *xkb_layout = NULL, *xkb_variant = NULL; char *xkb_model = NULL, *xkb_layout = NULL, *xkb_variant = NULL;
char *xkb_options = NULL, *config_info = NULL; char *xkb_options = NULL, *config_info = NULL;
InputOption *options = NULL; InputOption *options = NULL, *tmpo = NULL;
DeviceIntPtr dev; DeviceIntPtr dev;
DBusError error; DBusError error;
int type = TYPE_NONE; int type = TYPE_NONE;
@ -234,6 +236,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
if (NewInputDeviceRequest(options, &dev) != Success) { if (NewInputDeviceRequest(options, &dev) != Success) {
DebugF("[config/hal] NewInputDeviceRequest failed\n"); DebugF("[config/hal] NewInputDeviceRequest failed\n");
dev = NULL;
goto unwind; goto unwind;
} }
@ -259,6 +262,12 @@ unwind:
xfree(xkb_options); xfree(xkb_options);
if (config_info) if (config_info)
xfree(config_info); xfree(config_info);
while (!dev && (tmpo = options)) {
options = tmpo->next;
xfree(tmpo->key);
xfree(tmpo->value);
xfree(tmpo);
}
out_error: out_error:
dbus_error_free(&error); dbus_error_free(&error);

View File

@ -304,6 +304,7 @@ case $host_cpu in
*freebsd*) SYS_LIBS=-lio ;; *freebsd*) SYS_LIBS=-lio ;;
*netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;; *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
esac esac
GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
;; ;;
arm*) arm*)
ARM_VIDEO=yes ARM_VIDEO=yes
@ -333,6 +334,7 @@ case $host_cpu in
xorg_loader_sparcmuldiv="yes" xorg_loader_sparcmuldiv="yes"
SPARC64_VIDEO=yes SPARC64_VIDEO=yes
BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;; ;;
x86_64*|amd64*) x86_64*|amd64*)
use_x86_asm="yes" use_x86_asm="yes"
@ -347,8 +349,16 @@ case $host_cpu in
SYS_LIBS=-lamd64 SYS_LIBS=-lamd64
;; ;;
esac esac
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
ia64*)
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
s390*)
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;; ;;
esac esac
AC_SUBST(GLX_ARCH_DEFINES)
dnl BSD *_video.c selection dnl BSD *_video.c selection
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])

View File

@ -587,7 +587,8 @@ InitAndStartDevices(WindowPtr root)
for (dev = inputInfo.off_devices; dev; dev = dev->next) { for (dev = inputInfo.off_devices; dev; dev = dev->next) {
DebugF("(dix) initialising device %d\n", dev->id); DebugF("(dix) initialising device %d\n", dev->id);
ActivateDevice(dev); if (!dev->inited)
ActivateDevice(dev);
} }
if (!inputInfo.keyboard) { /* In theory, this cannot happen */ if (!inputInfo.keyboard) { /* In theory, this cannot happen */

View File

@ -149,6 +149,8 @@ int ProcInitialConnection();
#ifdef XSERVER_DTRACE #ifdef XSERVER_DTRACE
#include "registry.h" #include "registry.h"
#include <sys/types.h>
typedef const char *string;
#include "Xserver-dtrace.h" #include "Xserver-dtrace.h"
#endif #endif

View File

@ -800,7 +800,7 @@ _DeleteCallbackList(
for (i = 0; i < numCallbackListsToCleanup; i++) for (i = 0; i < numCallbackListsToCleanup; i++)
{ {
if ((listsToCleanup[i] = pcbl) != 0) if (listsToCleanup[i] == pcbl)
{ {
listsToCleanup[i] = NULL; listsToCleanup[i] = NULL;
break; break;

View File

@ -232,6 +232,8 @@ dixResetPrivates(void)
/* reset internal structures */ /* reset internal structures */
while (items) { while (items) {
next = items->next; next = items->next;
DeleteCallbackList(&items->initfuncs);
DeleteCallbackList(&items->deletefuncs);
xfree(items); xfree(items);
items = next; items = next;
} }

View File

@ -739,6 +739,14 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
prect[i].y = pSeg[i].y2; prect[i].y = pSeg[i].y2;
prect[i].height = pSeg[i].y1 - pSeg[i].y2 + 1; prect[i].height = pSeg[i].y1 - pSeg[i].y2 + 1;
} }
/* don't paint last pixel */
if (pGC->capStyle == CapNotLast) {
if (prect[i].width == 1)
prect[i].height--;
else
prect[i].width--;
}
} }
pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect); pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect);
xfree(prect); xfree(prect);

View File

@ -32,6 +32,7 @@ libglxproxy_a_SOURCES = compsize.c \
unpack.h unpack.h
AM_CFLAGS = \ AM_CFLAGS = \
@GLX_ARCH_DEFINES@ \
$(DIX_CFLAGS) \ $(DIX_CFLAGS) \
-I$(top_srcdir)/hw/dmx \ -I$(top_srcdir)/hw/dmx \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \

View File

@ -402,6 +402,7 @@ ephyrUnsetInternalDamage (ScreenPtr pScreen)
pPixmap = (*pScreen->GetScreenPixmap) (pScreen); pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
DamageUnregister (&pPixmap->drawable, scrpriv->pDamage); DamageUnregister (&pPixmap->drawable, scrpriv->pDamage);
DamageDestroy (scrpriv->pDamage);
RemoveBlockAndWakeupHandlers (ephyrInternalDamageBlockHandler, RemoveBlockAndWakeupHandlers (ephyrInternalDamageBlockHandler,
ephyrInternalDamageWakeupHandler, ephyrInternalDamageWakeupHandler,

View File

@ -832,7 +832,10 @@ KdSetPointerMatrix (KdPointerMatrix *pointer);
void void
KdComputePointerMatrix (KdPointerMatrix *pointer, Rotation randr, int width, int height); KdComputePointerMatrix (KdPointerMatrix *pointer, Rotation randr, int width, int height);
void
KdScreenToPointerCoords (int *x, int *y);
void void
KdBlockHandler (int screen, KdBlockHandler (int screen,
pointer blockData, pointer blockData,

View File

@ -631,6 +631,18 @@ KdComputePointerMatrix (KdPointerMatrix *m, Rotation randr, int width,
} }
} }
void
KdScreenToPointerCoords (int *x, int *y)
{
int (*m)[3] = kdPointerMatrix.matrix;
int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
int sx = *x;
int sy = *y;
*x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
*y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
}
static void static void
KdKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl) KdKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
{ {

View File

@ -60,6 +60,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
DPMSPtr pDPMS; DPMSPtr pDPMS;
pointer DPMSOpt; pointer DPMSOpt;
MessageType enabled_from = X_INFO;
DPMSKey = &DPMSKey; DPMSKey = &DPMSKey;
@ -78,8 +79,8 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
= xf86SetBoolOption(pScrn->options, "dpms", FALSE)) = xf86SetBoolOption(pScrn->options, "dpms", FALSE))
&& !DPMSDisabledSwitch) && !DPMSDisabledSwitch)
DPMSEnabled = TRUE; DPMSEnabled = TRUE;
enabled_from = X_CONFIG;
xf86MarkOptionUsed(DPMSOpt); xf86MarkOptionUsed(DPMSOpt);
xf86DrvMsg(pScreen->myNum, X_CONFIG, "DPMS enabled\n");
} else if (DPMSEnabledSwitch) { } else if (DPMSEnabledSwitch) {
if (!DPMSDisabledSwitch) if (!DPMSDisabledSwitch)
DPMSEnabled = TRUE; DPMSEnabled = TRUE;
@ -88,6 +89,8 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
else { else {
pDPMS->Enabled = defaultDPMSEnabled; pDPMS->Enabled = defaultDPMSEnabled;
} }
if (pDPMS->Enabled)
xf86DrvMsg(pScreen->myNum, enabled_from, "DPMS enabled\n");
pDPMS->CloseScreen = pScreen->CloseScreen; pDPMS->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = DPMSClose; pScreen->CloseScreen = DPMSClose;
DPMSCount++; DPMSCount++;

View File

@ -1215,20 +1215,40 @@ inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy)
{ {
float aspect = 0.0; float aspect = 0.0;
MonPtr mon = scrp->monitor; MonPtr mon = scrp->monitor;
xf86MonPtr DDC;
int x = 0, y = 0; int x = 0, y = 0;
DisplayModePtr mode; DisplayModePtr mode;
if (!mon) return 0; if (!mon) return 0;
DDC = mon->DDC;
if (DDC && DDC->ver.revision >= 4) {
/* For 1.4, we might actually get native pixel format. How novel. */
if (PREFERRED_TIMING_MODE(DDC->features.msc)) {
for (mode = modes; mode; mode = mode->next) {
if (mode->type & (M_T_DRIVER | M_T_PREFERRED)) {
x = mode->HDisplay;
y = mode->VDisplay;
goto found;
}
}
}
/*
* Even if we don't, we might get aspect ratio from extra CVT info
* or from the monitor size fields. TODO.
*/
}
/* /*
* technically this triggers if _either_ is zero, which is not what EDID * Technically this triggers if either is zero. That wasn't legal
* says, but if only one is zero this is best effort. also we don't * before EDID 1.4, but right now we'll get that wrong. TODO.
* know that all projectors are 4:3, but we certainly suspect it.
*/ */
if (!mon->widthmm || !mon->heightmm) if (!aspect) {
aspect = 4.0/3.0; if (!mon->widthmm || !mon->heightmm)
else aspect = 4.0/3.0;
aspect = (float)mon->widthmm / (float)mon->heightmm; else
aspect = (float)mon->widthmm / (float)mon->heightmm;
}
/* find the largest M_T_DRIVER mode with that aspect ratio */ /* find the largest M_T_DRIVER mode with that aspect ratio */
for (mode = modes; mode; mode = mode->next) { for (mode = modes; mode; mode = mode->next) {
@ -1252,6 +1272,7 @@ inferVirtualSize(ScrnInfoPtr scrp, DisplayModePtr modes, int *vx, int *vy)
return 0; return 0;
} }
found:
*vx = x; *vx = x;
*vy = y; *vy = y;

View File

@ -1,5 +1,5 @@
/*
/* edid.h: defines to parse an EDID block * edid.h: defines to parse an EDID block
* *
* This file contains all information to interpret a standard EDIC block * This file contains all information to interpret a standard EDIC block
* transmitted by a display device via DDC (Display Data Channel). So far * transmitted by a display device via DDC (Display Data Channel). So far
@ -125,7 +125,11 @@
#define SYNC _SYNC(GET(D_INPUT)) #define SYNC _SYNC(GET(D_INPUT))
#define _DFP(x) (x & 0x01) #define _DFP(x) (x & 0x01)
#define DFP _DFP(GET(D_INPUT)) #define DFP _DFP(GET(D_INPUT))
#define _GAMMA(x) (x == 0xff ? 1.0 : ((x + 100.0)/100.0)) #define _BPC(x) ((x & 0x70) >> 4)
#define BPC _BPC(GET(D_INPUT))
#define _DIGITAL_INTERFACE(x) (x & 0x0F)
#define DIGITAL_INTERFACE _DIGITAL_INTERFACE(GET(D_INPUT))
#define _GAMMA(x) (x == 0xff ? 0.0 : ((x + 100.0)/100.0))
#define GAMMA _GAMMA(GET(D_GAMMA)) #define GAMMA _GAMMA(GET(D_GAMMA))
#define HSIZE_MAX GET(D_HSIZE) #define HSIZE_MAX GET(D_HSIZE)
#define VSIZE_MAX GET(D_VSIZE) #define VSIZE_MAX GET(D_VSIZE)
@ -241,14 +245,18 @@
#define SERIAL_NUMBER 0xFF #define SERIAL_NUMBER 0xFF
#define ASCII_STR 0xFE #define ASCII_STR 0xFE
#define MONITOR_RANGES 0xFD #define MONITOR_RANGES 0xFD
#define _MIN_V_OFFSET(x) ((!!(x[4] & 0x01)) * 255)
#define _MAX_V_OFFSET(x) ((!!(x[4] & 0x02)) * 255)
#define _MIN_H_OFFSET(x) ((!!(x[4] & 0x04)) * 255)
#define _MAX_H_OFFSET(x) ((!!(x[4] & 0x08)) * 255)
#define _MIN_V(x) x[5] #define _MIN_V(x) x[5]
#define MIN_V _MIN_V(c) #define MIN_V (_MIN_V(c) + _MIN_V_OFFSET(c))
#define _MAX_V(x) x[6] #define _MAX_V(x) x[6]
#define MAX_V _MAX_V(c) #define MAX_V (_MAX_V(c) + _MAX_V_OFFSET(c))
#define _MIN_H(x) x[7] #define _MIN_H(x) x[7]
#define MIN_H _MIN_H(c) #define MIN_H (_MIN_H(c) + _MIN_H_OFFSET(c))
#define _MAX_H(x) x[8] #define _MAX_H(x) x[8]
#define MAX_H _MAX_H(c) #define MAX_H (_MAX_H(c) + _MAX_H_OFFSET(c))
#define _MAX_CLOCK(x) x[9] #define _MAX_CLOCK(x) x[9]
#define MAX_CLOCK _MAX_CLOCK(c) #define MAX_CLOCK _MAX_CLOCK(c)
#define _HAVE_2ND_GTF(x) (x[10] == 0x02) #define _HAVE_2ND_GTF(x) (x[10] == 0x02)
@ -282,6 +290,9 @@
#define _WHITE_GAMMA2(x) _GAMMA(x[14]) #define _WHITE_GAMMA2(x) _GAMMA(x[14])
#define WHITE_GAMMA2 _WHITE_GAMMA2(c) #define WHITE_GAMMA2 _WHITE_GAMMA2(c)
#define ADD_STD_TIMINGS 0xFA #define ADD_STD_TIMINGS 0xFA
#define COLOR_MANAGEMENT_DATA 0xF9
#define CVT_3BYTE_DATA 0xF8
#define ADD_EST_TIMINGS 0xF7
#define ADD_DUMMY 0x10 #define ADD_DUMMY 0x10
#define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN)) #define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
@ -315,11 +326,15 @@
#define DPMS_SUSPEND(x) (x & 0x02) #define DPMS_SUSPEND(x) (x & 0x02)
#define DPMS_OFF(x) (x & 0x01) #define DPMS_OFF(x) (x & 0x01)
/* display type */ /* display type, analog */
#define DISP_MONO 0 #define DISP_MONO 0
#define DISP_RGB 1 #define DISP_RGB 1
#define DISP_MULTCOLOR 2 #define DISP_MULTCOLOR 2
/* display color encodings, digital */
#define DISP_YCRCB444 0x01
#define DISP_YCRCB422 0x02
/* Msc stuff EDID Ver > 1.1 */ /* Msc stuff EDID Ver > 1.1 */
#define STD_COLOR_SPACE(x) (x & 0x4) #define STD_COLOR_SPACE(x) (x & 0x4)
#define PREFERRED_TIMING_MODE(x) (x & 0x2) #define PREFERRED_TIMING_MODE(x) (x & 0x2)
@ -357,6 +372,9 @@ struct disp_features {
unsigned int input_setup:1; unsigned int input_setup:1;
unsigned int input_sync:5; unsigned int input_sync:5;
unsigned int input_dfp:1; unsigned int input_dfp:1;
unsigned int input_bpc:3;
unsigned int input_interface:4;
/* 15 bit hole */
int hsize; int hsize;
int vsize; int vsize;
float gamma; float gamma;
@ -414,8 +432,13 @@ struct detailed_timings {
#define DS_RANGES 0xFD #define DS_RANGES 0xFD
#define DS_WHITE_P 0xFB #define DS_WHITE_P 0xFB
#define DS_STD_TIMINGS 0xFA #define DS_STD_TIMINGS 0xFA
#define DS_CMD 0xF9
#define DS_CVT 0xF8
#define DS_EST_III 0xF7
#define DS_DUMMY 0x10 #define DS_DUMMY 0x10
#define DS_UNKOWN 0x100 /* type is an int */ #define DS_UNKOWN 0x100 /* type is an int */
#define DS_VENDOR 0x101
#define DS_VENDOR_MAX 0x110
struct monitor_ranges { struct monitor_ranges {
int min_v; int min_v;
@ -437,17 +460,33 @@ struct whitePoints{
float white_gamma; float white_gamma;
}; };
struct cvt_timings {
int width;
int height;
int rate;
int rates;
};
/*
* Be careful when adding new sections; this structure can't grow, it's
* embedded in the middle of xf86Monitor which is ABI. Sizes below are
* in bytes, for ILP32 systems. If all else fails just copy the section
* literally like serial and friends.
*/
struct detailed_monitor_section { struct detailed_monitor_section {
int type; int type;
union { union {
struct detailed_timings d_timings; struct detailed_timings d_timings; /* 56 */
Uchar serial[13]; Uchar serial[13];
Uchar ascii_data[13]; Uchar ascii_data[13];
Uchar name[13]; Uchar name[13];
struct monitor_ranges ranges; struct monitor_ranges ranges; /* 40 */
struct std_timings std_t[5]; struct std_timings std_t[5]; /* 80 */
struct whitePoints wp[2]; struct whitePoints wp[2]; /* 32 */
} section; /* color management data */
struct cvt_timings cvt[4]; /* 64 */
/* established timings III */
} section; /* max: 80 */
}; };
typedef struct { typedef struct {

View File

@ -1,8 +1,28 @@
/*
/* interpret_edid.c: interpret a primary EDID block
*
* Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE> * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
* Copyright 2007 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software")
* to deal in the software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* them Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) 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 MERCHANTIBILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS 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.
*
* interpret_edid.c: interpret a primary EDID block
*/ */
#ifdef HAVE_XORG_CONFIG_H #ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h> #include <xorg-config.h>
#endif #endif
@ -128,8 +148,12 @@ get_display_section(Uchar *c, struct disp_features *r,
r->input_voltage = INPUT_VOLTAGE; r->input_voltage = INPUT_VOLTAGE;
r->input_setup = SETUP; r->input_setup = SETUP;
r->input_sync = SYNC; r->input_sync = SYNC;
} else if (v->version > 1 || v->revision > 2) } else if (v->revision == 2 || v->revision == 3) {
r->input_dfp = DFP; r->input_dfp = DFP;
} else if (v->revision >= 4) {
r->input_bpc = BPC;
r->input_interface = DIGITAL_INTERFACE;
}
r->hsize = HSIZE_MAX; r->hsize = HSIZE_MAX;
r->vsize = VSIZE_MAX; r->vsize = VSIZE_MAX;
r->gamma = GAMMA; r->gamma = GAMMA;
@ -154,6 +178,34 @@ get_established_timing_section(Uchar *c, struct established_timings *r)
r->t_manu = T_MANU; r->t_manu = T_MANU;
} }
static void
get_cvt_timing_section(Uchar *c, struct cvt_timings *r)
{
int i;
for (i = 0; i < 4; i++) {
if (c[0] && c[1] && c[2]) {
r[i].height = (c[0] + ((c[1] & 0xF0) << 8) + 1) * 2;
switch (c[1] & 0xc0) {
case 0x00: r[i].width = r[i].height * 4 / 3; break;
case 0x40: r[i].width = r[i].height * 16 / 9; break;
case 0x80: r[i].width = r[i].height * 16 / 10; break;
case 0xc0: r[i].width = r[i].height * 15 / 9; break;
}
switch (c[2] & 0x60) {
case 0x00: r[i].rate = 50; break;
case 0x20: r[i].rate = 60; break;
case 0x40: r[i].rate = 75; break;
case 0x60: r[i].rate = 85; break;
}
r[i].rates = c[2] & 0x1f;
} else {
return;
}
c += 3;
}
}
static void static void
get_std_timing_section(Uchar *c, struct std_timings *r, get_std_timing_section(Uchar *c, struct std_timings *r,
struct edid_version *v) struct edid_version *v)
@ -207,6 +259,16 @@ get_dt_md_section(Uchar *c, struct edid_version *ver,
det_mon[i].type = DS_STD_TIMINGS; det_mon[i].type = DS_STD_TIMINGS;
get_dst_timing_section(c,det_mon[i].section.std_t, ver); get_dst_timing_section(c,det_mon[i].section.std_t, ver);
break; break;
case COLOR_MANAGEMENT_DATA:
det_mon[i].type = DS_CMD;
break;
case CVT_3BYTE_DATA:
det_mon[i].type = DS_CVT;
get_cvt_timing_section(c, det_mon[i].section.cvt);
break;
case ADD_EST_TIMINGS:
det_mon[i].type = DS_EST_III;
break;
case ADD_DUMMY: case ADD_DUMMY:
det_mon[i].type = DS_DUMMY; det_mon[i].type = DS_DUMMY;
break; break;
@ -214,6 +276,9 @@ get_dt_md_section(Uchar *c, struct edid_version *ver,
det_mon[i].type = DS_UNKOWN; det_mon[i].type = DS_UNKOWN;
break; break;
} }
if (c[3] <= 0x0F) {
det_mon[i].type = DS_VENDOR + c[3];
}
} else { } else {
det_mon[i].type = DT; det_mon[i].type = DT;
get_detailed_timing_section(c,&det_mon[i].section.d_timings); get_detailed_timing_section(c,&det_mon[i].section.d_timings);
@ -304,13 +369,16 @@ get_detailed_timing_section(Uchar *c, struct detailed_timings *r)
r->misc = MISC; r->misc = MISC;
} }
#define MAX_EDID_MINOR 3 #define MAX_EDID_MINOR 4
static Bool static Bool
validate_version(int scrnIndex, struct edid_version *r) validate_version(int scrnIndex, struct edid_version *r)
{ {
if (r->version != 1) if (r->version != 1) {
xf86DrvMsg(scrnIndex, X_ERROR, "Unknown EDID version %d\n",
r->version);
return FALSE; return FALSE;
}
if (r->revision > MAX_EDID_MINOR) if (r->revision > MAX_EDID_MINOR)
xf86DrvMsg(scrnIndex, X_WARNING, xf86DrvMsg(scrnIndex, X_WARNING,

View File

@ -1,8 +1,28 @@
/*
/* print_edid.c: print out all information retrieved from display device
*
* Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE> * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
* Copyright 2007 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software")
* to deal in the software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* them Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) 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 MERCHANTIBILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS 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.
*
* print_edid.c: print out all information retrieved from display device
*/ */
#ifdef HAVE_XORG_CONFIG_H #ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h> #include <xorg-config.h>
#endif #endif
@ -11,53 +31,9 @@
#include "xf86.h" #include "xf86.h"
#include "xf86_OSproc.h" #include "xf86_OSproc.h"
#include "xf86DDC.h" #include "xf86DDC.h"
#include "edid.h"
static void print_vendor(int scrnIndex, struct vendor *);
static void print_version(int scrnIndex, struct edid_version *);
static void print_display(int scrnIndex, struct disp_features *,
struct edid_version *);
static void print_established_timings(int scrnIndex,
struct established_timings *);
static void print_std_timings(int scrnIndex, struct std_timings *);
static void print_detailed_monitor_section(int scrnIndex,
struct detailed_monitor_section *);
static void print_detailed_timings(int scrnIndex, struct detailed_timings *);
static void print_input_features(int scrnIndex, struct disp_features *);
static void print_dpms_features(int scrnIndex, struct disp_features *,
struct edid_version *v);
static void print_whitepoint(int scrnIndex, struct disp_features *);
static void print_number_sections(int scrnIndex, int);
#define EDID_WIDTH 16 #define EDID_WIDTH 16
xf86MonPtr
xf86PrintEDID(xf86MonPtr m)
{
CARD16 i, j;
char buf[EDID_WIDTH * 2 + 1];
if (!(m)) return NULL;
print_vendor(m->scrnIndex,&m->vendor);
print_version(m->scrnIndex,&m->ver);
print_display(m->scrnIndex,&m->features, &m->ver);
print_established_timings(m->scrnIndex,&m->timings1);
print_std_timings(m->scrnIndex,m->timings2);
print_detailed_monitor_section(m->scrnIndex,m->det_mon);
print_number_sections(m->scrnIndex,m->no_sections);
xf86DrvMsg(m->scrnIndex, X_INFO, "EDID (in hex):\n");
for (i = 0; i < 128; i += j) {
for (j = 0; j < EDID_WIDTH; ++j) {
sprintf(&buf[j * 2], "%02x", m->rawData[i + j]);
}
xf86DrvMsg(m->scrnIndex, X_INFO, "\t%s\n", buf);
}
return m;
}
static void static void
print_vendor(int scrnIndex, struct vendor *c) print_vendor(int scrnIndex, struct vendor *c)
@ -66,7 +42,7 @@ print_vendor(int scrnIndex, struct vendor *c)
(char *)&c->name, c->prod_id, c->serial); (char *)&c->name, c->prod_id, c->serial);
xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week); xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
} }
static void static void
print_version(int scrnIndex, struct edid_version *c) print_version(int scrnIndex, struct edid_version *c)
{ {
@ -74,32 +50,38 @@ print_version(int scrnIndex, struct edid_version *c)
c->revision); c->revision);
} }
static void static const char *digital_interfaces[] = {
print_display(int scrnIndex, struct disp_features *disp, "undefined",
struct edid_version *version) "DVI",
{ "HDMI-a",
print_input_features(scrnIndex,disp); "HDMI-b",
xf86DrvMsg(scrnIndex,X_INFO,"Max H-Image Size [cm]: "); "MDDI",
if (disp->hsize) "DisplayPort",
xf86ErrorF("horiz.: %i ",disp->hsize); "unknown"
else };
xf86ErrorF("H-Size may change, ");
if (disp->vsize)
xf86ErrorF("vert.: %i\n",disp->vsize);
else
xf86ErrorF("V-Size may change\n");
xf86DrvMsg(scrnIndex,X_INFO,"Gamma: %.2f\n", disp->gamma);
print_dpms_features(scrnIndex,disp,version);
print_whitepoint(scrnIndex,disp);
}
static void static void
print_input_features(int scrnIndex, struct disp_features *c) print_input_features(int scrnIndex, struct disp_features *c,
struct edid_version *v)
{ {
if (DIGITAL(c->input_type)) { if (DIGITAL(c->input_type)) {
xf86DrvMsg(scrnIndex,X_INFO,"Digital Display Input\n"); xf86DrvMsg(scrnIndex, X_INFO, "Digital Display Input\n");
if (DFP1(c->input_dfp)) if (v->revision == 2 || v->revision == 3) {
xf86DrvMsg(scrnIndex,X_INFO,"DFP 1.x compatible TMDS\n"); if (DFP1(c->input_dfp))
xf86DrvMsg(scrnIndex, X_INFO, "DFP 1.x compatible TMDS\n");
} else if (v->revision >= 4) {
int interface = c->input_interface;
int bpc = c->input_bpc;
if (interface > 6)
interface = 6; /* unknown */
if (bpc == 0 || bpc == 7)
xf86DrvMsg(scrnIndex, X_INFO, "Undefined color depth\n");
else
xf86DrvMsg(scrnIndex, X_INFO, "%d bits per channel\n",
bpc * 2 + 4);
xf86DrvMsg(scrnIndex, X_INFO, "Digital interface is %s\n",
digital_interfaces[interface]);
}
} else { } else {
xf86DrvMsg(scrnIndex,X_INFO,"Analog Display Input, "); xf86DrvMsg(scrnIndex,X_INFO,"Analog Display Input, ");
xf86ErrorF("Input Voltage Level: "); xf86ErrorF("Input Voltage Level: ");
@ -146,33 +128,53 @@ print_dpms_features(int scrnIndex, struct disp_features *c,
if (DPMS_OFF(c->dpms)) xf86ErrorF(" Off"); if (DPMS_OFF(c->dpms)) xf86ErrorF(" Off");
} else } else
xf86DrvMsg(scrnIndex,X_INFO,"No DPMS capabilities specified"); xf86DrvMsg(scrnIndex,X_INFO,"No DPMS capabilities specified");
switch (c->display_type){ if (!c->input_type) { /* analog */
case DISP_MONO: switch (c->display_type){
xf86ErrorF("; Monochorome/GrayScale Display\n"); case DISP_MONO:
break; xf86ErrorF("; Monochorome/GrayScale Display\n");
case DISP_RGB: break;
xf86ErrorF("; RGB/Color Display\n"); case DISP_RGB:
break; xf86ErrorF("; RGB/Color Display\n");
case DISP_MULTCOLOR: break;
xf86ErrorF("; Non RGB Multicolor Display\n"); case DISP_MULTCOLOR:
break; xf86ErrorF("; Non RGB Multicolor Display\n");
default: break;
xf86ErrorF("\n"); default:
break; xf86ErrorF("\n");
break;
}
} else {
int enc = c->display_type;
xf86DrvMsg(scrnIndex, X_INFO, "\nSupported color encodings: "
"RGB 4:4:4 %s%s\n",
enc & DISP_YCRCB444 ? "YCrCb 4:4:4 " : "",
enc & DISP_YCRCB422 ? "YCrCb 4:2:2" : "");
} }
if (STD_COLOR_SPACE(c->msc)) if (STD_COLOR_SPACE(c->msc))
xf86DrvMsg(scrnIndex,X_INFO, xf86DrvMsg(scrnIndex,X_INFO,
"Default color space is primary color space\n"); "Default color space is primary color space\n");
if (PREFERRED_TIMING_MODE(c->msc))
xf86DrvMsg(scrnIndex,X_INFO, if (PREFERRED_TIMING_MODE(c->msc) || v->revision >= 4) {
xf86DrvMsg(scrnIndex, X_INFO,
"First detailed timing is preferred mode\n"); "First detailed timing is preferred mode\n");
else if (v->version == 1 && v->revision >= 3) if (v->revision >= 4)
xf86DrvMsg(scrnIndex, X_INFO,
"Preferred mode is native pixel format and refresh rate\n");
} else if (v->revision == 3) {
xf86DrvMsg(scrnIndex,X_INFO, xf86DrvMsg(scrnIndex,X_INFO,
"First detailed timing not preferred " "First detailed timing not preferred "
"mode in violation of standard!"); "mode in violation of standard!");
if (GFT_SUPPORTED(c->msc)) }
xf86DrvMsg(scrnIndex,X_INFO,
"GTF timings supported\n"); if (v->revision >= 4) {
if (GFT_SUPPORTED(c->msc)) {
xf86DrvMsg(scrnIndex, X_INFO, "Display is continuous-frequency\n");
}
} else {
if (GFT_SUPPORTED(c->msc))
xf86DrvMsg(scrnIndex, X_INFO, "GTF timings supported\n");
}
} }
static void static void
@ -187,7 +189,37 @@ print_whitepoint(int scrnIndex, struct disp_features *disp)
xf86ErrorF("whiteX: %.3f whiteY: %.3f\n", xf86ErrorF("whiteX: %.3f whiteY: %.3f\n",
disp->whitex,disp->whitey); disp->whitex,disp->whitey);
} }
static void
print_display(int scrnIndex, struct disp_features *disp,
struct edid_version *v)
{
print_input_features(scrnIndex, disp, v);
if (disp->hsize && disp->vsize) {
xf86DrvMsg(scrnIndex, X_INFO, "Max Image Size [cm]: ");
xf86ErrorF("horiz.: %i ", disp->hsize);
xf86ErrorF("vert.: %i\n", disp->vsize);
} else if (v->revision >= 4 && (disp->hsize || disp->vsize)) {
if (disp->hsize)
xf86DrvMsg(scrnIndex, X_INFO, "Aspect ratio: %.2f (landscape)\n",
(disp->hsize + 99) / 100.0);
if (disp->vsize)
xf86DrvMsg(scrnIndex, X_INFO, "Aspect ratio: %.2f (portrait)\n",
100.0 / (float)(disp->vsize + 99));
} else {
xf86DrvMsg(scrnIndex, X_INFO, "Indeterminate output size\n");
}
if (!disp->gamma && v->revision >= 1.4)
xf86DrvMsg(scrnIndex, X_INFO, "Gamma defined in extension block\n");
else
xf86DrvMsg(scrnIndex, X_INFO, "Gamma: %.2f\n", disp->gamma);
print_dpms_features(scrnIndex, disp, v);
print_whitepoint(scrnIndex, disp);
}
static void static void
print_established_timings(int scrnIndex, struct established_timings *t) print_established_timings(int scrnIndex, struct established_timings *t)
{ {
@ -235,7 +267,68 @@ print_std_timings(int scrnIndex, struct std_timings *t)
} }
} }
} }
static void
print_cvt_timings(int si, struct cvt_timings *t)
{
int i;
for (i = 0; i < 4; i++) {
if (t[i].height) {
xf86DrvMsg(si, X_INFO, "%dx%d @ %s%s%s%s%s Hz\n",
t[i].width, t[i].height,
t[i].rates & 0x10 ? "50," : "",
t[i].rates & 0x08 ? "60," : "",
t[i].rates & 0x04 ? "75," : "",
t[i].rates & 0x02 ? "85," : "",
t[i].rates & 0x01 ? "60RB" : "");
} else break;
}
}
static void
print_detailed_timings(int scrnIndex, struct detailed_timings *t)
{
if (t->clock > 15000000) { /* sanity check */
xf86DrvMsg(scrnIndex,X_INFO,"Supported additional Video Mode:\n");
xf86DrvMsg(scrnIndex,X_INFO,"clock: %.1f MHz ",t->clock/1000000.0);
xf86ErrorF("Image Size: %i x %i mm\n",t->h_size,t->v_size);
xf86DrvMsg(scrnIndex,X_INFO,
"h_active: %i h_sync: %i h_sync_end %i h_blank_end %i ",
t->h_active, t->h_sync_off + t->h_active,
t->h_sync_off + t->h_sync_width + t->h_active,
t->h_active + t->h_blanking);
xf86ErrorF("h_border: %i\n",t->h_border);
xf86DrvMsg(scrnIndex,X_INFO,
"v_active: %i v_sync: %i v_sync_end %i v_blanking: %i ",
t->v_active, t->v_sync_off + t->v_active,
t->v_sync_off + t->v_sync_width + t->v_active,
t->v_active + t->v_blanking);
xf86ErrorF("v_border: %i\n",t->v_border);
if (IS_STEREO(t->stereo)) {
xf86DrvMsg(scrnIndex,X_INFO,"Stereo: ");
if (IS_RIGHT_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("right channel on sync\n");
else
xf86ErrorF("left channel on sync\n");
} else if (IS_LEFT_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("right channel on even line\n");
else
xf86ErrorF("left channel on evel line\n");
}
if (IS_4WAY_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("4-way interleaved\n");
else
xf86ErrorF("side-by-side interleaved");
}
}
}
}
static void static void
print_detailed_monitor_section(int scrnIndex, print_detailed_monitor_section(int scrnIndex,
struct detailed_monitor_section *m) struct detailed_monitor_section *m)
@ -290,56 +383,31 @@ print_detailed_monitor_section(int scrnIndex,
m[i].section.wp[j].white_y, m[i].section.wp[j].white_y,
m[i].section.wp[j].white_gamma); m[i].section.wp[j].white_gamma);
break; break;
case DS_CMD:
xf86DrvMsg(scrnIndex, X_INFO,
"Color management data: (not decoded)\n");
break;
case DS_CVT:
xf86DrvMsg(scrnIndex, X_INFO,
"CVT 3-byte-code modes:\n");
print_cvt_timings(scrnIndex, m[i].section.cvt);
break;
case DS_EST_III:
xf86DrvMsg(scrnIndex, X_INFO,
"Established timings III: (not decoded)\n");
break;
case DS_DUMMY: case DS_DUMMY:
default: default:
break; break;
} }
} if (m[i].type >= DS_VENDOR && m[i].type <= DS_VENDOR_MAX) {
} xf86DrvMsg(scrnIndex, X_WARNING,
"Unknown vendor-specific block %hx\n",
static void m[i].type - DS_VENDOR);
print_detailed_timings(int scrnIndex, struct detailed_timings *t)
{
if (t->clock > 15000000) { /* sanity check */
xf86DrvMsg(scrnIndex,X_INFO,"Supported additional Video Mode:\n");
xf86DrvMsg(scrnIndex,X_INFO,"clock: %.1f MHz ",t->clock/1000000.0);
xf86ErrorF("Image Size: %i x %i mm\n",t->h_size,t->v_size);
xf86DrvMsg(scrnIndex,X_INFO,
"h_active: %i h_sync: %i h_sync_end %i h_blank_end %i ",
t->h_active, t->h_sync_off + t->h_active,
t->h_sync_off + t->h_sync_width + t->h_active,
t->h_active + t->h_blanking);
xf86ErrorF("h_border: %i\n",t->h_border);
xf86DrvMsg(scrnIndex,X_INFO,
"v_active: %i v_sync: %i v_sync_end %i v_blanking: %i ",
t->v_active, t->v_sync_off + t->v_active,
t->v_sync_off + t->v_sync_width + t->v_active,
t->v_active + t->v_blanking);
xf86ErrorF("v_border: %i\n",t->v_border);
if (IS_STEREO(t->stereo)) {
xf86DrvMsg(scrnIndex,X_INFO,"Stereo: ");
if (IS_RIGHT_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("right channel on sync\n");
else
xf86ErrorF("left channel on sync\n");
} else if (IS_LEFT_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("right channel on even line\n");
else
xf86ErrorF("left channel on evel line\n");
}
if (IS_4WAY_STEREO(t->stereo)) {
if (!t->stereo_1)
xf86ErrorF("4-way interleaved\n");
else
xf86ErrorF("side-by-side interleaved");
}
} }
} }
} }
static void static void
print_number_sections(int scrnIndex, int num) print_number_sections(int scrnIndex, int num)
{ {
@ -348,3 +416,30 @@ print_number_sections(int scrnIndex, int num)
num); num);
} }
xf86MonPtr
xf86PrintEDID(xf86MonPtr m)
{
CARD16 i, j;
char buf[EDID_WIDTH * 2 + 1];
if (!(m)) return NULL;
print_vendor(m->scrnIndex,&m->vendor);
print_version(m->scrnIndex,&m->ver);
print_display(m->scrnIndex,&m->features, &m->ver);
print_established_timings(m->scrnIndex,&m->timings1);
print_std_timings(m->scrnIndex,m->timings2);
print_detailed_monitor_section(m->scrnIndex,m->det_mon);
print_number_sections(m->scrnIndex,m->no_sections);
xf86DrvMsg(m->scrnIndex, X_INFO, "EDID (in hex):\n");
for (i = 0; i < 128; i += j) {
for (j = 0; j < EDID_WIDTH; ++j) {
sprintf(&buf[j * 2], "%02x", m->rawData[i + j]);
}
xf86DrvMsg(m->scrnIndex, X_INFO, "\t%s\n", buf);
}
return m;
}

View File

@ -130,7 +130,7 @@ extern void XaceExtensionInit(INITARGS);
#endif #endif
#ifdef XSELINUX #ifdef XSELINUX
extern void XSELinuxExtensionInit(INITARGS); extern void SELinuxExtensionInit(INITARGS);
#endif #endif
#if 1 #if 1

View File

@ -250,6 +250,7 @@ ProcXF86MiscGetMouseSettings(client)
char *devname; char *devname;
pointer mouse; pointer mouse;
register int n; register int n;
int devnamelen;
DEBUG_P("XF86MiscGetMouseSettings"); DEBUG_P("XF86MiscGetMouseSettings");
@ -269,7 +270,7 @@ ProcXF86MiscGetMouseSettings(client)
rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT); rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT);
rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE); rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE);
rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS); rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS);
rep.devnamelen = (devname? strlen(devname): 0); devnamelen = rep.devnamelen = (devname? strlen(devname): 0);
rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) - rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) -
sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2; sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2;
@ -289,8 +290,8 @@ ProcXF86MiscGetMouseSettings(client)
WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep);
MiscExtDestroyStruct(mouse, MISC_POINTER); MiscExtDestroyStruct(mouse, MISC_POINTER);
if (rep.devnamelen) if (devnamelen)
WriteToClient(client, rep.devnamelen, devname); WriteToClient(client, devnamelen, devname);
return (client->noClientException); return (client->noClientException);
} }
@ -508,6 +509,7 @@ ProcXF86MiscGetFilePaths(client)
const char *modulepath; const char *modulepath;
const char *logfile; const char *logfile;
register int n; register int n;
int configlen, modulelen, loglen;
DEBUG_P("XF86MiscGetFilePaths"); DEBUG_P("XF86MiscGetFilePaths");
@ -518,9 +520,9 @@ ProcXF86MiscGetFilePaths(client)
if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile)) if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile))
return BadValue; return BadValue;
rep.configlen = (configfile? strlen(configfile): 0); configlen = rep.configlen = (configfile? strlen(configfile): 0);
rep.modulelen = (modulepath? strlen(modulepath): 0); modulelen = rep.modulelen = (modulepath? strlen(modulepath): 0);
rep.loglen = (logfile? strlen(logfile): 0); loglen = rep.loglen = (logfile? strlen(logfile): 0);
rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) + rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) +
((rep.configlen + 3) & ~3) + ((rep.configlen + 3) & ~3) +
((rep.modulelen + 3) & ~3) + ((rep.modulelen + 3) & ~3) +
@ -535,12 +537,12 @@ ProcXF86MiscGetFilePaths(client)
} }
WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep);
if (rep.configlen) if (configlen)
WriteToClient(client, rep.configlen, (char *)configfile); WriteToClient(client, configlen, (char *)configfile);
if (rep.modulelen) if (modulelen)
WriteToClient(client, rep.modulelen, (char *)modulepath); WriteToClient(client, modulelen, (char *)modulepath);
if (rep.loglen) if (loglen)
WriteToClient(client, rep.loglen, (char *)logfile); WriteToClient(client, loglen, (char *)logfile);
return (client->noClientException); return (client->noClientException);
} }
@ -553,6 +555,7 @@ ProcXF86MiscPassMessage(client)
char *msgtype, *msgval, *retstr; char *msgtype, *msgval, *retstr;
int retval, size; int retval, size;
register int n; register int n;
int mesglen;
REQUEST(xXF86MiscPassMessageReq); REQUEST(xXF86MiscPassMessageReq);
@ -589,7 +592,7 @@ ProcXF86MiscPassMessage(client)
rep.type = X_Reply; rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.mesglen = (retstr? strlen(retstr): 0); mesglen = rep.mesglen = (retstr? strlen(retstr): 0);
rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) + rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
((rep.mesglen + 3) & ~3)) >> 2; ((rep.mesglen + 3) & ~3)) >> 2;
rep.status = 0; rep.status = 0;
@ -601,8 +604,8 @@ ProcXF86MiscPassMessage(client)
} }
WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep); WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
if (rep.mesglen) if (mesglen)
WriteToClient(client, rep.mesglen, (char *)retstr); WriteToClient(client, mesglen, (char *)retstr);
xfree(msgtype); xfree(msgtype);
xfree(msgval); xfree(msgval);

View File

@ -493,7 +493,7 @@ extension) to connect from another host.
Default: off. Default: off.
.TP 7 .TP 7
.BI "Option \*qDisableModInDev\*q \*q" boolean \*q .BI "Option \*qDisableModInDev\*q \*q" boolean \*q
This disables the parts of the __xservername__\-Misc extension that can be used to This disables the parts of the XFree86\-Misc extension that can be used to
modify the input device settings dynamically. modify the input device settings dynamically.
Default: that functionality is enabled. Default: that functionality is enabled.
.TP 7 .TP 7
@ -704,6 +704,20 @@ default.
.BI "Option \*qIgnoreABI\*q \*q" boolean \*q .BI "Option \*qIgnoreABI\*q \*q" boolean \*q
Allow modules built for a different, potentially incompatible version of Allow modules built for a different, potentially incompatible version of
the X server to load. Disabled by default. the X server to load. Disabled by default.
.TP 7
.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
If enabled, don't add the standard keyboard and mouse drivers, if there are no
input devices in the config file. Disabled by default.
.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.
Enabled by default.
.TP 7
.BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q
If this option is disabled, then the devices will be added (and the
DevicePresenceNotify event sent), but not enabled, thus leaving policy up
to the client.
Enabled by default.
.SH "MODULE SECTION" .SH "MODULE SECTION"
The The
.B Module .B Module
@ -2015,7 +2029,7 @@ These both specify that the upper left corner's coordinates are
The The
.B Absolute .B Absolute
keyword is optional. keyword is optional.
Some older versions of __xservername__ (4.2 and earlier) don't recognise the Some older versions of XFree86 (4.2 and earlier) don't recognise the
.B Absolute .B Absolute
keyword, so it's safest to just specify the coordinates without it. keyword, so it's safest to just specify the coordinates without it.
.TP 4 .TP 4

View File

@ -13,6 +13,7 @@ STRL_SRCS = $(top_srcdir)/os/strlcat.c $(top_srcdir)/os/strlcpy.c
endif endif
libdummy_nonserver_a_SOURCES = \ libdummy_nonserver_a_SOURCES = \
dixprivates.c \
fatalerror.c \ fatalerror.c \
logvwrite.c \ logvwrite.c \
$(STRL_SRCS) \ $(STRL_SRCS) \
@ -24,7 +25,6 @@ libdummy_nonserver_a_SOURCES = \
xf86drvmsgverb.c \ xf86drvmsgverb.c \
xf86errorf.c \ xf86errorf.c \
xf86errorfverb.c \ xf86errorfverb.c \
xf86getpagesize.c \
xf86getverb.c \ xf86getverb.c \
xf86info.c \ xf86info.c \
xf86msg.c \ xf86msg.c \

View File

@ -11,11 +11,9 @@
* Utility functions required by libxf86_os. * Utility functions required by libxf86_os.
*/ */
int xf86getpagesize(void); _X_EXPORT pointer *
dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key)
_X_EXPORT int
xf86getpagesize(void)
{ {
return 4096; /* not used */ return NULL; /* not used */
} }

View File

@ -2192,9 +2192,12 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
return mon; return mon;
} }
static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", static char *_xf86ConnectorNames[] = {
"DVI-A", "Composite", "S-Video", "None", "VGA", "DVI-I", "DVI-D",
"Component", "LFP", "Proprietary" }; "DVI-A", "Composite", "S-Video",
"Component", "LFP", "Proprietary",
"HDMI", "DisplayPort",
};
_X_EXPORT char * _X_EXPORT char *
xf86ConnectorGetName(xf86ConnectorType connector) xf86ConnectorGetName(xf86ConnectorType connector)
{ {

View File

@ -61,7 +61,9 @@ typedef enum _xf86ConnectorType {
XF86ConnectorSvideo, XF86ConnectorSvideo,
XF86ConnectorComponent, XF86ConnectorComponent,
XF86ConnectorLFP, XF86ConnectorLFP,
XF86ConnectorProprietary XF86ConnectorProprietary,
XF86ConnectorHDMI,
XF86ConnectorDisplayPort,
} xf86ConnectorType; } xf86ConnectorType;
typedef enum _xf86OutputStatus { typedef enum _xf86OutputStatus {

View File

@ -354,6 +354,36 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
return Mode; return Mode;
} }
static DisplayModePtr
DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
{
DisplayModePtr modes = NULL;
int i;
for (i = 0; i < 4; i++) {
if (t[i].height) {
if (t[i].rates & 0x10)
modes = xf86ModesAdd(modes,
xf86CVTMode(t[i].width, t[i].height, 50, 0, 0));
if (t[i].rates & 0x08)
modes = xf86ModesAdd(modes,
xf86CVTMode(t[i].width, t[i].height, 60, 0, 0));
if (t[i].rates & 0x04)
modes = xf86ModesAdd(modes,
xf86CVTMode(t[i].width, t[i].height, 75, 0, 0));
if (t[i].rates & 0x02)
modes = xf86ModesAdd(modes,
xf86CVTMode(t[i].width, t[i].height, 85, 0, 0));
if (t[i].rates & 0x01)
modes = xf86ModesAdd(modes,
xf86CVTMode(t[i].width, t[i].height, 60, 1, 0));
} else break;
}
return modes;
}
/* /*
* *
*/ */
@ -504,6 +534,8 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC)
quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE); quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE);
preferred = PREFERRED_TIMING_MODE(DDC->features.msc); preferred = PREFERRED_TIMING_MODE(DDC->features.msc);
if (DDC->ver.revision >= 4)
preferred = TRUE;
if (quirks & DDC_QUIRK_FIRST_DETAILED_PREFERRED) if (quirks & DDC_QUIRK_FIRST_DETAILED_PREFERRED)
preferred = TRUE; preferred = TRUE;
if (quirks & (DDC_QUIRK_PREFER_LARGE_60 | DDC_QUIRK_PREFER_LARGE_75)) if (quirks & (DDC_QUIRK_PREFER_LARGE_60 | DDC_QUIRK_PREFER_LARGE_75))
@ -527,6 +559,10 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC)
quirks); quirks);
Modes = xf86ModesAdd(Modes, Mode); Modes = xf86ModesAdd(Modes, Mode);
break; break;
case DS_CVT:
Mode = DDCModesFromCVT(scrnIndex, det_mon->section.cvt);
Modes = xf86ModesAdd(Modes, Mode);
break;
default: default:
break; break;
} }

View File

@ -494,7 +494,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
{ {
ScrnInfoPtr pScrn = crtc->scrn; ScrnInfoPtr pScrn = crtc->scrn;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen; /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
PictTransform crtc_to_fb, fb_to_crtc; PictTransform crtc_to_fb, fb_to_crtc;
PictureTransformIdentity (&crtc_to_fb); PictureTransformIdentity (&crtc_to_fb);

View File

@ -122,10 +122,10 @@ static void vuidMouseAdjustFrame(int index, int x, int y, int flags);
static int vuidMouseGeneration = 0; static int vuidMouseGeneration = 0;
static DevPrivateKey vuidMouseScreenKey = &vuidMouseScreenKey; static DevPrivateKey vuidMouseScreenKey = &vuidMouseScreenKey;
#define vuidGetMouseScreenPrivate(s) ((VuidMsePtr) \ #define vuidMouseGetScreenPrivate(s) ( \
dixLookupPrivate(&(s)->devPrivates, vuidMouseScreenKey)) dixLookupPrivate(&(s)->devPrivates, vuidMouseScreenKey))
#define vuidSetMouseScreenPrivate(s,p) \ #define vuidMouseSetScreenPrivate(s,p) \
dixSetPrivate(&(s)->devPrivates, vuidMouseScreenKey, p) dixSetPrivate(&(s)->devPrivates, vuidMouseScreenKey, (void *) p)
#endif /* HAVE_ABSOLUTE_MOUSE_SCALING */ #endif /* HAVE_ABSOLUTE_MOUSE_SCALING */
static inline static inline

View File

@ -489,4 +489,3 @@ main(argc, argv)
return (0); return (0);
} }
#include "xf86getpagesize.c"

View File

@ -1,7 +1,9 @@
noinst_LTLIBRARIES = libXquartz.la noinst_LTLIBRARIES = libXquartz.la
AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
AM_OBJCFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-DBUILD_DATE=\"$(BUILD_DATE)\" \ -DBUILD_DATE=\"$(BUILD_DATE)\" \
-DXSERVER_VERSION=\"$(VERSION)\" \
-DINXQUARTZ \ -DINXQUARTZ \
-DUSE_NEW_CLUT \ -DUSE_NEW_CLUT \
-DXFree86Server \ -DXFree86Server \
@ -15,8 +17,9 @@ SUBDIRS = . xpr $(X11APP_SUBDIRS)
DIST_SUBDIRS = xpr bundle DIST_SUBDIRS = xpr bundle
libXquartz_la_SOURCES = \ libXquartz_la_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \ $(top_srcdir)/fb/fbcmap_mi.c \
$(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xext/dpmsstubs.c \
X11Application.m \ X11Application.m \
X11Controller.m \ X11Controller.m \
applewm.c \ applewm.c \

View File

@ -855,7 +855,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
NSWindow *window; NSWindow *window;
int pointer_x, pointer_y, ev_button, ev_type; int pointer_x, pointer_y, ev_button, ev_type;
// int num_events=0, i=0, state; // int num_events=0, i=0, state;
xEvent xe; // xEvent xe;
/* convert location to global top-left coordinates */ /* convert location to global top-left coordinates */
location = [e locationInWindow]; location = [e locationInWindow];

View File

@ -264,8 +264,7 @@ WMFreeEvents (data, id)
} }
static int static int
ProcAppleWMSelectInput (client) ProcAppleWMSelectInput (register ClientPtr client)
register ClientPtr client;
{ {
REQUEST(xAppleWMSelectInputReq); REQUEST(xAppleWMSelectInputReq);
WMEventPtr pEvent, pNewEvent, *pHead; WMEventPtr pEvent, pNewEvent, *pHead;
@ -479,13 +478,11 @@ ProcAppleWMSetFrontProcess(
} }
static int static int
ProcAppleWMSetWindowLevel( ProcAppleWMSetWindowLevel(register ClientPtr client)
register ClientPtr client
)
{ {
REQUEST(xAppleWMSetWindowLevelReq); REQUEST(xAppleWMSetWindowLevelReq);
WindowPtr pWin; WindowPtr pWin;
int errno; int err;
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
@ -497,9 +494,9 @@ ProcAppleWMSetWindowLevel(
return BadValue; return BadValue;
} }
errno = appleWMProcs->SetWindowLevel(pWin, stuff->level); err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
if (errno != Success) { if (err != Success) {
return errno; return err;
} }
return (client->noClientException); return (client->noClientException);

View File

@ -25,9 +25,9 @@
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Copyright © 2003-2007, Apple Inc. <string>Copyright © 2003-2008, Apple Inc.
Copyright © 2003, XFree86 Project, Inc. Copyright © 2003, XFree86 Project, Inc.
Copyright © 2003-2007, X.org Project, Inc. Copyright © 2003-2008, X.org Project, Inc.
</string> </string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>main</string> <string>main</string>

View File

@ -78,7 +78,7 @@
#include "darwinEvents.h" #include "darwinEvents.h"
#include "darwinKeyboard.h" #include "darwinKeyboard.h"
#include "quartz.h" #include "quartz.h"
#include "darwinClut8.h" //#include "darwinClut8.h"
#ifdef ENABLE_DEBUG_LOG #ifdef ENABLE_DEBUG_LOG
FILE *debug_log_fp = NULL; FILE *debug_log_fp = NULL;
@ -176,17 +176,10 @@ static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
* This is a callback from dix during AddScreen() from InitOutput(). * This is a callback from dix during AddScreen() from InitOutput().
* Initialize the screen and communicate information about it back to dix. * Initialize the screen and communicate information about it back to dix.
*/ */
static Bool DarwinAddScreen( static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) {
int index, int dpi;
ScreenPtr pScreen,
int argc,
char **argv )
{
int bitsPerRGB, i, dpi;
static int foundIndex = 0; static int foundIndex = 0;
Bool ret; Bool ret;
VisualPtr visual;
ColormapPtr pmap;
DarwinFramebufferPtr dfb; DarwinFramebufferPtr dfb;
// reset index of found screens for each server generation // reset index of found screens for each server generation
@ -204,28 +197,13 @@ static Bool DarwinAddScreen(
if (! ret) if (! ret)
return FALSE; return FALSE;
bitsPerRGB = dfb->bitsPerComponent;
// reset the visual list // reset the visual list
miClearVisualTypes(); miClearVisualTypes();
// setup a single visual appropriate for our pixel type // setup a single visual appropriate for our pixel type
if (dfb->colorType == TrueColor) { if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask, dfb->preferredCVC, dfb->redMask,
bitsPerRGB, TrueColor )) { dfb->greenMask, dfb->blueMask)) {
return FALSE;
}
} else if (dfb->colorType == PseudoColor) {
if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask,
bitsPerRGB, PseudoColor )) {
return FALSE;
}
} else if (dfb->colorType == StaticColor) {
if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask,
bitsPerRGB, StaticColor )) {
return FALSE;
}
} else {
return FALSE; return FALSE;
} }
@ -249,20 +227,28 @@ static Bool DarwinAddScreen(
return FALSE; return FALSE;
} }
// ErrorF("Screen type: %d, %d=%d, %d=%d, %d=%d, %x=%x=%x, %x=%x=%x, %x=%x=%x\n", pScreen->visuals->class,
// pScreen->visuals->offsetRed, dfb->bitsPerRGB * 2,
// pScreen->visuals->offsetGreen, dfb->bitsPerRGB,
// pScreen->visuals->offsetBlue, 0,
// pScreen->visuals->redMask, dfb->redMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetRed,
// pScreen->visuals->greenMask, dfb->greenMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetGreen,
// pScreen->visuals->blueMask, dfb->blueMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetBlue);
// set the RGB order correctly for TrueColor // set the RGB order correctly for TrueColor
if (dfb->bitsPerPixel > 8) { // if (dfb->bitsPerPixel > 8) {
for (i = 0, visual = pScreen->visuals; // someday we may have more than 1 // for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
i < pScreen->numVisuals; i++, visual++) { // i < pScreen->numVisuals; i++, visual++) {
if (visual->class == TrueColor) { // if (visual->class == TrueColor) {
visual->offsetRed = bitsPerRGB * 2; // visual->offsetRed = bitsPerRGB * 2;
visual->offsetGreen = bitsPerRGB; // visual->offsetGreen = bitsPerRGB;
visual->offsetBlue = 0; // visual->offsetBlue = 0;
visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed; // visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen; // visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue; // visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
} // }
} // }
} // }
#ifdef RENDER #ifdef RENDER
if (! fbPictureInit(pScreen, 0, 0)) { if (! fbPictureInit(pScreen, 0, 0)) {
@ -292,17 +278,16 @@ static Bool DarwinAddScreen(
* mode and we're using a fixed color map. Essentially this translates * mode and we're using a fixed color map. Essentially this translates
* to Darwin/x86 in 8-bit mode. * to Darwin/x86 in 8-bit mode.
*/ */
if( (dfb->colorBitsPerPixel == 8) && // if(dfb->depth == 8) {
(dfb->colorType == StaticColor) ) // ColormapPtr map = RootlessGetColormap (pScreen);
{ // for( i = 0; i < map->pVisual->ColormapEntries; i++ ) {
pmap = miInstalledMaps[pScreen->myNum]; // Entry *ent = map->red + i;
visual = pmap->pVisual; // ErrorF("Setting lo %d -> r: %04x g: %04x b: %04x\n", i, darwinClut8[i].red, darwinClut8[i].green, darwinClut8[i].blue);
for( i = 0; i < visual->ColormapEntries; i++ ) { // ent->co.local.red = darwinClut8[i].red;
pmap->red[i].co.local.red = darwinClut8[i].red; // ent->co.local.green = darwinClut8[i].green;
pmap->red[i].co.local.green = darwinClut8[i].green; // ent->co.local.blue = darwinClut8[i].blue;
pmap->red[i].co.local.blue = darwinClut8[i].blue; // }
} // }
}
dixScreenOrigins[index].x = dfb->x; dixScreenOrigins[index].x = dfb->x;
dixScreenOrigins[index].y = dfb->y; dixScreenOrigins[index].y = dfb->y;
@ -793,24 +778,21 @@ int ddxProcessArgument( int argc, char *argv[], int i )
} }
if ( !strcmp( argv[i], "-depth" ) ) { if ( !strcmp( argv[i], "-depth" ) ) {
int bitDepth;
if ( i == argc-1 ) { if ( i == argc-1 ) {
FatalError( "-depth must be followed by a number\n" ); FatalError( "-depth must be followed by a number\n" );
} }
#ifdef OLD_POWERBOOK_G3 #ifdef OLD_POWERBOOK_G3
ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n"); ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
#else #else
bitDepth = atoi( argv[i+1] ); darwinDesiredDepth = atoi( argv[i+1] );
if (bitDepth == 8) if(darwinDesiredDepth != -1 &&
darwinDesiredDepth = 0; darwinDesiredDepth != 8 &&
else if (bitDepth == 15) darwinDesiredDepth != 15 &&
darwinDesiredDepth = 1; darwinDesiredDepth != 24) {
else if (bitDepth == 24)
darwinDesiredDepth = 2;
else
FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" ); FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
ErrorF( "Attempting to use pixel depth of %i\n", bitDepth ); }
ErrorF( "Attempting to use pixel depth of %i\n", darwinDesiredDepth );
#endif #endif
return 2; return 2;
} }
@ -897,24 +879,6 @@ void AbortDDX( void )
ddxGiveUp(); ddxGiveUp();
} }
/*
* DPMS extension stubs
*/
Bool DPMSSupported(void)
{
return FALSE;
}
void DPMSSet(int level)
{
}
int DPMSGet(int *level)
{
return -1;
}
#include "mivalidate.h" // for union _Validate used by windowstr.h #include "mivalidate.h" // for union _Validate used by windowstr.h
#include "windowstr.h" // for struct _Window #include "windowstr.h" // for struct _Window
#include "scrnintstr.h" // for struct _Screen #include "scrnintstr.h" // for struct _Screen

View File

@ -40,10 +40,14 @@ typedef struct {
int width; int width;
int height; int height;
int pitch; int pitch;
int colorType; int depth;
int visuals;
int bitsPerRGB;
int bitsPerPixel; int bitsPerPixel;
int colorBitsPerPixel; int preferredCVC;
int bitsPerComponent; Pixel redMask;
Pixel greenMask;
Pixel blueMask;
} DarwinFramebufferRec, *DarwinFramebufferPtr; } DarwinFramebufferRec, *DarwinFramebufferPtr;
// From darwin.c // From darwin.c
@ -120,7 +124,7 @@ enum {
#ifdef ENABLE_DEBUG_LOG #ifdef ENABLE_DEBUG_LOG
extern FILE *debug_log_fp; extern FILE *debug_log_fp;
#define DEBUG_LOG_NAME "x11-debug.txt" #define DEBUG_LOG_NAME "x11-debug.txt"
#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%d: " msg, __FUNCTION__, __LINE__, ##args ) #define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
#else #else
#define DEBUG_LOG(msg, args...) #define DEBUG_LOG(msg, args...)
#endif #endif

View File

@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group.
#include "darwin.h" #include "darwin.h"
#include "quartz.h" #include "quartz.h"
#include "darwinKeyboard.h" #include "darwinKeyboard.h"
#include "darwinEvents.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
@ -213,9 +214,8 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
* *
* This should be deprecated in favor of miEQEnqueue -- BB * This should be deprecated in favor of miEQEnqueue -- BB
*/ */
void DarwinEQEnqueue(const xEvent *e) { void DarwinEQEnqueue(const xEventPtr e) {
HWEventQueueType oldtail, newtail; HWEventQueueType oldtail, newtail;
char byte = 0;
oldtail = darwinEventQueue.tail; oldtail = darwinEventQueue.tail;
@ -253,7 +253,7 @@ void DarwinEQEnqueue(const xEvent *e) {
* DarwinEQPointerPost * DarwinEQPointerPost
* Post a pointer event. Used by the mipointer.c routines. * Post a pointer event. Used by the mipointer.c routines.
*/ */
void DarwinEQPointerPost(xEvent *e) { void DarwinEQPointerPost(DeviceIntPtr pdev, xEventPtr e) {
(*darwinEventQueue.pPtr->processInputProc) (*darwinEventQueue.pPtr->processInputProc)
(e, (DeviceIntPtr)darwinEventQueue.pPtr, 1); (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
} }
@ -274,7 +274,6 @@ void ProcessInputEvents(void) {
EventRec *e; EventRec *e;
int x, y; int x, y;
xEvent xe; xEvent xe;
static int old_flags = 0; // last known modifier state
// button number and modifier mask of currently pressed fake button // button number and modifier mask of currently pressed fake button
input_check_flag=0; input_check_flag=0;

View File

@ -28,12 +28,13 @@
#define _DARWIN_EVENTS_H #define _DARWIN_EVENTS_H
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr); Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
void DarwinEQEnqueue(const xEvent *e); void DarwinEQEnqueue(const xEventPtr e);
void DarwinEQPointerPost(xEvent *e); void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
void DarwinPokeEQ(void); void DarwinPokeEQ(void);
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y); void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
void DarwinSendKeyboardEvents(int ev_type, int keycode); void DarwinSendKeyboardEvents(int ev_type, int keycode);
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y); void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
void DarwinUpdateModKeys(int flags);
#endif /* _DARWIN_EVENTS_H */ #endif /* _DARWIN_EVENTS_H */

View File

@ -330,7 +330,7 @@ static void parse_next_char_code(DataStream *s, KeySym *k) {
* DarwinReadKeymapFile * DarwinReadKeymapFile
* Read the appropriate keymapping from a keymapping file. * Read the appropriate keymapping from a keymapping file.
*/ */
Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) { static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
struct stat st; struct stat st;
NXEventSystemDevice info[20]; NXEventSystemDevice info[20];
int interface = 0, handler_id = 0; int interface = 0, handler_id = 0;
@ -439,7 +439,7 @@ Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
/* /*
* DarwinParseNXKeyMapping * DarwinParseNXKeyMapping
*/ */
Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) { static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
KeySym *k; KeySym *k;
int i; int i;
short numMods, numKeys, numPadKeys = 0; short numMods, numKeys, numPadKeys = 0;
@ -933,7 +933,7 @@ int DarwinModifierNXMaskToNXKey(int mask) {
return -1; return -1;
} }
const char *DarwinModifierNXMaskTostring(int mask) { static const char *DarwinModifierNXMaskTostring(int mask) {
switch (mask) { switch (mask) {
case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK"; case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
case NX_SHIFTMASK: return "NX_SHIFTMASK"; case NX_SHIFTMASK: return "NX_SHIFTMASK";

View File

@ -63,6 +63,7 @@ SOFTWARE.
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
#include "XIstubs.h" #include "XIstubs.h"
#include "chgkbd.h"
/*********************************************************************** /***********************************************************************
* *
@ -88,16 +89,12 @@ SOFTWARE.
* *
*/ */
int int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
ChangeKeyboardDevice (old_dev, new_dev)
DeviceIntPtr old_dev;
DeviceIntPtr new_dev;
{
/*********************************************************************** /***********************************************************************
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c * DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
**********************************************************************/ **********************************************************************/
return BadMatch; return BadMatch;
} }
/*********************************************************************** /***********************************************************************

View File

@ -50,7 +50,7 @@
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <assert.h> #include <assert.h>
void NSBeep(); void NSBeep(void);
typedef struct QuartzAudioRec { typedef struct QuartzAudioRec {
double frequency; double frequency;

View File

@ -37,6 +37,7 @@
#endif #endif
#include "quartzCommon.h" #include "quartzCommon.h"
#include "quartzPasteboard.h"
#define BOOL xBOOL #define BOOL xBOOL
#include "darwin.h" #include "darwin.h"

View File

@ -32,6 +32,8 @@
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#include <stdio.h> #include <stdio.h>
#include "quartzForeground.h"
int QuartzMoveToForeground() { int QuartzMoveToForeground() {
ProcessSerialNumber psn = { 0, kCurrentProcess }; ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication); OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);

View File

@ -32,6 +32,6 @@
#ifndef _QUARTZ_FOREGROUND_H_ #ifndef _QUARTZ_FOREGROUND_H_
#define _QUARTZ_FOREGROUND_H_ #define _QUARTZ_FOREGROUND_H_
int QuartzMoveToForeground(); int QuartzMoveToForeground(void);
#endif /* _QUARTZ_FOREGROUND_H_ */ #endif /* _QUARTZ_FOREGROUND_H_ */

View File

@ -34,11 +34,11 @@
#define _QUARTZPASTEBOARD_H #define _QUARTZPASTEBOARD_H
// Aqua->X // Aqua->X
void QuartzReadPasteboard(); void QuartzReadPasteboard(void);
char * QuartzReadCocoaPasteboard(void); // caller must free string char * QuartzReadCocoaPasteboard(void); // caller must free string
// X->Aqua // X->Aqua
void QuartzWritePasteboard(); void QuartzWritePasteboard(void);
void QuartzWriteCocoaPasteboard(char *text); void QuartzWriteCocoaPasteboard(char *text);
#endif /* _QUARTZPASTEBOARD_H */ #endif /* _QUARTZPASTEBOARD_H */

View File

@ -52,8 +52,11 @@
char **envpGlobal; // argcGlobal and argvGlobal char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c // are from dix/globals.c
int main(int argc, char **argv, char **envp);
void _InitHLTB(void);
void DarwinHandleGUI(int argc, char **argv, char **envp);
static void server_thread (void *arg) { static void server_thread (void *arg) {
extern int main(int argc, char **argv, char **envp);
exit (main (argcGlobal, argvGlobal, envpGlobal)); exit (main (argcGlobal, argvGlobal, envpGlobal));
} }
@ -103,8 +106,6 @@ void DarwinHandleGUI(int argc, char **argv, char **envp) {
before the main thread when we're _not_ prebound, things fail, before the main thread when we're _not_ prebound, things fail,
so initialize by hand. */ so initialize by hand. */
extern void _InitHLTB(void);
_InitHLTB(); _InitHLTB();
X11ControllerMain(argc, (const char **)argv, server_thread, NULL); X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
exit(0); exit(0);

View File

@ -55,6 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "swaprep.h" #include "swaprep.h"
#include "dri.h" #include "dri.h"
#include "dristruct.h" #include "dristruct.h"
#include "xpr.h"
static int DRIErrorBase = 0; static int DRIErrorBase = 0;

View File

@ -42,6 +42,7 @@
#include "globals.h" #include "globals.h"
#include "Xplugin.h" #include "Xplugin.h"
#include "applewmExt.h" #include "applewmExt.h"
#include "micmap.h"
// From xprFrame.c // From xprFrame.c
WindowPtr xprGetXWindow(xp_window_id wid); WindowPtr xprGetXWindow(xp_window_id wid);
@ -61,53 +62,52 @@ static const char *xprOpenGLBundle = "glxCGL.bundle";
* eventHandler * eventHandler
* Callback handler for Xplugin events. * Callback handler for Xplugin events.
*/ */
static void static void eventHandler(unsigned int type, const void *arg,
eventHandler(unsigned int type, const void *arg, unsigned int arg_size, void *data) {
unsigned int arg_size, void *data)
{
switch (type) { switch (type) {
case XP_EVENT_DISPLAY_CHANGED: case XP_EVENT_DISPLAY_CHANGED:
DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n"); DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
QuartzMessageServerThread(kXDarwinDisplayChanged, 0); QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
break; break;
case XP_EVENT_WINDOW_STATE_CHANGED: case XP_EVENT_WINDOW_STATE_CHANGED:
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED\n"); if (arg_size >= sizeof(xp_window_state_event)) {
if (arg_size >= sizeof(xp_window_state_event)) { const xp_window_state_event *ws_arg = arg;
const xp_window_state_event *ws_arg = arg;
DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state);
QuartzMessageServerThread(kXDarwinWindowState, 2, QuartzMessageServerThread(kXDarwinWindowState, 2,
ws_arg->id, ws_arg->state); ws_arg->id, ws_arg->state);
} } else {
break; DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
}
case XP_EVENT_WINDOW_MOVED: break;
DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
if (arg_size == sizeof(xp_window_id)) { case XP_EVENT_WINDOW_MOVED:
xp_window_id id = * (xp_window_id *) arg; DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
WindowPtr pWin = xprGetXWindow(id); if (arg_size == sizeof(xp_window_id)) {
QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin); xp_window_id id = * (xp_window_id *) arg;
} WindowPtr pWin = xprGetXWindow(id);
break; QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin);
}
case XP_EVENT_SURFACE_DESTROYED: break;
DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
case XP_EVENT_SURFACE_CHANGED: case XP_EVENT_SURFACE_DESTROYED:
DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n"); DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
if (arg_size == sizeof(xp_surface_id)) { case XP_EVENT_SURFACE_CHANGED:
int kind; DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
if (arg_size == sizeof(xp_surface_id)) {
if (type == XP_EVENT_SURFACE_DESTROYED) int kind;
kind = AppleDRISurfaceNotifyDestroyed;
else if (type == XP_EVENT_SURFACE_DESTROYED)
kind = AppleDRISurfaceNotifyChanged; kind = AppleDRISurfaceNotifyDestroyed;
else
DRISurfaceNotify(*(xp_surface_id *) arg, kind); kind = AppleDRISurfaceNotifyChanged;
}
break; DRISurfaceNotify(*(xp_surface_id *) arg, kind);
default: }
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", break;
type); default:
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
} }
} }
@ -249,35 +249,59 @@ static Bool
xprAddScreen(int index, ScreenPtr pScreen) xprAddScreen(int index, ScreenPtr pScreen)
{ {
DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen); DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
int depth = darwinDesiredDepth;
/* If no specific depth chosen, look for the depth of the main display.
Else if 16bpp specified, use that. Else use 32bpp. */ if(depth == -1) {
depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
dfb->colorType = TrueColor; //dfb->depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
dfb->bitsPerComponent = 8; //dfb->bitsPerRGB = CGDisplayBitsPerSample(kCGDirectMainDisplay);
dfb->bitsPerPixel = 32; //dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
dfb->colorBitsPerPixel = 24;
if (darwinDesiredDepth == -1)
{
dfb->bitsPerComponent = CGDisplayBitsPerSample(kCGDirectMainDisplay);
dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
dfb->colorBitsPerPixel =
CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
dfb->bitsPerComponent;
} }
else if (darwinDesiredDepth == 15)
{ switch(depth) {
dfb->bitsPerComponent = 5; case -8: // broken
dfb->bitsPerPixel = 16; FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
dfb->colorBitsPerPixel = 15; dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
} dfb->preferredCVC = GrayScale;
else if (darwinDesiredDepth == 8) dfb->depth = 8;
{ dfb->bitsPerRGB = 8;
dfb->colorType = PseudoColor; dfb->bitsPerPixel = 8;
dfb->bitsPerComponent = 8; dfb->redMask = 0;
dfb->bitsPerPixel = 8; dfb->greenMask = 0;
dfb->colorBitsPerPixel = 8; dfb->blueMask = 0;
break;
case 8: // broken
dfb->visuals = PseudoColorMask;
dfb->preferredCVC = PseudoColor;
dfb->depth = 8;
dfb->bitsPerRGB = 8;
dfb->bitsPerPixel = 8;
dfb->redMask = 0;
dfb->greenMask = 0;
dfb->blueMask = 0;
break;
case 15:
dfb->visuals = LARGE_VISUALS;
dfb->preferredCVC = TrueColor;
dfb->depth = 15;
dfb->bitsPerRGB = 5;
dfb->bitsPerPixel = 16;
dfb->redMask = 0x7c00;
dfb->greenMask = 0x03e0;
dfb->blueMask = 0x001f;
break;
case 24:
dfb->visuals = LARGE_VISUALS;
dfb->preferredCVC = TrueColor;
dfb->depth = 24;
dfb->bitsPerRGB = 8;
dfb->bitsPerPixel = 32;
dfb->redMask = 0x00ff0000;
dfb->greenMask = 0x0000ff00;
dfb->blueMask = 0x000000ff;
break;
default:
FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
} }
if (noPseudoramiXExtension) if (noPseudoramiXExtension)

View File

@ -331,7 +331,7 @@ extern void XaceExtensionInit(INITARGS);
extern void SecurityExtensionInit(INITARGS); extern void SecurityExtensionInit(INITARGS);
#endif #endif
#ifdef XSELINUX #ifdef XSELINUX
extern void XSELinuxExtensionInit(INITARGS); extern void SELinuxExtensionInit(INITARGS);
#endif #endif
#ifdef XPRINT #ifdef XPRINT
extern void XpExtensionInit(INITARGS); extern void XpExtensionInit(INITARGS);
@ -611,7 +611,7 @@ InitExtensions(argc, argv)
if (!noSecurityExtension) SecurityExtensionInit(); if (!noSecurityExtension) SecurityExtensionInit();
#endif #endif
#ifdef XSELINUX #ifdef XSELINUX
XSELinuxExtensionInit(); SELinuxExtensionInit();
#endif #endif
#ifdef XPRINT #ifdef XPRINT
XpExtensionInit(); /* server-specific extension, cannot be disabled */ XpExtensionInit(); /* server-specific extension, cannot be disabled */
@ -709,7 +709,7 @@ static ExtensionModule staticExtensions[] = {
{ SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL }, { SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, NULL },
#endif #endif
#ifdef XSELINUX #ifdef XSELINUX
{ XSELinuxExtensionInit, XSELINUX_EXTENSION_NAME, NULL, NULL, NULL }, { SELinuxExtensionInit, SELINUX_EXTENSION_NAME, NULL, NULL, NULL },
#endif #endif
#ifdef XPRINT #ifdef XPRINT
{ XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL }, { XpExtensionInit, XP_PRINTNAME, NULL, NULL, NULL },

View File

@ -51,6 +51,9 @@ static DevPrivateKey rlAccelScreenPrivateKey = &rlAccelScreenPrivateKey;
#define RLACCELREC(pScreen) ((rlAccelScreenRec *) \ #define RLACCELREC(pScreen) ((rlAccelScreenRec *) \
dixLookupPrivate(&(pScreen)->devPrivates, rlAccelScreenPrivateKey)) dixLookupPrivate(&(pScreen)->devPrivates, rlAccelScreenPrivateKey))
#define SETRLACCELREC(pScreen, v) \
dixSetPrivate(&(pScreen)->devPrivates, rlAccelScreenPrivateKey, v)
/* This is mostly identical to fbGCOps. */ /* This is mostly identical to fbGCOps. */
static GCOps rlAccelOps = { static GCOps rlAccelOps = {
rlFillSpans, rlFillSpans,
@ -132,7 +135,7 @@ RootlessAccelInit(ScreenPtr pScreen)
s = xalloc(sizeof(rlAccelScreenRec)); s = xalloc(sizeof(rlAccelScreenRec));
if (!s) return FALSE; if (!s) return FALSE;
RLACCELREC(pScreen) = s; SETRLACCELREC(pScreen, s);
// Wrap the screen functions we need // Wrap the screen functions we need
s->CreateGC = pScreen->CreateGC; s->CreateGC = pScreen->CreateGC;

View File

@ -353,7 +353,8 @@ InitConnectionLimits(void)
#endif #endif
#if !defined(WIN32) #if !defined(WIN32)
ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1)); if (!ConnectionTranslation)
ConnectionTranslation = (int *)xnfalloc(sizeof(int)*(lastfdesc + 1));
#else #else
InitConnectionTranslation(); InitConnectionTranslation();
#endif #endif