summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain G. Ainsworth <oga@openbsd.org>2009-01-13 18:46:41 +0000
committerKristian Høgsberg <krh@redhat.com>2009-01-20 12:11:01 -0500
commitc7db3201106f07f3228c989014d6db5ace5378f6 (patch)
tree56ae57cde03155cba1a9e15a2c4d8154c3a69cf9
parentc82adfd0169317efb6c2f9de0f315651f9adbae1 (diff)
Remove the pageflipping infrastructure.
It was broken on current kernels, and deprecated anyway.
-rw-r--r--configure.ac5
-rw-r--r--man/intel.man7
-rw-r--r--src/i830.h8
-rw-r--r--src/i830_dri.c278
-rw-r--r--src/i830_driver.c40
5 files changed, 0 insertions, 338 deletions
diff --git a/configure.ac b/configure.ac
index 6c4ba578..38d373ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,8 +105,6 @@ if test x$DRI != xno; then
[have_sarea_h="yes"], [have_sarea_h="no"])
AC_CHECK_FILE([${sdkdir}/dristruct.h],
[have_dristruct_h="yes"], [have_dristruct_h="no"])
- AC_CHECK_FILE([${sdkdir}/damage.h],
- [have_damage_h="yes"], [have_damage_h="no"])
fi
AC_MSG_CHECKING([whether to include DRI support])
if test x$DRI = xauto; then
@@ -215,9 +213,6 @@ if test "$DRI" = yes; then
PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
- if test "$have_damage_h" = yes; then
- AC_DEFINE(DAMAGE,1,[Use Damage extension])
- fi
fi
dnl exaGetPixmapDriverPrivate required for DRM_MODE.
diff --git a/man/intel.man b/man/intel.man
index 2359624f..65d11146 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -150,13 +150,6 @@ pool. On systems with a working GEM environment, this can be disabled to
increase the memory pool available to other graphics tasks.
Default for i830 and newer: Enabled.
Default for i810: this option is not used.
-.BI "Option \*qPageFlip\*q \*q" boolean \*q
-Enable support for page flipping. This should improve 3D performance at the
-potential cost of worse performance with mixed 2D/3D. Also note that this gives
-no benefit without corresponding support in the Mesa 3D driver
-Default for i810: The option is not used.
-Default for i830 and above: Disabled (This option is currently unstable).
-.TP
.BI "Option \*qAccelMethod\*q \*q" string \*q
Choose acceleration architecture, either "XAA" or "EXA". XAA is the old
XFree86 based acceleration architecture. EXA is a newer and simpler
diff --git a/src/i830.h b/src/i830.h
index 10f7bf69..b726dd68 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -72,9 +72,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri.h"
#include "GL/glxint.h"
#include "i830_dri.h"
-#ifdef DAMAGE
-#include "damage.h"
-#endif
#include "drmmode_display.h"
#endif
#include "intel_bufmgr.h"
@@ -477,16 +474,11 @@ typedef struct _I830Rec {
Bool can_resize;
Bool want_vblank_interrupts;
-#ifdef DAMAGE
- DamagePtr pDamage;
- RegionRec driRegion;
-#endif
#endif
Bool need_mi_flush;
Bool NeedRingBufferLow;
- Bool allowPageFlip;
Bool tiling;
Bool fb_compression;
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 98df2acc..d6698daa 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -111,14 +111,6 @@ static void I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
static void I830DRITransitionTo2d(ScreenPtr pScreen);
static void I830DRITransitionTo3d(ScreenPtr pScreen);
-#if defined(DAMAGE) && (DRIINFO_MAJOR_VERSION > 5 || \
- (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 1))
-#define DRI_SUPPORTS_CLIP_NOTIFY 1
-#else
-#define DRI_SUPPORTS_CLIP_NOTIFY 0
-static void I830DRITransitionMultiToSingle3d(ScreenPtr pScreen);
-static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
-#endif
#if (DRIINFO_MAJOR_VERSION > 5 || \
(DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 4))
@@ -127,10 +119,6 @@ static void I830DRITransitionSingleToMulti3d(ScreenPtr pScreen);
#define DRI_DRIVER_FRAMEBUFFER_MAP 0
#endif
-#if DRI_SUPPORTS_CLIP_NOTIFY
-static void I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num);
-#endif
-
extern void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig * configs,
void **configprivs);
@@ -599,10 +587,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->texOffsetStart = I830TexOffsetStart;
#endif
-#if DRI_SUPPORTS_CLIP_NOTIFY
- pDRIInfo->ClipNotify = I830DRIClipNotify;
-#endif
-
#if DRI_DRIVER_FRAMEBUFFER_MAP
/* DRI version is high enough that we can get the DRI code to not
* try to manage the framebuffer.
@@ -622,11 +606,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
pDRIInfo->TransitionTo2d = I830DRITransitionTo2d;
pDRIInfo->TransitionTo3d = I830DRITransitionTo3d;
-#if !DRI_SUPPORTS_CLIP_NOTIFY
- pDRIInfo->TransitionSingleToMulti3D = I830DRITransitionSingleToMulti3d;
- pDRIInfo->TransitionMultiToSingle3D = I830DRITransitionMultiToSingle3d;
-#endif
-
/* do driver-independent DRI screen initialization here */
if (!DRIScreenInit(pScreen, pDRIInfo, &pI830->drmSubFD)) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
@@ -729,14 +708,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
return FALSE;
}
pI830->drmMinor = version->version_minor;
-#ifdef DAMAGE
- if (pI830->allowPageFlip && pI830->drmMinor < 9) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "DRM version 1.9 or newer required for Page flipping. "
- "Disabling.\n");
- pI830->allowPageFlip = FALSE;
- }
-#endif
drmFreeVersion(version);
}
}
@@ -965,10 +936,6 @@ I830DRICloseScreen(ScreenPtr pScreen)
DPRINTF(PFX, "I830DRICloseScreen\n");
-#ifdef DAMAGE
- REGION_UNINIT(pScreen, &pI830->driRegion);
-#endif
-
if (!pI830->memory_manager && pI830DRI->irq) {
drmCtlUninstHandler(pI830->drmSubFD);
pI830DRI->irq = 0;
@@ -1022,66 +989,6 @@ I830DRIFinishScreenInit(ScreenPtr pScreen)
return TRUE;
}
-#ifdef DAMAGE
-/* This should be done *before* XAA syncs,
- * Otherwise will have to sync again???
- */
-static void
-I830DRIDoRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox, uint32_t dst)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- unsigned int i, cmd, pitch, flags;
-
- pitch = pScrn->displayWidth * pI830->cpp;
- flags = 0xcc << 16; /* ROP_S */
-
- if (pScrn->bitsPerPixel == 32) {
- cmd = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
- XY_SRC_COPY_BLT_WRITE_RGB);
- flags |= 3 << 24;
- } else {
- cmd = (XY_SRC_COPY_BLT_CMD);
- flags |= 1 << 24;
- }
-
- /* We can assume tiled buffers if page flipping is on */
- if (IS_I965G(pI830)) {
- cmd |= XY_SRC_COPY_BLT_DST_TILED | XY_SRC_COPY_BLT_SRC_TILED;
- pitch >>= 2;
- }
-
- for (i = 0 ; i < num ; i++, pbox++) {
- BEGIN_BATCH(8);
- OUT_BATCH(cmd);
- OUT_BATCH(flags | pitch);
- OUT_BATCH((pbox->y1 << 16) | pbox->x1);
- OUT_BATCH((pbox->y2 << 16) | pbox->x2);
- OUT_BATCH(dst);
- OUT_BATCH((pbox->y1 << 16) | pbox->x1);
- OUT_BATCH(pitch);
- OUT_BATCH(pI830->front_buffer->offset);
- ADVANCE_BATCH();
- }
-}
-
-static void
-I830DRIRefreshArea (ScrnInfoPtr pScrn, int num, BoxPtr pbox)
-{
- I830Ptr pI830 = I830PTR(pScrn);
- drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
-
- /* Don't want to do this when no 3d is active and pages are
- * right-way-round :
- */
- if (!pSAREAPriv->pf_active && pSAREAPriv->pf_current_page == 0)
- return;
-
- I830DRIDoRefreshArea(pScrn, num, pbox, pI830->back_buffer->offset);
-
- DamageEmpty(pI830->pDamage);
-}
-#endif
-
static void
I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
DRIContextType oldContextType, void *oldContext,
@@ -1104,86 +1011,14 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
if (!pI830->memory_manager)
i830_refresh_ring(pScrn);
-#ifdef DAMAGE
- if (!pI830->pDamage && pI830->allowPageFlip) {
- PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
- pI830->pDamage = DamageCreate(NULL, NULL, DamageReportNone, TRUE,
- pScreen, pPix);
-
- if (pI830->pDamage == NULL) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "No screen damage record, page flipping disabled\n");
- pI830->allowPageFlip = FALSE;
- } else {
- DamageRegister(&pPix->drawable, pI830->pDamage);
-
- DamageDamageRegion(&pPix->drawable,
- &WindowTable[pScreen->myNum]->winSize);
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Damage tracking initialized for page flipping\n");
- }
- }
-#endif
} else if (syncType == DRI_2D_SYNC &&
oldContextType == DRI_NO_CONTEXT &&
newContextType == DRI_2D_CONTEXT) {
-#ifdef DAMAGE
- drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-#endif
-
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("i830DRISwapContext (out)\n");
if (!pScrn->vtSema)
return;
-
-#ifdef DAMAGE
- if (pI830->pDamage) {
- RegionPtr pDamageReg = DamageRegion(pI830->pDamage);
-
- if (pDamageReg) {
- RegionRec region;
- int nrects;
-
- REGION_NULL(pScreen, &region);
- REGION_SUBTRACT(pScreen, &region, pDamageReg, &pI830->driRegion);
-
- if ((nrects = REGION_NUM_RECTS(&region)))
- I830DRIRefreshArea(pScrn, nrects, REGION_RECTS(&region));
-
- REGION_UNINIT(pScreen, &region);
- }
- }
-#endif
-
-#ifdef DAMAGE
- /* Try flipping back to the front page if necessary */
- if (sPriv && !sPriv->pf_enabled && sPriv->pf_current_page != 0) {
- drm_i915_flip_t flip = { .pipes = 0 };
-
- if (sPriv->pf_current_page & (0x3 << 2)) {
- sPriv->pf_current_page = sPriv->pf_current_page & 0x3;
- sPriv->pf_current_page |= 1 << 2;
-
- flip.pipes |= 0x2;
- }
-
- if (sPriv->pf_current_page & 0x3) {
- sPriv->pf_current_page = sPriv->pf_current_page & (0x3 << 2);
- sPriv->pf_current_page |= 1;
-
- flip.pipes |= 0x1;
- }
-
- drmCommandWrite(pI830->drmSubFD, DRM_I915_FLIP, &flip, sizeof(flip));
-
- if (sPriv->pf_current_page != 0)
- xf86DrvMsg(pScreen->myNum, X_WARNING,
- "[dri] %s: kernel failed to unflip buffers.\n", __func__);
- }
-#endif
-
pI830->LockHeld = 0;
} else if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("i830DRISwapContext (other)\n");
@@ -1402,70 +1237,12 @@ I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
i830MarkSync(pScrn);
}
-/* Use callbacks from dri.c to support pageflipping mode for a single
- * 3d context without need for any specific full-screen extension.
- *
- * Also see tdfx driver for example of using these callbacks to
- * allocate and free 3d-specific memory on demand.
- */
-
-/* Use the miext/shadow module to maintain a list of dirty rectangles.
- * These are blitted to the back buffer to keep both buffers clean
- * during page-flipping when the 3d application isn't fullscreen.
- *
- * Unlike most use of the shadow code, both buffers are in video
- * memory.
- *
- * An alternative to this would be to organize for all on-screen
- * drawing operations to be duplicated for the two buffers. That
- * might be faster, but seems like a lot more work...
- */
-
-static void
-I830DRISetPfMask(ScreenPtr pScreen, int pfMask)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- I830Ptr pI830 = I830PTR(pScrn);
- drmI830Sarea *pSAREAPriv = DRIGetSAREAPrivate(pScreen);
-
- if (pI830->allowPageFlip && pfMask) {
- pSAREAPriv->pf_enabled = pI830->allowPageFlip;
- pSAREAPriv->pf_active = pfMask;
- } else
- pSAREAPriv->pf_active = 0;
-}
-
-#if !DRI_SUPPORTS_CLIP_NOTIFY
-static void
-I830DRITransitionSingleToMulti3d(ScreenPtr pScreen)
-{
- /* Tell the clients not to pageflip. How?
- * -- Field in sarea, plus bumping the window counters.
- * -- DRM needs to cope with Front-to-Back swapbuffers.
- */
- I830DRISetPfMask(pScreen, 0);
-}
-
-static void
-I830DRITransitionMultiToSingle3d(ScreenPtr pScreen)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- I830Ptr pI830 = I830PTR(pScrn);
-
- /* Let the remaining 3d app start page flipping again.
- */
- I830DRISetPfMask(pScreen, pI830->allowPageFlip ? 0x3 : 0);
-}
-#endif /* !DRI_SUPPORTS_CLIP_NOTIFY */
-
static void
I830DRITransitionTo3d(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
- I830DRISetPfMask(pScreen, pI830->allowPageFlip ? 0x3 : 0);
-
pI830->want_vblank_interrupts = TRUE;
I830DRISetVBlankInterrupt(pScrn, TRUE);
}
@@ -1477,65 +1254,10 @@ I830DRITransitionTo2d(ScreenPtr pScreen)
I830Ptr pI830 = I830PTR(pScrn);
drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
- I830DRISetPfMask(pScreen, 0);
-
- sPriv->pf_enabled = 0;
-
pI830->want_vblank_interrupts = FALSE;
I830DRISetVBlankInterrupt(pScrn, FALSE);
}
-#if DRI_SUPPORTS_CLIP_NOTIFY
-static void
-I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- I830Ptr pI830 = I830PTR(pScrn);
- unsigned pfMask = 0;
-
- REGION_UNINIT(pScreen, &pI830->driRegion);
- REGION_NULL(pScreen, &pI830->driRegion);
-
- if (num > 0) {
- drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
- BoxRec crtcBox[2];
- unsigned numvisible[2] = { 0, 0 };
- int i, j;
-
- crtcBox[0].x1 = sPriv->pipeA_x;
- crtcBox[0].y1 = sPriv->pipeA_y;
- crtcBox[0].x2 = crtcBox[0].x1 + sPriv->pipeA_w;
- crtcBox[0].y2 = crtcBox[0].y1 + sPriv->pipeA_h;
- crtcBox[1].x1 = sPriv->pipeB_x;
- crtcBox[1].y1 = sPriv->pipeB_y;
- crtcBox[1].x2 = crtcBox[1].x1 + sPriv->pipeB_w;
- crtcBox[1].y2 = crtcBox[1].y1 + sPriv->pipeB_h;
-
- for (i = 0; i < 2; i++) {
- for (j = 0; j < num; j++) {
- WindowPtr pWin = ppWin[j];
-
- if (pWin) {
- if (RECT_IN_REGION(pScreen, &pWin->clipList, &crtcBox[i]) !=
- rgnOUT)
- numvisible[i]++;
-
- if (i == 0)
- REGION_UNION(pScreen, &pI830->driRegion, &pWin->clipList,
- &pI830->driRegion);
- }
- }
-
- if (numvisible[i] == 1)
- pfMask |= 1 << i;
- }
- } else
- REGION_NULL(pScreen, &pI830->driRegion);
-
- I830DRISetPfMask(pScreen, pfMask);
-}
-#endif /* DRI_SUPPORTS_CLIP_NOTIFY */
-
static int
i830_name_buffer (ScrnInfoPtr pScrn, i830_memory *mem)
{
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b5e77c75..7b66a539 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -323,7 +323,6 @@ static OptionInfoRec I830Options[] = {
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_CACHE_LINES, "CacheLines", OPTV_INTEGER, {0}, FALSE},
{OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, TRUE},
- {OPTION_PAGEFLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE},
{OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, TRUE},
{OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE},
{OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE},
@@ -1794,24 +1793,6 @@ I830XvInit(ScrnInfoPtr pScrn)
#endif
}
-static void
-I830DriOptsInit(ScrnInfoPtr pScrn)
-{
-#ifdef XF86DRI
- I830Ptr pI830 = I830PTR(pScrn);
- MessageType from = X_PROBED;
-
- pI830->allowPageFlip = FALSE;
- from = (pI830->directRenderingType != DRI_DISABLED &&
- xf86GetOptValBool(pI830->Options, OPTION_PAGEFLIP,
- &pI830->allowPageFlip)) ? X_CONFIG : X_DEFAULT;
-
- xf86DrvMsg(pScrn->scrnIndex, from, "Will%s try to enable page flipping\n",
- pI830->allowPageFlip ? "" : " not");
-
-#endif /* XF86DRI */
-}
-
/**
* This is called per zaphod head (so usually just once) to do initialization
* before the Screen is created.
@@ -1965,8 +1946,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
I830XvInit(pScrn);
- I830DriOptsInit(pScrn);
-
if (!xf86SetGamma(pScrn, zeros)) {
PreInitCleanup(pScrn);
return FALSE;
@@ -2879,11 +2858,6 @@ i830_memory_init(ScrnInfoPtr pScrn)
/* If tiling fails we have to disable page flipping & FBC */
pScrn->displayWidth = savedDisplayWidth;
- if (pI830->allowPageFlip)
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Couldn't allocate tiled memory, page flipping "
- "disabled\n");
- pI830->allowPageFlip = FALSE;
if (pI830->fb_compression)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Couldn't allocate tiled memory, fb compression "
@@ -3314,11 +3288,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
I830SwapPipes(pScrn);
#endif
-#ifdef XF86DRI
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Page Flipping %sabled\n",
- pI830->allowPageFlip ? "en" : "dis");
-#endif
-
if (I830IsPrimary(pScrn)) {
pScrn->fbOffset = pI830->front_buffer->offset;
} else {
@@ -3871,15 +3840,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
#ifdef XF86DRI
if (pI830->directRenderingOpen &&
pI830->directRenderingType == DRI_XF86DRI) {
-#ifdef DAMAGE
- if (pI830->pDamage) {
- PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen);
-
- DamageUnregister(&pPix->drawable, pI830->pDamage);
- DamageDestroy(pI830->pDamage);
- pI830->pDamage = NULL;
- }
-#endif
pI830->directRenderingOpen = FALSE;
I830DRICloseScreen(pScreen);
}