mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
Merge branch 'mi-cleanup' into next
This commit is contained in:
commit
579ee8f5d8
57 changed files with 790 additions and 427 deletions
|
|
@ -808,7 +808,7 @@ InitInput(int argc, char **argv)
|
|||
|
||||
GetEventList(&xf86Events);
|
||||
|
||||
/* Call the PreInit function for each input device instance. */
|
||||
/* Initialize all configured input devices */
|
||||
for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
|
||||
/* Replace obsolete keyboard driver with kbd */
|
||||
if (!xf86NameCmp((*pDev)->driver, "keyboard")) {
|
||||
|
|
|
|||
|
|
@ -242,11 +242,20 @@ xf86RandRSetConfig (ScreenPtr pScreen,
|
|||
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
|
||||
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
||||
DisplayModePtr mode;
|
||||
int px, py;
|
||||
int pos[MAXDEVICES][2];
|
||||
Bool useVirtual = FALSE;
|
||||
Rotation oldRotation = randrp->rotation;
|
||||
DeviceIntPtr dev;
|
||||
Bool view_adjusted = FALSE;
|
||||
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
{
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
|
||||
}
|
||||
|
||||
miPointerGetPosition(inputInfo.pointer, &px, &py);
|
||||
for (mode = scrp->modes; ; mode = mode->next)
|
||||
{
|
||||
if (mode->HDisplay == pSize->width &&
|
||||
|
|
@ -303,17 +312,31 @@ xf86RandRSetConfig (ScreenPtr pScreen,
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move the cursor back where it belongs; SwitchMode repositions it
|
||||
* FIXME: duplicated code, see modes/xf86RandR12.c
|
||||
*/
|
||||
if (pScreen == miPointerCurrentScreen ())
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
{
|
||||
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
|
||||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
if (pScreen == miPointerGetScreen(dev)) {
|
||||
int px = pos[dev->id][0];
|
||||
int py = pos[dev->id][1];
|
||||
|
||||
(*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE);
|
||||
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
|
||||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
|
||||
/* Setting the viewpoint makes only sense on one device */
|
||||
if (!view_adjusted && IsMaster(dev)) {
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
view_adjusted = TRUE;
|
||||
}
|
||||
|
||||
(*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ VidModeSetModeValue(pointer mode, int valtyp, int val)
|
|||
vidMonitorValue
|
||||
VidModeGetMonitorValue(pointer monitor, int valtyp, int indx)
|
||||
{
|
||||
vidMonitorValue ret;
|
||||
vidMonitorValue ret = { NULL, };
|
||||
|
||||
switch (valtyp) {
|
||||
case VIDMODE_MON_VENDOR:
|
||||
|
|
|
|||
|
|
@ -97,8 +97,11 @@ static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
|
|||
|
||||
static Bool xf86XVDestroyWindow(WindowPtr pWin);
|
||||
static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2);
|
||||
static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind);
|
||||
static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
|
||||
|
||||
#define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1)
|
||||
|
||||
/* ScrnInfoRec functions */
|
||||
|
||||
static Bool xf86XVEnterVT(int, int);
|
||||
|
|
@ -280,10 +283,9 @@ xf86XVScreenInit(
|
|||
|
||||
pScrn = xf86Screens[pScreen->myNum];
|
||||
|
||||
ScreenPriv->videoGC = NULL; /* for the helper */
|
||||
|
||||
ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
|
||||
ScreenPriv->WindowExposures = pScreen->WindowExposures;
|
||||
ScreenPriv->PostValidateTree = PostValidateTreeUndefined;
|
||||
ScreenPriv->ClipNotify = pScreen->ClipNotify;
|
||||
ScreenPriv->EnterVT = pScrn->EnterVT;
|
||||
ScreenPriv->LeaveVT = pScrn->LeaveVT;
|
||||
|
|
@ -333,6 +335,8 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
|||
RegionDestroy(pPriv->clientClip);
|
||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||
RegionDestroy(pPriv->pCompositeClip);
|
||||
if (pPriv->ckeyFilled)
|
||||
RegionDestroy(pPriv->ckeyFilled);
|
||||
free(pPriv);
|
||||
}
|
||||
}
|
||||
|
|
@ -1018,7 +1022,6 @@ static void
|
|||
xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
||||
{
|
||||
XF86XVWindowPtr winPriv, prevPriv = NULL;
|
||||
|
||||
winPriv = GET_XF86XV_WINDOW(pWin);
|
||||
|
||||
while(winPriv) {
|
||||
|
|
@ -1035,6 +1038,11 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
|||
winPriv = winPriv->next;
|
||||
}
|
||||
portPriv->pDraw = NULL;
|
||||
if (portPriv->ckeyFilled) {
|
||||
RegionDestroy(portPriv->ckeyFilled);
|
||||
portPriv->ckeyFilled = NULL;
|
||||
}
|
||||
portPriv->clipChanged = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1069,7 +1077,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
|
|||
}
|
||||
|
||||
static void
|
||||
xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn)
|
||||
xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged)
|
||||
{
|
||||
ScreenPtr pScreen = pScrn->pScreen;
|
||||
XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
|
||||
|
|
@ -1087,6 +1095,9 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn)
|
|||
if (pPriv->isOn == XV_OFF || !pWin)
|
||||
continue;
|
||||
|
||||
if (onlyChanged && !pPriv->clipChanged)
|
||||
continue;
|
||||
|
||||
visible = pWin->visibility == VisibilityUnobscured ||
|
||||
pWin->visibility == VisibilityPartiallyObscured;
|
||||
|
||||
|
|
@ -1098,6 +1109,8 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn)
|
|||
visible = FALSE;
|
||||
|
||||
xf86XVReputOrStopPort(pPriv, pWin, visible);
|
||||
|
||||
pPriv->clipChanged = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1123,9 +1136,6 @@ xf86XVDestroyWindow(WindowPtr pWin)
|
|||
|
||||
pPriv->pDraw = NULL;
|
||||
tmp = WinPriv;
|
||||
if(WinPriv->pGC) {
|
||||
FreeGC(WinPriv->pGC, 0);
|
||||
}
|
||||
WinPriv = WinPriv->next;
|
||||
free(tmp);
|
||||
}
|
||||
|
|
@ -1139,6 +1149,29 @@ xf86XVDestroyWindow(WindowPtr pWin)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
XF86XVScreenPtr ScreenPriv;
|
||||
ScrnInfoPtr pScrn;
|
||||
|
||||
if (pWin)
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
else
|
||||
pScreen = pLayerWin->drawable.pScreen;
|
||||
|
||||
ScreenPriv = GET_XF86XV_SCREEN(pScreen);
|
||||
pScrn = xf86Screens[pScreen->myNum];
|
||||
|
||||
xf86XVReputOrStopAllPorts(pScrn, TRUE);
|
||||
|
||||
pScreen->PostValidateTree = ScreenPriv->PostValidateTree;
|
||||
if (pScreen->PostValidateTree) {
|
||||
(*pScreen->PostValidateTree)(pWin, pLayerWin, kind);
|
||||
}
|
||||
ScreenPriv->PostValidateTree = PostValidateTreeUndefined;
|
||||
}
|
||||
|
||||
static void
|
||||
xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||
|
|
@ -1170,12 +1203,28 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
|||
if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
|
||||
visible = !AreasExposed;
|
||||
|
||||
/*
|
||||
* Subtract exposed areas from overlaid image to match textured video
|
||||
* behavior.
|
||||
*/
|
||||
if (!pPriv->type && pPriv->clientClip)
|
||||
RegionSubtract(pPriv->clientClip, pPriv->clientClip, reg1);
|
||||
|
||||
if (visible && pPriv->ckeyFilled) {
|
||||
RegionRec tmp;
|
||||
RegionNull(&tmp);
|
||||
RegionCopy(&tmp, reg1);
|
||||
RegionTranslate(&tmp, pWin->drawable.x, pWin->drawable.y);
|
||||
RegionSubtract(pPriv->ckeyFilled, pPriv->ckeyFilled, &tmp);
|
||||
}
|
||||
|
||||
WinPriv = WinPriv->next;
|
||||
xf86XVReputOrStopPort(pPriv, pWin, visible);
|
||||
|
||||
pPriv->clipChanged = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||
{
|
||||
|
|
@ -1185,9 +1234,6 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
|
|||
XvPortRecPrivatePtr pPriv;
|
||||
|
||||
while(WinPriv) {
|
||||
Bool visible = pWin->visibility == VisibilityUnobscured ||
|
||||
pWin->visibility == VisibilityPartiallyObscured;
|
||||
|
||||
pPriv = WinPriv->PortRec;
|
||||
|
||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||
|
|
@ -1199,15 +1245,14 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
|
|||
(*pPriv->AdaptorRec->ClipNotify)(pPriv->pScrn, pPriv->DevPriv.ptr,
|
||||
pWin, dx, dy);
|
||||
|
||||
/*
|
||||
* Stop and remove still/images if
|
||||
* ReputImage isn't supported.
|
||||
*/
|
||||
if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
|
||||
visible = FALSE;
|
||||
pPriv->clipChanged = TRUE;
|
||||
|
||||
if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) {
|
||||
ScreenPriv->PostValidateTree = pScreen->PostValidateTree;
|
||||
pScreen->PostValidateTree = xf86XVPostValidateTree;
|
||||
}
|
||||
|
||||
WinPriv = WinPriv->next;
|
||||
xf86XVReputOrStopPort(pPriv, pWin, visible);
|
||||
}
|
||||
|
||||
if(ScreenPriv->ClipNotify) {
|
||||
|
|
@ -1232,11 +1277,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
|
|||
|
||||
if(!ScreenPriv) return TRUE;
|
||||
|
||||
if(ScreenPriv->videoGC) {
|
||||
FreeGC(ScreenPriv->videoGC, 0);
|
||||
ScreenPriv->videoGC = NULL;
|
||||
}
|
||||
|
||||
pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
|
||||
pScreen->WindowExposures = ScreenPriv->WindowExposures;
|
||||
pScreen->ClipNotify = ScreenPriv->ClipNotify;
|
||||
|
|
@ -1345,7 +1385,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
|
|||
pScrn->AdjustFrame = xf86XVAdjustFrame;
|
||||
}
|
||||
|
||||
xf86XVReputOrStopAllPorts(pScrn);
|
||||
xf86XVReputOrStopAllPorts(pScrn, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1366,7 +1406,7 @@ xf86XVModeSet(ScrnInfoPtr pScrn)
|
|||
pScrn->ModeSet = xf86XVModeSet;
|
||||
}
|
||||
|
||||
xf86XVReputOrStopAllPorts(pScrn);
|
||||
xf86XVReputOrStopAllPorts(pScrn, FALSE);
|
||||
}
|
||||
|
||||
/**** XvAdaptorRec fields ****/
|
||||
|
|
@ -1869,92 +1909,92 @@ xf86XVQueryImageAttributes(
|
|||
format->id, width, height, pitches, offsets);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
||||
xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes)
|
||||
{
|
||||
ScreenPtr pScreen = pDraw->pScreen;
|
||||
WindowPtr pWin = (WindowPtr)pDraw;
|
||||
XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
|
||||
GCPtr pGC = NULL;
|
||||
BoxPtr pbox = RegionRects(clipboxes);
|
||||
int i, nbox = RegionNumRects(clipboxes);
|
||||
xRectangle *rects;
|
||||
|
||||
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
||||
|
||||
if(pPriv)
|
||||
pGC = pPriv->pGC;
|
||||
|
||||
if(!pGC) {
|
||||
int status;
|
||||
XID pval[2];
|
||||
pval[0] = key;
|
||||
pval[1] = IncludeInferiors;
|
||||
pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status,
|
||||
(XID)0, serverClient);
|
||||
if(!pGC) return;
|
||||
ValidateGC(pDraw, pGC);
|
||||
if (pPriv) pPriv->pGC = pGC;
|
||||
} else if (key != pGC->fgPixel){
|
||||
ChangeGCVal val;
|
||||
val.val = key;
|
||||
ChangeGC(NullClient, pGC, GCForeground, &val);
|
||||
ValidateGC(pDraw, pGC);
|
||||
}
|
||||
|
||||
RegionTranslate(clipboxes, -pDraw->x, -pDraw->y);
|
||||
|
||||
rects = malloc(nbox * sizeof(xRectangle));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
(*pGC->ops->PolyFillRect)(pDraw, pGC, nbox, rects);
|
||||
|
||||
if (!pPriv) FreeGC(pGC, 0);
|
||||
|
||||
free(rects);
|
||||
}
|
||||
|
||||
void
|
||||
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
|
||||
{
|
||||
DrawablePtr root = &pScreen->root->drawable;
|
||||
ChangeGCVal pval[2];
|
||||
BoxPtr pbox = RegionRects(clipboxes);
|
||||
int i, nbox = RegionNumRects(clipboxes);
|
||||
BoxPtr pbox = RegionRects(fillboxes);
|
||||
int i, nbox = RegionNumRects(fillboxes);
|
||||
xRectangle *rects;
|
||||
GCPtr gc;
|
||||
|
||||
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
||||
|
||||
gc = GetScratchGC(root->depth, pScreen);
|
||||
gc = GetScratchGC(pDraw->depth, pScreen);
|
||||
pval[0].val = key;
|
||||
pval[1].val = IncludeInferiors;
|
||||
(void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval);
|
||||
ValidateGC(root, gc);
|
||||
ValidateGC(pDraw, gc);
|
||||
|
||||
rects = malloc(nbox * sizeof(xRectangle));
|
||||
|
||||
for(i = 0; i < nbox; i++, pbox++)
|
||||
{
|
||||
rects[i].x = pbox->x1;
|
||||
rects[i].y = pbox->y1;
|
||||
rects[i].x = pbox->x1 - pDraw->x;
|
||||
rects[i].y = pbox->y1 - pDraw->y;
|
||||
rects[i].width = pbox->x2 - pbox->x1;
|
||||
rects[i].height = pbox->y2 - pbox->y1;
|
||||
}
|
||||
|
||||
(*gc->ops->PolyFillRect)(root, gc, nbox, rects);
|
||||
(*gc->ops->PolyFillRect)(pDraw, gc, nbox, rects);
|
||||
|
||||
free(rects);
|
||||
FreeScratchGC (gc);
|
||||
}
|
||||
|
||||
void
|
||||
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes)
|
||||
{
|
||||
xf86XVFillKeyHelperDrawable (&pScreen->root->drawable, key, fillboxes);
|
||||
}
|
||||
|
||||
void
|
||||
xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything)
|
||||
{
|
||||
WindowPtr pWin = (WindowPtr)pDraw;
|
||||
XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
|
||||
XvPortRecPrivatePtr portPriv = NULL;
|
||||
RegionRec reg;
|
||||
RegionPtr fillboxes;
|
||||
|
||||
while (WinPriv) {
|
||||
XvPortRecPrivatePtr pPriv = WinPriv->PortRec;
|
||||
|
||||
if (data == pPriv->DevPriv.ptr) {
|
||||
portPriv = pPriv;
|
||||
break;
|
||||
}
|
||||
|
||||
WinPriv = WinPriv->next;
|
||||
}
|
||||
|
||||
if (!portPriv)
|
||||
return;
|
||||
|
||||
if (!portPriv->ckeyFilled)
|
||||
portPriv->ckeyFilled = RegionCreate(NULL, 0);
|
||||
|
||||
if (!fillEverything) {
|
||||
RegionNull(®);
|
||||
fillboxes = ®
|
||||
RegionSubtract(fillboxes, clipboxes, portPriv->ckeyFilled);
|
||||
|
||||
if (!RegionNotEmpty(fillboxes))
|
||||
goto out;
|
||||
} else
|
||||
fillboxes = clipboxes;
|
||||
|
||||
|
||||
RegionCopy(portPriv->ckeyFilled, clipboxes);
|
||||
|
||||
xf86XVFillKeyHelperDrawable(pDraw, key, fillboxes);
|
||||
out:
|
||||
if (!fillEverything)
|
||||
RegionUninit(®);
|
||||
}
|
||||
|
||||
|
||||
/* xf86XVClipVideoHelper -
|
||||
|
||||
Takes the dst box in standard X BoxRec form (top and left
|
||||
|
|
|
|||
|
|
@ -244,6 +244,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes);
|
|||
extern _X_EXPORT void
|
||||
xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes);
|
||||
|
||||
extern _X_EXPORT void
|
||||
xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
xf86XVClipVideoHelper(
|
||||
BoxPtr dst,
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ typedef struct {
|
|||
DestroyWindowProcPtr DestroyWindow;
|
||||
ClipNotifyProcPtr ClipNotify;
|
||||
WindowExposuresProcPtr WindowExposures;
|
||||
PostValidateTreeProcPtr PostValidateTree;
|
||||
void (*AdjustFrame)(int, int, int, int);
|
||||
Bool (*EnterVT)(int, int);
|
||||
void (*LeaveVT)(int, int);
|
||||
GCPtr videoGC;
|
||||
xf86ModeSetProc *ModeSet;
|
||||
} XF86XVScreenRec, *XF86XVScreenPtr;
|
||||
|
||||
|
|
@ -69,11 +69,12 @@ typedef struct {
|
|||
unsigned char type;
|
||||
unsigned int subWindowMode;
|
||||
RegionPtr clientClip;
|
||||
RegionPtr ckeyFilled;
|
||||
RegionPtr pCompositeClip;
|
||||
Bool FreeCompositeClip;
|
||||
XvAdaptorRecPrivatePtr AdaptorRec;
|
||||
XvStatus isOn;
|
||||
Bool moved;
|
||||
Bool clipChanged;
|
||||
int vid_x, vid_y, vid_w, vid_h;
|
||||
int drw_x, drw_y, drw_w, drw_h;
|
||||
DevUnion DevPriv;
|
||||
|
|
@ -82,7 +83,6 @@ typedef struct {
|
|||
typedef struct _XF86XVWindowRec{
|
||||
XvPortRecPrivatePtr PortRec;
|
||||
struct _XF86XVWindowRec *next;
|
||||
GCPtr pGC;
|
||||
} XF86XVWindowRec, *XF86XVWindowPtr;
|
||||
|
||||
#endif /* _XF86XVPRIV_H_ */
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
|
|||
&& (pDraw->height == pPriv->height)
|
||||
&& (pPriv->serialNumber == DRI2DrawableSerial(pDraw));
|
||||
|
||||
buffers = malloc((count + 1) * sizeof(buffers[0]));
|
||||
buffers = calloc((count + 1), sizeof(buffers[0]));
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
const unsigned attachment = *(attachments++);
|
||||
|
|
|
|||
|
|
@ -264,14 +264,7 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
|
|||
{
|
||||
struct fb_fix_screeninfo fix;
|
||||
char filename[256];
|
||||
int fd,i,j;
|
||||
|
||||
|
||||
/* There are two ways to that we can determine which fb device is
|
||||
* associated with this PCI device. The more modern way is to look in
|
||||
* the sysfs directory for the PCI device for a file named
|
||||
* "graphics/fb*"
|
||||
*/
|
||||
int fd, i;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(filename,
|
||||
|
|
@ -304,55 +297,10 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* The other way is to examine the resources associated with each fb
|
||||
* device and see if there is a match with the PCI device. This technique
|
||||
* has some problems on certain mixed 64-bit / 32-bit architectures.
|
||||
* There is a flaw in the fb_fix_screeninfo structure in that it only
|
||||
* returns the low 32-bits of the address of the resources associated with
|
||||
* a device. However, on a mixed architecture the base addresses of PCI
|
||||
* devices, even for 32-bit applications, may be higher than 0x0f0000000.
|
||||
*/
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(filename,"/dev/fb%d",i);
|
||||
if (-1 == (fd = open(filename,O_RDWR,0))) {
|
||||
xf86DrvMsg(-1, X_WARNING,
|
||||
"open %s: %s\n", filename, strerror(errno));
|
||||
continue;
|
||||
}
|
||||
if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
for (j = 0; j < 6; j++) {
|
||||
const pciaddr_t res_start = pPci->regions[j].base_addr;
|
||||
const pciaddr_t res_end = res_start + pPci->regions[j].size;
|
||||
|
||||
if ((0 != fix.smem_len &&
|
||||
(pciaddr_t) fix.smem_start >= res_start &&
|
||||
(pciaddr_t) fix.smem_start < res_end) ||
|
||||
(0 != fix.mmio_len &&
|
||||
(pciaddr_t) fix.mmio_start >= res_start &&
|
||||
(pciaddr_t) fix.mmio_start < res_end))
|
||||
break;
|
||||
}
|
||||
if (j == 6) {
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
if (namep) {
|
||||
*namep = xnfalloc(16);
|
||||
strncpy(*namep,fix.id,16);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
if (namep)
|
||||
*namep = NULL;
|
||||
|
||||
xf86DrvMsg(-1, X_ERROR,
|
||||
"Unable to find a valid framebuffer device\n");
|
||||
xf86DrvMsg(-1, X_ERROR, "Unable to find a valid framebuffer device\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ pciCfg1in(CARD16 addr, CARD32 *val)
|
|||
}
|
||||
if (addr == 0xCFC) {
|
||||
pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
|
||||
val, PCI_OFFSET(PciCfg1Addr));
|
||||
(uint32_t *)val, PCI_OFFSET(PciCfg1Addr));
|
||||
if (PRINT_PORT && DEBUG_IO_TRACE())
|
||||
ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val);
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -1542,7 +1542,6 @@ struct det_monrec_parameter {
|
|||
static void handle_detailed_monrec(struct detailed_monitor_section *det_mon,
|
||||
void *data)
|
||||
{
|
||||
enum { sync_config, sync_edid, sync_default };
|
||||
struct det_monrec_parameter *p;
|
||||
p = (struct det_monrec_parameter *)data;
|
||||
|
||||
|
|
|
|||
|
|
@ -584,10 +584,12 @@ xf86RandR12SetConfig (ScreenPtr pScreen,
|
|||
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
|
||||
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
||||
DisplayModePtr mode;
|
||||
int px, py;
|
||||
int pos[MAXDEVICES][2];
|
||||
Bool useVirtual = FALSE;
|
||||
int maxX = 0, maxY = 0;
|
||||
Rotation oldRotation = randrp->rotation;
|
||||
DeviceIntPtr dev;
|
||||
Bool view_adjusted = FALSE;
|
||||
|
||||
randrp->rotation = rotation;
|
||||
|
||||
|
|
@ -597,7 +599,14 @@ xf86RandR12SetConfig (ScreenPtr pScreen,
|
|||
randrp->virtualY = scrp->virtualY;
|
||||
}
|
||||
|
||||
miPointerGetPosition (inputInfo.pointer, &px, &py);
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
{
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
miPointerGetPosition(dev, &pos[dev->id][0], &pos[dev->id][1]);
|
||||
}
|
||||
|
||||
for (mode = scrp->modes; ; mode = mode->next)
|
||||
{
|
||||
if (randrp->maxX == 0 || randrp->maxY == 0)
|
||||
|
|
@ -643,15 +652,28 @@ xf86RandR12SetConfig (ScreenPtr pScreen,
|
|||
|
||||
/*
|
||||
* Move the cursor back where it belongs; SwitchMode repositions it
|
||||
* FIXME: duplicated code, see modes/xf86RandR12.c
|
||||
*/
|
||||
if (pScreen == miPointerGetScreen(inputInfo.pointer))
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
{
|
||||
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
|
||||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
if (!IsMaster(dev) && !IsFloating(dev))
|
||||
continue;
|
||||
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
if (pScreen == miPointerGetScreen(dev)) {
|
||||
int px = pos[dev->id][0];
|
||||
int py = pos[dev->id][1];
|
||||
|
||||
(*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, px, py, FALSE);
|
||||
px = (px >= pScreen->width ? (pScreen->width - 1) : px);
|
||||
py = (py >= pScreen->height ? (pScreen->height - 1) : py);
|
||||
|
||||
/* Setting the viewpoint makes only sense on one device */
|
||||
if (!view_adjusted && IsMaster(dev)) {
|
||||
xf86SetViewport(pScreen, px, py);
|
||||
view_adjusted = TRUE;
|
||||
}
|
||||
|
||||
(*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -317,8 +317,7 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
|
|||
|
||||
/* only update for VCP, otherwise we get cursor jumps when removing a
|
||||
sprite. The second cursor is never HW rendered anyway. */
|
||||
if (pDev == inputInfo.pointer ||
|
||||
(!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
|
||||
if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer)
|
||||
{
|
||||
pCurs->refcnt++;
|
||||
if (ScreenPriv->CurrentCursor)
|
||||
|
|
@ -386,8 +385,7 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
|||
|
||||
/* only update coordinate state for first sprite, otherwise we get jumps
|
||||
when removing a sprite. The second sprite is never HW rendered anyway */
|
||||
if (pDev == inputInfo.pointer ||
|
||||
(!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
|
||||
if (GetMaster(pDev, MASTER_POINTER) == inputInfo.pointer)
|
||||
{
|
||||
ScreenPriv->x = x;
|
||||
ScreenPriv->y = y;
|
||||
|
|
|
|||
Loading…
Reference in a new issue