Merge branch 'master' into mpx
Conflicts: dix/devices.c hw/xfree86/common/xf86Xinput.c hw/xfree86/loader/xf86sym.c mi/mieq.c
This commit is contained in:
commit
1f97a76476
|
@ -1019,6 +1019,7 @@ __glXCreateARGBConfig(__GLXscreen *screen)
|
|||
VisualPtr visual;
|
||||
int i;
|
||||
|
||||
/* search for a 32-bit visual */
|
||||
visual = NULL;
|
||||
for (i = 0; i < screen->pScreen->numVisuals; i++)
|
||||
if (screen->pScreen->visuals[i].nplanes == 32) {
|
||||
|
@ -1037,8 +1038,22 @@ __glXCreateARGBConfig(__GLXscreen *screen)
|
|||
if (modes == NULL)
|
||||
return;
|
||||
|
||||
modes->next = screen->modes;
|
||||
screen->modes = modes;
|
||||
/* Insert this new mode at the TAIL of the linked list.
|
||||
* Previously, the mode was incorrectly inserted at the head of the
|
||||
* list, causing find_mesa_visual() to be off by one. This would
|
||||
* GLX clients to blow up if they attempted to use the last mode
|
||||
* in the list!
|
||||
*/
|
||||
{
|
||||
__GLcontextModes *prev = NULL, *m;
|
||||
for (m = screen->modes; m; m = m->next)
|
||||
prev = m;
|
||||
if (prev)
|
||||
prev->next = modes;
|
||||
else
|
||||
screen->modes = modes;
|
||||
}
|
||||
|
||||
screen->numUsableVisuals++;
|
||||
screen->numVisuals++;
|
||||
|
||||
|
@ -1104,6 +1119,9 @@ int DoGetFBConfigs(__GLXclientState *cl, unsigned screen, GLboolean do_swap)
|
|||
}
|
||||
pGlxScreen = __glXActiveScreens[screen];
|
||||
|
||||
/* Create the "extra" 32bpp ARGB visual, if not already added.
|
||||
* XXX This is questionable place to do so! Re-examine this someday.
|
||||
*/
|
||||
__glXCreateARGBConfig(pGlxScreen);
|
||||
|
||||
reply.numFBConfigs = pGlxScreen->numUsableVisuals;
|
||||
|
@ -1661,6 +1679,7 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
|
|||
xGLXGetDrawableAttributesReply reply;
|
||||
CARD32 attributes[4];
|
||||
int numAttribs;
|
||||
PixmapPtr pixmap;
|
||||
|
||||
glxPixmap = (__GLXpixmap *)LookupIDByType(drawId, __glXPixmapRes);
|
||||
if (!glxPixmap) {
|
||||
|
@ -1675,10 +1694,19 @@ DoGetDrawableAttributes(__GLXclientState *cl, XID drawId)
|
|||
reply.numAttribs = numAttribs;
|
||||
|
||||
attributes[0] = GLX_TEXTURE_TARGET_EXT;
|
||||
attributes[1] = GLX_TEXTURE_RECTANGLE_EXT;
|
||||
attributes[2] = GLX_Y_INVERTED_EXT;
|
||||
attributes[3] = GL_FALSE;
|
||||
|
||||
/* XXX this is merely less wrong, see fdo bug #8991 */
|
||||
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
||||
if ((pixmap->drawable.width & (pixmap->drawable.width - 1)) ||
|
||||
(pixmap->drawable.height & (pixmap->drawable.height - 1))
|
||||
/* || strstr(CALL_GetString(GL_EXTENSIONS,
|
||||
"GL_ARB_texture_non_power_of_two")) */)
|
||||
attributes[1] = GLX_TEXTURE_RECTANGLE_EXT;
|
||||
else
|
||||
attributes[1] = GLX_TEXTURE_2D_EXT;
|
||||
|
||||
if (client->swapped) {
|
||||
__glXSwapGetDrawableAttributesReply(client, &reply, attributes);
|
||||
} else {
|
||||
|
|
|
@ -42,6 +42,10 @@
|
|||
|
||||
#include <damage.h>
|
||||
|
||||
#ifdef XF86DRI
|
||||
#include <GL/internal/dri_interface.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
|
||||
DrawablePtr pDraw;
|
||||
|
@ -50,7 +54,12 @@ typedef struct {
|
|||
ScreenPtr pScreen;
|
||||
Bool idExists;
|
||||
int refcnt;
|
||||
#ifdef XF86DRI
|
||||
DamagePtr pDamage;
|
||||
__DRIcontext *pDRICtx;
|
||||
GLint texname;
|
||||
unsigned long offset;
|
||||
#endif
|
||||
} __GLXpixmap;
|
||||
|
||||
struct __GLXdrawable {
|
||||
|
|
292
GL/glx/glxdri.c
292
GL/glx/glxdri.c
|
@ -76,6 +76,11 @@ struct __GLXDRIscreen {
|
|||
xf86EnterVTProc *enterVT;
|
||||
xf86LeaveVTProc *leaveVT;
|
||||
|
||||
DRITexOffsetStartProcPtr texOffsetStart;
|
||||
DRITexOffsetFinishProcPtr texOffsetFinish;
|
||||
__GLXpixmap* texOffsetOverride[16];
|
||||
GLuint lastTexOffsetOverride;
|
||||
|
||||
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
|
||||
};
|
||||
|
||||
|
@ -125,30 +130,75 @@ struct __GLXDRIdrawable {
|
|||
static const char CREATE_NEW_SCREEN_FUNC[] =
|
||||
"__driCreateNewScreen_" STRINGIFY (INTERNAL_VERSION);
|
||||
|
||||
/* The DRI driver entry point version wasn't bumped when the
|
||||
* copySubBuffer functionality was added to the DRI drivers, but the
|
||||
* functionality is still conditional on the value of the
|
||||
* internal_api_version passed to __driCreateNewScreen. However, the
|
||||
* screen constructor doesn't fail for a DRI driver that's older than
|
||||
* the passed in version number, so there's no way we can know for
|
||||
* sure that we can actually use the copySubBuffer functionality. But
|
||||
* since the earliest (and at this point only) released mesa version
|
||||
* (6.5) that uses the 20050727 entry point does have copySubBuffer,
|
||||
* we'll just settle for that. We still have to pass in a higher to
|
||||
* the screen constructor to enable the functionality.
|
||||
*/
|
||||
#define COPY_SUB_BUFFER_INTERNAL_VERSION 20060314
|
||||
|
||||
static void
|
||||
__glXDRIleaveServer(void)
|
||||
__glXDRIleaveServer(GLboolean rendering)
|
||||
{
|
||||
DRIBlockHandler(NULL, NULL, NULL);
|
||||
int i;
|
||||
|
||||
for (i = 0; rendering && i < screenInfo.numScreens; i++) {
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(i);
|
||||
GLuint lastOverride = screen->lastTexOffsetOverride;
|
||||
|
||||
if (lastOverride) {
|
||||
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < lastOverride; j++) {
|
||||
__GLXpixmap *pGlxPix = texOffsetOverride[j];
|
||||
|
||||
if (pGlxPix && pGlxPix->texname) {
|
||||
pGlxPix->offset =
|
||||
screen->texOffsetStart((PixmapPtr)pGlxPix->pDraw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DRIBlockHandler(NULL, NULL, NULL);
|
||||
|
||||
for (i = 0; rendering && i < screenInfo.numScreens; i++) {
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(i);
|
||||
GLuint lastOverride = screen->lastTexOffsetOverride;
|
||||
|
||||
if (lastOverride) {
|
||||
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < lastOverride; j++) {
|
||||
__GLXpixmap *pGlxPix = texOffsetOverride[j];
|
||||
|
||||
if (pGlxPix && pGlxPix->texname) {
|
||||
screen->driScreen.setTexOffset(pGlxPix->pDRICtx,
|
||||
pGlxPix->texname,
|
||||
pGlxPix->offset,
|
||||
pGlxPix->pDraw->depth,
|
||||
((PixmapPtr)pGlxPix->pDraw)->
|
||||
devKind);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
__glXDRIenterServer(void)
|
||||
__glXDRIenterServer(GLboolean rendering)
|
||||
{
|
||||
DRIWakeupHandler(NULL, 0, NULL);
|
||||
int i;
|
||||
|
||||
for (i = 0; rendering && i < screenInfo.numScreens; i++) {
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(i);
|
||||
|
||||
if (screen->lastTexOffsetOverride) {
|
||||
CALL_Flush(GET_DISPATCH(), ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DRIWakeupHandler(NULL, 0, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -289,19 +339,6 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
|
|||
&context->driContext);
|
||||
}
|
||||
|
||||
static int
|
||||
glxCountBits(int word)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
while (word) {
|
||||
ret += (word & 1);
|
||||
word >>= 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
glxFillAlphaChannel (PixmapPtr pixmap, int x, int y, int width, int height)
|
||||
{
|
||||
|
@ -335,19 +372,75 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
int buffer,
|
||||
__GLXpixmap *glxPixmap)
|
||||
{
|
||||
RegionPtr pRegion;
|
||||
RegionPtr pRegion = NULL;
|
||||
PixmapPtr pixmap;
|
||||
int bpp;
|
||||
int w, h, bpp, override = 0;
|
||||
GLenum target, format, type;
|
||||
ScreenPtr pScreen = glxPixmap->pScreen;
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum);
|
||||
|
||||
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
||||
if (!glxPixmap->pDamage) {
|
||||
glxPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone,
|
||||
TRUE, glxPixmap->pScreen, NULL);
|
||||
if (!glxPixmap->pDamage)
|
||||
return BadAlloc;
|
||||
w = pixmap->drawable.width;
|
||||
h = pixmap->drawable.height;
|
||||
|
||||
if (h & (h - 1) || w & (w - 1))
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
else
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
if (screen->texOffsetStart && screen->driScreen.setTexOffset) {
|
||||
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
|
||||
int i, firstEmpty = 16, texname;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (texOffsetOverride[i] == glxPixmap)
|
||||
goto alreadyin;
|
||||
|
||||
if (firstEmpty == 16 && !texOffsetOverride[i])
|
||||
firstEmpty = i;
|
||||
}
|
||||
|
||||
if (firstEmpty == 16) {
|
||||
ErrorF("%s: Failed to register texture offset override\n", __func__);
|
||||
goto nooverride;
|
||||
}
|
||||
|
||||
if (firstEmpty >= screen->lastTexOffsetOverride)
|
||||
screen->lastTexOffsetOverride = firstEmpty + 1;
|
||||
|
||||
texOffsetOverride[firstEmpty] = glxPixmap;
|
||||
|
||||
alreadyin:
|
||||
override = 1;
|
||||
|
||||
glxPixmap->pDRICtx = &((__GLXDRIcontext*)baseContext)->driContext;
|
||||
|
||||
CALL_GetIntegerv(GET_DISPATCH(), (target == GL_TEXTURE_2D ?
|
||||
GL_TEXTURE_BINDING_2D :
|
||||
GL_TEXTURE_BINDING_RECTANGLE_NV,
|
||||
&texname));
|
||||
|
||||
if (texname == glxPixmap->texname)
|
||||
return Success;
|
||||
|
||||
glxPixmap->texname = texname;
|
||||
|
||||
screen->driScreen.setTexOffset(glxPixmap->pDRICtx, texname, 0,
|
||||
pixmap->drawable.depth, pixmap->devKind);
|
||||
}
|
||||
nooverride:
|
||||
|
||||
if (!glxPixmap->pDamage) {
|
||||
if (!override) {
|
||||
glxPixmap->pDamage = DamageCreate(NULL, NULL, DamageReportNone,
|
||||
TRUE, pScreen, NULL);
|
||||
if (!glxPixmap->pDamage)
|
||||
return BadAlloc;
|
||||
|
||||
DamageRegister ((DrawablePtr) pixmap, glxPixmap->pDamage);
|
||||
}
|
||||
|
||||
DamageRegister ((DrawablePtr) pixmap, glxPixmap->pDamage);
|
||||
pRegion = NULL;
|
||||
} else {
|
||||
pRegion = DamageRegion(glxPixmap->pDamage);
|
||||
|
@ -360,30 +453,22 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
bpp = 4;
|
||||
format = GL_BGRA;
|
||||
type =
|
||||
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
|
||||
GL_UNSIGNED_BYTE;
|
||||
#else
|
||||
GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
!override ? GL_UNSIGNED_INT_8_8_8_8_REV :
|
||||
#endif
|
||||
GL_UNSIGNED_BYTE;
|
||||
} else {
|
||||
bpp = 2;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
}
|
||||
|
||||
if (!(glxCountBits(pixmap->drawable.width) == 1 &&
|
||||
glxCountBits(pixmap->drawable.height) == 1)
|
||||
/* || strstr(CALL_GetString(GL_EXTENSIONS,
|
||||
"GL_ARB_texture_non_power_of_two")) */)
|
||||
target = GL_TEXTURE_RECTANGLE_ARB;
|
||||
else
|
||||
target = GL_TEXTURE_2D;
|
||||
|
||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH,
|
||||
pixmap->devKind / bpp) );
|
||||
|
||||
if (pRegion == NULL)
|
||||
{
|
||||
if (pixmap->drawable.depth == 24)
|
||||
if (!override && pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(pixmap,
|
||||
pixmap->drawable.x,
|
||||
pixmap->drawable.y,
|
||||
|
@ -404,8 +489,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
0,
|
||||
format,
|
||||
type,
|
||||
pixmap->devPrivate.ptr) );
|
||||
} else {
|
||||
override ? NULL : pixmap->devPrivate.ptr) );
|
||||
} else if (!override) {
|
||||
int i, numRects;
|
||||
BoxPtr p;
|
||||
|
||||
|
@ -436,7 +521,8 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
}
|
||||
}
|
||||
|
||||
DamageEmpty(glxPixmap->pDamage);
|
||||
if (!override)
|
||||
DamageEmpty(glxPixmap->pDamage);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
@ -446,6 +532,40 @@ __glXDRIreleaseTexImage(__GLXcontext *baseContext,
|
|||
int buffer,
|
||||
__GLXpixmap *pixmap)
|
||||
{
|
||||
ScreenPtr pScreen = pixmap->pScreen;
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum);
|
||||
GLuint lastOverride = screen->lastTexOffsetOverride;
|
||||
|
||||
if (lastOverride) {
|
||||
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lastOverride; i++) {
|
||||
if (texOffsetOverride[i] == pixmap) {
|
||||
if (screen->texOffsetFinish)
|
||||
screen->texOffsetFinish((PixmapPtr)pixmap->pDraw);
|
||||
|
||||
texOffsetOverride[i] = NULL;
|
||||
|
||||
if (i + 1 == lastOverride) {
|
||||
lastOverride = 0;
|
||||
|
||||
while (i--) {
|
||||
if (texOffsetOverride[i]) {
|
||||
lastOverride = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
screen->lastTexOffsetOverride = lastOverride;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -666,9 +786,9 @@ static GLboolean createContext(__DRInativeDisplay *dpy, int screen,
|
|||
fakeID = FakeClientID(0);
|
||||
*(XID *) contextID = fakeID;
|
||||
|
||||
__glXDRIenterServer();
|
||||
__glXDRIenterServer(GL_FALSE);
|
||||
retval = DRICreateContext(pScreen, visual, fakeID, hw_context);
|
||||
__glXDRIleaveServer();
|
||||
__glXDRIleaveServer(GL_FALSE);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -677,9 +797,9 @@ static GLboolean destroyContext(__DRInativeDisplay *dpy, int screen,
|
|||
{
|
||||
GLboolean retval;
|
||||
|
||||
__glXDRIenterServer();
|
||||
__glXDRIenterServer(GL_FALSE);
|
||||
retval = DRIDestroyContext(screenInfo.screens[screen], context);
|
||||
__glXDRIleaveServer();
|
||||
__glXDRIleaveServer(GL_FALSE);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -694,12 +814,12 @@ createDrawable(__DRInativeDisplay *dpy, int screen,
|
|||
if (!pDrawable)
|
||||
return GL_FALSE;
|
||||
|
||||
__glXDRIenterServer();
|
||||
__glXDRIenterServer(GL_FALSE);
|
||||
retval = DRICreateDrawable(screenInfo.screens[screen],
|
||||
drawable,
|
||||
pDrawable,
|
||||
hHWDrawable);
|
||||
__glXDRIleaveServer();
|
||||
__glXDRIleaveServer(GL_FALSE);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -713,11 +833,11 @@ destroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable)
|
|||
if (!pDrawable)
|
||||
return GL_FALSE;
|
||||
|
||||
__glXDRIenterServer();
|
||||
__glXDRIenterServer(GL_FALSE);
|
||||
retval = DRIDestroyDrawable(screenInfo.screens[screen],
|
||||
drawable,
|
||||
pDrawable);
|
||||
__glXDRIleaveServer();
|
||||
__glXDRIleaveServer(GL_FALSE);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -754,20 +874,44 @@ getDrawableInfo(__DRInativeDisplay *dpy, int screen,
|
|||
return GL_FALSE;
|
||||
}
|
||||
|
||||
__glXDRIenterServer();
|
||||
__glXDRIenterServer(GL_FALSE);
|
||||
retval = DRIGetDrawableInfo(screenInfo.screens[screen],
|
||||
pDrawable, index, stamp,
|
||||
x, y, width, height,
|
||||
numClipRects, &pClipRects,
|
||||
backX, backY,
|
||||
numBackClipRects, &pBackClipRects);
|
||||
__glXDRIleaveServer();
|
||||
__glXDRIleaveServer(GL_FALSE);
|
||||
|
||||
if (*numClipRects > 0) {
|
||||
size = sizeof (drm_clip_rect_t) * *numClipRects;
|
||||
*ppClipRects = xalloc (size);
|
||||
if (*ppClipRects != NULL)
|
||||
memcpy (*ppClipRects, pClipRects, size);
|
||||
|
||||
/* Clip cliprects to screen dimensions (redirected windows) */
|
||||
if (*ppClipRects != NULL) {
|
||||
ScreenPtr pScreen = screenInfo.screens[screen];
|
||||
int i, j;
|
||||
|
||||
for (i = 0, j = 0; i < *numClipRects; i++) {
|
||||
(*ppClipRects)[j].x1 = max(pClipRects[i].x1, 0);
|
||||
(*ppClipRects)[j].y1 = max(pClipRects[i].y1, 0);
|
||||
(*ppClipRects)[j].x2 = min(pClipRects[i].x2, pScreen->width);
|
||||
(*ppClipRects)[j].y2 = min(pClipRects[i].y2, pScreen->height);
|
||||
|
||||
if ((*ppClipRects)[j].x1 < (*ppClipRects)[j].x2 &&
|
||||
(*ppClipRects)[j].y1 < (*ppClipRects)[j].y2) {
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*numClipRects != j) {
|
||||
*numClipRects = j;
|
||||
*ppClipRects = xrealloc (*ppClipRects,
|
||||
sizeof (drm_clip_rect_t) *
|
||||
*numClipRects);
|
||||
}
|
||||
} else
|
||||
*numClipRects = 0;
|
||||
}
|
||||
else {
|
||||
*ppClipRects = NULL;
|
||||
|
@ -866,7 +1010,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
__DRIframebuffer framebuffer;
|
||||
int fd = -1;
|
||||
int status;
|
||||
int api_ver = COPY_SUB_BUFFER_INTERNAL_VERSION;
|
||||
int api_ver = 20070121;
|
||||
drm_magic_t magic;
|
||||
drmVersionPtr version;
|
||||
int newlyopened;
|
||||
|
@ -881,13 +1025,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
size_t buffer_size;
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
|
||||
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) {
|
||||
LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) {
|
||||
LogMessage(X_ERROR,
|
||||
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
|
||||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
|
||||
!isCapable) {
|
||||
LogMessage(X_INFO,
|
||||
"AIGLX: Screen %d is not DRI capable\n", pScreen->myNum);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1048,6 +1189,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
|||
goto handle_error;
|
||||
}
|
||||
|
||||
DRIGetTexOffsetFuncs(pScreen, &screen->texOffsetStart,
|
||||
&screen->texOffsetFinish);
|
||||
|
||||
__glXScreenInit(&screen->base, pScreen);
|
||||
|
||||
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
|
||||
|
|
|
@ -238,9 +238,9 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
|
|||
* the latter case we need to lift the DRI lock manually. */
|
||||
|
||||
if (!glxBlockClients) {
|
||||
__glXleaveServer();
|
||||
__glXleaveServer(GL_FALSE);
|
||||
cx->destroy(cx);
|
||||
__glXenterServer();
|
||||
__glXenterServer(GL_FALSE);
|
||||
} else {
|
||||
cx->next = glxPendingDestroyContexts;
|
||||
glxPendingDestroyContexts = cx;
|
||||
|
@ -439,49 +439,49 @@ void glxResumeClients(void)
|
|||
AttendClient(__glXClients[i]->client);
|
||||
}
|
||||
|
||||
__glXleaveServer();
|
||||
__glXleaveServer(GL_FALSE);
|
||||
for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) {
|
||||
next = cx->next;
|
||||
|
||||
cx->destroy(cx);
|
||||
}
|
||||
glxPendingDestroyContexts = NULL;
|
||||
__glXenterServer();
|
||||
__glXenterServer(GL_FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
__glXnopEnterServer(void)
|
||||
__glXnopEnterServer(GLboolean rendering)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
__glXnopLeaveServer(void)
|
||||
__glXnopLeaveServer(GLboolean rendering)
|
||||
{
|
||||
}
|
||||
|
||||
static void (*__glXenterServerFunc)(void) = __glXnopEnterServer;
|
||||
static void (*__glXleaveServerFunc)(void) = __glXnopLeaveServer;
|
||||
static void (*__glXenterServerFunc)(GLboolean) = __glXnopEnterServer;
|
||||
static void (*__glXleaveServerFunc)(GLboolean) = __glXnopLeaveServer;
|
||||
|
||||
void __glXsetEnterLeaveServerFuncs(void (*enter)(void),
|
||||
void (*leave)(void))
|
||||
void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
|
||||
void (*leave)(GLboolean))
|
||||
{
|
||||
__glXenterServerFunc = enter;
|
||||
__glXleaveServerFunc = leave;
|
||||
}
|
||||
|
||||
|
||||
void __glXenterServer(void)
|
||||
void __glXenterServer(GLboolean rendering)
|
||||
{
|
||||
glxServerLeaveCount--;
|
||||
|
||||
if (glxServerLeaveCount == 0)
|
||||
(*__glXenterServerFunc)();
|
||||
(*__glXenterServerFunc)(rendering);
|
||||
}
|
||||
|
||||
void __glXleaveServer(void)
|
||||
void __glXleaveServer(GLboolean rendering)
|
||||
{
|
||||
if (glxServerLeaveCount == 0)
|
||||
(*__glXleaveServerFunc)();
|
||||
(*__glXleaveServerFunc)(rendering);
|
||||
|
||||
glxServerLeaveCount++;
|
||||
}
|
||||
|
@ -546,11 +546,12 @@ static int __glXDispatch(ClientPtr client)
|
|||
opcode,
|
||||
client->swapped);
|
||||
if (proc != NULL) {
|
||||
__glXleaveServer();
|
||||
GLboolean rendering = opcode <= X_GLXRenderLarge;
|
||||
__glXleaveServer(rendering);
|
||||
|
||||
retval = (*proc)(cl, (GLbyte *) stuff);
|
||||
|
||||
__glXenterServer();
|
||||
__glXenterServer(rendering);
|
||||
}
|
||||
else {
|
||||
retval = BadRequest;
|
||||
|
|
|
@ -106,11 +106,11 @@ __glXMesaDrawableSwapBuffers(__GLXdrawable *base)
|
|||
* why we need to re-take the lock and swap in the server context
|
||||
* before calling XMesaSwapBuffers() here. /me shakes head. */
|
||||
|
||||
__glXenterServer();
|
||||
__glXenterServer(GL_FALSE);
|
||||
|
||||
XMesaSwapBuffers(glxPriv->xm_buf);
|
||||
|
||||
__glXleaveServer();
|
||||
__glXleaveServer(GL_FALSE);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
|
|
@ -131,10 +131,10 @@ struct __GLXprovider {
|
|||
|
||||
void GlxPushProvider(__GLXprovider *provider);
|
||||
|
||||
void __glXsetEnterLeaveServerFuncs(void (*enter)(void),
|
||||
void (*leave)(void));
|
||||
void __glXenterServer(void);
|
||||
void __glXleaveServer(void);
|
||||
void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
|
||||
void (*leave)(GLboolean));
|
||||
void __glXenterServer(GLboolean rendering);
|
||||
void __glXleaveServer(GLboolean rendering);
|
||||
|
||||
void glxSuspendClients(void);
|
||||
void glxResumeClients(void);
|
||||
|
|
|
@ -211,8 +211,6 @@ extern HIDDEN int __glXDisp_ReadPixels(struct __GLXclientStateRec *, GLbyte *);
|
|||
extern HIDDEN int __glXDispSwap_ReadPixels(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN void __glXDisp_EdgeFlagv(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_EdgeFlagv(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_TexParameterf(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_TexParameterf(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_TexParameteri(GLbyte * pc);
|
||||
|
@ -519,6 +517,8 @@ extern HIDDEN void __glXDisp_SecondaryColor3ivEXT(GLbyte * pc);
|
|||
extern HIDDEN void __glXDispSwap_SecondaryColor3ivEXT(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_TexCoord4iv(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_TexCoord4iv(GLbyte * pc);
|
||||
extern HIDDEN int __glXDisp_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetDrawableAttributesSGIX(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN void __glXDisp_SampleMaskSGIS(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_SampleMaskSGIS(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_ColorTableParameteriv(GLbyte * pc);
|
||||
|
@ -849,10 +849,8 @@ extern HIDDEN int __glXDisp_GetHistogramParameteriv(struct __GLXclientStateRec *
|
|||
extern HIDDEN int __glXDispSwap_GetHistogramParameteriv(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetHistogramParameterivEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN void __glXDisp_Rotatef(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_Rotatef(GLbyte * pc);
|
||||
extern HIDDEN int __glXDisp_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetProgramivARB(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN void __glXDisp_BlendFuncSeparateEXT(GLbyte * pc);
|
||||
|
@ -877,6 +875,10 @@ extern HIDDEN void __glXDisp_Map2f(GLbyte * pc);
|
|||
extern HIDDEN void __glXDispSwap_Map2f(GLbyte * pc);
|
||||
extern HIDDEN void __glXDisp_ProgramStringARB(GLbyte * pc);
|
||||
extern HIDDEN void __glXDispSwap_ProgramStringARB(GLbyte * pc);
|
||||
extern HIDDEN int __glXDisp_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetConvolutionFilter(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetConvolutionFilterEXT(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *, GLbyte *);
|
||||
extern HIDDEN int __glXDisp_GetTexGenfv(struct __GLXclientStateRec *, GLbyte *);
|
||||
|
|
|
@ -1231,8 +1231,8 @@ const struct __glXDispatchInfo Render_dispatch_info = {
|
|||
};
|
||||
|
||||
/*****************************************************************/
|
||||
/* tree depth = 13 */
|
||||
static const int_fast16_t VendorPriv_dispatch_tree[155] = {
|
||||
/* tree depth = 12 */
|
||||
static const int_fast16_t VendorPriv_dispatch_tree[152] = {
|
||||
/* [0] -> opcode range [0, 131072], node depth 1 */
|
||||
2,
|
||||
5,
|
||||
|
@ -1474,17 +1474,12 @@ static const int_fast16_t VendorPriv_dispatch_tree[155] = {
|
|||
|
||||
/* [149] -> opcode range [65536, 65568], node depth 12 */
|
||||
1,
|
||||
152,
|
||||
EMPTY_LEAF,
|
||||
|
||||
/* [152] -> opcode range [65536, 65552], node depth 13 */
|
||||
1,
|
||||
LEAF(88),
|
||||
EMPTY_LEAF,
|
||||
|
||||
};
|
||||
|
||||
static const void *VendorPriv_function_table[96][2] = {
|
||||
static const void *VendorPriv_function_table[104][2] = {
|
||||
/* [ 0] = 0 */ {NULL, NULL},
|
||||
/* [ 1] = 1 */ {__glXDisp_GetConvolutionFilterEXT, __glXDispSwap_GetConvolutionFilterEXT},
|
||||
/* [ 2] = 2 */ {__glXDisp_GetConvolutionParameterfvEXT, __glXDispSwap_GetConvolutionParameterfvEXT},
|
||||
|
@ -1581,6 +1576,14 @@ static const void *VendorPriv_function_table[96][2] = {
|
|||
/* [ 93] = 65541 */ {__glXDisp_CreateContextWithConfigSGIX, __glXDispSwap_CreateContextWithConfigSGIX},
|
||||
/* [ 94] = 65542 */ {__glXDisp_CreateGLXPixmapWithConfigSGIX, __glXDispSwap_CreateGLXPixmapWithConfigSGIX},
|
||||
/* [ 95] = 65543 */ {NULL, NULL},
|
||||
/* [ 96] = 65544 */ {NULL, NULL},
|
||||
/* [ 97] = 65545 */ {NULL, NULL},
|
||||
/* [ 98] = 65546 */ {__glXDisp_GetDrawableAttributesSGIX, __glXDispSwap_GetDrawableAttributesSGIX},
|
||||
/* [ 99] = 65547 */ {NULL, NULL},
|
||||
/* [ 100] = 65548 */ {NULL, NULL},
|
||||
/* [ 101] = 65549 */ {NULL, NULL},
|
||||
/* [ 102] = 65550 */ {NULL, NULL},
|
||||
/* [ 103] = 65551 */ {NULL, NULL},
|
||||
};
|
||||
|
||||
const struct __glXDispatchInfo VendorPriv_dispatch_info = {
|
||||
|
|
|
@ -35,7 +35,6 @@ MODULE_SRCS = \
|
|||
xcmisc.c
|
||||
|
||||
# Extra configuration files ship with some extensions
|
||||
SERVERCONFIGdir = $(libdir)/xserver
|
||||
SERVERCONFIG_DATA =
|
||||
|
||||
# Optional sources included if extension enabled by configure.ac rules
|
||||
|
|
119
Xext/sync.c
119
Xext/sync.c
|
@ -243,6 +243,11 @@ SyncInitServerTime(
|
|||
void
|
||||
);
|
||||
|
||||
static void
|
||||
SyncInitIdleTime(
|
||||
void
|
||||
);
|
||||
|
||||
static void
|
||||
SyncResetProc(
|
||||
ExtensionEntry * /* extEntry */
|
||||
|
@ -2400,6 +2405,7 @@ SyncExtensionInit(INITARGS)
|
|||
* because there is always a servertime counter.
|
||||
*/
|
||||
SyncInitServerTime();
|
||||
SyncInitIdleTime();
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Sync Extension %d.%d\n",
|
||||
|
@ -2520,3 +2526,116 @@ SyncInitServerTime(void)
|
|||
ServertimeQueryValue, ServertimeBracketValues);
|
||||
pnext_time = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* IDLETIME implementation
|
||||
*/
|
||||
|
||||
static pointer IdleTimeCounter;
|
||||
static XSyncValue *pIdleTimeValueLess;
|
||||
static XSyncValue *pIdleTimeValueGreater;
|
||||
|
||||
static void
|
||||
IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return)
|
||||
{
|
||||
CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
|
||||
XSyncIntsToValue (pValue_return, idle, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
IdleTimeBlockHandler (pointer env,
|
||||
struct timeval **wt,
|
||||
pointer LastSelectMask)
|
||||
{
|
||||
XSyncValue idle;
|
||||
|
||||
if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
|
||||
return;
|
||||
|
||||
IdleTimeQueryValue (NULL, &idle);
|
||||
|
||||
if (pIdleTimeValueLess &&
|
||||
XSyncValueLessOrEqual (idle, *pIdleTimeValueLess))
|
||||
{
|
||||
AdjustWaitForDelay (wt, 0);
|
||||
}
|
||||
else if (pIdleTimeValueGreater)
|
||||
{
|
||||
unsigned long timeout = 0;
|
||||
|
||||
if (XSyncValueLessThan (idle, *pIdleTimeValueGreater))
|
||||
{
|
||||
XSyncValue value;
|
||||
Bool overflow;
|
||||
|
||||
XSyncValueSubtract (&value, *pIdleTimeValueGreater,
|
||||
idle, &overflow);
|
||||
timeout = XSyncValueLow32 (value);
|
||||
}
|
||||
|
||||
AdjustWaitForDelay (wt, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
IdleTimeWakeupHandler (pointer env,
|
||||
int rc,
|
||||
pointer LastSelectMask)
|
||||
{
|
||||
XSyncValue idle;
|
||||
|
||||
if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
|
||||
return;
|
||||
|
||||
IdleTimeQueryValue (NULL, &idle);
|
||||
|
||||
if ((pIdleTimeValueGreater &&
|
||||
XSyncValueGreaterThan (idle, *pIdleTimeValueGreater)) ||
|
||||
(pIdleTimeValueLess && XSyncValueLessThan (idle, *pIdleTimeValueLess)))
|
||||
{
|
||||
SyncChangeCounter (IdleTimeCounter, idle);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
IdleTimeBracketValues (pointer pCounter,
|
||||
CARD64 *pbracket_less,
|
||||
CARD64 *pbracket_greater)
|
||||
{
|
||||
Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater);
|
||||
|
||||
if (registered && !pbracket_less && !pbracket_greater)
|
||||
{
|
||||
RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler,
|
||||
IdleTimeWakeupHandler,
|
||||
NULL);
|
||||
}
|
||||
else if (!registered && (pbracket_less || pbracket_greater))
|
||||
{
|
||||
RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler,
|
||||
IdleTimeWakeupHandler,
|
||||
NULL);
|
||||
}
|
||||
|
||||
pIdleTimeValueGreater = pbracket_greater;
|
||||
pIdleTimeValueLess = pbracket_less;
|
||||
}
|
||||
|
||||
static void
|
||||
SyncInitIdleTime (void)
|
||||
{
|
||||
CARD64 resolution;
|
||||
XSyncValue idle;
|
||||
|
||||
IdleTimeQueryValue (NULL, &idle);
|
||||
XSyncIntToValue (&resolution, 4);
|
||||
|
||||
IdleTimeCounter = SyncCreateSystemCounter ("IDLETIME", idle, resolution,
|
||||
XSyncCounterUnrestricted,
|
||||
IdleTimeQueryValue,
|
||||
IdleTimeBracketValues);
|
||||
|
||||
pIdleTimeValueLess = pIdleTimeValueGreater = NULL;
|
||||
}
|
||||
|
|
|
@ -696,11 +696,13 @@ CompositeExtensionInit (void)
|
|||
if (GetPictureScreenIfSet(pScreen) == NULL)
|
||||
return;
|
||||
}
|
||||
#ifdef PANORAMIX
|
||||
/* Xinerama's rewriting of window drawing before Composite gets to it
|
||||
* breaks Composite.
|
||||
*/
|
||||
if (!noPanoramiXExtension)
|
||||
return;
|
||||
#endif
|
||||
|
||||
CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
|
||||
if (!CompositeClientWindowType)
|
||||
|
|
62
configure.ac
62
configure.ac
|
@ -123,19 +123,19 @@ b = __swap16(a);
|
|||
], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
|
||||
AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
|
||||
|
||||
AC_MSG_CHECKING([for bswap_16 variant of <sys/endian.h> byteswapping macros])
|
||||
AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <sys/endian.h>
|
||||
], [
|
||||
int a = 1, b;
|
||||
b = bswap_16(a);
|
||||
b = bswap16(a);
|
||||
])
|
||||
], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
|
||||
AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
|
||||
|
||||
if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
|
||||
USE_SYS_ENDIAN_H=yes
|
||||
BSWAP=bswap_
|
||||
BSWAP=bswap
|
||||
else
|
||||
if test "$SYS_ENDIAN__SWAP" = "yes" ; then
|
||||
USE_SYS_ENDIAN_H=yes
|
||||
|
@ -165,23 +165,24 @@ AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
|
|||
AC_FUNC_ALLOCA
|
||||
dnl Old HAS_* names used in os/*.c.
|
||||
AC_CHECK_FUNC([getdtablesize],
|
||||
AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the `getdtablesize' function.]))
|
||||
AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.]))
|
||||
AC_CHECK_FUNC([getifaddrs],
|
||||
AC_DEFINE(HAS_GETIFADDRS, 1, [Have the `getifaddrs' function.]))
|
||||
AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.]))
|
||||
AC_CHECK_FUNC([getpeereid],
|
||||
AC_DEFINE(HAS_GETPEEREID, 1, [Have the `getpeereid' function.]))
|
||||
AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.]))
|
||||
AC_CHECK_FUNC([getpeerucred],
|
||||
AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the `getpeerucred' function.]))
|
||||
AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.]))
|
||||
AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
|
||||
AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])
|
||||
|
||||
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])
|
||||
|
||||
dnl Check for mmap support for Xvfb
|
||||
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the `mmap' function.]))
|
||||
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.]))
|
||||
|
||||
dnl Find the math libary
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function]))
|
||||
|
||||
AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
|
||||
|
||||
|
@ -361,24 +362,6 @@ case $host_os in
|
|||
esac
|
||||
AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes)
|
||||
|
||||
AC_MSG_CHECKING(for MMX capable platform)
|
||||
if test "x$use_x86_asm" = xyes && test "x$GCC" = xyes ; then
|
||||
AC_PREPROC_IFELSE([
|
||||
#if (!defined (__GNUC__) || __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
|
||||
#error Not supported
|
||||
#endif
|
||||
], mmx_capable=yes, mmx_capable=no)
|
||||
else
|
||||
mmx_capable=no
|
||||
fi
|
||||
AC_MSG_RESULT([$mmx_capable])
|
||||
AM_CONDITIONAL(MMX_CAPABLE, [test "x$mmx_capable" = xyes])
|
||||
|
||||
|
||||
OSNAME=`uname -srm`
|
||||
AC_DEFINE_UNQUOTED(OSNAME, "$OSNAME",
|
||||
[Define to OS Name string to display for build OS in Xorg log])
|
||||
|
||||
DEFAULT_VENDOR_NAME="The X.Org Foundation"
|
||||
DEFAULT_VENDOR_NAME_SHORT="X.Org"
|
||||
DEFAULT_VERSION_MAJOR=7
|
||||
|
@ -444,9 +427,9 @@ AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
|
|||
[Builder address (default: xorg@lists.freedesktop.org)]),
|
||||
[ BUILDERADDR="$withval" ],
|
||||
[ BUILDERADDR="xorg@lists.freedesktop.org" ])
|
||||
AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: UNKNOWN)]),
|
||||
AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]),
|
||||
[ OSNAME="$withval" ],
|
||||
[ OSNAME="UNKNOWN" ])
|
||||
[ OSNAME=`uname -srm` ])
|
||||
AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
|
||||
[ OSVENDOR="$withval" ],
|
||||
[ OSVENDOR="" ])
|
||||
|
@ -469,6 +452,9 @@ AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to
|
|||
AC_ARG_WITH(rgb-path, AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
|
||||
[ RGBPATH="$withval" ],
|
||||
[ RGBPATH="${datadir}/X11/rgb" ])
|
||||
AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], [Path to server config (default: ${libdir}/xserver)]),
|
||||
[ SERVERCONFIG="$withval" ],
|
||||
[ SERVERCONFIG="${libdir}/xserver" ])
|
||||
APPLE_APPLICATIONS_DIR="${bindir}/Applications"
|
||||
AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: ${bindir}/Applications)]),
|
||||
[ APPLE_APPLICATIONS_DIR="${withval}" ].
|
||||
|
@ -627,9 +613,11 @@ XEXT_INC='-I$(top_srcdir)/Xext'
|
|||
XEXT_LIB='$(top_builddir)/Xext/libXext.la'
|
||||
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
|
||||
|
||||
PIXMAN="[pixman >= 0.9.2]"
|
||||
|
||||
dnl Core modules for most extensions, et al.
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
|
||||
REQUIRED_LIBS="xfont xau fontenc"
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]"
|
||||
REQUIRED_LIBS="xfont xau fontenc $PIXMAN"
|
||||
|
||||
if test "x$DBUS" = xauto; then
|
||||
PKG_CHECK_MODULES(DBUS, dbus-1, [DBUS=yes], [DBUS=no])
|
||||
|
@ -877,7 +865,7 @@ XKB_LIB='$(top_builddir)/xkb/libxkb.la'
|
|||
XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
|
||||
|
||||
AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
|
||||
[Do not have `strcasecmp'.]))
|
||||
[Do not have 'strcasecmp'.]))
|
||||
|
||||
if test "x$NULL_ROOT_CURSOR" = xyes; then
|
||||
AC_DEFINE(NULL_ROOT_CURSOR, 1, [Use an empty root cursor])
|
||||
|
@ -940,6 +928,7 @@ VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}"
|
|||
|
||||
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
|
||||
AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path])
|
||||
AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path])
|
||||
AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path])
|
||||
AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
|
||||
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name])
|
||||
|
@ -948,6 +937,11 @@ AC_DEFINE_UNQUOTED(XORG_RELEASE, ["$VENDOR_RELEASE_STRING"], [Vendor release])
|
|||
AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
|
||||
AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
|
||||
AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
|
||||
|
||||
if test -z "$OSNAME"; then
|
||||
OSNAME="UNKNOWN"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
|
||||
AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor])
|
||||
AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string])
|
||||
|
@ -1102,7 +1096,7 @@ dnl ---------------------------------------------------------------------------
|
|||
dnl DMX DDX
|
||||
|
||||
AC_MSG_CHECKING([whether to build Xdmx DDX])
|
||||
PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
|
||||
PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES $PIXMAN], [have_dmx=yes], [have_dmx=no])
|
||||
if test "x$DMX" = xauto; then
|
||||
DMX="$have_dmx"
|
||||
fi
|
||||
|
@ -1593,7 +1587,7 @@ AC_MSG_CHECKING([whether to build Xprint DDX])
|
|||
AC_MSG_RESULT([$XPRINT])
|
||||
|
||||
if test "x$XPRINT" = xyes; then
|
||||
PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau])
|
||||
PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau $PIXMAN])
|
||||
XPRINT_EXTENSIONS="$XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS"
|
||||
XPRINT_LIBS="$DIX_LIB $CONFIG_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS $XPRINT_LIBS"
|
||||
AC_SUBST([XPRINT_CFLAGS])
|
||||
|
@ -1941,6 +1935,8 @@ AM_CONDITIONAL(SUN_KBD_MODE, [test x$KBD_MODE_TYPE = xsun])
|
|||
|
||||
BUILD_DATE="$(date +'%Y%m%d')"
|
||||
AC_SUBST([BUILD_DATE])
|
||||
BUILD_TIME="$(date +'1%H%M%S')"
|
||||
AC_SUBST([BUILD_TIME])
|
||||
|
||||
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
|
||||
|
||||
|
|
|
@ -1042,6 +1042,7 @@ InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
|
|||
abs->width = -1;
|
||||
abs->height = -1;
|
||||
abs->following = 0;
|
||||
abs->screen = 0;
|
||||
|
||||
dev->absolute = abs;
|
||||
|
||||
|
|
|
@ -996,10 +996,6 @@ ProcGetAtomName(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int k5_bad();
|
||||
#endif
|
||||
|
||||
int
|
||||
ProcSetSelectionOwner(ClientPtr client)
|
||||
{
|
||||
|
@ -3541,12 +3537,6 @@ InitProcVectors(void)
|
|||
ProcVector[i] = SwappedProcVector[i] = ProcBadRequest;
|
||||
ReplySwapVector[i] = ReplyNotSwappd;
|
||||
}
|
||||
#ifdef K5AUTH
|
||||
if (!k5_Vector[i])
|
||||
{
|
||||
k5_Vector[i] = k5_bad;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
for(i = LASTEvent; i < 128; i++)
|
||||
{
|
||||
|
|
|
@ -265,7 +265,7 @@ _X_EXPORT int
|
|||
dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask access)
|
||||
{
|
||||
pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY,
|
||||
DixReadAccess);
|
||||
access);
|
||||
int clientIndex = CLIENT_ID(rid);
|
||||
client->errorValue = rid;
|
||||
|
||||
|
|
|
@ -745,6 +745,13 @@ XineramaChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor)
|
|||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define SyntheticMotion(x, y) \
|
||||
PostSyntheticMotion(x, y, \
|
||||
0, \
|
||||
syncEvents.playingEvents ? \
|
||||
syncEvents.time.milliseconds : \
|
||||
currentTime.milliseconds);
|
||||
|
||||
#endif /* PANORAMIX */
|
||||
|
||||
|
|
|
@ -253,6 +253,7 @@ main(int argc, char *argv[], char *envp[])
|
|||
display = "0";
|
||||
|
||||
InitGlobals();
|
||||
InitRegions();
|
||||
#ifdef XPRINT
|
||||
PrinterInitGlobals();
|
||||
#endif
|
||||
|
|
15
dix/tables.c
15
dix/tables.c
|
@ -61,11 +61,6 @@ SOFTWARE.
|
|||
#include "swaprep.h"
|
||||
#include "swapreq.h"
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int
|
||||
k5_stage1(), k5_stage2(), k5_stage3(), k5_bad();
|
||||
#endif
|
||||
|
||||
int (* InitialVector[3]) (
|
||||
ClientPtr /* client */
|
||||
) =
|
||||
|
@ -515,13 +510,3 @@ _X_EXPORT ReplySwapPtr ReplySwapVector[256] =
|
|||
ReplyNotSwappd, /* NoOperation */
|
||||
ReplyNotSwappd
|
||||
};
|
||||
|
||||
#ifdef K5AUTH
|
||||
int (*k5_Vector[256])() =
|
||||
{
|
||||
k5_bad,
|
||||
k5_stage1,
|
||||
k5_bad,
|
||||
k5_stage3
|
||||
};
|
||||
#endif
|
||||
|
|
25
exa/exa.c
25
exa/exa.c
|
@ -126,7 +126,7 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
|
|||
* the backing drawable. These coordinates are nonzero only for redirected
|
||||
* windows.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
|
||||
int *xp, int *yp)
|
||||
{
|
||||
|
@ -172,29 +172,6 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
|
|||
REGION_UNINIT(pScreen, ®ion);
|
||||
}
|
||||
|
||||
/**
|
||||
* exaDrawableDirty() marks a pixmap backing a drawable as dirty, allowing for
|
||||
* optimizations in pixmap migration when no changes have occurred.
|
||||
*/
|
||||
void
|
||||
exaDrawableDirty (DrawablePtr pDrawable, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
PixmapPtr pPix = exaGetDrawablePixmap(pDrawable);
|
||||
int xoff, yoff;
|
||||
|
||||
x1 = max(x1, pDrawable->x);
|
||||
y1 = max(y1, pDrawable->y);
|
||||
x2 = min(x2, pDrawable->x + pDrawable->width);
|
||||
y2 = min(y2, pDrawable->y + pDrawable->height);
|
||||
|
||||
if (x1 >= x2 || y1 >= y2)
|
||||
return;
|
||||
|
||||
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
|
||||
|
||||
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
||||
}
|
||||
|
||||
static Bool
|
||||
exaDestroyPixmap (PixmapPtr pPixmap)
|
||||
{
|
||||
|
|
|
@ -229,7 +229,7 @@ typedef struct _ExaDriver {
|
|||
* @{
|
||||
*/
|
||||
/**
|
||||
* PrepareCopy() sets up the driver for doing a copy within offscreen
|
||||
* PrepareCopy() sets up the driver for doing a copy within video
|
||||
* memory.
|
||||
*
|
||||
* @param pSrcPixmap source pixmap
|
||||
|
@ -721,6 +721,9 @@ exaOffscreenAlloc(ScreenPtr pScreen, int size, int align,
|
|||
ExaOffscreenArea *
|
||||
exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area);
|
||||
|
||||
void
|
||||
ExaOffscreenMarkUsed (PixmapPtr pPixmap);
|
||||
|
||||
unsigned long
|
||||
exaGetPixmapOffset(PixmapPtr pPix);
|
||||
|
||||
|
|
469
exa/exa_accel.c
469
exa/exa_accel.c
|
@ -74,6 +74,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|||
pGC->planemask,
|
||||
pGC->fgPixel))
|
||||
{
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted);
|
||||
return;
|
||||
}
|
||||
|
@ -109,8 +110,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|||
(*pExaScr->info->Solid) (pPixmap,
|
||||
fullX1 + off_x, fullY1 + off_y,
|
||||
fullX2 + off_x, fullY1 + 1 + off_y);
|
||||
exaPixmapDirty (pPixmap, fullX1 + off_x, fullY1 + off_y,
|
||||
fullX2 + off_x, fullY1 + 1 + off_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -129,8 +128,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|||
(*pExaScr->info->Solid) (pPixmap,
|
||||
partX1 + off_x, fullY1 + off_y,
|
||||
partX2 + off_x, fullY1 + 1 + off_y);
|
||||
exaPixmapDirty (pPixmap, partX1 + off_x, fullY1 + off_y,
|
||||
partX2 + off_x, fullY1 + 1 + off_y);
|
||||
}
|
||||
}
|
||||
pbox++;
|
||||
|
@ -154,8 +151,9 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|||
int xoff, yoff;
|
||||
int src_stride, bpp = pDrawable->bitsPerPixel;
|
||||
|
||||
if (pExaScr->swappedOut || pExaScr->info->UploadToScreen == NULL)
|
||||
goto migrate_and_fallback;
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||
|
||||
/* Don't bother with under 8bpp, XYPixmaps. */
|
||||
if (format != ZPixmap || bpp < 8)
|
||||
|
@ -165,10 +163,14 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|||
if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy)
|
||||
goto migrate_and_fallback;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||
if (pExaScr->swappedOut)
|
||||
goto fallback;
|
||||
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
|
||||
if (pExaScr->info->UploadToScreen == NULL)
|
||||
goto fallback;
|
||||
|
||||
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
||||
|
||||
if (pPix == NULL)
|
||||
|
@ -221,25 +223,23 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|||
|
||||
fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)),
|
||||
src_stride / sizeof(FbStip),
|
||||
(x1 - x) * bpp,
|
||||
dst + (y1 + yoff) * dst_stride,
|
||||
(x1 - x) * dstBpp,
|
||||
dst + (y1 + dstYoff) * dst_stride,
|
||||
dst_stride,
|
||||
(x1 + xoff) * bpp,
|
||||
(x2 - x1) * bpp,
|
||||
(x1 + dstXoff) * dstBpp,
|
||||
(x2 - x1) * dstBpp,
|
||||
y2 - y1,
|
||||
GXcopy, FB_ALLONES, bpp);
|
||||
GXcopy, FB_ALLONES, dstBpp);
|
||||
|
||||
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
migrate_and_fallback:
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
|
||||
fallback:
|
||||
|
@ -387,6 +387,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
int src_off_x, src_off_y;
|
||||
int dst_off_x, dst_off_y;
|
||||
ExaMigrationRec pixmaps[2];
|
||||
Bool fallback = FALSE;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
|
@ -404,62 +405,64 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
pDstPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pDstPixmap->drawable.height > pExaScr->info->maxY)
|
||||
{
|
||||
exaDoMigration (pixmaps, 2, FALSE);
|
||||
goto fallback;
|
||||
fallback = TRUE;
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 2, TRUE);
|
||||
}
|
||||
|
||||
/* Mixed directions must be handled specially if the card is lame */
|
||||
if (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS &&
|
||||
if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) &&
|
||||
reverse != upsidedown) {
|
||||
if (!exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox,
|
||||
if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox,
|
||||
dx, dy))
|
||||
goto fallback;
|
||||
return;
|
||||
return;
|
||||
fallback = TRUE;
|
||||
}
|
||||
|
||||
if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
||||
(pDstPixmap = exaGetOffscreenPixmap (pDstDrawable, &dst_off_x, &dst_off_y)) &&
|
||||
(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap,
|
||||
reverse ? -1 : 1, upsidedown ? -1 : 1,
|
||||
pGC ? pGC->alu : GXcopy,
|
||||
pGC ? pGC->planemask : FB_ALLONES))
|
||||
pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable);
|
||||
pDstPixmap = exaGetDrawablePixmap (pDstDrawable);
|
||||
|
||||
exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
|
||||
exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
|
||||
|
||||
if (fallback || !exaPixmapIsOffscreen(pSrcPixmap) ||
|
||||
!exaPixmapIsOffscreen(pDstPixmap) ||
|
||||
!(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1,
|
||||
upsidedown ? -1 : 1,
|
||||
pGC ? pGC->alu : GXcopy,
|
||||
pGC ? pGC->planemask : FB_ALLONES)) {
|
||||
fallback = TRUE;
|
||||
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
|
||||
exaDrawableLocation(pSrcDrawable),
|
||||
exaDrawableLocation(pDstDrawable)));
|
||||
exaDoMigration (pixmaps, 2, FALSE);
|
||||
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||
bitplane, closure);
|
||||
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
while (nbox--)
|
||||
{
|
||||
while (nbox--)
|
||||
{
|
||||
if (!fallback)
|
||||
(*pExaScr->info->Copy) (pDstPixmap,
|
||||
pbox->x1 + dx + src_off_x,
|
||||
pbox->y1 + dy + src_off_y,
|
||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 - pbox->x1,
|
||||
pbox->y2 - pbox->y1);
|
||||
exaPixmapDirty (pDstPixmap,
|
||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||
pbox++;
|
||||
}
|
||||
(*pExaScr->info->DoneCopy) (pDstPixmap);
|
||||
exaMarkSync(pDstDrawable->pScreen);
|
||||
return;
|
||||
}
|
||||
|
||||
fallback:
|
||||
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
|
||||
exaDrawableLocation(pSrcDrawable),
|
||||
exaDrawableLocation(pDstDrawable)));
|
||||
exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||
fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
||||
pbox, nbox, dx, dy, reverse, upsidedown,
|
||||
bitplane, closure);
|
||||
exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
||||
exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
||||
while (nbox--)
|
||||
{
|
||||
exaDrawableDirty (pDstDrawable, pbox->x1, pbox->y1, pbox->x2, pbox->y2);
|
||||
pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
|
||||
exaPixmapDirty (pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||
pbox++;
|
||||
}
|
||||
|
||||
if (fallback)
|
||||
return;
|
||||
|
||||
(*pExaScr->info->DoneCopy) (pDstPixmap);
|
||||
exaMarkSync (pDstDrawable->pScreen);
|
||||
}
|
||||
|
||||
RegionPtr
|
||||
|
@ -618,6 +621,9 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
|
|||
DEALLOCATE_LOCAL(prect);
|
||||
}
|
||||
|
||||
static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion,
|
||||
Pixel pixel, CARD32 planemask, CARD32 alu);
|
||||
|
||||
static void
|
||||
exaPolyFillRect(DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
|
@ -626,7 +632,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|||
{
|
||||
ExaScreenPriv (pDrawable->pScreen);
|
||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||
PixmapPtr pPixmap;
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
||||
register BoxPtr pbox;
|
||||
BoxPtr pextent;
|
||||
int extentX1, extentX2, extentY1, extentY2;
|
||||
|
@ -635,39 +641,80 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|||
int xoff, yoff;
|
||||
int xorg, yorg;
|
||||
int n;
|
||||
ExaMigrationRec pixmaps[1];
|
||||
ExaMigrationRec pixmaps[2];
|
||||
RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
|
||||
RegionPtr pDamageReg = DamageRegion(ExaGetPixmapPriv(pPixmap)->pDamage);
|
||||
|
||||
/* Compute intersection of rects and clip region */
|
||||
REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
|
||||
REGION_INTERSECT(pScreen, pReg, pClip, pReg);
|
||||
|
||||
if (!REGION_NUM_RECTS(pReg)) {
|
||||
REGION_DESTROY(pScreen, pReg);
|
||||
return;
|
||||
}
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||
pixmaps[0].pPix = pPixmap;
|
||||
|
||||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||
|
||||
if (pExaScr->swappedOut ||
|
||||
pGC->fillStyle != FillSolid ||
|
||||
pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
{
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||
while (nrect-- >= 0) {
|
||||
exaDrawableDirty(pDrawable,
|
||||
pDrawable->x + prect->x,
|
||||
pDrawable->y + prect->y,
|
||||
pDrawable->x + prect->x + prect->width,
|
||||
pDrawable->y + prect->y + prect->height);
|
||||
prect++;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
if (!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
||||
/* For ROPs where overlaps don't matter, convert rectangles to region and
|
||||
* call exaFillRegion{Solid,Tiled}.
|
||||
*/
|
||||
if ((pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) &&
|
||||
(pGC->alu == GXcopy || pGC->alu == GXclear || pGC->alu == GXnoop ||
|
||||
pGC->alu == GXcopyInverted || pGC->alu == GXset)) {
|
||||
if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) &&
|
||||
exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ?
|
||||
pGC->fgPixel : pGC->tile.pixel, pGC->planemask,
|
||||
pGC->alu)) ||
|
||||
(pGC->fillStyle == FillTiled && !pGC->tileIsPixel &&
|
||||
exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg,
|
||||
pGC->planemask, pGC->alu))) {
|
||||
goto damage;
|
||||
}
|
||||
}
|
||||
|
||||
if (pGC->fillStyle != FillSolid &&
|
||||
!(pGC->tileIsPixel && pGC->fillStyle == FillTiled))
|
||||
{
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
|
||||
if (!exaPixmapIsOffscreen (pPixmap) ||
|
||||
!(*pExaScr->info->PrepareSolid) (pPixmap,
|
||||
pGC->alu,
|
||||
pGC->planemask,
|
||||
pGC->fgPixel))
|
||||
{
|
||||
fallback:
|
||||
if (pGC->fillStyle == FillTiled && !pGC->tileIsPixel) {
|
||||
pixmaps[1].as_dst = FALSE;
|
||||
pixmaps[1].as_src = TRUE;
|
||||
pixmaps[1].pPix = pGC->tile.pixmap;
|
||||
exaDoMigration (pixmaps, 2, FALSE);
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
}
|
||||
|
||||
ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||
|
||||
damage:
|
||||
REGION_TRANSLATE(pScreen, pReg, xoff, yoff);
|
||||
REGION_UNION(pScreen, pDamageReg, pReg, pDamageReg);
|
||||
REGION_DESTROY(pScreen, pReg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -715,7 +762,8 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|||
pbox = REGION_RECTS(pClip);
|
||||
/*
|
||||
* clip the rectangle to each box in the clip region
|
||||
* this is logically equivalent to calling Intersect()
|
||||
* this is logically equivalent to calling Intersect(),
|
||||
* but rectangles may overlap each other here.
|
||||
*/
|
||||
while(n--)
|
||||
{
|
||||
|
@ -775,20 +823,19 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
|||
pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
{
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
goto fallback;
|
||||
fallback = TRUE;
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
}
|
||||
|
||||
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
||||
exaGetDrawableDeltas (pDrawable, pPixmap, &xoff, &yoff);
|
||||
|
||||
if (!pPixmap ||
|
||||
if (fallback || !exaPixmapIsOffscreen(pPixmap) ||
|
||||
!(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
||||
{
|
||||
fallback:
|
||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable,
|
||||
exaDrawableLocation(pDrawable)));
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
fallback = TRUE;
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
||||
|
@ -827,10 +874,10 @@ fallback:
|
|||
(*pExaScr->info->Solid) (pPixmap,
|
||||
partX1 + xoff, partY1 + yoff,
|
||||
partX2 + xoff, partY2 + yoff);
|
||||
exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
|
||||
partX2 + xoff, partY2 + yoff);
|
||||
} else
|
||||
exaDrawableDirty (pDrawable, partX1, partY1, partX2, partY2);
|
||||
}
|
||||
|
||||
exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff,
|
||||
partY2 + yoff);
|
||||
}
|
||||
|
||||
if (fallback)
|
||||
|
@ -870,12 +917,36 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|||
int dstBpp;
|
||||
int dstXoff, dstYoff;
|
||||
FbBits depthMask;
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
||||
ExaMigrationRec pixmaps[1];
|
||||
int xBack, widthBack, yBack, heightBack;
|
||||
|
||||
for (ppci = ppciInit, n = nglyph, widthBack = 0; n; n--)
|
||||
widthBack += (*ppci++)->metrics.characterWidth;
|
||||
|
||||
xBack = x;
|
||||
if (widthBack < 0)
|
||||
{
|
||||
xBack += widthBack;
|
||||
widthBack = -widthBack;
|
||||
}
|
||||
yBack = y - FONTASCENT(pGC->font);
|
||||
heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
|
||||
|
||||
if (xBack >= pDrawable->width || yBack >= pDrawable->height ||
|
||||
(xBack + widthBack) <= 0 || (yBack + heightBack) <= 0)
|
||||
return;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
pixmaps[0].pPix = pPixmap;
|
||||
|
||||
depthMask = FbFullMask(pDrawable->depth);
|
||||
if ((pGC->planemask & depthMask) != depthMask)
|
||||
{
|
||||
exaDoMigration(pixmaps, 1, FALSE);
|
||||
ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase);
|
||||
return;
|
||||
goto damage;
|
||||
}
|
||||
glyph = NULL;
|
||||
switch (pDrawable->bitsPerPixel) {
|
||||
|
@ -887,6 +958,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|||
|
||||
x += pDrawable->x;
|
||||
y += pDrawable->y;
|
||||
xBack += pDrawable->x;
|
||||
yBack += pDrawable->y;
|
||||
|
||||
if (TERMINALFONT (pGC->font) && !glyph)
|
||||
{
|
||||
|
@ -894,23 +967,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|||
}
|
||||
else
|
||||
{
|
||||
int xBack, widthBack;
|
||||
int yBack, heightBack;
|
||||
|
||||
ppci = ppciInit;
|
||||
n = nglyph;
|
||||
widthBack = 0;
|
||||
while (n--)
|
||||
widthBack += (*ppci++)->metrics.characterWidth;
|
||||
|
||||
xBack = x;
|
||||
if (widthBack < 0)
|
||||
{
|
||||
xBack += widthBack;
|
||||
widthBack = -widthBack;
|
||||
}
|
||||
yBack = y - FONTASCENT(pGC->font);
|
||||
heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
|
||||
exaSolidBoxClipped (pDrawable,
|
||||
fbGetCompositeClip(pGC),
|
||||
pGC->planemask,
|
||||
|
@ -923,74 +979,50 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|||
}
|
||||
|
||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
||||
exaDoMigration(pixmaps, 1, FALSE);
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccessGC (pGC);
|
||||
|
||||
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
|
||||
|
||||
ppci = ppciInit;
|
||||
while (nglyph--)
|
||||
for (ppci = ppciInit; nglyph; nglyph--, x += pci->metrics.characterWidth)
|
||||
{
|
||||
pci = *ppci++;
|
||||
pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
||||
gWidth = GLYPHWIDTHPIXELS(pci);
|
||||
gHeight = GLYPHHEIGHTPIXELS(pci);
|
||||
if (gWidth && gHeight)
|
||||
gx = x + pci->metrics.leftSideBearing;
|
||||
gy = y - pci->metrics.ascent;
|
||||
|
||||
if (!gWidth || !gHeight || (gx + gWidth) <= xBack ||
|
||||
(gy + gHeight) <= yBack || gx >= (xBack + widthBack) ||
|
||||
gy >= (yBack + heightBack))
|
||||
continue;
|
||||
|
||||
pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
||||
|
||||
if (glyph && gWidth <= sizeof (FbStip) * 8 &&
|
||||
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
|
||||
{
|
||||
gx = x + pci->metrics.leftSideBearing;
|
||||
gy = y - pci->metrics.ascent;
|
||||
if (glyph && gWidth <= sizeof (FbStip) * 8 &&
|
||||
fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
|
||||
{
|
||||
(*glyph) (dst + (gy + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
dstBpp,
|
||||
(FbStip *) pglyph,
|
||||
pPriv->fg,
|
||||
gx + dstXoff,
|
||||
gHeight);
|
||||
exaDrawableDirty (pDrawable, gx, gy, gx + gWidth, gy + gHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||
int nbox;
|
||||
BoxPtr pbox;
|
||||
|
||||
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
||||
fbPutXYImage (pDrawable,
|
||||
pClip,
|
||||
pPriv->fg,
|
||||
pPriv->bg,
|
||||
pPriv->pm,
|
||||
GXcopy,
|
||||
opaque,
|
||||
|
||||
gx,
|
||||
gy,
|
||||
gWidth, gHeight,
|
||||
|
||||
(FbStip *) pglyph,
|
||||
gStride,
|
||||
0);
|
||||
|
||||
for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
||||
nbox--; pbox++) {
|
||||
int x1 = max(gx, pbox->x1), x2 = min(gx + gWidth, pbox->x2);
|
||||
int y1 = max(gy, pbox->y1), y2 = min(gy + gHeight, pbox->y2);
|
||||
|
||||
if (x1 >= x2 || y1 >= y2)
|
||||
continue;
|
||||
|
||||
exaDrawableDirty (pDrawable, gx, gy, gx + gWidth,
|
||||
gy + gHeight);
|
||||
}
|
||||
}
|
||||
(*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp,
|
||||
(FbStip *) pglyph, pPriv->fg, gx + dstXoff, gHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||
|
||||
gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
||||
fbPutXYImage (pDrawable, pClip, pPriv->fg, pPriv->bg, pPriv->pm,
|
||||
GXcopy, opaque, gx, gy, gWidth, gHeight,
|
||||
(FbStip *) pglyph, gStride, 0);
|
||||
}
|
||||
x += pci->metrics.characterWidth;
|
||||
}
|
||||
exaFinishAccessGC (pGC);
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
|
||||
damage:
|
||||
exaGetDrawableDeltas(pDrawable, pPixmap, &dstXoff, &dstYoff);
|
||||
exaPixmapDirty(pPixmap, xBack + dstXoff, yBack + dstYoff,
|
||||
xBack + dstXoff + widthBack, yBack + dstYoff + heightBack);
|
||||
}
|
||||
|
||||
const GCOps exaOps = {
|
||||
|
@ -1043,10 +1075,12 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
|
||||
}
|
||||
|
||||
static void
|
||||
static Bool
|
||||
exaFillRegionSolid (DrawablePtr pDrawable,
|
||||
RegionPtr pRegion,
|
||||
Pixel pixel)
|
||||
Pixel pixel,
|
||||
CARD32 planemask,
|
||||
CARD32 alu)
|
||||
{
|
||||
ExaScreenPriv(pDrawable->pScreen);
|
||||
PixmapPtr pPixmap;
|
||||
|
@ -1062,22 +1096,19 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
|||
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
{
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
goto fallback;
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
}
|
||||
|
||||
if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) &&
|
||||
(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel))
|
||||
(*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel))
|
||||
{
|
||||
while (nbox--)
|
||||
{
|
||||
(*pExaScr->info->Solid) (pPixmap,
|
||||
pBox->x1 + xoff, pBox->y1 + yoff,
|
||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||
exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||
pBox++;
|
||||
}
|
||||
(*pExaScr->info->DoneSolid) (pPixmap);
|
||||
|
@ -1086,27 +1117,30 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
|||
else
|
||||
{
|
||||
fallback:
|
||||
if (alu != GXcopy || planemask != FB_ALLONES)
|
||||
return FALSE;
|
||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable,
|
||||
exaDrawableLocation(pDrawable)));
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
fbFillRegionSolid (pDrawable, pRegion, 0,
|
||||
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
while (nbox--)
|
||||
{
|
||||
exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||
pBox++;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Try to do an accelerated tile of the pTile into pRegion of pDrawable.
|
||||
* Based on fbFillRegionTiled(), fbTile().
|
||||
*/
|
||||
static void
|
||||
Bool
|
||||
exaFillRegionTiled (DrawablePtr pDrawable,
|
||||
RegionPtr pRegion,
|
||||
PixmapPtr pTile)
|
||||
PixmapPtr pTile,
|
||||
DDXPointPtr pPatOrg,
|
||||
CARD32 planemask,
|
||||
CARD32 alu)
|
||||
{
|
||||
ExaScreenPriv(pDrawable->pScreen);
|
||||
PixmapPtr pPixmap;
|
||||
|
@ -1122,10 +1156,10 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
/* If we're filling with a solid color, grab it out and go to
|
||||
* FillRegionSolid, saving numerous copies.
|
||||
*/
|
||||
if (tileWidth == 1 && tileHeight == 1) {
|
||||
exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel (pTile));
|
||||
return;
|
||||
}
|
||||
if (tileWidth == 1 && tileHeight == 1)
|
||||
return exaFillRegionSolid(pDrawable, pRegion,
|
||||
exaGetPixmapFirstPixel (pTile), planemask,
|
||||
alu);
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
|
@ -1139,7 +1173,6 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
tileWidth > pExaScr->info->maxX ||
|
||||
tileHeight > pExaScr->info->maxY)
|
||||
{
|
||||
exaDoMigration (pixmaps, 2, FALSE);
|
||||
goto fallback;
|
||||
} else {
|
||||
exaDoMigration (pixmaps, 2, TRUE);
|
||||
|
@ -1153,8 +1186,9 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
if (!exaPixmapIsOffscreen(pTile))
|
||||
goto fallback;
|
||||
|
||||
if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile, &tileXoff, &tileYoff), pPixmap, 0, 0, GXcopy,
|
||||
FB_ALLONES))
|
||||
if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile,
|
||||
&tileXoff, &tileYoff),
|
||||
pPixmap, 0, 0, alu, planemask))
|
||||
{
|
||||
while (nbox--)
|
||||
{
|
||||
|
@ -1162,7 +1196,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
int dstY = pBox->y1;
|
||||
int tileY;
|
||||
|
||||
tileY = (dstY - pDrawable->y) % tileHeight;
|
||||
tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight;
|
||||
while (height > 0) {
|
||||
int width = pBox->x2 - pBox->x1;
|
||||
int dstX = pBox->x1;
|
||||
|
@ -1173,7 +1207,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
h = height;
|
||||
height -= h;
|
||||
|
||||
tileX = (dstX - pDrawable->x) % tileWidth;
|
||||
tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth;
|
||||
while (width > 0) {
|
||||
int w = tileWidth - tileX;
|
||||
if (w > width)
|
||||
|
@ -1190,38 +1224,44 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
dstY += h;
|
||||
tileY = 0;
|
||||
}
|
||||
exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||
pBox++;
|
||||
}
|
||||
(*pExaScr->info->DoneCopy) (pPixmap);
|
||||
exaMarkSync(pDrawable->pScreen);
|
||||
return;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
fallback:
|
||||
if (alu != GXcopy || planemask != FB_ALLONES)
|
||||
return FALSE;
|
||||
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable,
|
||||
exaDrawableLocation(&pTile->drawable),
|
||||
exaDrawableLocation(pDrawable)));
|
||||
exaDoMigration (pixmaps, 2, FALSE);
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
|
||||
fbFillRegionTiled (pDrawable, pRegion, pTile);
|
||||
exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
while (nbox--)
|
||||
{
|
||||
exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||
pBox++;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
||||
{
|
||||
ExaScreenPriv (pWin->drawable.pScreen);
|
||||
if (!REGION_NUM_RECTS(pRegion))
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap((DrawablePtr)pWin);
|
||||
int xoff, yoff;
|
||||
BoxPtr pBox;
|
||||
int nbox = REGION_NUM_RECTS(pRegion);
|
||||
|
||||
if (!nbox)
|
||||
return;
|
||||
|
||||
if (!pExaScr->swappedOut) {
|
||||
DDXPointRec zeros = { 0, 0 };
|
||||
|
||||
switch (what) {
|
||||
case PW_BACKGROUND:
|
||||
switch (pWin->backgroundState) {
|
||||
|
@ -1235,25 +1275,41 @@ exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
|||
what);
|
||||
return;
|
||||
case BackgroundPixel:
|
||||
exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel);
|
||||
return;
|
||||
exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel,
|
||||
FB_ALLONES, GXcopy);
|
||||
goto damage;
|
||||
case BackgroundPixmap:
|
||||
exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap);
|
||||
return;
|
||||
exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap,
|
||||
&zeros, FB_ALLONES, GXcopy);
|
||||
goto damage;
|
||||
}
|
||||
break;
|
||||
case PW_BORDER:
|
||||
if (pWin->borderIsPixel) {
|
||||
exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel);
|
||||
return;
|
||||
exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel,
|
||||
FB_ALLONES, GXcopy);
|
||||
goto damage;
|
||||
} else {
|
||||
exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap);
|
||||
return;
|
||||
exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap,
|
||||
&zeros, FB_ALLONES, GXcopy);
|
||||
goto damage;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
ExaCheckPaintWindow (pWin, pRegion, what);
|
||||
|
||||
damage:
|
||||
exaGetDrawableDeltas((DrawablePtr)pWin, pPixmap, &xoff, &yoff);
|
||||
|
||||
pBox = REGION_RECTS(pRegion);
|
||||
|
||||
while (nbox--)
|
||||
{
|
||||
exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
||||
pBox->x2 + xoff, pBox->y2 + yoff);
|
||||
pBox++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1273,27 +1329,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
|
|||
int xoff, yoff;
|
||||
Bool ok;
|
||||
|
||||
if (pExaScr->swappedOut || pExaScr->info->DownloadFromScreen == NULL)
|
||||
goto fallback;
|
||||
if (pExaScr->info->DownloadFromScreen == NULL)
|
||||
goto migrate_and_fallback;
|
||||
|
||||
/* Only cover the ZPixmap, solid copy case. */
|
||||
if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask))
|
||||
goto fallback;
|
||||
goto migrate_and_fallback;
|
||||
|
||||
/* Only try to handle the 8bpp and up cases, since we don't want to think
|
||||
* about <8bpp.
|
||||
*/
|
||||
if (pDrawable->bitsPerPixel < 8)
|
||||
goto migrate_and_fallback;
|
||||
|
||||
if (pExaScr->swappedOut)
|
||||
goto fallback;
|
||||
|
||||
/* Migrate, but assume that we could accelerate the download. It is up to
|
||||
* the migration scheme to ensure that this case doesn't result in bad
|
||||
* moving of pixmaps.
|
||||
*/
|
||||
pixmaps[0].as_dst = FALSE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
||||
if (pPix == NULL)
|
||||
goto fallback;
|
||||
|
@ -1308,12 +1359,12 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
|
|||
return;
|
||||
}
|
||||
|
||||
fallback:
|
||||
migrate_and_fallback:
|
||||
pixmaps[0].as_dst = FALSE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
||||
exaDoMigration (pixmaps, 1, FALSE);
|
||||
|
||||
fallback:
|
||||
ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
||||
}
|
||||
|
||||
|
|
|
@ -464,12 +464,10 @@ exaAssertNotDirty (PixmapPtr pPixmap)
|
|||
BoxPtr pBox = REGION_RECTS(pValidReg);
|
||||
Bool ret = TRUE;
|
||||
|
||||
if (pExaPixmap == NULL || pExaPixmap->fb_ptr == NULL)
|
||||
if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL)
|
||||
return ret;
|
||||
|
||||
dst = pExaPixmap->sys_ptr;
|
||||
dst_pitch = pExaPixmap->sys_pitch;
|
||||
src = pExaPixmap->fb_ptr;
|
||||
src_pitch = pExaPixmap->fb_pitch;
|
||||
cpp = pPixmap->drawable.bitsPerPixel / 8;
|
||||
|
||||
|
@ -486,21 +484,18 @@ exaAssertNotDirty (PixmapPtr pPixmap)
|
|||
continue;
|
||||
|
||||
rowbytes = (pBox->x2 - pBox->x1) * cpp;
|
||||
src += pBox->y1 * src_pitch + pBox->x1 * cpp;
|
||||
dst += pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
||||
src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp;
|
||||
dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
||||
|
||||
for (y = pBox->y2 - pBox->y1; y; y--) {
|
||||
if (memcmp(dst + pBox->y1 * dst_pitch + pBox->x1 * cpp,
|
||||
src + pBox->y1 * src_pitch + pBox->x1 * cpp,
|
||||
(pBox->x2 - pBox->x1) * cpp) != 0) {
|
||||
for (y = pBox->y1; y < pBox->y2;
|
||||
y++, src += src_pitch, dst += dst_pitch) {
|
||||
if (memcmp(dst, src, rowbytes) != 0) {
|
||||
ret = FALSE;
|
||||
exaPixmapDirty(pPixmap, pBox->x1, pBox->y1, pBox->x2,
|
||||
pBox->y2);
|
||||
break;
|
||||
}
|
||||
src += src_pitch;
|
||||
dst += dst_pitch;
|
||||
}
|
||||
src -= pBox->y1 * src_pitch + pBox->x1 * cpp;
|
||||
dst -= pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
||||
}
|
||||
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ ExaOffscreenValidate (ScreenPtr pScreen)
|
|||
assert (area->offset >= area->base_offset &&
|
||||
area->offset < (area->base_offset + area->size));
|
||||
if (prev)
|
||||
assert (prev->base_offset + prev->area.size == area->base_offset);
|
||||
assert (prev->base_offset + prev->size == area->base_offset);
|
||||
prev = area;
|
||||
}
|
||||
assert (prev->base_offset + prev->size == pExaScr->info->memorySize);
|
||||
|
@ -341,13 +341,15 @@ exaEnableDisableFBAccess (int index, Bool enable)
|
|||
ScreenPtr pScreen = screenInfo.screens[index];
|
||||
ExaScreenPriv (pScreen);
|
||||
|
||||
if (!enable) {
|
||||
if (!enable && pExaScr->disableFbCount++ == 0) {
|
||||
if (pExaScr->info->exa_minor < 1)
|
||||
ExaOffscreenSwapOut (pScreen);
|
||||
else
|
||||
ExaOffscreenEjectPixmaps (pScreen);
|
||||
pExaScr->swappedOut = TRUE;
|
||||
} else {
|
||||
}
|
||||
|
||||
if (enable && --pExaScr->disableFbCount == 0) {
|
||||
if (pExaScr->info->exa_minor < 1)
|
||||
ExaOffscreenSwapIn (pScreen);
|
||||
pExaScr->swappedOut = FALSE;
|
||||
|
|
|
@ -113,6 +113,7 @@ typedef struct {
|
|||
enum ExaMigrationHeuristic migration;
|
||||
Bool hideOffscreenPixmapData;
|
||||
Bool checkDirtyCorrectness;
|
||||
unsigned disableFbCount;
|
||||
} ExaScreenPrivRec, *ExaScreenPrivPtr;
|
||||
|
||||
/*
|
||||
|
@ -287,6 +288,10 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap);
|
|||
void
|
||||
exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
||||
|
||||
Bool
|
||||
exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
|
||||
DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu);
|
||||
|
||||
void
|
||||
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
|
||||
|
||||
|
@ -317,9 +322,6 @@ ExaCheckComposite (CARD8 op,
|
|||
#endif
|
||||
|
||||
/* exa_offscreen.c */
|
||||
void
|
||||
ExaOffscreenMarkUsed (PixmapPtr pPixmap);
|
||||
|
||||
void
|
||||
ExaOffscreenSwapOut (ScreenPtr pScreen);
|
||||
|
||||
|
@ -343,7 +345,8 @@ void
|
|||
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
|
||||
|
||||
void
|
||||
exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2);
|
||||
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
|
||||
int *xp, int *yp);
|
||||
|
||||
Bool
|
||||
exaDrawableIsOffscreen (DrawablePtr pDrawable);
|
||||
|
|
178
exa/exa_render.c
178
exa/exa_render.c
|
@ -297,15 +297,15 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
|||
|
||||
nbox = REGION_NUM_RECTS(®ion);
|
||||
pbox = REGION_RECTS(®ion);
|
||||
|
||||
while (nbox--)
|
||||
{
|
||||
(*pExaScr->info->Solid) (pDstPix,
|
||||
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||
exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||
pbox++;
|
||||
}
|
||||
|
||||
(*pExaScr->info->DoneSolid) (pDstPix);
|
||||
exaMarkSync(pDst->pDrawable->pScreen);
|
||||
|
||||
|
@ -446,8 +446,6 @@ exaTryDriverComposite(CARD8 op,
|
|||
pbox->y1 + dst_off_y,
|
||||
pbox->x2 - pbox->x1,
|
||||
pbox->y2 - pbox->y1);
|
||||
exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
||||
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
||||
pbox++;
|
||||
}
|
||||
(*pExaScr->info->DoneComposite) (pDstPix);
|
||||
|
@ -521,6 +519,9 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op,
|
|||
CARD16 height)
|
||||
{
|
||||
ExaScreenPriv (pDst->pDrawable->pScreen);
|
||||
DrawablePtr pDstDraw = pDst->pDrawable;
|
||||
PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDstDraw);
|
||||
int xoff, yoff;
|
||||
|
||||
assert(op == PictOpOver);
|
||||
|
||||
|
@ -539,6 +540,12 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op,
|
|||
exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask,
|
||||
xDst, yDst, width, height);
|
||||
|
||||
exaGetDrawableDeltas(pDstDraw, pDstPixmap, &xoff, &yoff);
|
||||
xoff += pDstDraw->x;
|
||||
yoff += pDstDraw->y;
|
||||
exaPixmapDirty(pDstPixmap, xDst + xoff, yDst + yoff, xDst + xoff + width,
|
||||
yDst + yoff + height);
|
||||
|
||||
/* Then, add in the source value times the destination alpha factors (1.0).
|
||||
*/
|
||||
exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask,
|
||||
|
@ -565,6 +572,28 @@ exaComposite(CARD8 op,
|
|||
int ret = -1;
|
||||
Bool saveSrcRepeat = pSrc->repeat;
|
||||
Bool saveMaskRepeat = pMask ? pMask->repeat : 0;
|
||||
ExaMigrationRec pixmaps[3];
|
||||
int npixmaps = 1;
|
||||
PixmapPtr pSrcPixmap = NULL;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = exaOpReadsDestination(op);
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable);
|
||||
|
||||
if (pSrc->pDrawable) {
|
||||
pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||
pixmaps[npixmaps].as_dst = FALSE;
|
||||
pixmaps[npixmaps].as_src = TRUE;
|
||||
pixmaps[npixmaps].pPix = pSrcPixmap;
|
||||
npixmaps++;
|
||||
}
|
||||
|
||||
if (pMask && pMask->pDrawable) {
|
||||
pixmaps[npixmaps].as_dst = FALSE;
|
||||
pixmaps[npixmaps].as_src = TRUE;
|
||||
pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable);
|
||||
npixmaps++;
|
||||
}
|
||||
|
||||
/* We currently don't support acceleration of gradients, or other pictures
|
||||
* with a NULL pDrawable.
|
||||
|
@ -583,19 +612,24 @@ exaComposite(CARD8 op,
|
|||
|
||||
if (!pMask)
|
||||
{
|
||||
if (op == PictOpSrc)
|
||||
if ((op == PictOpSrc &&
|
||||
((pSrc->format == pDst->format) ||
|
||||
(pSrc->format==PICT_a8r8g8b8 && pDst->format==PICT_x8r8g8b8) ||
|
||||
(pSrc->format==PICT_a8b8g8r8 && pDst->format==PICT_x8b8g8r8))) ||
|
||||
(op == PictOpOver && !pSrc->alphaMap && !pDst->alphaMap &&
|
||||
pSrc->format == pDst->format &&
|
||||
(pSrc->format==PICT_x8r8g8b8 || pSrc->format==PICT_x8b8g8r8)))
|
||||
{
|
||||
if (pSrc->pDrawable->width == 1 &&
|
||||
pSrc->pDrawable->height == 1 && pSrc->repeat &&
|
||||
pSrc->repeatType == RepeatNormal)
|
||||
pSrc->pDrawable->height == 1 &&
|
||||
pSrc->repeat)
|
||||
{
|
||||
ret = exaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst,
|
||||
width, height);
|
||||
if (ret == 1)
|
||||
goto done;
|
||||
}
|
||||
else if (!pSrc->repeat && !pSrc->transform &&
|
||||
pSrc->format == pDst->format)
|
||||
else if (pSrcPixmap && !pSrc->repeat && !pSrc->transform)
|
||||
{
|
||||
RegionRec region;
|
||||
|
||||
|
@ -617,6 +651,45 @@ exaComposite(CARD8 op,
|
|||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||
goto done;
|
||||
}
|
||||
else if (pSrcPixmap && !pSrc->transform &&
|
||||
pSrc->repeatType == RepeatNormal)
|
||||
{
|
||||
RegionRec region;
|
||||
DDXPointRec srcOrg;
|
||||
|
||||
/* Let's see if the driver can do the repeat in one go */
|
||||
if (pExaScr->info->PrepareComposite && !pSrc->alphaMap &&
|
||||
!pDst->alphaMap)
|
||||
{
|
||||
ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc,
|
||||
ySrc, xMask, yMask, xDst, yDst,
|
||||
width, height);
|
||||
if (ret == 1)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Now see if we can use exaFillRegionTiled() */
|
||||
xDst += pDst->pDrawable->x;
|
||||
yDst += pDst->pDrawable->y;
|
||||
xSrc += pSrc->pDrawable->x;
|
||||
ySrc += pSrc->pDrawable->y;
|
||||
|
||||
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc,
|
||||
ySrc, xMask, yMask, xDst, yDst,
|
||||
width, height))
|
||||
goto done;
|
||||
|
||||
srcOrg.x = (xSrc - xDst) % pSrcPixmap->drawable.width;
|
||||
srcOrg.y = (ySrc - yDst) % pSrcPixmap->drawable.height;
|
||||
|
||||
ret = exaFillRegionTiled(pDst->pDrawable, ®ion, pSrcPixmap,
|
||||
&srcOrg, FB_ALLONES, GXcopy);
|
||||
|
||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
||||
|
||||
if (ret)
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -627,8 +700,8 @@ exaComposite(CARD8 op,
|
|||
pMask->repeat = 0;
|
||||
|
||||
if (pExaScr->info->PrepareComposite &&
|
||||
(!pSrc->repeat || pSrc->repeat == RepeatNormal) &&
|
||||
(!pMask || !pMask->repeat || pMask->repeat == RepeatNormal) &&
|
||||
(!pSrc->repeat || pSrc->repeatType == RepeatNormal) &&
|
||||
(!pMask || !pMask->repeat || pMask->repeatType == RepeatNormal) &&
|
||||
!pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap)
|
||||
{
|
||||
Bool isSrcSolid;
|
||||
|
@ -660,39 +733,14 @@ exaComposite(CARD8 op,
|
|||
}
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
ExaMigrationRec pixmaps[3];
|
||||
/* failure to accelerate was not due to pixmaps being in the wrong
|
||||
* locations.
|
||||
*/
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = exaOpReadsDestination(op);
|
||||
pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable);
|
||||
pixmaps[1].as_dst = FALSE;
|
||||
pixmaps[1].as_src = TRUE;
|
||||
pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||
if (pMask) {
|
||||
pixmaps[2].as_dst = FALSE;
|
||||
pixmaps[2].as_src = TRUE;
|
||||
pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable);
|
||||
exaDoMigration(pixmaps, 3, FALSE);
|
||||
} else {
|
||||
exaDoMigration(pixmaps, 2, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
fallback:
|
||||
#if DEBUG_TRACE_FALL
|
||||
exaPrintCompositeFallback (op, pSrc, pMask, pDst);
|
||||
#endif
|
||||
|
||||
exaDoMigration(pixmaps, npixmaps, FALSE);
|
||||
ExaCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc,
|
||||
xMask, yMask, xDst, yDst, width, height);
|
||||
exaDrawableDirty(pDst->pDrawable,
|
||||
pDst->pDrawable->x + xDst,
|
||||
pDst->pDrawable->y + yDst,
|
||||
pDst->pDrawable->x + xDst + width,
|
||||
pDst->pDrawable->y + yDst + height);
|
||||
|
||||
done:
|
||||
pSrc->repeat = saveSrcRepeat;
|
||||
|
@ -716,6 +764,7 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
|||
{
|
||||
DrawablePtr pDraw = pPicture->pDrawable;
|
||||
ExaMigrationRec pixmaps[1];
|
||||
int xoff, yoff;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
|
@ -724,8 +773,10 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
|||
|
||||
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
||||
fbRasterizeTrapezoid(pPicture, trap, x_off, y_off);
|
||||
exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
||||
pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
||||
exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff);
|
||||
exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff,
|
||||
pDraw->x + xoff + pDraw->width,
|
||||
pDraw->y + yoff + pDraw->height);
|
||||
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
|
@ -739,6 +790,7 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
|||
{
|
||||
DrawablePtr pDraw = pPicture->pDrawable;
|
||||
ExaMigrationRec pixmaps[1];
|
||||
int xoff, yoff;
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
|
@ -747,8 +799,10 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
|||
|
||||
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
||||
fbAddTriangles(pPicture, x_off, y_off, ntri, tris);
|
||||
exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
||||
pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
||||
exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff);
|
||||
exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff,
|
||||
pDraw->x + xoff + pDraw->width,
|
||||
pDraw->y + yoff + pDraw->height);
|
||||
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
|
@ -845,10 +899,11 @@ exaGlyphs (CARD8 op,
|
|||
PixmapPtr pPixmap = NULL;
|
||||
PicturePtr pPicture;
|
||||
PixmapPtr pMaskPixmap = NULL;
|
||||
PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable);
|
||||
PicturePtr pMask;
|
||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||
int width = 0, height = 0;
|
||||
int x, y;
|
||||
int x, y, x1, y1, xoff, yoff;
|
||||
int xDst = list->xOff, yDst = list->yOff;
|
||||
int n;
|
||||
int error;
|
||||
|
@ -892,7 +947,12 @@ exaGlyphs (CARD8 op,
|
|||
xRectangle rect;
|
||||
|
||||
miGlyphExtents (nlist, list, glyphs, &extents);
|
||||
|
||||
|
||||
extents.x1 = max(extents.x1, 0);
|
||||
extents.y1 = max(extents.y1, 0);
|
||||
extents.x2 = min(extents.x2, pDst->pDrawable->width);
|
||||
extents.y2 = min(extents.y2, pDst->pDrawable->height);
|
||||
|
||||
if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
|
||||
return;
|
||||
width = extents.x2 - extents.x1;
|
||||
|
@ -918,6 +978,7 @@ exaGlyphs (CARD8 op,
|
|||
rect.width = width;
|
||||
rect.height = height;
|
||||
(*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect);
|
||||
exaPixmapDirty(pMaskPixmap, 0, 0, width, height);
|
||||
FreeScratchGC (pGC);
|
||||
x = -extents.x1;
|
||||
y = -extents.y1;
|
||||
|
@ -929,6 +990,8 @@ exaGlyphs (CARD8 op,
|
|||
y = 0;
|
||||
}
|
||||
|
||||
exaGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &xoff, &yoff);
|
||||
|
||||
while (nlist--)
|
||||
{
|
||||
GCPtr pGC = NULL;
|
||||
|
@ -983,13 +1046,21 @@ exaGlyphs (CARD8 op,
|
|||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = TRUE;
|
||||
pixmaps[0].pPix = pPixmap;
|
||||
exaDoMigration (pixmaps, 1, TRUE);
|
||||
exaDoMigration (pixmaps, 1, pExaScr->info->PrepareComposite != NULL);
|
||||
|
||||
while (n--)
|
||||
{
|
||||
GlyphPtr glyph = *glyphs++;
|
||||
pointer glyphdata = (pointer) (glyph + 1);
|
||||
|
||||
DrawablePtr pCmpDrw = (maskFormat ? pMask : pDst)->pDrawable;
|
||||
|
||||
x1 = x - glyph->info.x;
|
||||
y1 = y - glyph->info.y;
|
||||
|
||||
if (x1 >= pCmpDrw->width || y1 >= pCmpDrw->height ||
|
||||
(x1 + glyph->info.width) <= 0 || (y1 + glyph->info.height) <= 0)
|
||||
goto nextglyph;
|
||||
|
||||
(*pScreen->ModifyPixmapHeader) (pScratchPixmap,
|
||||
glyph->info.width,
|
||||
glyph->info.height,
|
||||
|
@ -1048,17 +1119,22 @@ exaGlyphs (CARD8 op,
|
|||
if (maskFormat)
|
||||
{
|
||||
exaComposite (PictOpAdd, pPicture, NULL, pMask, 0, 0, 0, 0,
|
||||
x - glyph->info.x, y - glyph->info.y,
|
||||
glyph->info.width, glyph->info.height);
|
||||
x1, y1, glyph->info.width, glyph->info.height);
|
||||
exaPixmapDirty(pMaskPixmap, x1, y1, x1 + glyph->info.width,
|
||||
y1 + glyph->info.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
exaComposite (op, pSrc, pPicture, pDst,
|
||||
xSrc + (x - glyph->info.x) - xDst,
|
||||
ySrc + (y - glyph->info.y) - yDst,
|
||||
0, 0, x - glyph->info.x, y - glyph->info.y,
|
||||
glyph->info.width, glyph->info.height);
|
||||
xSrc + x1 - xDst, ySrc + y1 - yDst,
|
||||
0, 0, x1, y1, glyph->info.width,
|
||||
glyph->info.height);
|
||||
x1 += pDst->pDrawable->x + xoff;
|
||||
y1 += pDst->pDrawable->y + yoff;
|
||||
exaPixmapDirty(pDstPixmap, x1, y1, x1 + glyph->info.width,
|
||||
y1 + glyph->info.height);
|
||||
}
|
||||
nextglyph:
|
||||
x += glyph->info.xOff;
|
||||
y += glyph->info.yOff;
|
||||
}
|
||||
|
|
|
@ -88,10 +88,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
|||
int x, int y, int w, int h, int leftPad, int format,
|
||||
char *bits)
|
||||
{
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
||||
int xoff, yoff;
|
||||
|
||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||
exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h);
|
||||
}
|
||||
|
||||
RegionPtr
|
||||
|
@ -201,32 +206,11 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
|||
{
|
||||
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
||||
|
||||
if (nrect) {
|
||||
int x1 = max(prect->x, 0), y1 = max(prect->y, 0);
|
||||
int x2 = min(prect->x + prect->width, pDrawable->width);
|
||||
int y2 = min(prect->y + prect->height, pDrawable->height);
|
||||
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccessGC (pGC);
|
||||
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||
exaFinishAccessGC (pGC);
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
|
||||
/* Only track bounding box of damage, as this path can degenerate to
|
||||
* zillions of damage boxes
|
||||
*/
|
||||
while (--nrect)
|
||||
{
|
||||
prect++;
|
||||
x1 = min(x1, prect->x);
|
||||
x2 = max(x2, prect->x + prect->width);
|
||||
y1 = min(y1, prect->y);
|
||||
y2 = max(y2, prect->y + prect->height);
|
||||
}
|
||||
|
||||
exaDrawableDirty (pDrawable, pDrawable->x + x1, pDrawable->y + y1,
|
||||
pDrawable->x + x2, pDrawable->y + y2);
|
||||
}
|
||||
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccessGC (pGC);
|
||||
fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
||||
exaFinishAccessGC (pGC);
|
||||
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
noinst_LTLIBRARIES = libfb.la libwfb.la libfbmmx.la
|
||||
noinst_LTLIBRARIES = libfb.la libwfb.la
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/hw/xfree86/os-support \
|
||||
|
@ -12,25 +12,8 @@ endif
|
|||
|
||||
libfb_la_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
if MMX_CAPABLE
|
||||
libfb_la_CFLAGS += -DUSE_MMX
|
||||
|
||||
libfbmmx_la_CFLAGS = \
|
||||
$(DIX_CFLAGS) \
|
||||
-DUSE_MMX \
|
||||
-mmmx \
|
||||
-msse \
|
||||
-Winline \
|
||||
--param inline-unit-growth=10000 \
|
||||
--param large-function-growth=10000
|
||||
endif
|
||||
|
||||
libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
|
||||
|
||||
libfbmmx_la_SOURCES = \
|
||||
fbmmx.c \
|
||||
fbmmx.h
|
||||
|
||||
libfb_la_SOURCES = \
|
||||
fb.h \
|
||||
fb24_32.c \
|
||||
|
@ -42,7 +25,6 @@ libfb_la_SOURCES = \
|
|||
fbblt.c \
|
||||
fbbltone.c \
|
||||
fbbstore.c \
|
||||
fbcompose.c \
|
||||
fbcopy.c \
|
||||
fbfill.c \
|
||||
fbfillrect.c \
|
||||
|
@ -70,12 +52,8 @@ libfb_la_SOURCES = \
|
|||
fbutil.c \
|
||||
fbwindow.c \
|
||||
fbpseudocolor.c \
|
||||
fbpseudocolor.h \
|
||||
fbedge.c \
|
||||
fbedgeimp.h
|
||||
fbpseudocolor.h
|
||||
|
||||
libwfb_la_SOURCES = $(libfb_la_SOURCES)
|
||||
|
||||
libfb_la_LIBADD = libfbmmx.la
|
||||
|
||||
EXTRA_DIST = fbcmap.c fbcmap_mi.c
|
||||
|
|
6
fb/fb.h
6
fb/fb.h
|
@ -26,6 +26,8 @@
|
|||
#define _FB_H_
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <pixman/pixman.h>
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "pixmap.h"
|
||||
#include "pixmapstr.h"
|
||||
|
@ -2146,4 +2148,8 @@ void
|
|||
fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
|
||||
|
||||
|
||||
pixman_image_t *image_from_pict (PicturePtr pict,
|
||||
Bool has_clip);
|
||||
|
||||
#endif /* _FB_H_ */
|
||||
|
||||
|
|
4414
fb/fbcompose.c
4414
fb/fbcompose.c
File diff suppressed because it is too large
Load Diff
25
fb/fbcopy.c
25
fb/fbcopy.c
|
@ -29,7 +29,6 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "fb.h"
|
||||
#include "fbmmx.h"
|
||||
|
||||
void
|
||||
fbCopyNtoN (DrawablePtr pSrcDrawable,
|
||||
|
@ -60,21 +59,17 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
|
||||
while (nbox--)
|
||||
{
|
||||
#ifdef USE_MMX
|
||||
#ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
|
||||
if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
|
||||
!upsidedown && fbHaveMMX())
|
||||
!upsidedown)
|
||||
{
|
||||
if (!fbCopyAreammx (pSrcDrawable,
|
||||
pDstDrawable,
|
||||
|
||||
(pbox->x1 + dx),
|
||||
(pbox->y1 + dy),
|
||||
|
||||
(pbox->x1),
|
||||
(pbox->y1),
|
||||
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1)))
|
||||
if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
|
||||
(pbox->x1 + dx + srcXoff),
|
||||
(pbox->y1 + dy + srcYoff),
|
||||
(pbox->x1 + srcXoff),
|
||||
(pbox->y1 + srcYoff),
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1)))
|
||||
goto fallback;
|
||||
else
|
||||
goto next;
|
||||
|
@ -98,7 +93,7 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
|
||||
reverse,
|
||||
upsidedown);
|
||||
#ifdef USE_MMX
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
next:
|
||||
#endif
|
||||
pbox++;
|
||||
|
|
314
fb/fbedge.c
314
fb/fbedge.c
|
@ -1,314 +0,0 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "fb.h"
|
||||
|
||||
#ifdef RENDER
|
||||
|
||||
#include "picturestr.h"
|
||||
#include "mipict.h"
|
||||
#include "renderedge.h"
|
||||
#include "fbpict.h"
|
||||
|
||||
/*
|
||||
* 4 bit alpha
|
||||
*/
|
||||
|
||||
#define N_BITS 4
|
||||
#define rasterizeEdges fbRasterizeEdges4
|
||||
|
||||
#if BITMAP_BIT_ORDER == LSBFirst
|
||||
#define Shift4(o) ((o) << 2)
|
||||
#else
|
||||
#define Shift4(o) ((1-(o)) << 2)
|
||||
#endif
|
||||
|
||||
#define Get4(x,o) (((x) >> Shift4(o)) & 0xf)
|
||||
#define Put4(x,o,v) (((x) & ~(0xf << Shift4(o))) | (((v) & 0xf) << Shift4(o)))
|
||||
|
||||
#define DefineAlpha(line,x) \
|
||||
CARD8 *__ap = (CARD8 *) line + ((x) >> 1); \
|
||||
int __ao = (x) & 1
|
||||
|
||||
#define StepAlpha ((__ap += __ao), (__ao ^= 1))
|
||||
|
||||
#define AddAlpha(a) { \
|
||||
CARD8 __o = READ(__ap); \
|
||||
CARD8 __a = (a) + Get4(__o, __ao); \
|
||||
WRITE(__ap, Put4 (__o, __ao, __a | (0 - ((__a) >> 4)))); \
|
||||
}
|
||||
|
||||
#include "fbedgeimp.h"
|
||||
|
||||
#undef AddAlpha
|
||||
#undef StepAlpha
|
||||
#undef DefineAlpha
|
||||
#undef rasterizeEdges
|
||||
#undef N_BITS
|
||||
|
||||
|
||||
/*
|
||||
* 1 bit alpha
|
||||
*/
|
||||
|
||||
#define N_BITS 1
|
||||
#define rasterizeEdges fbRasterizeEdges1
|
||||
|
||||
#include "fbedgeimp.h"
|
||||
|
||||
#undef rasterizeEdges
|
||||
#undef N_BITS
|
||||
|
||||
/*
|
||||
* 8 bit alpha
|
||||
*/
|
||||
|
||||
static INLINE CARD8
|
||||
clip255 (int x)
|
||||
{
|
||||
if (x > 255) return 255;
|
||||
return x;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
add_saturate_8 (CARD8 *buf, int value, int length)
|
||||
{
|
||||
while (length--)
|
||||
{
|
||||
WRITE(buf, clip255 (READ(buf) + value));
|
||||
buf++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We want to detect the case where we add the same value to a long
|
||||
* span of pixels. The triangles on the end are filled in while we
|
||||
* count how many sub-pixel scanlines contribute to the middle section.
|
||||
*
|
||||
* +--------------------------+
|
||||
* fill_height =| \ /
|
||||
* +------------------+
|
||||
* |================|
|
||||
* fill_start fill_end
|
||||
*/
|
||||
static void
|
||||
fbRasterizeEdges8 (FbBits *buf,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
xFixed y = t;
|
||||
FbBits *line;
|
||||
int fill_start = -1, fill_end = -1;
|
||||
int fill_size = 0;
|
||||
|
||||
line = buf + xFixedToInt (y) * stride;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
CARD8 *ap = (CARD8 *) line;
|
||||
xFixed lx, rx;
|
||||
int lxi, rxi;
|
||||
|
||||
/* clip X */
|
||||
lx = l->x;
|
||||
if (lx < 0)
|
||||
lx = 0;
|
||||
rx = r->x;
|
||||
if (xFixedToInt (rx) >= width)
|
||||
rx = IntToxFixed (width);
|
||||
|
||||
/* Skip empty (or backwards) sections */
|
||||
if (rx > lx)
|
||||
{
|
||||
int lxs, rxs;
|
||||
|
||||
/* Find pixel bounds for span. */
|
||||
lxi = xFixedToInt (lx);
|
||||
rxi = xFixedToInt (rx);
|
||||
|
||||
/* Sample coverage for edge pixels */
|
||||
lxs = RenderSamplesX (lx, 8);
|
||||
rxs = RenderSamplesX (rx, 8);
|
||||
|
||||
/* Add coverage across row */
|
||||
if (lxi == rxi)
|
||||
{
|
||||
WRITE(ap +lxi, clip255 (READ(ap + lxi) + rxs - lxs));
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITE(ap + lxi, clip255 (READ(ap + lxi) + N_X_FRAC(8) - lxs));
|
||||
|
||||
/* Move forward so that lxi/rxi is the pixel span */
|
||||
lxi++;
|
||||
|
||||
/* Don't bother trying to optimize the fill unless
|
||||
* the span is longer than 4 pixels. */
|
||||
if (rxi - lxi > 4)
|
||||
{
|
||||
if (fill_start < 0)
|
||||
{
|
||||
fill_start = lxi;
|
||||
fill_end = rxi;
|
||||
fill_size++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lxi >= fill_end || rxi < fill_start)
|
||||
{
|
||||
/* We're beyond what we saved, just fill it */
|
||||
add_saturate_8 (ap + fill_start,
|
||||
fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
fill_start = lxi;
|
||||
fill_end = rxi;
|
||||
fill_size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Update fill_start */
|
||||
if (lxi > fill_start)
|
||||
{
|
||||
add_saturate_8 (ap + fill_start,
|
||||
fill_size * N_X_FRAC(8),
|
||||
lxi - fill_start);
|
||||
fill_start = lxi;
|
||||
}
|
||||
else if (lxi < fill_start)
|
||||
{
|
||||
add_saturate_8 (ap + lxi, N_X_FRAC(8),
|
||||
fill_start - lxi);
|
||||
}
|
||||
|
||||
/* Update fill_end */
|
||||
if (rxi < fill_end)
|
||||
{
|
||||
add_saturate_8 (ap + rxi,
|
||||
fill_size * N_X_FRAC(8),
|
||||
fill_end - rxi);
|
||||
fill_end = rxi;
|
||||
}
|
||||
else if (fill_end < rxi)
|
||||
{
|
||||
add_saturate_8 (ap + fill_end,
|
||||
N_X_FRAC(8),
|
||||
rxi - fill_end);
|
||||
}
|
||||
fill_size++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + lxi, N_X_FRAC(8), rxi - lxi);
|
||||
}
|
||||
|
||||
/* Do not add in a 0 alpha here. This check is
|
||||
* necessary to avoid a buffer overrun, (when rx
|
||||
* is exactly on a pixel boundary). */
|
||||
if (rxs)
|
||||
WRITE(ap + rxi, clip255 (READ(ap + rxi) + rxs));
|
||||
}
|
||||
}
|
||||
|
||||
if (y == b) {
|
||||
/* We're done, make sure we clean up any remaining fill. */
|
||||
if (fill_start != fill_end) {
|
||||
if (fill_size == N_Y_FRAC(8))
|
||||
{
|
||||
MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (xFixedFrac (y) != Y_FRAC_LAST(8))
|
||||
{
|
||||
RenderEdgeStepSmall (l);
|
||||
RenderEdgeStepSmall (r);
|
||||
y += STEP_Y_SMALL(8);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderEdgeStepBig (l);
|
||||
RenderEdgeStepBig (r);
|
||||
y += STEP_Y_BIG(8);
|
||||
if (fill_start != fill_end)
|
||||
{
|
||||
if (fill_size == N_Y_FRAC(8))
|
||||
{
|
||||
MEMSET_WRAPPED (ap + fill_start, 0xff, fill_end - fill_start);
|
||||
}
|
||||
else
|
||||
{
|
||||
add_saturate_8 (ap + fill_start, fill_size * N_X_FRAC(8),
|
||||
fill_end - fill_start);
|
||||
}
|
||||
fill_start = fill_end = -1;
|
||||
fill_size = 0;
|
||||
}
|
||||
line += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fbRasterizeEdges (FbBits *buf,
|
||||
int bpp,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
switch (bpp) {
|
||||
case 1:
|
||||
fbRasterizeEdges1 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
case 4:
|
||||
fbRasterizeEdges4 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
case 8:
|
||||
fbRasterizeEdges8 (buf, width, stride, l, r, t, b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* RENDER */
|
145
fb/fbedgeimp.h
145
fb/fbedgeimp.h
|
@ -1,145 +0,0 @@
|
|||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef rasterizeSpan
|
||||
#endif
|
||||
|
||||
static void
|
||||
rasterizeEdges (FbBits *buf,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b)
|
||||
{
|
||||
xFixed y = t;
|
||||
FbBits *line;
|
||||
|
||||
line = buf + xFixedToInt (y) * stride;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
xFixed lx, rx;
|
||||
int lxi, rxi;
|
||||
|
||||
/* clip X */
|
||||
lx = l->x;
|
||||
if (lx < 0)
|
||||
lx = 0;
|
||||
rx = r->x;
|
||||
if (xFixedToInt (rx) >= width)
|
||||
rx = IntToxFixed (width);
|
||||
|
||||
/* Skip empty (or backwards) sections */
|
||||
if (rx > lx)
|
||||
{
|
||||
|
||||
/* Find pixel bounds for span */
|
||||
lxi = xFixedToInt (lx);
|
||||
rxi = xFixedToInt (rx);
|
||||
|
||||
#if N_BITS == 1
|
||||
{
|
||||
FbBits *a = line;
|
||||
FbBits startmask, endmask;
|
||||
int nmiddle;
|
||||
int width = rxi - lxi;
|
||||
int x = lxi;
|
||||
|
||||
a += x >> FB_SHIFT;
|
||||
x &= FB_MASK;
|
||||
|
||||
FbMaskBits (x, width, startmask, nmiddle, endmask);
|
||||
if (startmask) {
|
||||
WRITE(a, READ(a) | startmask);
|
||||
a++;
|
||||
}
|
||||
while (nmiddle--)
|
||||
WRITE(a++, FB_ALLONES);
|
||||
if (endmask)
|
||||
WRITE(a, READ(a) | endmask);
|
||||
}
|
||||
#else
|
||||
{
|
||||
DefineAlpha(line,lxi);
|
||||
int lxs, rxs;
|
||||
|
||||
/* Sample coverage for edge pixels */
|
||||
lxs = RenderSamplesX (lx, N_BITS);
|
||||
rxs = RenderSamplesX (rx, N_BITS);
|
||||
|
||||
/* Add coverage across row */
|
||||
if (lxi == rxi)
|
||||
{
|
||||
AddAlpha (rxs - lxs);
|
||||
}
|
||||
else
|
||||
{
|
||||
int xi;
|
||||
|
||||
AddAlpha (N_X_FRAC(N_BITS) - lxs);
|
||||
StepAlpha;
|
||||
for (xi = lxi + 1; xi < rxi; xi++)
|
||||
{
|
||||
AddAlpha (N_X_FRAC(N_BITS));
|
||||
StepAlpha;
|
||||
}
|
||||
/* Do not add in a 0 alpha here. This check is necessary
|
||||
* to avoid a buffer overrun when rx is exactly on a pixel
|
||||
* boundary.
|
||||
*/
|
||||
if (rxs != 0)
|
||||
AddAlpha (rxs);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (y == b)
|
||||
break;
|
||||
|
||||
#if N_BITS > 1
|
||||
if (xFixedFrac (y) != Y_FRAC_LAST(N_BITS))
|
||||
{
|
||||
RenderEdgeStepSmall (l);
|
||||
RenderEdgeStepSmall (r);
|
||||
y += STEP_Y_SMALL(N_BITS);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
RenderEdgeStepBig (l);
|
||||
RenderEdgeStepBig (r);
|
||||
y += STEP_Y_BIG(N_BITS);
|
||||
line += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef rasterizeSpan
|
28
fb/fbfill.c
28
fb/fbfill.c
|
@ -27,7 +27,6 @@
|
|||
#endif
|
||||
|
||||
#include "fb.h"
|
||||
#include "fbmmx.h"
|
||||
|
||||
void
|
||||
fbFill (DrawablePtr pDrawable,
|
||||
|
@ -47,12 +46,15 @@ fbFill (DrawablePtr pDrawable,
|
|||
|
||||
switch (pGC->fillStyle) {
|
||||
case FillSolid:
|
||||
#ifdef USE_MMX
|
||||
if (!pPriv->and && fbHaveMMX())
|
||||
if (fbSolidFillmmx (pDrawable, x, y, width, height, pPriv->xor)) {
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
if (!pPriv->and)
|
||||
{
|
||||
if (pixman_fill (dst, dstStride, dstBpp, x + dstXoff, y + dstYoff, width, height, pPriv->xor))
|
||||
{
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fbSolid (dst + (y + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
|
@ -215,16 +217,16 @@ fbSolidBoxClipped (DrawablePtr pDrawable,
|
|||
if (partY2 <= partY1)
|
||||
continue;
|
||||
|
||||
#ifdef USE_MMX
|
||||
if (!and && fbHaveMMX())
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
if (!and)
|
||||
{
|
||||
if (fbSolidFillmmx (pDrawable,
|
||||
partX1, partY1,
|
||||
(partX2 - partX1), (partY2 - partY1),
|
||||
xor)) {
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
if (pixman_fill (dst, dstStride, dstBpp,
|
||||
partX1 + dstXoff, partX2 + dstYoff, (partX2 - partX1), (partY2 - partY1),
|
||||
xor))
|
||||
{
|
||||
fbFinishAccess (pDrawable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fbSolid (dst + (partY1 + dstYoff) * dstStride,
|
||||
|
|
2900
fb/fbmmx.c
2900
fb/fbmmx.c
File diff suppressed because it is too large
Load Diff
294
fb/fbmmx.h
294
fb/fbmmx.h
|
@ -1,294 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 Red Hat, Inc.
|
||||
* Copyright © 2005 Trolltech AS
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Red Hat not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Red Hat makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Author: Søren Sandmann (sandmann@redhat.com)
|
||||
* Lars Knoll (lars@trolltech.com)
|
||||
*
|
||||
* Based on work by Owen Taylor
|
||||
*/
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_MMX
|
||||
|
||||
#if !defined(__amd64__) && !defined(__x86_64__)
|
||||
Bool fbHaveMMX(void);
|
||||
#else
|
||||
#define fbHaveMMX() TRUE
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define fbHaveMMX() FALSE
|
||||
#endif
|
||||
|
||||
#ifdef USE_MMX
|
||||
|
||||
void fbComposeSetupMMX(void);
|
||||
|
||||
void fbCompositeSolidMask_nx8888x0565Cmmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8888x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void
|
||||
fbCompositeSolidMaskSrc_nx8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void
|
||||
fbCompositeSrc_x888x8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8888x8888Cmmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeIn_nx8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeIn_8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8888x8x8mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrcAdd_8000x8000mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888RevNPx8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888RevNPx0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolid_nx8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolid_nx0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSolidMask_nx8x0565mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
void fbCompositeSrc_8888x8x8888mmx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool fbCopyAreammx (DrawablePtr pSrc,
|
||||
DrawablePtr pDst,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height);
|
||||
void fbCompositeCopyAreammx (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
Bool fbSolidFillmmx (DrawablePtr pDraw,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
FbBits xor);
|
||||
|
||||
#endif /* USE_MMX */
|
2529
fb/fbpict.c
2529
fb/fbpict.c
File diff suppressed because it is too large
Load Diff
236
fb/fbpict.h
236
fb/fbpict.h
|
@ -383,6 +383,9 @@ typedef struct _FbComposeData {
|
|||
CARD16 height;
|
||||
} FbComposeData;
|
||||
|
||||
void
|
||||
fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer);
|
||||
|
||||
typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width);
|
||||
typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width);
|
||||
typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width);
|
||||
|
@ -409,210 +412,7 @@ fbCompositeGeneral (CARD8 op,
|
|||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
|
||||
/* fbedge.c */
|
||||
void
|
||||
fbRasterizeEdges (FbBits *buf,
|
||||
int bpp,
|
||||
int width,
|
||||
int stride,
|
||||
RenderEdge *l,
|
||||
RenderEdge *r,
|
||||
xFixed t,
|
||||
xFixed b);
|
||||
|
||||
/* fbpict.c */
|
||||
CARD32
|
||||
fbOver (CARD32 x, CARD32 y);
|
||||
|
||||
CARD32
|
||||
fbOver24 (CARD32 x, CARD32 y);
|
||||
|
||||
CARD32
|
||||
fbIn (CARD32 x, CARD8 y);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx8x8888 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx8x0888 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx8888x8888C (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx8x0565 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx8888x0565C (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrc_8888x8888 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrc_8888x0888 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrc_8888x0565 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrc_0565x0565 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrcAdd_8000x8000 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrcAdd_8888x8888 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSrcAdd_1000x1000 (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbCompositeSolidMask_nx1xn (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbComposite (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
|
@ -627,6 +427,36 @@ fbComposite (CARD8 op,
|
|||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
typedef void (*CompositeFunc) (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height);
|
||||
|
||||
void
|
||||
fbWalkCompositeRegion (CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst,
|
||||
INT16 yDst,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
Bool srcRepeat,
|
||||
Bool maskRepeat,
|
||||
CompositeFunc compositeRect);
|
||||
|
||||
/* fbtrap.c */
|
||||
|
||||
void
|
||||
|
|
100
fb/fbtrap.c
100
fb/fbtrap.c
|
@ -42,61 +42,16 @@ fbAddTraps (PicturePtr pPicture,
|
|||
int ntrap,
|
||||
xTrap *traps)
|
||||
{
|
||||
FbBits *buf;
|
||||
int bpp;
|
||||
int width;
|
||||
int stride;
|
||||
int height;
|
||||
int pxoff, pyoff;
|
||||
pixman_image_t *image = image_from_pict (pPicture, FALSE);
|
||||
|
||||
xFixed x_off_fixed;
|
||||
xFixed y_off_fixed;
|
||||
RenderEdge l, r;
|
||||
xFixed t, b;
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
|
||||
|
||||
width = pPicture->pDrawable->width;
|
||||
height = pPicture->pDrawable->height;
|
||||
x_off += pxoff;
|
||||
y_off += pyoff;
|
||||
|
||||
x_off_fixed = IntToxFixed(y_off);
|
||||
y_off_fixed = IntToxFixed(y_off);
|
||||
|
||||
while (ntrap--)
|
||||
{
|
||||
t = traps->top.y + y_off_fixed;
|
||||
if (t < 0)
|
||||
t = 0;
|
||||
t = RenderSampleCeilY (t, bpp);
|
||||
|
||||
b = traps->bot.y + y_off_fixed;
|
||||
if (xFixedToInt (b) >= height)
|
||||
b = IntToxFixed (height) - 1;
|
||||
b = RenderSampleFloorY (b, bpp);
|
||||
|
||||
if (b >= t)
|
||||
{
|
||||
/* initialize edge walkers */
|
||||
RenderEdgeInit (&l, bpp, t,
|
||||
traps->top.l + x_off_fixed,
|
||||
traps->top.y + y_off_fixed,
|
||||
traps->bot.l + x_off_fixed,
|
||||
traps->bot.y + y_off_fixed);
|
||||
|
||||
RenderEdgeInit (&r, bpp, t,
|
||||
traps->top.r + x_off_fixed,
|
||||
traps->top.y + y_off_fixed,
|
||||
traps->bot.r + x_off_fixed,
|
||||
traps->bot.y + y_off_fixed);
|
||||
|
||||
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
|
||||
}
|
||||
traps++;
|
||||
}
|
||||
pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
|
||||
|
||||
fbFinishAccess (pPicture->pDrawable);
|
||||
|
||||
pixman_image_unref (image);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -105,47 +60,16 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
|
|||
int x_off,
|
||||
int y_off)
|
||||
{
|
||||
FbBits *buf;
|
||||
int bpp;
|
||||
int width;
|
||||
int stride;
|
||||
int height;
|
||||
int pxoff, pyoff;
|
||||
pixman_image_t *image = image_from_pict (pPicture, FALSE);
|
||||
|
||||
xFixed x_off_fixed;
|
||||
xFixed y_off_fixed;
|
||||
RenderEdge l, r;
|
||||
xFixed t, b;
|
||||
|
||||
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
width = pPicture->pDrawable->width;
|
||||
height = pPicture->pDrawable->height;
|
||||
x_off += pxoff;
|
||||
y_off += pyoff;
|
||||
|
||||
x_off_fixed = IntToxFixed(x_off);
|
||||
y_off_fixed = IntToxFixed(y_off);
|
||||
t = trap->top + y_off_fixed;
|
||||
if (t < 0)
|
||||
t = 0;
|
||||
t = RenderSampleCeilY (t, bpp);
|
||||
|
||||
b = trap->bottom + y_off_fixed;
|
||||
if (xFixedToInt (b) >= height)
|
||||
b = IntToxFixed (height) - 1;
|
||||
b = RenderSampleFloorY (b, bpp);
|
||||
|
||||
if (b >= t)
|
||||
{
|
||||
/* initialize edge walkers */
|
||||
RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
|
||||
RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
|
||||
|
||||
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
|
||||
}
|
||||
pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
|
||||
|
||||
fbFinishAccess (pPicture->pDrawable);
|
||||
|
||||
pixman_image_unref (image);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -30,10 +30,6 @@
|
|||
|
||||
#include "fb.h"
|
||||
|
||||
#ifdef USE_MMX
|
||||
#include "fbmmx.h"
|
||||
#endif
|
||||
|
||||
Bool
|
||||
fbCreateWindow(WindowPtr pWin)
|
||||
{
|
||||
|
@ -222,37 +218,38 @@ fbFillRegionSolid (DrawablePtr pDrawable,
|
|||
int n = REGION_NUM_RECTS(pRegion);
|
||||
BoxPtr pbox = REGION_RECTS(pRegion);
|
||||
|
||||
#ifdef USE_MMX
|
||||
int has_mmx = 0;
|
||||
if (!and && fbHaveMMX())
|
||||
has_mmx = 1;
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
int try_mmx = 0;
|
||||
if (!and)
|
||||
try_mmx = 1;
|
||||
#endif
|
||||
|
||||
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
|
||||
|
||||
while (n--)
|
||||
{
|
||||
#ifdef USE_MMX
|
||||
if (!has_mmx || !fbSolidFillmmx (pDrawable,
|
||||
pbox->x1,
|
||||
pbox->y1,
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1), xor)) {
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
if (!try_mmx || !pixman_fill (dst, dstStride, dstBpp,
|
||||
pbox->x1 + dstXoff, pbox->y1 + dstYoff,
|
||||
(pbox->x2 - pbox->x1),
|
||||
(pbox->y2 - pbox->y1),
|
||||
xor))
|
||||
{
|
||||
#endif
|
||||
fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
(pbox->x1 + dstXoff) * dstBpp,
|
||||
dstBpp,
|
||||
(pbox->x2 - pbox->x1) * dstBpp,
|
||||
pbox->y2 - pbox->y1,
|
||||
and, xor);
|
||||
#ifdef USE_MMX
|
||||
fbSolid (dst + (pbox->y1 + dstYoff) * dstStride,
|
||||
dstStride,
|
||||
(pbox->x1 + dstXoff) * dstBpp,
|
||||
dstBpp,
|
||||
(pbox->x2 - pbox->x1) * dstBpp,
|
||||
pbox->y2 - pbox->y1,
|
||||
and, xor);
|
||||
#ifndef FB_ACCESS_WRAPPER
|
||||
}
|
||||
#endif
|
||||
fbValidateDrawable (pDrawable);
|
||||
pbox++;
|
||||
}
|
||||
|
||||
|
||||
fbFinishAccess (pDrawable);
|
||||
}
|
||||
|
||||
|
|
|
@ -184,9 +184,11 @@
|
|||
#define fbUnmapWindow wfbUnmapWindow
|
||||
#define fbUnrealizeFont wfbUnrealizeFont
|
||||
#define fbValidateGC wfbValidateGC
|
||||
#define fbWalkCompositeRegion wfbWalkCompositeRegion
|
||||
#define fbWinPrivateIndex wfbWinPrivateIndex
|
||||
#define fbZeroLine wfbZeroLine
|
||||
#define fbZeroSegment wfbZeroSegment
|
||||
#define image_from_pict wfb_image_from_pict
|
||||
#define xxScrPrivateIndex wfbxxScrPrivateIndex
|
||||
#define xxGCPrivateIndex wfbxxGCPrivateIndex
|
||||
#define xxColormapPrivateIndex wfbxxColormapPrivateIndex
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
((year-2000) * 10000) + \
|
||||
((month) * 100) + \
|
||||
((day) * 1)
|
||||
#define VENDOR_RELEASE DMX_VENDOR_RELEASE(1,2,2004,6,30)
|
||||
#define VENDOR_RELEASE DMX_VENDOR_RELEASE(1,2,2007,4,24)
|
||||
#define VENDOR_STRING "DMX Project"
|
||||
|
||||
/* Enable the DMX extension */
|
||||
|
|
|
@ -67,7 +67,7 @@ extern void __glXFreeGLXPixmap( __GLXpixmap *pGlxPixmap );
|
|||
|
||||
extern void __glXNoSuchRenderOpcode(GLbyte*);
|
||||
extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
|
||||
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
|
||||
extern void __glXErrorCallBack(GLenum code);
|
||||
extern void __glXClearErrorOccured(void);
|
||||
extern GLboolean __glXErrorOccured(void);
|
||||
extern void __glXResetLargeCommandStatus(__GLXclientState*);
|
||||
|
|
|
@ -65,7 +65,7 @@ of the copyright holder.
|
|||
|
||||
#include <linux/agpgart.h>
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/agpio.h>
|
||||
#endif
|
||||
|
|
|
@ -1365,7 +1365,7 @@ do { \
|
|||
# define write_mem_barrier() /* NOP */
|
||||
|
||||
# if !defined(__SUNPRO_C)
|
||||
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)
|
||||
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__)
|
||||
# ifdef GCCUSESGAS
|
||||
|
||||
/*
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#define BUILD_DATE @BUILD_DATE@
|
||||
#define BUILD_TIME @BUILD_TIME@
|
||||
|
|
|
@ -3004,7 +3004,7 @@ xf86FindPrimaryDevice()
|
|||
|
||||
}
|
||||
|
||||
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
|
||||
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__)
|
||||
#include "vgaHW.h"
|
||||
#include "compiler.h"
|
||||
#endif
|
||||
|
|
|
@ -131,9 +131,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
|
|||
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
|
||||
static Bool addDefaultModes(MonPtr monitorp);
|
||||
#ifdef XF86DRI
|
||||
static Bool configDRI(XF86ConfDRIPtr drip);
|
||||
static void configDRI(XF86ConfDRIPtr drip);
|
||||
#endif
|
||||
static Bool configExtensions(XF86ConfExtensionsPtr conf_ext);
|
||||
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
|
||||
|
||||
/*
|
||||
* xf86GetPathElem --
|
||||
|
@ -254,6 +254,7 @@ xf86ModulelistFromConfig(pointer **optlist)
|
|||
char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", NULL };
|
||||
pointer *optarray;
|
||||
XF86LoadPtr modp;
|
||||
Bool found;
|
||||
|
||||
/*
|
||||
* make sure the config file has been parsed and that we have a
|
||||
|
@ -266,35 +267,76 @@ xf86ModulelistFromConfig(pointer **optlist)
|
|||
}
|
||||
|
||||
if (xf86configptr->conf_modules) {
|
||||
/*
|
||||
* Walk the list of modules in the "Module" section to determine how
|
||||
* many we have.
|
||||
*/
|
||||
modp = xf86configptr->conf_modules->mod_load_lst;
|
||||
while (modp) {
|
||||
for (i = 0; ignore[i]; i++) {
|
||||
if (strcmp(modp->load_name, ignore[i]) == 0)
|
||||
modp->ignore = 1;
|
||||
/* Walk the disable list and let people know what we've parsed to
|
||||
* not be loaded
|
||||
*/
|
||||
modp = xf86configptr->conf_modules->mod_disable_lst;
|
||||
while (modp) {
|
||||
xf86Msg(X_WARNING, "\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n", modp->load_name);
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
/*
|
||||
* Walk the default settings table. For each module listed to be
|
||||
* loaded, make sure it's in the mod_load_lst. If it's not, make
|
||||
* sure it's not in the mod_no_load_lst. If it's not disabled,
|
||||
* append it to mod_load_lst
|
||||
*/
|
||||
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
|
||||
if (ModuleDefaults[i].toLoad == FALSE) {
|
||||
xf86Msg(X_WARNING, "\"%s\" is not to be loaded by default. Skipping.\n", ModuleDefaults[i].name);
|
||||
continue;
|
||||
}
|
||||
if (!modp->ignore)
|
||||
count++;
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
found = FALSE;
|
||||
modp = xf86configptr->conf_modules->mod_load_lst;
|
||||
while (modp) {
|
||||
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
|
||||
xf86Msg(X_INFO, "\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n", ModuleDefaults[i].name);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
if (found == FALSE) {
|
||||
modp = xf86configptr->conf_modules->mod_disable_lst;
|
||||
while (modp) {
|
||||
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
|
||||
xf86Msg(X_INFO, "\"%s\" will be loaded even though the default is to disable it.\n", ModuleDefaults[i].name);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
}
|
||||
if (found == FALSE) {
|
||||
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
|
||||
ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
|
||||
xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec));
|
||||
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
|
||||
if (ModuleDefaults[i].toLoad == TRUE) {
|
||||
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
|
||||
ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
|
||||
ptr = xf86addNewLoadDirective(ptr, "extmod", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "dbe", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "glx", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "freetype", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "type1", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "record", XF86_LOAD_MODULE, NULL);
|
||||
ptr = xf86addNewLoadDirective(ptr, "dri", XF86_LOAD_MODULE, NULL);
|
||||
count = 7;
|
||||
}
|
||||
/*
|
||||
* Walk the list of modules in the "Module" section to determine how
|
||||
* many we have.
|
||||
*/
|
||||
modp = xf86configptr->conf_modules->mod_load_lst;
|
||||
while (modp) {
|
||||
for (i = 0; ignore[i]; i++) {
|
||||
if (strcmp(modp->load_name, ignore[i]) == 0)
|
||||
modp->ignore = 1;
|
||||
}
|
||||
if (!modp->ignore)
|
||||
count++;
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
|
||||
/*
|
||||
* allocate the memory and walk the list again to fill in the pointers
|
||||
|
@ -303,22 +345,22 @@ xf86ModulelistFromConfig(pointer **optlist)
|
|||
optarray = xnfalloc((count + 1) * sizeof(pointer));
|
||||
count = 0;
|
||||
if (xf86configptr->conf_modules) {
|
||||
modp = xf86configptr->conf_modules->mod_load_lst;
|
||||
while (modp) {
|
||||
modp = xf86configptr->conf_modules->mod_load_lst;
|
||||
while (modp) {
|
||||
if (!modp->ignore) {
|
||||
modulearray[count] = modp->load_name;
|
||||
optarray[count] = modp->load_opt;
|
||||
count++;
|
||||
modulearray[count] = modp->load_name;
|
||||
optarray[count] = modp->load_opt;
|
||||
count++;
|
||||
}
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
modp = (XF86LoadPtr) modp->list.next;
|
||||
}
|
||||
}
|
||||
modulearray[count] = NULL;
|
||||
optarray[count] = NULL;
|
||||
if (optlist)
|
||||
*optlist = optarray;
|
||||
*optlist = optarray;
|
||||
else
|
||||
xfree(optarray);
|
||||
xfree(optarray);
|
||||
return modulearray;
|
||||
}
|
||||
|
||||
|
@ -556,7 +598,7 @@ xf86ConfigError(char *msg, ...)
|
|||
return;
|
||||
}
|
||||
|
||||
static Bool
|
||||
static void
|
||||
configFiles(XF86ConfFilesPtr fileconf)
|
||||
{
|
||||
MessageType pathFrom = X_DEFAULT;
|
||||
|
@ -565,16 +607,24 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
char *log_buf;
|
||||
|
||||
/* FontPath */
|
||||
|
||||
/* Try XF86Config FontPath first */
|
||||
if (!xf86fpFlag) {
|
||||
if (fileconf) {
|
||||
if (fileconf->file_fontpath) {
|
||||
char *f = xf86ValidateFontPath(fileconf->file_fontpath);
|
||||
pathFrom = X_CONFIG;
|
||||
if (*f)
|
||||
defaultFontPath = f;
|
||||
else {
|
||||
if (*f) {
|
||||
if (xf86Info.useDefaultFontPath) {
|
||||
xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath);
|
||||
char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3);
|
||||
strcpy(g, f);
|
||||
strcat(g, ",");
|
||||
defaultFontPath = strcat(g, defaultFontPath);
|
||||
xfree(f);
|
||||
} else {
|
||||
defaultFontPath = f;
|
||||
}
|
||||
} else {
|
||||
xf86Msg(X_WARNING,
|
||||
"FontPath is completely invalid. Using compiled-in default.\n");
|
||||
fontPath = NULL;
|
||||
|
@ -582,7 +632,7 @@ configFiles(XF86ConfFilesPtr fileconf)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
xf86Msg(X_WARNING,
|
||||
xf86Msg(X_DEFAULT,
|
||||
"No FontPath specified. Using compiled-in default.\n");
|
||||
pathFrom = X_DEFAULT;
|
||||
}
|
||||
|
@ -742,6 +792,7 @@ typedef enum {
|
|||
FLAG_AIGLX,
|
||||
FLAG_IGNORE_ABI,
|
||||
FLAG_ALLOW_EMPTY_INPUT,
|
||||
FLAG_USE_DEFAULT_FONT_PATH
|
||||
} FlagValues;
|
||||
|
||||
static OptionInfoRec FlagOptions[] = {
|
||||
|
@ -817,6 +868,8 @@ static OptionInfoRec FlagOptions[] = {
|
|||
{0}, FALSE },
|
||||
{ FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
|
||||
{0}, FALSE },
|
||||
{ FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
|
||||
{0}, FALSE },
|
||||
{ -1, NULL, OPTV_NONE,
|
||||
{0}, FALSE },
|
||||
};
|
||||
|
@ -1016,6 +1069,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
|||
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
|
||||
xf86Info.allowEmptyInput = TRUE;
|
||||
|
||||
xf86Info.useDefaultFontPath = TRUE;
|
||||
xf86Info.useDefaultFontPathFrom = X_DEFAULT;
|
||||
if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) {
|
||||
xf86Info.useDefaultFontPath = value;
|
||||
xf86Info.useDefaultFontPathFrom = X_CONFIG;
|
||||
}
|
||||
|
||||
/* Make sure that timers don't overflow CARD32's after multiplying */
|
||||
#define MAX_TIME_IN_MIN (0x7fffffff / MILLI_PER_MIN)
|
||||
|
||||
|
@ -1414,13 +1474,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
|||
}
|
||||
|
||||
if (pointerMsg) {
|
||||
xf86Msg(X_WARNING, "The core pointer device wasn't specified "
|
||||
xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
|
||||
"explicitly in the layout.\n"
|
||||
"\tUsing the %s.\n", pointerMsg);
|
||||
}
|
||||
|
||||
if (keyboardMsg) {
|
||||
xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
|
||||
xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
|
||||
"explicitly in the layout.\n"
|
||||
"\tUsing the %s.\n", keyboardMsg);
|
||||
}
|
||||
|
@ -1749,7 +1809,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
|
|||
indp = xnfalloc(sizeof(IDevRec));
|
||||
indp->identifier = NULL;
|
||||
servlayoutp->inputs = indp;
|
||||
if (!xf86Info.allowEmptyInput && checkCoreInputDevices(servlayoutp, TRUE))
|
||||
if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -1877,7 +1937,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
|
|||
}
|
||||
|
||||
if (defaultMonitor) {
|
||||
xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
|
||||
xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n"
|
||||
"\tUsing a default monitor configuration.\n", screenp->id);
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -2168,7 +2228,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
|
|||
}
|
||||
|
||||
#ifdef XF86DRI
|
||||
static Bool
|
||||
static void
|
||||
configDRI(XF86ConfDRIPtr drip)
|
||||
{
|
||||
int count = 0;
|
||||
|
@ -2209,12 +2269,10 @@ configDRI(XF86ConfDRIPtr drip)
|
|||
xf86ConfigDRI.bufs[i].flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
static Bool
|
||||
static void
|
||||
configExtensions(XF86ConfExtensionsPtr conf_ext)
|
||||
{
|
||||
XF86OptionPtr o;
|
||||
|
@ -2249,11 +2307,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
|||
xf86NameCmp(val, "false") == 0) {
|
||||
enable = !enable;
|
||||
} else {
|
||||
xf86Msg(X_ERROR,
|
||||
"%s is not a valid value for the Extension option\n",
|
||||
val);
|
||||
xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
|
||||
xfree(n);
|
||||
return FALSE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (EnableDisableExtension(name, enable)) {
|
||||
|
@ -2266,8 +2322,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
|
|||
xfree(n);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
@ -2397,7 +2451,7 @@ xf86HandleConfigFile(Bool autoconfig)
|
|||
|
||||
if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
|
||||
if (xf86ScreenName == NULL) {
|
||||
xf86Msg(X_WARNING,
|
||||
xf86Msg(X_DEFAULT,
|
||||
"No Layout section. Using the first Screen section.\n");
|
||||
}
|
||||
if (!configImpliedLayout(&xf86ConfigLayout,
|
||||
|
@ -2450,19 +2504,17 @@ xf86HandleConfigFile(Bool autoconfig)
|
|||
}
|
||||
|
||||
/* Now process everything else */
|
||||
|
||||
if (!configFiles(xf86configptr->conf_files) ||
|
||||
!configServerFlags(xf86configptr->conf_flags,
|
||||
xf86ConfigLayout.options) ||
|
||||
!configExtensions(xf86configptr->conf_extensions)
|
||||
#ifdef XF86DRI
|
||||
|| !configDRI(xf86configptr->conf_dri)
|
||||
#endif
|
||||
) {
|
||||
if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
|
||||
ErrorF ("Problem when converting the config data structures\n");
|
||||
return CONFIG_PARSE_ERROR;
|
||||
}
|
||||
|
||||
configFiles(xf86configptr->conf_files);
|
||||
configExtensions(xf86configptr->conf_extensions);
|
||||
#ifdef XF86DRI
|
||||
configDRI(xf86configptr->conf_dri);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle some command line options that can override some of the
|
||||
* ServerFlags settings.
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#ifndef _xf86_config_h
|
||||
#define _xf86_config_h
|
||||
|
||||
#include "xf86Optrec.h"
|
||||
|
||||
#ifdef HAVE_PARSER_DECLS
|
||||
/*
|
||||
* global structure that holds the result of parsing the config file
|
||||
|
@ -46,6 +48,23 @@ typedef enum _ConfigStatus {
|
|||
CONFIG_NOFILE
|
||||
} ConfigStatus;
|
||||
|
||||
typedef struct _ModuleDefault {
|
||||
char *name;
|
||||
Bool toLoad;
|
||||
XF86OptionPtr load_opt;
|
||||
} ModuleDefault;
|
||||
|
||||
static ModuleDefault ModuleDefaults[] = {
|
||||
{.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "glx", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "freetype", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "type1", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "record", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = "dri", .toLoad = TRUE, .load_opt=NULL},
|
||||
{.name = NULL, .toLoad = FALSE, .load_opt=NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
* prototypes
|
||||
*/
|
||||
|
|
|
@ -1210,31 +1210,3 @@ _X_EXPORT void
|
|||
DDXRingBell(int volume, int pitch, int duration) {
|
||||
xf86OSRingBell(volume, pitch, duration);
|
||||
}
|
||||
|
||||
#ifdef WSCONS_SUPPORT
|
||||
|
||||
/* XXX Currently XKB is mandatory. */
|
||||
|
||||
extern int WSKbdToKeycode(int);
|
||||
|
||||
void
|
||||
xf86PostWSKbdEvent(struct wscons_event *event)
|
||||
{
|
||||
int type = event->type;
|
||||
int value = event->value;
|
||||
unsigned int keycode;
|
||||
int blocked;
|
||||
|
||||
if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
|
||||
Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
|
||||
|
||||
/* map the scancodes to standard XFree86 scancode */
|
||||
keycode = WSKbdToKeycode(value);
|
||||
if (!down) keycode |= 0x80;
|
||||
/* It seems better to block SIGIO there */
|
||||
blocked = xf86BlockSIGIO();
|
||||
xf86PostKbdEvent(keycode);
|
||||
xf86UnblockSIGIO(blocked);
|
||||
}
|
||||
}
|
||||
#endif /* WSCONS_SUPPORT */
|
||||
|
|
|
@ -1730,8 +1730,16 @@ xf86PrintBanner()
|
|||
t.tm_mday = BUILD_DATE % 100;
|
||||
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
|
||||
t.tm_year = BUILD_DATE / 10000 - 1900;
|
||||
#if defined(BUILD_TIME)
|
||||
t.tm_sec = BUILD_TIME % 100;
|
||||
t.tm_min = (BUILD_TIME / 100) % 100;
|
||||
t.tm_hour = (BUILD_TIME / 10000) % 100;
|
||||
if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%s%p", &t))
|
||||
ErrorF("Build Date: %s\n", buf);
|
||||
#else
|
||||
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
|
||||
ErrorF("Build Date: %s\n", buf);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
|
||||
|
|
|
@ -1890,7 +1890,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
|
|||
virtX, virtY, vx, vy);
|
||||
virtX = vx;
|
||||
virtY = vy;
|
||||
linePitch = miScanLineWidth(vx, vy, linePitch, apertureSize,
|
||||
linePitch = miScanLineWidth(vx, vy, minPitch, apertureSize,
|
||||
BankFormat, pitchInc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ typedef enum {
|
|||
*/
|
||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
|
||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
|
||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 1)
|
||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
|
||||
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)
|
||||
|
||||
|
|
|
@ -120,6 +120,8 @@ typedef struct {
|
|||
MessageType randRFrom;
|
||||
Bool aiglx;
|
||||
MessageType aiglxFrom;
|
||||
Bool useDefaultFontPath;
|
||||
MessageType useDefaultFontPathFrom;
|
||||
Bool ignoreABI;
|
||||
struct {
|
||||
Bool disabled; /* enable/disable deactivating
|
||||
|
|
|
@ -110,7 +110,7 @@ xf86SendDragEvents(DeviceIntPtr device)
|
|||
{
|
||||
LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
|
||||
|
||||
if (device->button->buttonsDown > 0)
|
||||
if (device->button && device->button->buttonsDown > 0)
|
||||
return (local->flags & XI86_SEND_DRAG_EVENTS);
|
||||
else
|
||||
return (TRUE);
|
||||
|
@ -129,9 +129,11 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
|
|||
pointer list)
|
||||
{
|
||||
if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
|
||||
xf86SetBoolOption(list, "SendCoreEvents", 0) ||
|
||||
xf86SetBoolOption(list, "CorePointer", 0) ||
|
||||
xf86SetBoolOption(list, "CoreKeyboard", 0)) {
|
||||
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
|
||||
!xf86SetBoolOption(list, "CorePointer", 1) ||
|
||||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
|
||||
xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
|
||||
} else {
|
||||
local->flags |= XI86_ALWAYS_CORE;
|
||||
xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
|
||||
}
|
||||
|
@ -358,7 +360,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
|||
return BadAlloc;
|
||||
|
||||
for (option = options; option; option = option->next) {
|
||||
if (strcmp(option->key, "driver") == 0) {
|
||||
if (strcasecmp(option->key, "driver") == 0) {
|
||||
if (idev->driver) {
|
||||
rval = BadRequest;
|
||||
goto unwind;
|
||||
|
@ -381,8 +383,8 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
|||
goto unwind;
|
||||
}
|
||||
}
|
||||
if (strcmp(option->key, "name") == 0 ||
|
||||
strcmp(option->key, "identifier") == 0) {
|
||||
if (strcasecmp(option->key, "name") == 0 ||
|
||||
strcasecmp(option->key, "identifier") == 0) {
|
||||
if (idev->identifier) {
|
||||
rval = BadRequest;
|
||||
goto unwind;
|
||||
|
@ -445,7 +447,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
|
|||
|
||||
dev = pInfo->dev;
|
||||
ActivateDevice(dev);
|
||||
if (dev->inited && dev->startup)
|
||||
if (dev->inited && dev->startup && xf86Screens[0]->vtSema)
|
||||
EnableDevice(dev);
|
||||
|
||||
if (!IsPointerDevice(dev))
|
||||
|
@ -505,26 +507,47 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
...)
|
||||
{
|
||||
va_list var;
|
||||
int i = 0, nevents = 0;
|
||||
int dx, dy;
|
||||
Bool drag = xf86SendDragEvents(device);
|
||||
int *valuators = NULL;
|
||||
int flags = 0;
|
||||
xEvent *xE = NULL;
|
||||
int index;
|
||||
int i = 0;
|
||||
static int *valuators = NULL;
|
||||
static int n_valuators = 0;
|
||||
|
||||
if (is_absolute)
|
||||
flags = POINTER_ABSOLUTE;
|
||||
else
|
||||
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
|
||||
if (num_valuators > n_valuators) {
|
||||
xfree (valuators);
|
||||
valuators = NULL;
|
||||
}
|
||||
|
||||
valuators = xcalloc(sizeof(int), num_valuators);
|
||||
if (!valuators) {
|
||||
valuators = xcalloc(sizeof(int), num_valuators);
|
||||
n_valuators = num_valuators;
|
||||
}
|
||||
|
||||
va_start(var, num_valuators);
|
||||
for (i = 0; i < num_valuators; i++)
|
||||
valuators[i] = va_arg(var, int);
|
||||
va_end(var);
|
||||
|
||||
xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
xf86PostMotionEventP(DeviceIntPtr device,
|
||||
int is_absolute,
|
||||
int first_valuator,
|
||||
int num_valuators,
|
||||
int *valuators)
|
||||
{
|
||||
int i = 0, nevents = 0;
|
||||
int dx, dy;
|
||||
Bool drag = xf86SendDragEvents(device);
|
||||
xEvent *xE = NULL;
|
||||
int index;
|
||||
int flags = 0;
|
||||
|
||||
if (is_absolute)
|
||||
flags = POINTER_ABSOLUTE;
|
||||
else
|
||||
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
|
||||
|
||||
#if XFreeXDGA
|
||||
if (first_valuator == 0 && num_valuators >= 2) {
|
||||
if (miPointerGetScreen(inputInfo.pointer)) {
|
||||
|
@ -538,7 +561,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
dy = valuators[1];
|
||||
}
|
||||
if (DGAStealMotionEvent(index, dx, dy))
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -560,9 +583,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
|
|||
mieqEnqueue(device, (xf86Events + i)->event);
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
xfree(valuators);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
|
|
|
@ -164,6 +164,8 @@ extern InputInfoPtr xf86InputDevs;
|
|||
void InitExtInput(void);
|
||||
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
|
||||
int first_valuator, int num_valuators, ...);
|
||||
void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
|
||||
int first_valuator, int num_valuators, int *valuators);
|
||||
void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
|
||||
int first_valuator, int num_valuators, ...);
|
||||
void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
|
||||
|
|
|
@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
|||
winPriv->next = PrivRoot;
|
||||
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
|
||||
}
|
||||
|
||||
portPriv->pDraw = (DrawablePtr)pWin;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -1375,7 +1378,6 @@ xf86XVPutVideo(
|
|||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
if(result != Success) return result;
|
||||
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->type = XvInputMask;
|
||||
|
||||
/* save a copy of these parameters */
|
||||
|
@ -1479,7 +1481,6 @@ xf86XVPutStill(
|
|||
|
||||
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
portPriv->isOn = XV_ON;
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||
portPriv->type = 0; /* no mask means it's transient and should
|
||||
|
@ -1529,7 +1530,6 @@ xf86XVGetVideo(
|
|||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||
if(result != Success) return result;
|
||||
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->type = XvOutputMask;
|
||||
|
||||
/* save a copy of these parameters */
|
||||
|
@ -1784,7 +1784,6 @@ xf86XVPutImage(
|
|||
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
|
||||
|
||||
portPriv->isOn = XV_ON;
|
||||
portPriv->pDraw = pDraw;
|
||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||
portPriv->type = 0; /* no mask means it's transient and should
|
||||
|
@ -1876,42 +1875,35 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
|||
_X_EXPORT void
|
||||
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
|
||||
{
|
||||
XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
|
||||
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
|
||||
XID pval[2];
|
||||
BoxPtr pbox = REGION_RECTS(clipboxes);
|
||||
int i, nbox = REGION_NUM_RECTS(clipboxes);
|
||||
xRectangle *rects;
|
||||
GCPtr gc;
|
||||
|
||||
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
||||
|
||||
if(!ScreenPriv->videoGC) {
|
||||
int status;
|
||||
pval[0] = key;
|
||||
pval[1] = IncludeInferiors;
|
||||
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
|
||||
pval, &status);
|
||||
if(!ScreenPriv->videoGC) return;
|
||||
ValidateGC(root, ScreenPriv->videoGC);
|
||||
} else if (key != ScreenPriv->videoGC->fgPixel){
|
||||
pval[0] = key;
|
||||
ChangeGC(ScreenPriv->videoGC, GCForeground, pval);
|
||||
ValidateGC(root, ScreenPriv->videoGC);
|
||||
}
|
||||
gc = GetScratchGC(root->depth, pScreen);
|
||||
pval[0] = key;
|
||||
pval[1] = IncludeInferiors;
|
||||
(void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
|
||||
ValidateGC(root, gc);
|
||||
|
||||
rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
|
||||
rects = xalloc (nbox * sizeof(xRectangle));
|
||||
|
||||
for(i = 0; i < nbox; i++, pbox++) {
|
||||
for(i = 0; i < nbox; i++, pbox++)
|
||||
{
|
||||
rects[i].x = pbox->x1;
|
||||
rects[i].y = pbox->y1;
|
||||
rects[i].width = pbox->x2 - pbox->x1;
|
||||
rects[i].height = pbox->y2 - pbox->y1;
|
||||
}
|
||||
|
||||
(*ScreenPriv->videoGC->ops->PolyFillRect)(
|
||||
root, ScreenPriv->videoGC, nbox, rects);
|
||||
|
||||
DEALLOCATE_LOCAL(rects);
|
||||
|
||||
(*gc->ops->PolyFillRect)(root, gc, nbox, rects);
|
||||
|
||||
xfree (rects);
|
||||
FreeScratchGC (gc);
|
||||
}
|
||||
|
||||
/* xf86XVClipVideoHelper -
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
sdk_HEADERS = edid.h vdif.h xf86DDC.h
|
||||
sdk_HEADERS = edid.h xf86DDC.h
|
||||
|
||||
noinst_LIBRARIES = libddc.a
|
||||
|
||||
libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \
|
||||
interpret_vdif.c print_vdif.c ddcProperty.c
|
||||
ddcProperty.c
|
||||
|
||||
INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
|
||||
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
|
||||
#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
|
||||
|
||||
static void
|
||||
addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
||||
|
@ -103,16 +102,6 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
|||
xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8,
|
||||
256, (unsigned char *)EDID2rawdata);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (DDC->vdif) {
|
||||
#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n"
|
||||
|
||||
VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE);
|
||||
xf86RegisterRootWindowProperty(scrnIndex, VDIFAtom, XA_STRING, 8,
|
||||
strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#ifndef _EDID_H_
|
||||
#define _EDID_H_
|
||||
|
||||
#include "vdif.h"
|
||||
|
||||
/* read complete EDID record */
|
||||
#define EDID1_LEN 128
|
||||
#define BITS_PER_BYTE 9
|
||||
|
@ -453,7 +451,7 @@ typedef struct {
|
|||
struct established_timings timings1;
|
||||
struct std_timings timings2[8];
|
||||
struct detailed_monitor_section det_mon[4];
|
||||
xf86vdifPtr vdif;
|
||||
void *vdif; /* unused */
|
||||
int no_sections;
|
||||
Uchar *rawData;
|
||||
} xf86Monitor, *xf86MonPtr;
|
||||
|
|
|
@ -1,132 +0,0 @@
|
|||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/Xarch.h>
|
||||
#include "xf86DDC.h"
|
||||
#include "vdif.h"
|
||||
|
||||
static xf86VdifLimitsPtr* get_limits(CARD8 *c);
|
||||
static xf86VdifGammaPtr* get_gamma(CARD8 *c);
|
||||
static xf86VdifTimingPtr* get_timings(CARD8 *c);
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
static CARD32 swap_byte_order(CARD32 c);
|
||||
#endif
|
||||
|
||||
xf86vdifPtr
|
||||
xf86InterpretVdif(CARD8 *c)
|
||||
{
|
||||
xf86VdifPtr p = (xf86VdifPtr)c;
|
||||
xf86vdifPtr vdif;
|
||||
int i;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
int length;
|
||||
#endif
|
||||
unsigned long l = 0;
|
||||
|
||||
if (c == NULL) return NULL;
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
length = swap_byte_order(p->FileLength);
|
||||
for (i = 0; i < (length >>2); i++)
|
||||
((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ;
|
||||
#endif
|
||||
if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I'
|
||||
|| p->VDIFId[3] != 'F') return NULL;
|
||||
for ( i = 12; i < p->FileLength; i++)
|
||||
l += c[i];
|
||||
if ( l != p->Checksum) return NULL;
|
||||
vdif = xalloc(sizeof(xf86vdif));
|
||||
vdif->vdif = p;
|
||||
vdif->limits = get_limits(c);
|
||||
vdif->timings = get_timings(c);
|
||||
vdif->gamma = get_gamma(c);
|
||||
vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0);
|
||||
xfree(c);
|
||||
return vdif;
|
||||
}
|
||||
|
||||
static xf86VdifLimitsPtr*
|
||||
get_limits(CARD8 *c)
|
||||
{
|
||||
int num, i, j;
|
||||
xf86VdifLimitsPtr *pp;
|
||||
xf86VdifLimitsPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
|
||||
pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1));
|
||||
p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
|
||||
j = 0;
|
||||
for ( i = 0; i<num; i++) {
|
||||
if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(p);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
static xf86VdifGammaPtr*
|
||||
get_gamma(CARD8 *c)
|
||||
{
|
||||
int num, i, j;
|
||||
xf86VdifGammaPtr *pp;
|
||||
xf86VdifGammaPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOptions;
|
||||
pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1));
|
||||
p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c));
|
||||
j = 0;
|
||||
for ( i = 0; i<num; i++)
|
||||
{
|
||||
if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_OPTIONS(p);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
static xf86VdifTimingPtr*
|
||||
get_timings(CARD8 *c)
|
||||
{
|
||||
int num, num_limits;
|
||||
int i,j,k;
|
||||
xf86VdifLimitsPtr lp;
|
||||
xf86VdifTimingPtr *pp;
|
||||
xf86VdifTimingPtr p;
|
||||
|
||||
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
|
||||
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
|
||||
num_limits = 0;
|
||||
for (i = 0; i < num; i++) {
|
||||
if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
|
||||
num_limits += lp->NumberPreadjustedTimings;
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
|
||||
}
|
||||
pp = xalloc(sizeof(xf86VdifTimingPtr)
|
||||
* (num_limits+1));
|
||||
j = 0;
|
||||
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c));
|
||||
for (i = 0; i < num; i++) {
|
||||
p = VDIF_PREADJUSTED_TIMING(lp);
|
||||
for (k = 0; k < lp->NumberPreadjustedTimings; k++) {
|
||||
if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG)
|
||||
pp[j++] = p;
|
||||
VDIF_NEXT_PREADJUSTED_TIMING(p);
|
||||
}
|
||||
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
|
||||
}
|
||||
pp[j] = NULL;
|
||||
return pp;
|
||||
}
|
||||
|
||||
#if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
static CARD32
|
||||
swap_byte_order(CARD32 c)
|
||||
{
|
||||
return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8)
|
||||
| ((c & 0xFF00) << 8) | ((c & 0xFF) << 24);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,225 +0,0 @@
|
|||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include "vdif.h"
|
||||
#include "misc.h"
|
||||
#include "xf86DDC.h"
|
||||
|
||||
static void print_vdif(xf86VdifPtr l, char *s);
|
||||
static void print_timings(xf86VdifTimingPtr *pt);
|
||||
static void print_limits(xf86VdifLimitsPtr *pl);
|
||||
static void print_gamma(xf86VdifGammaPtr *pg);
|
||||
static void print_type(CARD8 c);
|
||||
static void print_polarity(CARD8 c);
|
||||
|
||||
void
|
||||
xf86print_vdif(xf86vdifPtr v)
|
||||
{
|
||||
print_vdif(v->vdif,v->strings);
|
||||
print_limits(v->limits);
|
||||
print_timings(v->timings);
|
||||
print_gamma(v->gamma);
|
||||
}
|
||||
|
||||
static void
|
||||
print_vdif(xf86VdifPtr l, char *s)
|
||||
{
|
||||
ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision);
|
||||
ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0],
|
||||
l->Date[1],l->Date[2],l->DateManufactured[0],
|
||||
l->DateManufactured[1],l->DateManufactured[2]);
|
||||
ErrorF("File Revision: %i",l->FileRevision);
|
||||
ErrorF("Manufacturer: %s\n",s + l->Manufacturer);
|
||||
ErrorF("ModelNumber: %s\n",s + l->ModelNumber);
|
||||
ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex);
|
||||
ErrorF("Version: %s\n",s + l->Version);
|
||||
ErrorF("SerialNumber %s\n",s + l->SerialNumber);
|
||||
ErrorF("MonitorType: ");
|
||||
switch (l->MonitorType) {
|
||||
case VDIF_MONITOR_MONOCHROME:
|
||||
ErrorF("Mono\n");
|
||||
break;
|
||||
case VDIF_MONITOR_COLOR:
|
||||
ErrorF("Color\n");
|
||||
break;
|
||||
}
|
||||
ErrorF("CRT Size: %i inches\n",l->CRTSize);
|
||||
switch (l->MonitorType) {
|
||||
case VDIF_MONITOR_MONOCHROME:
|
||||
ErrorF("Border: %i percent\n",
|
||||
l->BorderRed);
|
||||
ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay);
|
||||
if (l->GreenPhosphorDecay !=0)
|
||||
ErrorF(" 2: %i,",l->GreenPhosphorDecay);
|
||||
if (l->BluePhosphorDecay !=0)
|
||||
ErrorF(" 3: %i",l->BluePhosphorDecay);
|
||||
ErrorF(" ms\n");
|
||||
if (l->RedChromaticity_x)
|
||||
ErrorF("Chromaticity: 1: x:%f, y:%f; ",
|
||||
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0);
|
||||
if (l->GreenChromaticity_x)
|
||||
ErrorF("Chromaticity: 2: x:%f, y:%f; ",
|
||||
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0);
|
||||
if (l->BlueChromaticity_x)
|
||||
ErrorF("Chromaticity: 3: x:%f, y:%f ",
|
||||
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
|
||||
ErrorF("\n");
|
||||
ErrorF("Gamma: %f\n",l->RedGamma/1000.0);
|
||||
break;
|
||||
case VDIF_MONITOR_COLOR:
|
||||
ErrorF("Border: Red: %i Green: %i Blue: %i percent\n",
|
||||
l->BorderRed,l->BorderGreen,l->BorderBlue);
|
||||
ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n",
|
||||
l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay);
|
||||
ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; "
|
||||
"Blue: x:%f, y:%f\n",
|
||||
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0,
|
||||
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0,
|
||||
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
|
||||
ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0,
|
||||
l->GreenGamma/1000.0,l->BlueGamma/1000.0);
|
||||
break;
|
||||
}
|
||||
ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0,
|
||||
l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0);
|
||||
}
|
||||
|
||||
static void
|
||||
print_limits(xf86VdifLimitsPtr *pl)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifLimitsPtr l;
|
||||
|
||||
while((l = pl[i]) != NULL) {
|
||||
ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel,
|
||||
l->MaxVerPixel);
|
||||
ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength,
|
||||
l->MaxVerActiveHeight);
|
||||
ErrorF("Video Type: ");
|
||||
print_type(l->VideoType);
|
||||
ErrorF("Sync Type: ");
|
||||
print_type(l->SyncType);
|
||||
ErrorF("Sync Configuration ");
|
||||
switch (l->SyncConfiguration) {
|
||||
case VDIF_SYNC_SEPARATE:
|
||||
ErrorF("separate\n");
|
||||
break;
|
||||
case VDIF_SYNC_C:
|
||||
ErrorF("composite C\n");
|
||||
break;
|
||||
case VDIF_SYNC_CP:
|
||||
ErrorF("composite CP\n");
|
||||
break;
|
||||
case VDIF_SYNC_G:
|
||||
ErrorF("composite G\n");
|
||||
break;
|
||||
case VDIF_SYNC_GP:
|
||||
ErrorF("composite GP\n");
|
||||
break;
|
||||
case VDIF_SYNC_OTHER:
|
||||
ErrorF("other\n");
|
||||
break;
|
||||
}
|
||||
ErrorF("Termination Resistance: %i\n",l->TerminationResistance);
|
||||
ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n",
|
||||
l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel);
|
||||
ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0);
|
||||
ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n",
|
||||
l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0,
|
||||
l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0);
|
||||
ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0,
|
||||
l->MinVerRetrace/1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_timings(xf86VdifTimingPtr *pt)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifTimingPtr t;
|
||||
|
||||
while((t = pt[i]) != NULL) {
|
||||
ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName);
|
||||
ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel);
|
||||
ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight);
|
||||
ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio);
|
||||
ErrorF("Character width: %i",t->CharacterWidth);
|
||||
ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0,
|
||||
t->HorFrequency/1000.0,t->VerFrequency/1000.0);
|
||||
ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0,
|
||||
t->VerTotalTime/1000.0);
|
||||
ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, "
|
||||
"HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0,
|
||||
t->HorBlankStart/1000.0,t->HorBlankTime/1000.0,
|
||||
t->HorSyncStart/1000.0,t->HorSyncTime/1000.0);
|
||||
ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, "
|
||||
"VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0,
|
||||
t->VerBlankStart/1000.0,t->VerBlankTime/1000.0,
|
||||
t->VerSyncStart/1000.0,t->VerSyncTime/1000.0);
|
||||
ErrorF("Scan Type: ");
|
||||
switch (t->ScanType) {
|
||||
case VDIF_SCAN_INTERLACED:
|
||||
ErrorF("interlaced ");
|
||||
break;
|
||||
case VDIF_SCAN_NONINTERLACED:
|
||||
ErrorF("non interlaced ");
|
||||
break;
|
||||
case VDIF_SCAN_OTHER:
|
||||
ErrorF("other ");
|
||||
break;
|
||||
}
|
||||
ErrorF("Polarity: H: ");
|
||||
print_polarity(t->HorSyncPolarity);
|
||||
ErrorF("V: ");
|
||||
print_polarity(t->VerSyncPolarity);
|
||||
ErrorF("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_gamma(xf86VdifGammaPtr *pg)
|
||||
{
|
||||
int i = 0;
|
||||
xf86VdifGammaPtr g;
|
||||
|
||||
while((g = pg[i]) != NULL) {
|
||||
ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_type(CARD8 c)
|
||||
{
|
||||
switch (c) {
|
||||
case VDIF_VIDEO_TTL :
|
||||
ErrorF("TTL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_ANALOG :
|
||||
ErrorF("Analog\n");
|
||||
break;
|
||||
case VDIF_VIDEO_ECL:
|
||||
ErrorF("ECL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_DECL:
|
||||
ErrorF("DECL\n");
|
||||
break;
|
||||
case VDIF_VIDEO_OTHER:
|
||||
ErrorF("other\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_polarity(CARD8 c)
|
||||
{
|
||||
switch (c) {
|
||||
case VDIF_POLARITY_NEGATIVE:
|
||||
ErrorF(" Neg.");
|
||||
break;
|
||||
case VDIF_POLARITY_POSITIVE:
|
||||
ErrorF(" Pos.");
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
|
||||
#ifndef _VDIF_H
|
||||
#define _VDIF_H
|
||||
|
||||
#define VDIF_MONITOR_MONOCHROME 0
|
||||
#define VDIF_MONITOR_COLOR 1
|
||||
#define VDIF_VIDEO_TTL 0
|
||||
#define VDIF_VIDEO_ANALOG 1
|
||||
#define VDIF_VIDEO_ECL 2
|
||||
#define VDIF_VIDEO_DECL 3
|
||||
#define VDIF_VIDEO_OTHER 4
|
||||
#define VDIF_SYNC_SEPARATE 0
|
||||
#define VDIF_SYNC_C 1
|
||||
#define VDIF_SYNC_CP 2
|
||||
#define VDIF_SYNC_G 3
|
||||
#define VDIF_SYNC_GP 4
|
||||
#define VDIF_SYNC_OTHER 5
|
||||
#define VDIF_SCAN_NONINTERLACED 0
|
||||
#define VDIF_SCAN_INTERLACED 1
|
||||
#define VDIF_SCAN_OTHER 2
|
||||
#define VDIF_POLARITY_NEGATIVE 0
|
||||
#define VDIF_POLARITY_POSITIVE 1
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#undef CARD32
|
||||
#define CARD32 unsigned int /* ... on all supported platforms */
|
||||
|
||||
typedef struct _VDIF { /* Monitor Description: */
|
||||
CARD8 VDIFId[4]; /* alway "VDIF" */
|
||||
CARD32 FileLength; /* lenght of the whole file */
|
||||
CARD32 Checksum; /* sum of all bytes in the file after*/
|
||||
/* this field */
|
||||
CARD16 VDIFVersion; /* structure version number */
|
||||
CARD16 VDIFRevision; /* structure revision number */
|
||||
CARD16 Date[3]; /* file date Year/Month/Day */
|
||||
CARD16 DateManufactured[3]; /* date Year/Month/Day */
|
||||
CARD32 FileRevision; /* file revision string */
|
||||
CARD32 Manufacturer; /* ASCII ID of the manufacturer */
|
||||
CARD32 ModelNumber; /* ASCII ID of the model */
|
||||
CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
|
||||
CARD32 Version; /* ASCII ID of the model version */
|
||||
CARD32 SerialNumber; /* ASCII ID of the serial number */
|
||||
CARD8 MonitorType; /* Monochrome or Color */
|
||||
CARD8 CRTSize; /* inches */
|
||||
CARD8 BorderRed; /* percent */
|
||||
CARD8 BorderGreen; /* percent */
|
||||
CARD8 BorderBlue; /* percent */
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD16 Reserved2; /* padding */
|
||||
CARD32 RedPhosphorDecay; /* microseconds */
|
||||
CARD32 GreenPhosphorDecay; /* microseconds */
|
||||
CARD32 BluePhosphorDecay; /* microseconds */
|
||||
CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
|
||||
CARD16 WhitePoint_y;
|
||||
CARD16 WhitePoint_Y;
|
||||
CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
|
||||
CARD16 RedChromaticity_y;
|
||||
CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
|
||||
CARD16 GreenChromaticity_y;
|
||||
CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
|
||||
CARD16 BlueChromaticity_y;
|
||||
CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
|
||||
CARD16 GreenGamma;
|
||||
CARD16 BlueGamma;
|
||||
CARD32 NumberOperationalLimits;
|
||||
CARD32 OffsetOperationalLimits;
|
||||
CARD32 NumberOptions; /* optinal sections (gamma table) */
|
||||
CARD32 OffsetOptions;
|
||||
CARD32 OffsetStringTable;
|
||||
} xf86VdifRec, *xf86VdifPtr;
|
||||
|
||||
typedef enum { /* Tags for section identification */
|
||||
VDIF_OPERATIONAL_LIMITS_TAG = 1,
|
||||
VDIF_PREADJUSTED_TIMING_TAG,
|
||||
VDIF_GAMMA_TABLE_TAG
|
||||
} VDIFScnTag;
|
||||
|
||||
typedef struct _VDIFScnHdr { /* Generic Section Header: */
|
||||
CARD32 ScnLength; /* lenght of section */
|
||||
CARD32 ScnTag; /* tag for section identification */
|
||||
} VDIFScnHdrRec, *VDIFScnHdrPtr;
|
||||
|
||||
typedef struct _VDIFLimits { /* Operational Limits: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD16 MaxHorPixel; /* pixels */
|
||||
CARD16 MaxVerPixel; /* lines */
|
||||
CARD16 MaxHorActiveLength; /* millimeters */
|
||||
CARD16 MaxVerActiveHeight; /* millimeters */
|
||||
CARD8 VideoType; /* TTL / Analog / ECL / DECL */
|
||||
CARD8 SyncType; /* TTL / Analog / ECL / DECL */
|
||||
CARD8 SyncConfiguration; /* separate / composite / other */
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD16 Reserved2; /* padding */
|
||||
CARD16 TerminationResistance; /* */
|
||||
CARD16 WhiteLevel; /* millivolts */
|
||||
CARD16 BlackLevel; /* millivolts */
|
||||
CARD16 BlankLevel; /* millivolts */
|
||||
CARD16 SyncLevel; /* millivolts */
|
||||
CARD32 MaxPixelClock; /* kiloHertz */
|
||||
CARD32 MinHorFrequency; /* Hertz */
|
||||
CARD32 MaxHorFrequency; /* Hertz */
|
||||
CARD32 MinVerFrequency; /* milliHertz */
|
||||
CARD32 MaxVerFrequency; /* milliHertz */
|
||||
CARD16 MinHorRetrace; /* nanoseconds */
|
||||
CARD16 MinVerRetrace; /* microseconds */
|
||||
CARD32 NumberPreadjustedTimings;
|
||||
CARD32 OffsetNextLimits;
|
||||
} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
|
||||
|
||||
typedef struct _VDIFTiming { /* Preadjusted Timing: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
|
||||
CARD16 HorPixel; /* pixels */
|
||||
CARD16 VerPixel; /* lines */
|
||||
CARD16 HorAddrLength; /* millimeters */
|
||||
CARD16 VerAddrHeight; /* millimeters */
|
||||
CARD8 PixelWidthRatio; /* gives H:V */
|
||||
CARD8 PixelHeightRatio;
|
||||
CARD8 Reserved1; /* padding */
|
||||
CARD8 ScanType; /* noninterlaced / interlaced / other*/
|
||||
CARD8 HorSyncPolarity; /* negative / positive */
|
||||
CARD8 VerSyncPolarity; /* negative / positive */
|
||||
CARD16 CharacterWidth; /* pixels */
|
||||
CARD32 PixelClock; /* kiloHertz */
|
||||
CARD32 HorFrequency; /* Hertz */
|
||||
CARD32 VerFrequency; /* milliHertz */
|
||||
CARD32 HorTotalTime; /* nanoseconds */
|
||||
CARD32 VerTotalTime; /* microseconds */
|
||||
CARD16 HorAddrTime; /* nanoseconds */
|
||||
CARD16 HorBlankStart; /* nanoseconds */
|
||||
CARD16 HorBlankTime; /* nanoseconds */
|
||||
CARD16 HorSyncStart; /* nanoseconds */
|
||||
CARD16 HorSyncTime; /* nanoseconds */
|
||||
CARD16 VerAddrTime; /* microseconds */
|
||||
CARD16 VerBlankStart; /* microseconds */
|
||||
CARD16 VerBlankTime; /* microseconds */
|
||||
CARD16 VerSyncStart; /* microseconds */
|
||||
CARD16 VerSyncTime; /* microseconds */
|
||||
} xf86VdifTimingRec, *xf86VdifTimingPtr;
|
||||
|
||||
typedef struct _VDIFGamma { /* Gamma Table: */
|
||||
VDIFScnHdrRec Header; /* common section info */
|
||||
CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
|
||||
CARD16 Unused1;
|
||||
} xf86VdifGammaRec, *xf86VdifGammaPtr;
|
||||
|
||||
/* access macros */
|
||||
#define VDIF_OPERATIONAL_LIMITS(vdif) \
|
||||
((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
|
||||
#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
|
||||
((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
|
||||
#define VDIF_PREADJUSTED_TIMING(limits) \
|
||||
((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
|
||||
#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
|
||||
((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
|
||||
#define VDIF_OPTIONS(vdif) \
|
||||
((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
|
||||
#define VDIF_NEXT_OPTIONS(options) options = \
|
||||
((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
|
||||
#define VDIF_STRING(vdif, string) \
|
||||
((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
|
||||
|
||||
typedef struct _vdif {
|
||||
xf86VdifPtr vdif;
|
||||
xf86VdifLimitsPtr *limits;
|
||||
xf86VdifTimingPtr *timings;
|
||||
xf86VdifGammaPtr *gamma;
|
||||
char * strings;
|
||||
} xf86vdif, *xf86vdifPtr;
|
||||
|
||||
#undef CARD32
|
||||
|
||||
#endif
|
|
@ -38,12 +38,6 @@ static unsigned char* EDID1Read_DDC2(
|
|||
I2CBusPtr pBus
|
||||
);
|
||||
|
||||
static unsigned char * VDIFRead(
|
||||
int scrnIndex,
|
||||
I2CBusPtr pBus,
|
||||
int start
|
||||
);
|
||||
|
||||
static unsigned char * DDCRead_DDC2(
|
||||
int scrnIndex,
|
||||
I2CBusPtr pBus,
|
||||
|
@ -138,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||
unsigned char *EDID_block = NULL;
|
||||
unsigned char *VDIF_Block = NULL;
|
||||
xf86MonPtr tmp = NULL;
|
||||
/* Default DDC and DDC2 to enabled. */
|
||||
Bool noddc = FALSE, noddc2 = FALSE;
|
||||
|
@ -171,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
else
|
||||
ErrorF("Sections to follow: %i\n",tmp->no_sections);
|
||||
#endif
|
||||
if (tmp) {
|
||||
VDIF_Block =
|
||||
VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
|
||||
tmp->vdif = xf86InterpretVdif(VDIF_Block);
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
@ -253,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
|
|||
return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN);
|
||||
}
|
||||
|
||||
static unsigned char*
|
||||
VDIFRead(int scrnIndex, I2CBusPtr pBus, int start)
|
||||
{
|
||||
unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL;
|
||||
int i, num = 0;
|
||||
|
||||
/* read VDIF length in 64 byte blocks */
|
||||
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
|
||||
if (Buffer == NULL)
|
||||
return NULL;
|
||||
#ifdef DEBUG
|
||||
ErrorF("number of 64 bit blocks: %i\n",Buffer[0]);
|
||||
#endif
|
||||
if ((num = Buffer[0]) > 0)
|
||||
v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
|
||||
if (Buffer == NULL) {
|
||||
xfree (v_buffer);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */
|
||||
xfree(Buffer);
|
||||
v_bufferp += 63;
|
||||
}
|
||||
return v_buffer;
|
||||
}
|
||||
|
||||
static unsigned char *
|
||||
DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
|
||||
{
|
||||
|
|
|
@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID(
|
|||
int screenIndex, Uchar *block
|
||||
);
|
||||
|
||||
extern xf86vdifPtr xf86InterpretVdif(
|
||||
CARD8 *c
|
||||
);
|
||||
|
||||
extern void
|
||||
xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
|
||||
|
||||
|
@ -55,10 +51,6 @@ extern Bool xf86SetDDCproperties(
|
|||
xf86MonPtr DDC
|
||||
);
|
||||
|
||||
extern void xf86print_vdif(
|
||||
xf86vdifPtr v
|
||||
);
|
||||
|
||||
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -45,9 +45,6 @@ fontsmodule_LTLIBRARIES = libfreetype.la \
|
|||
|
||||
AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
|
||||
INCLUDES = @XORG_INCS@ \
|
||||
-I$(top_srcdir)/afb \
|
||||
-I$(top_srcdir)/cfb \
|
||||
-I$(top_srcdir)/mfb \
|
||||
-I$(top_srcdir)/dbe \
|
||||
-I$(top_srcdir)/hw/xfree86/loader \
|
||||
-I$(top_srcdir)/miext/shadow \
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#endif
|
||||
|
||||
#include "xf86Module.h"
|
||||
#include "afb.h"
|
||||
|
||||
static MODULESETUPPROTO(afbSetup);
|
||||
|
||||
|
|
|
@ -28,10 +28,7 @@
|
|||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#define PSZ 32
|
||||
|
||||
#include "xf86Module.h"
|
||||
#include "cfb.h"
|
||||
|
||||
static MODULESETUPPROTO(cfb32Setup);
|
||||
|
||||
|
|
|
@ -28,10 +28,7 @@
|
|||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#define PSZ 8
|
||||
|
||||
#include "xf86Module.h"
|
||||
#include "cfb.h"
|
||||
|
||||
static MODULESETUPPROTO(cfbSetup);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1519,13 +1519,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
|
|||
if (x1 > pScreen->width) x1 = pScreen->width;
|
||||
if (y1 > pScreen->height) y1 = pScreen->height;
|
||||
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
if (y0 >= y1 || x0 >= x1) {
|
||||
*numBackClipRects = 0;
|
||||
*pBackClipRects = NULL;
|
||||
} else {
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
}
|
||||
} else {
|
||||
/* Use the frontbuffer cliprects for back buffers. */
|
||||
*numBackClipRects = 0;
|
||||
|
@ -1864,11 +1869,15 @@ DRITreeTraversal(WindowPtr pWin, pointer data)
|
|||
if(pDRIDrawablePriv) {
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||
RegionPtr reg = (RegionPtr)data;
|
||||
|
||||
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
|
||||
if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) {
|
||||
RegionPtr reg = (RegionPtr)data;
|
||||
|
||||
if(pDRIPriv->nrWindows == 1)
|
||||
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
|
||||
pDRIPriv->nrWalked++;
|
||||
}
|
||||
|
||||
if(pDRIPriv->nrWindows == pDRIPriv->nrWalked)
|
||||
return WT_STOPWALKING;
|
||||
}
|
||||
return WT_WALKCHILDREN;
|
||||
|
@ -1886,6 +1895,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|||
RegionRec reg;
|
||||
|
||||
REGION_NULL(pScreen, ®);
|
||||
pDRIPriv->nrWalked = 0;
|
||||
TraverseTree(pWin, DRITreeTraversal, (pointer)(®));
|
||||
|
||||
if(REGION_NOTEMPTY(pScreen, ®)) {
|
||||
|
@ -2211,6 +2221,19 @@ DRIGetContext(ScreenPtr pScreen)
|
|||
return pDRIPriv->myContext;
|
||||
}
|
||||
|
||||
void
|
||||
DRIGetTexOffsetFuncs(ScreenPtr pScreen,
|
||||
DRITexOffsetStartProcPtr *texOffsetStartFunc,
|
||||
DRITexOffsetFinishProcPtr *texOffsetFinishFunc)
|
||||
{
|
||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||
|
||||
if (!pDRIPriv) return;
|
||||
|
||||
*texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart;
|
||||
*texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish;
|
||||
}
|
||||
|
||||
/* This lets get at the unwrapped functions so that they can correctly
|
||||
* call the lowerlevel functions, and choose whether they will be
|
||||
* called at every level of recursion (eg in validatetree).
|
||||
|
|
|
@ -107,9 +107,12 @@ typedef struct {
|
|||
*/
|
||||
|
||||
#define DRIINFO_MAJOR_VERSION 5
|
||||
#define DRIINFO_MINOR_VERSION 2
|
||||
#define DRIINFO_MINOR_VERSION 3
|
||||
#define DRIINFO_PATCH_VERSION 0
|
||||
|
||||
typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix);
|
||||
typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix);
|
||||
|
||||
typedef struct {
|
||||
/* driver call back functions
|
||||
*
|
||||
|
@ -180,6 +183,10 @@ typedef struct {
|
|||
/* New with DRI version 5.2.0 */
|
||||
Bool allocSarea;
|
||||
Bool keepFDOpen;
|
||||
|
||||
/* New with DRI version 5.3.0 */
|
||||
DRITexOffsetStartProcPtr texOffsetStart;
|
||||
DRITexOffsetFinishProcPtr texOffsetFinish;
|
||||
} DRIInfoRec, *DRIInfoPtr;
|
||||
|
||||
|
||||
|
@ -358,7 +365,9 @@ extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
|
|||
|
||||
extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
|
||||
|
||||
|
||||
extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
|
||||
DRITexOffsetStartProcPtr *texOffsetStartFunc,
|
||||
DRITexOffsetFinishProcPtr *texOffsetFinishFunc);
|
||||
|
||||
#define _DRI_H_
|
||||
|
||||
|
|
|
@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|||
drmSetServerInfo(&DRIDRMServerInfo);
|
||||
|
||||
/* Need a non-NULL return value to indicate success */
|
||||
return 1;
|
||||
return (pointer)1;
|
||||
}
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ ProcXF86DRIGetDrawableInfo(
|
|||
xXF86DRIGetDrawableInfoReply rep;
|
||||
DrawablePtr pDrawable;
|
||||
int X, Y, W, H;
|
||||
drm_clip_rect_t * pClipRects;
|
||||
drm_clip_rect_t * pClipRects, *pClippedRects;
|
||||
drm_clip_rect_t * pBackClipRects;
|
||||
int backX, backY, rc;
|
||||
|
||||
|
@ -502,8 +502,35 @@ ProcXF86DRIGetDrawableInfo(
|
|||
if (rep.numBackClipRects)
|
||||
rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects;
|
||||
|
||||
if (rep.numClipRects)
|
||||
pClippedRects = pClipRects;
|
||||
|
||||
if (rep.numClipRects) {
|
||||
/* Clip cliprects to screen dimensions (redirected windows) */
|
||||
pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t));
|
||||
|
||||
if (pClippedRects) {
|
||||
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
|
||||
int i, j;
|
||||
|
||||
for (i = 0, j = 0; i < rep.numClipRects; i++) {
|
||||
pClippedRects[j].x1 = max(pClipRects[i].x1, 0);
|
||||
pClippedRects[j].y1 = max(pClipRects[i].y1, 0);
|
||||
pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width);
|
||||
pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height);
|
||||
|
||||
if (pClippedRects[j].x1 < pClippedRects[j].x2 &&
|
||||
pClippedRects[j].y1 < pClippedRects[j].y2) {
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
rep.numClipRects = j;
|
||||
} else {
|
||||
rep.numClipRects = 0;
|
||||
}
|
||||
|
||||
rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
|
||||
}
|
||||
|
||||
rep.length = ((rep.length + 3) & ~3) >> 2;
|
||||
|
||||
|
@ -512,7 +539,8 @@ ProcXF86DRIGetDrawableInfo(
|
|||
if (rep.numClipRects) {
|
||||
WriteToClient(client,
|
||||
sizeof(drm_clip_rect_t) * rep.numClipRects,
|
||||
(char *)pClipRects);
|
||||
(char *)pClippedRects);
|
||||
xfree(pClippedRects);
|
||||
}
|
||||
|
||||
if (rep.numBackClipRects) {
|
||||
|
|
|
@ -96,6 +96,11 @@
|
|||
#endif
|
||||
#include "xf86DDC.h"
|
||||
#include "edid.h"
|
||||
#include "xf86Cursor.h"
|
||||
#include "xf86RamDac.h"
|
||||
#include "BT.h"
|
||||
#include "IBM.h"
|
||||
#include "TI.h"
|
||||
|
||||
#include "xf86RamDac.h"
|
||||
#include "BT.h"
|
||||
|
@ -1234,8 +1239,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
|||
SYMFUNC(xf86DoEDID_DDC2)
|
||||
SYMFUNC(xf86InterpretEDID)
|
||||
SYMFUNC(xf86PrintEDID)
|
||||
SYMFUNC(xf86InterpretVdif)
|
||||
SYMFUNC(xf86print_vdif)
|
||||
SYMFUNC(xf86DDCMonitorSet)
|
||||
SYMFUNC(xf86SetDDCproperties)
|
||||
|
||||
|
@ -1259,13 +1262,49 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
|||
SYMFUNC(xf86I2CWriteVec)
|
||||
SYMFUNC(xf86I2CWriteWord)
|
||||
|
||||
/* ramdac */
|
||||
SYMFUNC(RamDacInit)
|
||||
/* ramdac/xf86RamDac.c */
|
||||
SYMFUNC(RamDacCreateInfoRec)
|
||||
SYMFUNC(RamDacDestroyInfoRec)
|
||||
SYMFUNC(RamDacHelperCreateInfoRec)
|
||||
SYMFUNC(RamDacFreeRec)
|
||||
SYMFUNC(RamDacDestroyInfoRec)
|
||||
SYMFUNC(RamDacHelperDestroyInfoRec)
|
||||
SYMFUNC(RamDacInit)
|
||||
SYMFUNC(RamDacHandleColormaps)
|
||||
SYMFUNC(RamDacFreeRec)
|
||||
SYMFUNC(RamDacGetHWIndex)
|
||||
SYMVAR(RamDacHWPrivateIndex)
|
||||
SYMVAR(RamDacScreenPrivateIndex)
|
||||
|
||||
/* ramdac/xf86Cursor.c */
|
||||
SYMFUNC(xf86InitCursor)
|
||||
SYMFUNC(xf86CreateCursorInfoRec)
|
||||
SYMFUNC(xf86DestroyCursorInfoRec)
|
||||
SYMFUNC(xf86ForceHWCursor)
|
||||
|
||||
/* ramdac/BT.c */
|
||||
SYMFUNC(BTramdacProbe)
|
||||
SYMFUNC(BTramdacSave)
|
||||
SYMFUNC(BTramdacRestore)
|
||||
SYMFUNC(BTramdacSetBpp)
|
||||
|
||||
/* ramdac/IBM.c */
|
||||
SYMFUNC(IBMramdacProbe)
|
||||
SYMFUNC(IBMramdacSave)
|
||||
SYMFUNC(IBMramdacRestore)
|
||||
SYMFUNC(IBMramdac526SetBpp)
|
||||
SYMFUNC(IBMramdac640SetBpp)
|
||||
SYMFUNC(IBMramdac526CalculateMNPCForClock)
|
||||
SYMFUNC(IBMramdac640CalculateMNPCForClock)
|
||||
SYMFUNC(IBMramdac526HWCursorInit)
|
||||
SYMFUNC(IBMramdac640HWCursorInit)
|
||||
SYMFUNC(IBMramdac526SetBppWeak)
|
||||
|
||||
/* ramdac/TI.c */
|
||||
SYMFUNC(TIramdacCalculateMNPForClock)
|
||||
SYMFUNC(TIramdacProbe)
|
||||
SYMFUNC(TIramdacSave)
|
||||
SYMFUNC(TIramdacRestore)
|
||||
SYMFUNC(TIramdac3026SetBpp)
|
||||
SYMFUNC(TIramdac3030SetBpp)
|
||||
SYMFUNC(TIramdacHWCursorInit)
|
||||
SYMFUNC(TIramdacLoadPalette)
|
||||
};
|
||||
|
|
|
@ -1217,8 +1217,15 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
|
|||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
int o;
|
||||
|
||||
if (maxX == 0 || maxY == 0)
|
||||
xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY);
|
||||
/* When canGrow was TRUE in the initial configuration we have to
|
||||
* compare against the maximum values so that we don't drop modes.
|
||||
* When canGrow was FALSE, the maximum values would have been clamped
|
||||
* anyway.
|
||||
*/
|
||||
if (maxX == 0 || maxY == 0) {
|
||||
maxX = config->maxWidth;
|
||||
maxY = config->maxHeight;
|
||||
}
|
||||
|
||||
/* Elide duplicate modes before defaulting code uses them */
|
||||
xf86PruneDuplicateMonitorModes (scrn->monitor);
|
||||
|
@ -1723,8 +1730,26 @@ Bool
|
|||
xf86SetDesiredModes (ScrnInfoPtr scrn)
|
||||
{
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||
int c;
|
||||
int c, o;
|
||||
|
||||
/*
|
||||
* Turn off everything so mode setting is done
|
||||
* with hardware in a consistent state
|
||||
*/
|
||||
for (o = 0; o < config->num_output; o++)
|
||||
{
|
||||
xf86OutputPtr output = config->output[o];
|
||||
(*output->funcs->dpms)(output, DPMSModeOff);
|
||||
}
|
||||
|
||||
for (c = 0; c < config->num_crtc; c++)
|
||||
{
|
||||
xf86CrtcPtr crtc = config->crtc[c];
|
||||
|
||||
crtc->funcs->dpms(crtc, DPMSModeOff);
|
||||
memset(&crtc->mode, 0, sizeof(crtc->mode));
|
||||
}
|
||||
|
||||
for (c = 0; c < config->num_crtc; c++)
|
||||
{
|
||||
xf86CrtcPtr crtc = config->crtc[c];
|
||||
|
|
|
@ -562,6 +562,10 @@ typedef struct _xf86CrtcConfig {
|
|||
OptionInfoPtr options;
|
||||
|
||||
Bool debug_modes;
|
||||
|
||||
/* wrap screen BlockHandler for rotation */
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
|
||||
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
|
||||
|
||||
extern int xf86CrtcConfigPrivateIndex;
|
||||
|
|
|
@ -71,7 +71,11 @@ static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC)
|
|||
if (memcmp (DDC->vendor.name, "VSC", 4) == 0 &&
|
||||
DDC->vendor.prod_id == 58653)
|
||||
return TRUE;
|
||||
|
||||
/* Samsung SyncMaster 205BW */
|
||||
if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
|
||||
DDC->vendor.prod_id == 541)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static Bool
|
||||
xf86RotateRedisplay(ScreenPtr pScreen)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
|
@ -273,7 +273,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
|
|||
RegionPtr region;
|
||||
|
||||
if (!damage)
|
||||
return;
|
||||
return FALSE;
|
||||
xf86RotatePrepare (pScreen);
|
||||
region = DamageRegion(damage);
|
||||
if (REGION_NOTEMPTY(pScreen, region))
|
||||
|
@ -317,19 +317,25 @@ xf86RotateRedisplay(ScreenPtr pScreen)
|
|||
pScreen->SourceValidate = SourceValidate;
|
||||
DamageEmpty(damage);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
xf86RotateBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead)
|
||||
xf86RotateBlockHandler(int screenNum, pointer blockData,
|
||||
pointer pTimeout, pointer pReadmask)
|
||||
{
|
||||
ScreenPtr pScreen = (ScreenPtr) data;
|
||||
ScreenPtr pScreen = screenInfo.screens[screenNum];
|
||||
ScrnInfoPtr pScrn = xf86Screens[screenNum];
|
||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
|
||||
xf86RotateRedisplay(pScreen);
|
||||
}
|
||||
|
||||
static void
|
||||
xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask)
|
||||
{
|
||||
pScreen->BlockHandler = xf86_config->BlockHandler;
|
||||
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
|
||||
if (xf86RotateRedisplay(pScreen))
|
||||
{
|
||||
/* Re-wrap if rotation is still happening */
|
||||
xf86_config->BlockHandler = pScreen->BlockHandler;
|
||||
pScreen->BlockHandler = xf86RotateBlockHandler;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -367,10 +373,6 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
|
|||
}
|
||||
DamageDestroy (xf86_config->rotation_damage);
|
||||
xf86_config->rotation_damage = NULL;
|
||||
/* Free block/wakeup handler */
|
||||
RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
|
||||
xf86RotateWakeupHandler,
|
||||
(pointer) pScreen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -440,20 +442,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
|
|||
if (!xf86_config->rotation_damage)
|
||||
goto bail2;
|
||||
|
||||
/* Assign block/wakeup handler */
|
||||
if (!RegisterBlockAndWakeupHandlers (xf86RotateBlockHandler,
|
||||
xf86RotateWakeupHandler,
|
||||
(pointer) pScreen))
|
||||
{
|
||||
goto bail3;
|
||||
}
|
||||
/* Wrap block handler */
|
||||
xf86_config->BlockHandler = pScreen->BlockHandler;
|
||||
pScreen->BlockHandler = xf86RotateBlockHandler;
|
||||
}
|
||||
if (0)
|
||||
{
|
||||
bail3:
|
||||
DamageDestroy (xf86_config->rotation_damage);
|
||||
xf86_config->rotation_damage = NULL;
|
||||
|
||||
bail2:
|
||||
if (shadow || shadowData)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
|
||||
#if defined (SYSCONS_SUPPORT)
|
||||
#include <sys/kbio.h>
|
||||
#endif
|
||||
|
||||
|
@ -77,7 +77,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
|
|||
wsb.pitch = pitch;
|
||||
wsb.period = duration;
|
||||
wsb.volume = loudness;
|
||||
ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL,
|
||||
ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL,
|
||||
&wsb);
|
||||
break;
|
||||
#endif
|
||||
|
|
|
@ -50,6 +50,11 @@
|
|||
#include <machine/mtrr.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <sys/queue.h>
|
||||
#ifdef __x86_64__
|
||||
#define i386_set_mtrr x86_64_set_mtrr
|
||||
#define i386_get_mtrr x86_64_get_mtrr
|
||||
#define i386_iopl x86_64_iopl
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__) && defined(__amd64__)
|
||||
|
|
|
@ -327,7 +327,7 @@
|
|||
# define INCLUDE_XF86_MAP_PCI_MEM
|
||||
# define INCLUDE_XF86_NO_DOMAIN
|
||||
# endif
|
||||
# if !defined(__FreeBSD__)
|
||||
# if !defined(__FreeBSD__) && !defined(linux)
|
||||
# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
|
||||
# endif
|
||||
#elif defined(__amd64__) || defined(__amd64)
|
||||
|
|
|
@ -788,8 +788,10 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
|
|||
write(fd, "1", 2);
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
||||
len = min(Len, st.st_size);
|
||||
|
||||
/* copy the ROM until we hit Len, EOF or read error */
|
||||
for (i = 0; i < Len && read(fd, Buf, 1) > 0; Buf++, i++)
|
||||
for (; len && (size = read(fd, Buf, len)) > 0 ; Buf+=size, len-=size)
|
||||
;
|
||||
|
||||
write(fd, "0", 2);
|
||||
|
|
|
@ -117,49 +117,29 @@ xf86LinearVidMem()
|
|||
/**************************************************************************
|
||||
* I/O Permissions section
|
||||
***************************************************************************/
|
||||
mach_port_t io_port;
|
||||
|
||||
/*
|
||||
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
|
||||
* this.
|
||||
*/
|
||||
extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
|
||||
|
||||
Bool
|
||||
xf86EnableIO()
|
||||
{
|
||||
mach_port_t device;
|
||||
kern_return_t err;
|
||||
|
||||
err = get_privileged_ports(NULL, &device);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't get_privileged_ports. (%s)\n",strerror(errno));
|
||||
}
|
||||
err = device_open(device,D_READ|D_WRITE,"io",&io_port);
|
||||
mach_port_deallocate(mach_task_self(), device);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno));
|
||||
}
|
||||
|
||||
err = i386_io_port_add(mach_thread_self (), io_port);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) (%s)\n",strerror(errno));
|
||||
if (ioperm(0, 0xffff, 1)) {
|
||||
FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
ioperm(0x40,4,0); /* trap access to the timer chip */
|
||||
ioperm(0x60,4,0); /* trap access to the keyboard controller */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xf86DisableIO()
|
||||
{
|
||||
kern_return_t err;
|
||||
|
||||
err = i386_io_port_remove(mach_thread_self (), io_port);
|
||||
if( err )
|
||||
{
|
||||
errno = err;
|
||||
FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) (%s)\n",strerror(errno));
|
||||
}
|
||||
mach_port_deallocate(mach_task_self(), io_port);
|
||||
ioperm(0,0xffff,0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,8 @@ static Bool ExtendedEnabled = FALSE;
|
|||
#elif !defined(__powerpc__) && \
|
||||
!defined(__mc68000__) && \
|
||||
!defined(__sparc__) && \
|
||||
!defined(__mips__)
|
||||
!defined(__mips__) && \
|
||||
!defined(__arm__)
|
||||
|
||||
/*
|
||||
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
|
||||
|
@ -567,7 +568,7 @@ xf86EnableIO(void)
|
|||
#endif
|
||||
}
|
||||
close(fd);
|
||||
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
|
||||
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__)
|
||||
if (ioperm(0, 1024, 1) || iopl(3)) {
|
||||
if (errno == ENODEV)
|
||||
ErrorF("xf86EnableIOPorts: no I/O ports found\n");
|
||||
|
@ -603,73 +604,21 @@ xf86DisableIO(void)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Interrupt Handling section */
|
||||
/***************************************************************************/
|
||||
|
||||
/* XXX The #ifdefs should be made simpler. */
|
||||
/*
|
||||
* Don't use these two functions. They can't possibly work. If you actually
|
||||
* need interrupts off for something, you ought to be doing it in the kernel
|
||||
* anyway.
|
||||
*/
|
||||
|
||||
_X_EXPORT Bool
|
||||
xf86DisableInterrupts()
|
||||
{
|
||||
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
|
||||
if (!ExtendedEnabled)
|
||||
if (iopl(3) || ioperm(0, 1024, 1))
|
||||
return (FALSE);
|
||||
#endif
|
||||
#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# if defined(__ia64__)
|
||||
# if 0
|
||||
__asm__ __volatile__ (";; rsm psr.i;; srlz.d" ::: "memory");
|
||||
# endif
|
||||
# else
|
||||
__asm__ __volatile__("cli");
|
||||
# endif
|
||||
# else
|
||||
asm("cli");
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
|
||||
if (!ExtendedEnabled) {
|
||||
iopl(0);
|
||||
ioperm(0, 1024, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
xf86EnableInterrupts()
|
||||
{
|
||||
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
|
||||
if (!ExtendedEnabled)
|
||||
if (iopl(3) || ioperm(0, 1024, 1))
|
||||
return;
|
||||
#endif
|
||||
#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# if defined(__ia64__)
|
||||
# if 0
|
||||
__asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory");
|
||||
# endif
|
||||
# else
|
||||
__asm__ __volatile__("sti");
|
||||
# endif
|
||||
# else
|
||||
asm("sti");
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
|
||||
if (!ExtendedEnabled) {
|
||||
iopl(0);
|
||||
ioperm(0, 1024, 0);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
|
|||
#if !defined(__sparc__) && \
|
||||
!defined(__powerpc__) && \
|
||||
!defined(__mips__) && \
|
||||
!defined(__ia64__)
|
||||
!defined(__ia64__) && \
|
||||
!defined(__arm__)
|
||||
outb(0x80, 0x00);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ static xf86ConfigSymTabRec ModuleTab[] =
|
|||
{
|
||||
{ENDSECTION, "endsection"},
|
||||
{LOAD, "load"},
|
||||
{DISABLE, "disable"},
|
||||
{LOAD_DRIVER, "loaddriver"},
|
||||
{SUBSECTION, "subsection"},
|
||||
{-1, ""},
|
||||
|
@ -141,6 +142,13 @@ xf86parseModuleSection (void)
|
|||
xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
|
||||
XF86_LOAD_MODULE, NULL);
|
||||
break;
|
||||
case DISABLE:
|
||||
if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
|
||||
Error (QUOTE_MSG, "Disable");
|
||||
ptr->mod_disable_lst =
|
||||
xf86addNewLoadDirective (ptr->mod_disable_lst, val.str,
|
||||
XF86_DISABLE_MODULE, NULL);
|
||||
break;
|
||||
case LOAD_DRIVER:
|
||||
if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
|
||||
Error (QUOTE_MSG, "LoadDriver");
|
||||
|
@ -257,6 +265,15 @@ xf86freeModules (XF86ConfModulePtr ptr)
|
|||
lptr = lptr->list.next;
|
||||
xf86conffree (prev);
|
||||
}
|
||||
lptr = ptr->mod_disable_lst;
|
||||
while (lptr)
|
||||
{
|
||||
TestFree (lptr->load_name);
|
||||
TestFree (lptr->load_comment);
|
||||
prev = lptr;
|
||||
lptr = lptr->list.next;
|
||||
xf86conffree (prev);
|
||||
}
|
||||
TestFree (ptr->mod_comment);
|
||||
xf86conffree (ptr);
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ XF86ConfFilesRec, *XF86ConfFilesPtr;
|
|||
/* Values for load_type */
|
||||
#define XF86_LOAD_MODULE 0
|
||||
#define XF86_LOAD_DRIVER 1
|
||||
#define XF86_DISABLE_MODULE 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -97,6 +98,7 @@ XF86LoadRec, *XF86LoadPtr;
|
|||
typedef struct
|
||||
{
|
||||
XF86LoadPtr mod_load_lst;
|
||||
XF86LoadPtr mod_disable_lst;
|
||||
char *mod_comment;
|
||||
}
|
||||
XF86ConfModuleRec, *XF86ConfModulePtr;
|
||||
|
|
|
@ -170,6 +170,7 @@ typedef enum {
|
|||
/* Module tokens */
|
||||
LOAD,
|
||||
LOAD_DRIVER,
|
||||
DISABLE,
|
||||
|
||||
/* Device tokens */
|
||||
DRIVER,
|
||||
|
|
|
@ -32,10 +32,6 @@ Original mi code written by Keith Packard.
|
|||
#include "xaa.h"
|
||||
#include "xaalocal.h"
|
||||
|
||||
#ifdef ICEILTEMPDECL
|
||||
ICEILTEMPDECL
|
||||
#endif
|
||||
|
||||
#define DRAW_POINT(pScrn, x, y) \
|
||||
if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \
|
||||
else XAAPointHelper(pScrn, x, y)
|
||||
|
|
|
@ -177,7 +177,7 @@ xglCompositeGeneral (CARD8 op,
|
|||
{
|
||||
if (!pSrc->transform && pSrc->filter != PictFilterConvolution)
|
||||
{
|
||||
if (pSrc->pDrawable && pSrc->repeat == RepeatNormal)
|
||||
if (pSrc->pDrawable && pSrc->repeatType == RepeatNormal)
|
||||
{
|
||||
XGL_PIXMAP_PRIV ((PixmapPtr) pSrc->pDrawable);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $Xorg: Xnest.man,v 1.3 2000/08/17 19:53:28 cpqbld Exp $
|
||||
.\" Copyright (c) 1993, 1994 X Consortium
|
||||
.\"
|
||||
.\"
|
||||
.\" 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
|
||||
|
@ -8,10 +8,10 @@
|
|||
.\" distribute, sublicense, and/or sell copies of the Software, and to
|
||||
.\" permit persons to whom the Software is furnished to do so, subject to
|
||||
.\" the following conditions:
|
||||
.\"
|
||||
.\"
|
||||
.\" The above copyright notice and this permission notice shall be included
|
||||
.\" in all copies or substantial portions of the Software.
|
||||
.\"
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
|
@ -19,7 +19,7 @@
|
|||
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
.\" OTHER DEALINGS IN THE SOFTWARE.
|
||||
.\"
|
||||
.\"
|
||||
.\" Except as contained in this notice, the name of the X Consortium shall
|
||||
.\" not be used in advertising or otherwise to promote the sale, use or
|
||||
.\" other dealings in this Software without prior written authorization
|
||||
|
@ -27,238 +27,402 @@
|
|||
.\"
|
||||
.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $
|
||||
.\"
|
||||
.TH XNEST 1 __xorgversion__
|
||||
.TH Xnest __appmansuffix__ __xorgversion__
|
||||
.SH NAME
|
||||
Xnest \- a nested X server
|
||||
.SH SYNOPSIS
|
||||
.B Xnest
|
||||
[-options]
|
||||
[
|
||||
.I options
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
\fIXnest\fP is a client and a server. \fIXnest\fP is a client of the
|
||||
real server which manages windows and graphics requests on its behalf.
|
||||
\fIXnest\fP is a server to its own clients. \fIXnest\fP manages
|
||||
windows and graphics requests on their behalf. To these clients
|
||||
\fIXnest\fP appears to be a conventional server.
|
||||
.B Xnest
|
||||
is both an X client and an X server.
|
||||
.B Xnest
|
||||
is a client of the real server which manages windows and graphics requests on
|
||||
its behalf.
|
||||
.B Xnest
|
||||
is a server to its own clients.
|
||||
.B Xnest
|
||||
manages windows and graphics requests on their behalf.
|
||||
To these clients,
|
||||
.B Xnest
|
||||
appears to be a conventional server.
|
||||
.SH OPTIONS
|
||||
\fIXnest\fP supports all standard options of the sample server
|
||||
implementation. For more details, please see the manual page on your
|
||||
system for \fIXserver\fP. The following additional arguments are
|
||||
supported as well.
|
||||
.TP 4
|
||||
.B \-display \fIstring\fP
|
||||
.B Xnest
|
||||
supports all standard options of the sample server implementation.
|
||||
For more details, please see
|
||||
.BR Xserver (__appmansuffix__).
|
||||
The following additional arguments are supported as well.
|
||||
.TP
|
||||
.BI "\-display " string
|
||||
This option specifies the display name of the real server that
|
||||
\fIXnest\fP should try to connect with. If it is not provided on the
|
||||
command line \fIXnest\fP will read the \fIDISPLAY\fP environment
|
||||
variable in order to find out the same information.
|
||||
.TP 4
|
||||
.B Xnest
|
||||
should try to connect to.
|
||||
If it is not provided on the command line,
|
||||
.B Xnest
|
||||
will read the
|
||||
.I DISPLAY
|
||||
environment variable in order to find out this information.
|
||||
.TP
|
||||
.B \-sync
|
||||
This option tells \fIXnest\fP to synchronize its window and graphics
|
||||
operations with the real server. This is a useful option for
|
||||
debugging, but it will slow down the performance considerably. It
|
||||
should not be used unless absolutely necessary.
|
||||
.TP 4
|
||||
This option tells
|
||||
.B Xnest
|
||||
to synchronize its window and graphics operations with the real server.
|
||||
This is a useful option for debugging, but it will slow down
|
||||
.BR Xnest 's
|
||||
performance considerably.
|
||||
It should not be used unless absolutely necessary.
|
||||
.TP
|
||||
.B \-full
|
||||
This option tells \fIXnest\fP to utilize full regeneration of real
|
||||
server objects and reopen a new connection to the real server each
|
||||
time the nested server regenerates. The sample server implementation
|
||||
regenerates all objects in the server when the last client of this
|
||||
server terminates. When this happens, \fIXnest\fP by default
|
||||
maintains the same top level window and the same real server
|
||||
connection in each new generation. If the user selects full
|
||||
regeneration, even the top level window and the connection to the real
|
||||
server will be regenerated for each server generation.
|
||||
.TP 4
|
||||
.B \-class \fIstring\fP
|
||||
This option tells
|
||||
.B Xnest
|
||||
to utilize full regeneration of real server objects and reopen a new connection
|
||||
to the real server each time the nested server regenerates.
|
||||
The sample server implementation regenerates all objects in the server when the
|
||||
last client of this server terminates.
|
||||
When this happens,
|
||||
.B Xnest
|
||||
by default maintains the same top-level window and the same real server
|
||||
connection in each new generation.
|
||||
If the user selects full regeneration, even the top-level window and the
|
||||
connection to the real server will be regenerated for each server generation.
|
||||
.TP
|
||||
.BI "\-class " string
|
||||
This option specifies the default visual class of the nested server.
|
||||
It is similar to the \fI-cc\fP option from the set of standard options
|
||||
except that it will accept a string rather than a number for the
|
||||
visual class specification. The string must be one of the following
|
||||
six values: \fIStaticGray\fP, \fIGrayScale\fP, \fIStaticColor\fP,
|
||||
\fIPseudoColor\fP, \fITrueColor\fP, or \fIDirectColor\fP. If both,
|
||||
\fI-class\fP and \fI-cc\fP options are specified, the last instance of
|
||||
either option assumes precedence. The class of the default visual of
|
||||
the nested server need not be the same as the class of the default
|
||||
visual of the real server; although, it has to be supported by the
|
||||
real server. See \fIxdpyinfo\fP for a list of supported visual
|
||||
classes on the real server before starting \fIXnest\fP. If the user
|
||||
chooses a static class, all the colors in the default colormap will be
|
||||
preallocated. If the user chooses a dynamic class, colors in the
|
||||
default colormap will be available to individual clients for
|
||||
allocation.
|
||||
.TP 4
|
||||
.B \-depth \fIint\fP
|
||||
It is similar to the
|
||||
.B \-cc
|
||||
option from the set of standard options except that it will accept a string
|
||||
rather than a number for the visual class specification.
|
||||
The
|
||||
.I string
|
||||
must be one of the following six values:
|
||||
.BR StaticGray ,
|
||||
.BR GrayScale ,
|
||||
.BR StaticColor ,
|
||||
.BR PseudoColor ,
|
||||
.BR TrueColor ,
|
||||
or
|
||||
.BR DirectColor .
|
||||
If both the
|
||||
.B \-class
|
||||
and
|
||||
.B \-cc
|
||||
options are specified, the last instance of either option takes precedence.
|
||||
The class of the default visual of the nested server need not be the same as the
|
||||
class of the default visual of the real server, but it must be supported by the
|
||||
real server.
|
||||
Use
|
||||
.BR xdpyinfo (__appmansuffix__)
|
||||
to obtain a list of supported visual classes on the real server before starting
|
||||
.BR Xnest .
|
||||
If the user chooses a static class, all the colors in the default color map will
|
||||
be preallocated.
|
||||
If the user chooses a dynamic class, colors in the default color map will be
|
||||
available to individual clients for allocation.
|
||||
.TP
|
||||
.BI "\-depth " int
|
||||
This option specifies the default visual depth of the nested server.
|
||||
The depth of the default visual of the nested server need not be the
|
||||
same as the depth of the default visual of the real server; although,
|
||||
it has to be supported by the real server. See \fIxdpyinfo\fP for a
|
||||
list of supported visual depths on the real server before starting
|
||||
\fIXnest\fP.
|
||||
.TP 4
|
||||
The depth of the default visual of the nested server need not be the same as the
|
||||
depth of the default visual of the real server, but it must be supported by the
|
||||
real server.
|
||||
Use
|
||||
.BR xdpyinfo (__appmansuffix__)
|
||||
to obtain a list of supported visual depths on the real server before starting
|
||||
.BR Xnest .
|
||||
.TP
|
||||
.B \-sss
|
||||
This option tells \fIXnest\fP to use the software screen saver. By
|
||||
default \fIXnest\fP will use the screen saver that corresponds to the
|
||||
hardware screen saver in the real server. Of course, even this screen
|
||||
saver is software generated since \fIXnest\fP does not control any
|
||||
actual hardware. However, it is treated as a hardware screen saver
|
||||
within the sample server code.
|
||||
.TP 4
|
||||
.B \-geometry \fIWxH+X+Y\fP
|
||||
This option specifies geometry parameters for the top level
|
||||
\fIXnest\fP windows. These windows corresponds to the root windows of
|
||||
the nested server. The width and height specified with this option
|
||||
will be the maximum width and height of each top level \fIXnest\fP
|
||||
window. \fIXnest\fP will allow the user to make any top level window
|
||||
smaller, but it will not actually change the size of the nested server
|
||||
root window. As of yet, there is no mechanism within the sample
|
||||
server implementation to change the size of the root window after
|
||||
screen initialization. In order to do so, one would probably need to
|
||||
extend the X protocol. Therefore, it is not likely that this will be
|
||||
available any time soon. If this option is not specified \fIXnest\fP
|
||||
will choose width and height to be 3/4 of the dimensions of the root
|
||||
window of the real server.
|
||||
.TP 4
|
||||
.B \-bw \fIint\fP
|
||||
This option specifies the border width of the top level \fIXnest\fP
|
||||
window. The integer parameter must be a positive number. The default
|
||||
border width is 1.
|
||||
.TP 4
|
||||
.B \-name \fIstring\fP
|
||||
This option specifies the name of the top level \fIXnest\fP window.
|
||||
This option tells
|
||||
.B Xnest
|
||||
to use the software screen saver.
|
||||
By default,
|
||||
.B Xnest
|
||||
will use the screen saver that corresponds to the hardware screen saver in the
|
||||
real server.
|
||||
Of course, even this screen saver is software-generated since
|
||||
.B Xnest
|
||||
does not control any actual hardware.
|
||||
However, it is treated as a hardware screen saver within the sample server code.
|
||||
.TP
|
||||
.B \-geometry \fIW\fBx\fIH\fB+\fIX\fB+\fIY\fP
|
||||
This option specifies the geometry parameters for the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
See \(lqGEOMETRY SPECIFICATIONS\(rq in
|
||||
.BR X (__miscmansuffix__)
|
||||
for a discusson of this option's syntax.
|
||||
This window corresponds to the root window of the nested server.
|
||||
The width
|
||||
.I W
|
||||
and height
|
||||
.I H
|
||||
specified with this option will be the maximum width and height of each
|
||||
top-level
|
||||
.B Xnest
|
||||
window.
|
||||
.B Xnest
|
||||
will allow the user to make any top-level window smaller, but it will not
|
||||
actually change the size of the nested server root window.
|
||||
.B Xnest
|
||||
does not yet support the RANDR extension for resizing, rotation, and reflection
|
||||
of the root window.
|
||||
If this option is not specified,
|
||||
.B Xnest
|
||||
will choose
|
||||
.I W
|
||||
and
|
||||
.I H
|
||||
to be 3/4ths the dimensions of the root window of the real server.
|
||||
.TP
|
||||
.BI "\-bw " int
|
||||
This option specifies the border width of the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
The integer parameter
|
||||
.I int
|
||||
must be positive.
|
||||
The default border width is 1.
|
||||
.TP
|
||||
.BI "\-name " string
|
||||
This option specifies the name of the top-level
|
||||
.B Xnest
|
||||
window as
|
||||
.IR string .
|
||||
The default value is the program name.
|
||||
.TP 4
|
||||
.B \-scrns \fIint\fP
|
||||
This option specifies the number of screens to create in the nested
|
||||
server. For each screen, \fIXnest\fP will create a separate top level
|
||||
window. Each screen is referenced by the number after the dot in the
|
||||
client display name specification. For example, \fIxterm -display
|
||||
:1.1\fP will open an \fIxterm\fP client in the nested server with the
|
||||
display number \fI:1\fP on the second screen. The number of screens
|
||||
is limited by the hard coded constant in the server sample code which
|
||||
is usually 3.
|
||||
.TP 4
|
||||
.TP
|
||||
.BI "\-scrns " int
|
||||
This option specifies the number of screens to create in the nested server.
|
||||
For each screen,
|
||||
.B Xnest
|
||||
will create a separate top-level window.
|
||||
Each screen is referenced by the number after the dot in the client display name
|
||||
specification.
|
||||
For example,
|
||||
.B xterm \-display :1.1
|
||||
will open an
|
||||
.BR xterm (__appmansuffix__)
|
||||
client in the nested server with the display number
|
||||
.B :1
|
||||
on the second screen.
|
||||
The number of screens is limited by the hard-coded constant in the server sample
|
||||
code, which is usually 3.
|
||||
.TP
|
||||
.B \-install
|
||||
This option tells \fIXnest\fP to do its own colormap installation by
|
||||
bypassing the real window manager. For it to work properly the user
|
||||
will probably have to temporarily quit the real window manager. By
|
||||
default \fIXnest\fP will keep the nested client window whose colormap
|
||||
should be installed in the real server in the
|
||||
\fIWM\_COLORMAP\_WINDOWS\fP property of the top level \fIXnest\fP
|
||||
window. If this colormap is of the same visual type as the root
|
||||
window of the nested server, \fIXnest\fP will associate this colormap
|
||||
with the top level \fIXnest\fP window as well. Since this does not
|
||||
have to be the case, window managers should look primarily at the
|
||||
\fIWM\_COLORMAP\_WINDOWS\fP property rather than the colormap
|
||||
associated with the top level \fIXnest\fP window. Unfortunately,
|
||||
window managers are not very good at doing that yet so this option
|
||||
might come in handy.
|
||||
.TP 4
|
||||
.B \-parent \fIwindow_id\fP
|
||||
This option tells \fIXnest\fP to use the \fIwindow_id\fP as the
|
||||
root window instead of creating a window. This option is used
|
||||
by the xrx xnestplugin.
|
||||
.SH USAGE
|
||||
Starting up \fIXnest\fP is as simple as starting up \fIxclock\fP from
|
||||
a terminal emulator. If a user wishes to run \fIXnest\fP on the same
|
||||
workstation as the real server, it is important that the nested server
|
||||
is given its own listening socket address. Therefore, if there is a
|
||||
server already running on the user's workstation, \fIXnest\fP will
|
||||
have to be started up with a new display number. Since there is
|
||||
usually no more than one server running on a workstation, specifying
|
||||
\fIXnest :1\fP on the command line will be sufficient for most users.
|
||||
For each server running on the workstation the display number needs to
|
||||
be incremented by one. Thus, if you wish to start another
|
||||
\fIXnest\fP, you will need to type \fIXnest :2\fP on the command line.
|
||||
This option tells
|
||||
.B Xnest
|
||||
to do its own color map installation by bypassing the real window manager.
|
||||
For it to work properly, the user will probably have to temporarily quit the
|
||||
real window manager.
|
||||
By default,
|
||||
.B Xnest
|
||||
will keep the nested client window whose color map should be installed in the
|
||||
real server in the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property of the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
If this color map is of the same visual type as the root window of the nested
|
||||
server,
|
||||
.B Xnest
|
||||
will associate this color map with the top-level
|
||||
.B Xnest
|
||||
window as well.
|
||||
Since this does not have to be the case, window managers should look primarily
|
||||
at the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property rather than the color map associated with the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
.\" Is the following still true? This sentence is several years old.
|
||||
Unfortunately, window managers are not very good at doing that yet so this
|
||||
option might come in handy.
|
||||
.TP
|
||||
.BI "\-parent " window_id
|
||||
This option tells
|
||||
.B Xnest
|
||||
to use
|
||||
.I window_id
|
||||
as the root window instead of creating a window.
|
||||
.\" XRX is dead, dead, dead.
|
||||
.\" This option is used by the xrx xnestplugin.
|
||||
.SH "EXTENDED DESCRIPTION"
|
||||
Starting up
|
||||
.B Xnest
|
||||
is just as simple as starting up
|
||||
.BR xclock (__appmansuffix__)
|
||||
from a terminal emulator.
|
||||
If a user wishes to run
|
||||
.B Xnest
|
||||
on the same
|
||||
workstation as the real server, it is important that the nested server is given
|
||||
its own listening socket address.
|
||||
Therefore, if there is a server already running on the user's workstation,
|
||||
.B Xnest
|
||||
will have to be started up with a new display number.
|
||||
Since there is usually no more than one server running on a workstation,
|
||||
specifying
|
||||
.RB \(oq "Xnest :1" \(cq
|
||||
on the command line will be sufficient for most users.
|
||||
For each server running on the workstation, the display number needs to be
|
||||
incremented by one.
|
||||
Thus, if you wish to start another
|
||||
.BR Xnest ,
|
||||
you will need to type
|
||||
.RB \(oq "Xnest :2" \(cq
|
||||
on the command line.
|
||||
.PP
|
||||
To run clients in the nested server each client needs to be given the
|
||||
same display number as the nested server. For example, \fIxterm
|
||||
-display :1\fP will start up an \fIxterm\fP in the first nested server
|
||||
and \fIxterm -display :2\fP will start an \fIxterm\fP in the second
|
||||
nested server from the example above. Additional clients can be
|
||||
started from these \fIxterm\fPs in each nested server.
|
||||
.SH XNEST AS A CLIENT
|
||||
\fIXnest\fP behaves and looks to the real server and other real
|
||||
clients as another real client. It is a rather demanding client,
|
||||
however, since almost any window or graphics request from a nested
|
||||
client will result in a window or graphics request from \fIXnest\fP to
|
||||
the real server. Therefore, it is desirable that \fIXnest\fP and the
|
||||
real server are on a local network, or even better, on the same
|
||||
machine. As of now, \fIXnest\fP assumes that the real server supports
|
||||
the shape extension. There is no way to turn off this assumption
|
||||
dynamically. \fIXnest\fP can be compiled without the shape extension
|
||||
built in, and in that case the real server need not support it. The
|
||||
dynamic shape extension selection support should be considered in
|
||||
further development of \fIXnest\fP.
|
||||
To run clients in the nested server, each client needs to be given the same
|
||||
display number as the nested server.
|
||||
For example,
|
||||
.RB \(oq "xterm \-display :1" \(cq
|
||||
will start up an
|
||||
.B xterm
|
||||
process in the first nested server
|
||||
and
|
||||
.RB \(oq "xterm \-display :2" \(cq
|
||||
will start an
|
||||
.B xterm
|
||||
in the second nested server from the example above.
|
||||
Additional clients can be started from these
|
||||
.BR xterm s
|
||||
in each nested server.
|
||||
.SS "Xnest as a client"
|
||||
.B Xnest
|
||||
behaves and looks to the real server and other real clients as another real
|
||||
client.
|
||||
It is a rather demanding client, however, since almost any window or graphics
|
||||
request from a nested client will result in a window or graphics request from
|
||||
.B Xnest
|
||||
to the real server.
|
||||
Therefore, it is desirable that
|
||||
.B Xnest
|
||||
and the real server are on a local network, or even better, on the same machine.
|
||||
.B Xnest
|
||||
assumes that the real server supports the SHAPE extension.
|
||||
There is no way to turn off this assumption dynamically.
|
||||
.B Xnest
|
||||
can be compiled without the SHAPE extension built in, in which case the real
|
||||
server need not support it.
|
||||
Dynamic SHAPE extension selection support may be considered in further
|
||||
development of
|
||||
.BR Xnest .
|
||||
.PP
|
||||
Since \fIXnest\fP need not use the same default visual as the the real
|
||||
server, the top level window of the \fIXnest\fP client always has its
|
||||
own colormap. This implies that other windows' colors will not be
|
||||
displayed properly while the keyboard or pointer focus is in the
|
||||
\fIXnest\fP window, unless the real server has support for more than
|
||||
one installed colormap at any time. The colormap associated with the
|
||||
top window of the \fIXnest\fP client need not be the appropriate
|
||||
colormap that the nested server wants installed in the real server.
|
||||
In the case that a nested client attempts to install a colormap of a
|
||||
different visual from the default visual of the nested server,
|
||||
\fIXnest\fP will put the top window of this nested client and all
|
||||
other top windows of the nested clients that use the same colormap
|
||||
into the \fIWM\_COLORMAP\_WINDOWS\fP property of the top level
|
||||
\fIXnest\fP window on the real server. Thus, it is important that the
|
||||
real window manager that manages the \fIXnest\fP top level window
|
||||
looks at the \fIWM\_COLORMAP\_WINDOWS\fP property rather than the
|
||||
colormap associated with the top level \fIXnest\fP window. Since most
|
||||
window managers appear to not implement this convention properly as of
|
||||
yet, \fIXnest\fP can optionally do direct installation of colormaps
|
||||
into the real server bypassing the real window manager. If the user
|
||||
chooses this option, it is usually necessary to temporarily disable
|
||||
the real window manager since it will interfere with the \fIXnest\fP
|
||||
scheme of colormap installation.
|
||||
Since
|
||||
.B Xnest
|
||||
need not use the same default visual as the the real server, the top-level
|
||||
window of the
|
||||
.B Xnest
|
||||
client always has its own color map.
|
||||
This implies that other windows' colors will not be displayed properly while the
|
||||
keyboard or pointer focus is in the
|
||||
.B Xnest
|
||||
window, unless the real server has support for more than one installed color map
|
||||
at any time.
|
||||
The color map associated with the top window of the
|
||||
.B Xnest
|
||||
client need not be the appropriate color map that the nested server wants
|
||||
installed in the real server.
|
||||
In the case that a nested client attempts to install a color map of a different
|
||||
visual from the default visual of the nested server,
|
||||
.B Xnest
|
||||
will put the top window of this nested client and all other top windows of the
|
||||
nested clients that use the same color map into the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property of the top-level
|
||||
.B Xnest
|
||||
window on the real server.
|
||||
Thus, it is important that the real window manager that manages the
|
||||
.B Xnest
|
||||
top-level window looks at the
|
||||
.I WM_COLORMAP_WINDOWS
|
||||
property rather than the color map associated with the top-level
|
||||
.B Xnest
|
||||
window.
|
||||
Since most window managers don't yet appear to implement this convention
|
||||
properly,
|
||||
.B Xnest
|
||||
can optionally do direct installation of color maps into the real server
|
||||
bypassing the real window manager.
|
||||
If the user chooses this option, it is usually necessary to temporarily disable
|
||||
the real window manager since it will interfere with the
|
||||
.B Xnest
|
||||
scheme of color map installation.
|
||||
.PP
|
||||
Keyboard and pointer control procedures of the nested server change
|
||||
the keyboard and pointer control parameters of the real server.
|
||||
Therefore, after \fIXnest\fP is started up, it will change the
|
||||
keyboard and pointer controls of the real server to its own internal
|
||||
defaults. Perhaps there should be a command line option to tell
|
||||
\fIXnest\fP to inherit the keyboard and pointer control parameters
|
||||
from the real server rather than imposing its own. This is a future
|
||||
consideration.
|
||||
.SH XNEST AS A SERVER
|
||||
\fIXnest\fP as a server looks exactly like a real server to its own
|
||||
clients. For the clients there is no way of telling if they are
|
||||
running on a real or a nested server.
|
||||
Keyboard and pointer control procedures of the nested server change the keyboard
|
||||
and pointer control parameters of the real server.
|
||||
Therefore, after
|
||||
.B Xnest
|
||||
is started up, it will change the keyboard and pointer controls of the real
|
||||
server to its own internal defaults.
|
||||
.SS "Xnest as a server"
|
||||
.B Xnest
|
||||
as a server looks exactly like a real server to its own clients.
|
||||
For the clients, there is no way of telling if they are running on a real or a
|
||||
nested server.
|
||||
.PP
|
||||
As already mentioned, \fIXnest\fP is a very user friendly server when
|
||||
it comes to customization. \fIXnest\fP will pick up a number of
|
||||
command line arguments that can configure its default visual class and
|
||||
depth, number of screens, etc. In the future, \fIXnest\fP should read
|
||||
a customization input file to provide even greater freedom and
|
||||
simplicity in selecting the desired layout. Unfortunately, there is
|
||||
no support for backing store and save under as of yet, but this should
|
||||
also be considered in the future development of \fIXnest\fP.
|
||||
As already mentioned,
|
||||
.B Xnest
|
||||
is a very user-friendly server when it comes to customization.
|
||||
.B Xnest
|
||||
will pick up a number of command-line arguments that can configure its default
|
||||
visual class and depth, number of screens, etc.
|
||||
.PP
|
||||
The only apparent intricacy from the users' perspective about using
|
||||
\fIXnest\fP as a server is the selection of fonts. \fIXnest\fP
|
||||
manages fonts by loading them locally and then passing the font name
|
||||
to the real server and asking it to load that font remotely. This
|
||||
approach avoids the overload of sending the glyph bits across the
|
||||
network for every text operation, although it is really a bug. The
|
||||
proper implementation of fonts should be moved into the \fIos\fP
|
||||
layer. The consequence of this approach is that the user will have to
|
||||
worry about two different font paths - a local one for the nested
|
||||
server and a remote one for the real server - since \fIXnest\fP does
|
||||
not propagate its font path to the real server. The reason for this
|
||||
is because real and nested servers need not run on the same file
|
||||
system which makes the two font paths mutually incompatible. Thus, if
|
||||
there is a font in the local font path of the nested server, there is
|
||||
no guarantee that this font exists in the remote font path of the real
|
||||
server. \fIXlsfonts\fP client, if run on the nested server will list
|
||||
fonts in the local font path and if run on the real server will list
|
||||
fonts in the remote font path. Before a font can be successfully
|
||||
opened by the nested server it has to exist in local and remote font
|
||||
paths. It is the users' responsibility to make sure that this is the
|
||||
case.
|
||||
.B Xnest
|
||||
as a server is the selection of fonts.
|
||||
.B Xnest
|
||||
manages fonts by loading them locally and then passing the font name to the real
|
||||
server and asking it to load that font remotely.
|
||||
This approach avoids the overload of sending the glyph bits across the network
|
||||
for every text operation, although it is really a bug.
|
||||
The consequence of this approach is that the user will have to worry about two
|
||||
different font paths \(em a local one for the nested server and a remote one for
|
||||
the real server \(em since
|
||||
.B Xnest
|
||||
does not propagate its font path to the real server.
|
||||
The reason for this is because real and nested servers need not run on the same
|
||||
file system which makes the two font paths mutually incompatible.
|
||||
Thus, if there is a font in the local font path of the nested server, there is
|
||||
no guarantee that this font exists in the remote font path of the real server.
|
||||
The
|
||||
.BR xlsfonts (__appmansuffix__)
|
||||
client, if run on the nested server, will list fonts in the local font path and,
|
||||
if run on the real server, will list fonts in the remote font path.
|
||||
Before a font can be successfully opened by the nested server, it has to exist
|
||||
in local and remote font paths.
|
||||
It is the users' responsibility to make sure that this is the case.
|
||||
.SH "FUTURE DIRECTIONS"
|
||||
Make dynamic the requirement for the SHAPE extension in the real server, rather
|
||||
than having to recompile
|
||||
.B Xnest
|
||||
to turn this requirement on and off.
|
||||
.PP
|
||||
Perhaps there should be a command-line option to tell
|
||||
.B Xnest
|
||||
to inherit the keyboard and pointer control parameters from the real server
|
||||
rather than imposing its own.
|
||||
.PP
|
||||
.B Xnest
|
||||
should read a customization input file to provide even greater freedom and
|
||||
simplicity in selecting the desired layout.
|
||||
.PP
|
||||
There is no support for backing store and save unders, but this should also be
|
||||
considered.
|
||||
.PP
|
||||
.\" Is the following still true now that client-side font rendering is
|
||||
.\" considered the way to go?
|
||||
The proper implementation of fonts should be moved into the
|
||||
.I os
|
||||
layer.
|
||||
.SH BUGS
|
||||
Won't run well on servers supporting different visual depths.
|
||||
Still crashes randomly. Probably has some memory leaks.
|
||||
Doesn't run well on servers supporting different visual depths.
|
||||
.PP
|
||||
Still crashes randomly.
|
||||
.PP
|
||||
Probably has some memory leaks.
|
||||
.SH AUTHOR
|
||||
Davor Matic, MIT X Consortium
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR Xserver (__appmansuffix__),
|
||||
.BR xdpyinfo (__appmansuffix__),
|
||||
.BR X (__miscmansuffix__)
|
||||
|
|
|
@ -10,9 +10,9 @@ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \
|
|||
|
||||
Xprt_LDFLAGS = -L$(top_srcdir)
|
||||
Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \
|
||||
pcl/libpcl.la pcl-mono/libpcl.la ../../fb/libfb.la \
|
||||
../../render/librender.la ../../mi/libmi.la ../../Xext/libXext.la \
|
||||
@FREETYPE_LIBS@
|
||||
pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \
|
||||
$(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \
|
||||
$(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@
|
||||
|
||||
miinitext-wrapper.c:
|
||||
echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@
|
||||
|
|
|
@ -100,9 +100,10 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
|
|||
InitPointerDeviceStruct (pDevice,
|
||||
map,
|
||||
lngMouseButtons + lngWheelEvents,
|
||||
miPointerGetMotionEvents,
|
||||
GetMotionHistory,
|
||||
winMouseCtrl,
|
||||
miPointerGetMotionBufferSize ());
|
||||
GetMotionHistorySize(),
|
||||
2);
|
||||
free(map);
|
||||
|
||||
#if defined(XFree86Server) && defined(XINPUT)
|
||||
|
|
|
@ -264,7 +264,7 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
|
|||
if (prop->propertyName == XA_WM_TRANSIENT_FOR)
|
||||
{
|
||||
if (ppDaddy)
|
||||
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr *));
|
||||
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -445,10 +445,7 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
|
|||
}
|
||||
else
|
||||
{
|
||||
XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum);
|
||||
|
||||
/* */
|
||||
if (nNum && ppList && *ppList)
|
||||
if (XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
|
||||
{
|
||||
*ppName = strdup (*ppList);
|
||||
XFreeStringList (ppList);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "winmultiwindowclass.h"
|
||||
#include "winprefs.h"
|
||||
#include "winmsg.h"
|
||||
#include "inputstr.h"
|
||||
|
||||
/*
|
||||
* External global variables
|
||||
|
@ -444,7 +445,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
/* Avoid the BitBlt's if the PAINTSTRUCT is bogus */
|
||||
if (ps.rcPaint.right==0 && ps.rcPaint.bottom==0 && ps.rcPaint.left==0 && ps.rcPaint.top==0)
|
||||
{
|
||||
EndPaint (hwndScreen, &ps);
|
||||
EndPaint (hwnd, &ps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -474,7 +475,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
}
|
||||
|
||||
/* EndPaint frees the DC */
|
||||
EndPaint (hwndScreen, &ps);
|
||||
EndPaint (hwnd, &ps);
|
||||
return 0;
|
||||
|
||||
case WM_MOUSEMOVE:
|
||||
|
@ -494,8 +495,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
|||
break;
|
||||
|
||||
/* Has the mouse pointer crossed screens? */
|
||||
if (s_pScreen != miPointerCurrentScreen ())
|
||||
miPointerSetNewScreen (s_pScreenInfo->dwScreen,
|
||||
if (s_pScreen != miPointerGetScreen(inputInfo.pointer))
|
||||
miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen,
|
||||
ptMouse.x - s_pScreenInfo->dwXOffset,
|
||||
ptMouse.y - s_pScreenInfo->dwYOffset);
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <X11/Xatom.h>
|
||||
#include "winmultiwindowclass.h"
|
||||
#include "winmsg.h"
|
||||
#include "inputstr.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@ -538,8 +539,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
|||
break;
|
||||
|
||||
/* Has the mouse pointer crossed screens? */
|
||||
if (pScreen != miPointerCurrentScreen ())
|
||||
miPointerSetNewScreen (pScreenInfo->dwScreen,
|
||||
if (pScreen != miPointerGetScreen(inputInfo.pointer))
|
||||
miPointerSetScreen (inputInfo.pointer, pScreenInfo->dwScreen,
|
||||
ptMouse.x - pScreenInfo->dwXOffset,
|
||||
ptMouse.y - pScreenInfo->dwYOffset);
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "winprefs.h"
|
||||
#include "winconfig.h"
|
||||
#include "winmsg.h"
|
||||
#include "inputstr.h"
|
||||
|
||||
#ifdef XKB
|
||||
extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam);
|
||||
|
@ -723,8 +724,8 @@ winWindowProc (HWND hwnd, UINT message,
|
|||
break;
|
||||
|
||||
/* Has the mouse pointer crossed screens? */
|
||||
if (s_pScreen != miPointerCurrentScreen ())
|
||||
miPointerSetNewScreen (s_pScreenInfo->dwScreen,
|
||||
if (s_pScreen != miPointerGetScreen(inputInfo.pointer))
|
||||
miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen,
|
||||
GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
|
||||
GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
|
||||
|
||||
|
|
|
@ -102,6 +102,9 @@
|
|||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
#undef HAVE_BYTESWAP_H
|
||||
|
||||
/* Define to 1 if you have cbrt */
|
||||
#undef HAVE_CBRT
|
||||
|
||||
/* Define to 1 if you have the <dbm.h> header file. */
|
||||
#undef HAVE_DBM_H
|
||||
|
||||
|
|
|
@ -209,10 +209,6 @@ extern int (* ProcVector[256]) (ClientPtr /*client*/);
|
|||
|
||||
extern int (* SwappedProcVector[256]) (ClientPtr /*client*/);
|
||||
|
||||
#ifdef K5AUTH
|
||||
extern int (*k5_Vector[256])(ClientPtr /*client*/);
|
||||
#endif
|
||||
|
||||
extern ReplySwapPtr ReplySwapVector[256];
|
||||
|
||||
extern int ProcBadRequest(ClientPtr /*client*/);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue