Fix DRI in EXA mode: Don't attempt to use XAA symbols (use the driver's internal
ones for EXA support when available). Also, add an abstraction of XAA/EXA MarkSync and WaitSync functionality so we don't need to sprinkle the ifdefs all over, and correctly use them.
This commit is contained in:
parent
bc42dbe07c
commit
f2ab3aa319
|
|
@ -491,6 +491,8 @@ extern Bool I830CheckModeSupport(ScrnInfoPtr pScrn, int x, int y, int mode);
|
|||
extern Bool I830Rotate(ScrnInfoPtr pScrn, DisplayModePtr mode);
|
||||
extern Bool I830FixOffset(ScrnInfoPtr pScrn, I830MemRange *mem);
|
||||
|
||||
extern void i830MarkSync(ScrnInfoPtr pScrn);
|
||||
extern void i830WaitSync(ScrnInfoPtr pScrn);
|
||||
/*
|
||||
* 12288 is set as the maximum, chosen because it is enough for
|
||||
* 1920x1440@32bpp with a 2048 pixel line pitch with some to spare.
|
||||
|
|
|
|||
|
|
@ -208,10 +208,7 @@ I830RefreshRing(ScrnInfoPtr pScrn)
|
|||
pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8);
|
||||
if (pI830->LpRing->space < 0)
|
||||
pI830->LpRing->space += pI830->LpRing->mem.Size;
|
||||
#ifdef I830_USE_XAA
|
||||
if (pI830->AccelInfoRec)
|
||||
pI830->AccelInfoRec->NeedToSync = TRUE;
|
||||
#endif
|
||||
i830MarkSync(pScrn);
|
||||
}
|
||||
|
||||
/* The following function sets up the supported acceleration. Call it
|
||||
|
|
|
|||
|
|
@ -979,7 +979,6 @@ I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
|
|||
{
|
||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
BoxPtr pbox = REGION_RECTS(prgn);
|
||||
int nbox = REGION_NUM_RECTS(prgn);
|
||||
|
||||
|
|
@ -1017,9 +1016,7 @@ I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
|
|||
}
|
||||
|
||||
I830SelectBuffer(pScrn, I830_SELECT_FRONT);
|
||||
#ifdef I830_USE_XAA
|
||||
pI830->AccelInfoRec->NeedToSync = TRUE;
|
||||
#endif
|
||||
i830MarkSync(pScrn);
|
||||
}
|
||||
|
||||
/* This routine is a modified form of XAADoBitBlt with the calls to
|
||||
|
|
@ -1033,7 +1030,6 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
{
|
||||
ScreenPtr pScreen = pParent->drawable.pScreen;
|
||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
BoxPtr pboxTmp, pboxNext, pboxBase;
|
||||
DDXPointPtr pptTmp, pptNew2;
|
||||
int xdir, ydir;
|
||||
|
|
@ -1180,9 +1176,7 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
|
|||
DEALLOCATE_LOCAL(pptNew1);
|
||||
DEALLOCATE_LOCAL(pboxNew1);
|
||||
}
|
||||
#ifdef I830_USE_XAA
|
||||
pI830->AccelInfoRec->NeedToSync = TRUE;
|
||||
#endif
|
||||
i830MarkSync(pScrn);
|
||||
}
|
||||
|
||||
/* Initialize the first context */
|
||||
|
|
|
|||
|
|
@ -5258,18 +5258,8 @@ I830BIOSAdjustFrame(int scrnIndex, int x, int y, int flags)
|
|||
x, pI830->xoffset, y, pI830->yoffset);
|
||||
|
||||
/* Sync the engine before adjust frame */
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->noAccel && !pI830->useEXA && pI830->AccelInfoRec->NeedToSync) {
|
||||
(*pI830->AccelInfoRec->Sync)(pScrn);
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
}
|
||||
#endif
|
||||
#ifdef I830_USE_EXA
|
||||
if (!pI830->noAccel && pI830->useEXA) {
|
||||
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
|
||||
exaWaitSync(pScreen);
|
||||
}
|
||||
#endif
|
||||
i830WaitSync(pScrn);
|
||||
|
||||
if (I830IsPrimary(pScrn))
|
||||
Start = pI830->FrontBuffer.Start;
|
||||
else {
|
||||
|
|
@ -5398,16 +5388,11 @@ I830BIOSLeaveVT(int scrnIndex, int flags)
|
|||
RestoreBIOSMemSize(pScrn);
|
||||
if (I830IsPrimary(pScrn))
|
||||
I830UnbindAGPMemory(pScrn);
|
||||
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->useEXA && pI830->AccelInfoRec)
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
#endif
|
||||
#ifdef I830_USE_EXA
|
||||
if (pI830->useEXA && pI830->EXADriverPtr) {
|
||||
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
|
||||
exaMarkSync(pScreen);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* DO IT AGAIN! AS IT SEEMS THAT SOME LFPs FLICKER OTHERWISE */
|
||||
if (I830IsPrimary(pScrn)) {
|
||||
|
|
@ -5741,18 +5726,7 @@ I830BIOSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
|
|||
#endif
|
||||
|
||||
/* Sync the engine before mode switch */
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->noAccel && !pI830->useEXA) {
|
||||
(*pI830->AccelInfoRec->Sync)(pScrn);
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
}
|
||||
#endif
|
||||
#ifdef I830_USE_EXA
|
||||
if (!pI830->noAccel && pI830->useEXA) {
|
||||
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
|
||||
exaWaitSync(pScreen);
|
||||
}
|
||||
#endif
|
||||
i830WaitSync(pScrn);
|
||||
|
||||
/* Check if our currentmode is about to change. We do this so if we
|
||||
* are rotating, we don't need to call the mode setup again.
|
||||
|
|
@ -6122,14 +6096,8 @@ I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg)
|
|||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Hotkey switch to 0x%lx.\n", (unsigned long) temp);
|
||||
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->useEXA && pI830->AccelInfoRec && pI830->AccelInfoRec->NeedToSync) {
|
||||
(*pI830->AccelInfoRec->Sync)(pScrn);
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
if (xf86IsEntityShared(pScrn->entityList[0]))
|
||||
pI8302->AccelInfoRec->NeedToSync = FALSE;
|
||||
}
|
||||
#endif
|
||||
i830WaitSync(pScrn);
|
||||
|
||||
GetAttachableDisplayDeviceList(pScrn);
|
||||
|
||||
pI8301->lastDevice0 = pI8301->lastDevice1;
|
||||
|
|
@ -6398,6 +6366,42 @@ I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg)
|
|||
return 1000;
|
||||
}
|
||||
|
||||
void
|
||||
i830WaitSync(ScrnInfoPtr pScrn)
|
||||
{
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->noAccel && !pI830->useEXA && pI830->AccelInfoRec->NeedToSync) {
|
||||
(*pI830->AccelInfoRec->Sync)(pScrn);
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
}
|
||||
#endif
|
||||
#ifdef I830_USE_EXA
|
||||
if (!pI830->noAccel && pI830->useEXA && pI830->EXADriverPtr) {
|
||||
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
|
||||
exaWaitSync(pScreen);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
i830MarkSync(ScrnInfoPtr pScrn)
|
||||
{
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
|
||||
#ifdef I830_USE_XAA
|
||||
if (!pI830->useEXA && pI830->AccelInfoRec)
|
||||
pI830->AccelInfoRec->NeedToSync = FALSE;
|
||||
#endif
|
||||
#ifdef I830_USE_EXA
|
||||
if (pI830->useEXA && pI830->EXADriverPtr) {
|
||||
ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
|
||||
exaMarkSync(pScreen);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
I830InitpScrn(ScrnInfoPtr pScrn)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ do { \
|
|||
#define I830FALLBACK(s, arg...) { return FALSE; }
|
||||
#endif
|
||||
|
||||
int I830CopyROP[16] =
|
||||
const int I830CopyROP[16] =
|
||||
{
|
||||
ROP_0, /* GXclear */
|
||||
ROP_DSa, /* GXand */
|
||||
|
|
@ -71,7 +71,7 @@ int I830CopyROP[16] =
|
|||
ROP_1 /* GXset */
|
||||
};
|
||||
|
||||
static int I830PatternROP[16] =
|
||||
const int I830PatternROP[16] =
|
||||
{
|
||||
ROP_0,
|
||||
ROP_DPa,
|
||||
|
|
|
|||
|
|
@ -92,6 +92,11 @@ static void I830SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno);
|
|||
#endif
|
||||
static void I830RestoreAccelState(ScrnInfoPtr pScrn);
|
||||
|
||||
#ifdef I830_USE_EXA
|
||||
extern const int I830PatternROP[16];
|
||||
extern const int I830CopyROP[16];
|
||||
#endif
|
||||
|
||||
Bool
|
||||
I830XAAInit(ScreenPtr pScreen)
|
||||
{
|
||||
|
|
@ -235,8 +240,17 @@ I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
|
|||
ErrorF("I830SetupForFillRectSolid color: %x rop: %x mask: %x\n",
|
||||
color, rop, planemask);
|
||||
|
||||
#ifdef I830_USE_EXA
|
||||
/* This function gets used by I830DRIInitBuffers(), and we might not have
|
||||
* XAAGetPatternROP() available. So just use the ROPs from our EXA code
|
||||
* if available.
|
||||
*/
|
||||
pI830->BR[13] = ((I830PatternROP[rop] << 16) |
|
||||
(pScrn->displayWidth * pI830->cpp));
|
||||
#else
|
||||
pI830->BR[13] = ((XAAGetPatternROP(rop) << 16) |
|
||||
(pScrn->displayWidth * pI830->cpp));
|
||||
#endif
|
||||
|
||||
pI830->BR[16] = color;
|
||||
|
||||
|
|
@ -291,7 +305,15 @@ I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
|
|||
xdir, ydir, rop, planemask, transparency_color);
|
||||
|
||||
pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
|
||||
#ifdef I830_USE_EXA
|
||||
/* This function gets used by I830DRIInitBuffers(), and we might not have
|
||||
* XAAGetCopyROP() available. So just use the ROPs from our EXA code
|
||||
* if available.
|
||||
*/
|
||||
pI830->BR[13] |= I830CopyROP[rop] << 16;
|
||||
#else
|
||||
pI830->BR[13] |= XAAGetCopyROP(rop) << 16;
|
||||
#endif
|
||||
|
||||
switch (pScrn->bitsPerPixel) {
|
||||
case 8:
|
||||
|
|
|
|||
Loading…
Reference in New Issue