summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-01-11 12:59:12 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-01-11 13:03:44 +1000
commit104b3ea842d4cebd993d3e7e9d55ebcadae0cf28 (patch)
treecb2a0e1818248e9b4f944c0e725c33fbf8e5fcd7
parente8798d91eedc5d8337223b2257ca607da8a197de (diff)
exa: Remove non-driver pixmaps path
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--src/drmmode_display.c4
-rw-r--r--src/nouveau_exa.c103
-rw-r--r--src/nouveau_wfb.c11
-rw-r--r--src/nouveau_xv.c12
-rw-r--r--src/nv_driver.c39
-rw-r--r--src/nv_type.h29
6 files changed, 23 insertions, 175 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index c315299..04353e6 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -170,7 +170,7 @@ drmmode_fbcon_copy(ScrnInfoPtr pScrn)
unsigned w = pScrn->virtualX, h = pScrn->virtualY;
int i, ret, fbcon_id = 0;
- if (!pNv->exa_driver_pixmaps) {
+ if (pNv->NoAccel) {
if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR))
return;
memset(pNv->scanout->map, 0x00, pNv->scanout->size);
@@ -1163,7 +1163,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
}
ppix = screen->GetScreenPixmap(screen);
- if (pNv->exa_driver_pixmaps)
+ if (!pNv->NoAccel)
nouveau_bo_ref(pNv->scanout, &nouveau_pixmap(ppix)->bo);
screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch,
(!pNv->NoAccel || pNv->ShadowPtr) ?
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index 3165f08..fab87c6 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -290,79 +290,31 @@ nouveau_exa_mark_sync(ScreenPtr pScreen)
static void
nouveau_exa_wait_marker(ScreenPtr pScreen, int marker)
{
- NVPtr pNv = NVPTR(xf86Screens[pScreen->myNum]);
-
- if (!pNv->exa_driver_pixmaps)
- NVSync(xf86Screens[pScreen->myNum]);
}
static Bool
nouveau_exa_prepare_access(PixmapPtr ppix, int index)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
- NVPtr pNv = NVPTR(pScrn);
- struct nouveau_bo *bo;
-
- if (pNv->exa_driver_pixmaps) {
- void *map = nouveau_exa_pixmap_map(ppix);
-
- if (!map)
- return FALSE;
-
- ppix->devPrivate.ptr = map;
- return TRUE;
- } else
- if (ppix == pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) {
- nouveau_bo_map(pNv->scanout, NOUVEAU_BO_RDWR);
- ppix->devPrivate.ptr = pNv->scanout->map;
- nouveau_bo_unmap(pNv->scanout);
- return TRUE;
- } else
- if (drmmode_is_rotate_pixmap(ppix, &bo)) {
- nouveau_bo_map(bo, NOUVEAU_BO_RDWR);
- ppix->devPrivate.ptr = bo->map;
- nouveau_bo_unmap(bo);
- return TRUE;
- }
+ void *map = nouveau_exa_pixmap_map(ppix);
+ if (!map)
+ return FALSE;
- return FALSE;
+ ppix->devPrivate.ptr = map;
+ return TRUE;
}
static void
nouveau_exa_finish_access(PixmapPtr ppix, int index)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
- NVPtr pNv = NVPTR(pScrn);
-
- if (pNv->exa_driver_pixmaps) {
- nouveau_exa_pixmap_unmap(ppix);
- } else
- if (ppix == pScrn->pScreen->GetScreenPixmap(pScrn->pScreen) ||
- drmmode_is_rotate_pixmap(ppix, NULL)) {
- ppix->devPrivate.ptr = NULL;
- }
+ nouveau_exa_pixmap_unmap(ppix);
}
static Bool
nouveau_exa_pixmap_is_offscreen(PixmapPtr ppix)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
- NVPtr pNv = NVPTR(pScrn);
+ struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
- if (pNv->exa_driver_pixmaps) {
- struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
-
- if (nvpix && nvpix->bo)
- return TRUE;
- } else
- if (ppix->devPrivate.ptr >= pNv->offscreen_map &&
- ppix->devPrivate.ptr < pNv->offscreen_map + pNv->offscreen->size)
- return TRUE;
- else
- if (ppix == pScrn->pScreen->GetScreenPixmap(pScrn->pScreen))
- return TRUE;
- else
- if (drmmode_is_rotate_pixmap(ppix, NULL))
+ if (nvpix && nvpix->bo)
return TRUE;
return FALSE;
@@ -620,41 +572,12 @@ nouveau_exa_init(ScreenPtr pScreen)
exa->PrepareAccess = nouveau_exa_prepare_access;
exa->FinishAccess = nouveau_exa_finish_access;
-#if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 5) || EXA_VERSION_MAJOR > 2
- if (pNv->exa_driver_pixmaps) {
- exa->flags |= (EXA_HANDLES_PIXMAPS | EXA_MIXED_PIXMAPS);
- exa->pixmapOffsetAlign = 256;
- exa->pixmapPitchAlign = 64;
-
- exa->CreatePixmap2 = nouveau_exa_create_pixmap;
- exa->DestroyPixmap = nouveau_exa_destroy_pixmap;
- } else
-#endif
- {
- exa->memoryBase = pNv->offscreen_map;
- exa->memorySize = pNv->offscreen->size;
- exa->offScreenBase = 0;
+ exa->flags |= (EXA_HANDLES_PIXMAPS | EXA_MIXED_PIXMAPS);
+ exa->pixmapOffsetAlign = 256;
+ exa->pixmapPitchAlign = 64;
- if (pNv->Architecture < NV_ARCH_50) {
- exa->pixmapOffsetAlign = 256;
- } else {
- /* Workaround some corruption issues caused by exa's
- * offscreen memory allocation no understanding G8x/G9x
- * memory layout. This is terrible, but it should
- * prevent all but the most unlikely cases from
- * occuring.
- *
- * See http://nouveau.freedesktop.org/wiki/NV50Support
- * for a far better fix until driver pixmaps are ready
- * to be used.
- */
- exa->pixmapOffsetAlign = 65536;
- exa->flags |= EXA_OFFSCREEN_ALIGN_POT;
- exa->offScreenBase =
- NOUVEAU_ALIGN(exa->offScreenBase, 0x10000);
- }
- exa->pixmapPitchAlign = 64;
- }
+ exa->CreatePixmap2 = nouveau_exa_create_pixmap;
+ exa->DestroyPixmap = nouveau_exa_destroy_pixmap;
if (pNv->Architecture >= NV_ARCH_50) {
exa->maxX = 8192;
diff --git a/src/nouveau_wfb.c b/src/nouveau_wfb.c
index b49d7d9..adee492 100644
--- a/src/nouveau_wfb.c
+++ b/src/nouveau_wfb.c
@@ -125,8 +125,6 @@ void
nouveau_wfb_setup_wrap(ReadMemoryProcPtr *pRead, WriteMemoryProcPtr *pWrite,
DrawablePtr pDraw)
{
- ScreenPtr pScreen = pDraw->pScreen;
- NVPtr pNv = NVPTR(xf86Screens[pScreen->myNum]);
struct nouveau_bo *bo = NULL;
struct wfb_pixmap *wfb;
PixmapPtr ppix = NULL;
@@ -136,13 +134,8 @@ nouveau_wfb_setup_wrap(ReadMemoryProcPtr *pRead, WriteMemoryProcPtr *pWrite,
return;
ppix = NVGetDrawablePixmap(pDraw);
- if (ppix) {
- if (pNv->exa_driver_pixmaps)
- bo = nouveau_pixmap_bo(ppix);
- else
- if (ppix == pScreen->GetScreenPixmap(pScreen))
- bo = pNv->scanout;
- }
+ if (ppix)
+ bo = nouveau_pixmap_bo(ppix);
if (!ppix || !bo) {
for (i = 0; i < 6; i++)
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index b5eae26..405362b 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -1257,18 +1257,6 @@ CPU_copy:
exaMoveInPixmap(ppix);
pNv->exa_force_cp = FALSE;
- if (!pNv->exa_driver_pixmaps) {
- ScreenPtr pScreen = pScrn->pScreen;
-
- /* check if it made it offscreen */
- if (ppix != pScreen->GetScreenPixmap(pScreen) &&
- exaGetPixmapOffset(ppix) >=
- pNv->EXADriverPtr->memorySize)
- /* we lost, insufficient space probably */
- return BadAlloc;
-
- ExaOffscreenMarkUsed(ppix);
- } else
if (!exaGetPixmapDriverPrivate(ppix))
return BadAlloc;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 3eed25a..12ec7ce 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -417,7 +417,7 @@ NVCreateScreenResources(ScreenPtr pScreen)
return FALSE;
pScreen->CreateScreenResources = NVCreateScreenResources;
- if (pNv->exa_driver_pixmaps) {
+ if (!pNv->NoAccel) {
ppix = pScreen->GetScreenPixmap(pScreen);
nouveau_bo_ref(pNv->scanout, &nouveau_pixmap(ppix)->bo);
}
@@ -824,17 +824,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
"Using \"Shadow Framebuffer\" - acceleration disabled\n");
}
-#if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 5) || EXA_VERSION_MAJOR > 2
- if (!pNv->NoAccel &&
- xf86ReturnOptValBool(pNv->Options, OPTION_EXA_PIXMAPS, TRUE)) {
- pNv->exa_driver_pixmaps = TRUE;
- }
-
if (!pNv->NoAccel && pNv->Architecture >= NV_ARCH_50) {
pNv->wfb_enabled = TRUE;
pNv->tiled_scanout = TRUE;
}
-#endif
if(xf86GetOptValInteger(pNv->Options, OPTION_VIDEO_KEY, &(pNv->videoKey))) {
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n",
@@ -933,33 +926,6 @@ NVMapMem(ScrnInfoPtr pScrn)
if (pNv->NoAccel)
return TRUE;
- if (!pNv->exa_driver_pixmaps) {
- size = (dev->vm_vram_size / 2) - size;
-
- if (pNv->Architecture >= NV_ARCH_50) {
- tile_mode = 0;
- tile_flags = 0x7000;
- }
-
- ret = nouveau_bo_new_tile(dev, NOUVEAU_BO_VRAM |
- NOUVEAU_BO_MAP, 0, size, tile_mode,
- tile_flags, &pNv->offscreen);
- if (ret) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Error allocating"
- " offscreen pixmap area: %d\n", ret);
- return FALSE;
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Allocated %dMiB VRAM for offscreen pixmaps\n",
- (uint32_t)(pNv->offscreen->size >> 20));
-
- nouveau_bo_map(pNv->offscreen, NOUVEAU_BO_RDWR);
- pNv->offscreen_map = pNv->offscreen->map;
- nouveau_bo_unmap(pNv->offscreen);
- }
-
-
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: %dMiB available\n",
(unsigned int)(dev->vm_gart_size >> 20));
if (dev->vm_gart_size > (16 * 1024 * 1024))
@@ -1077,7 +1043,6 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
"Falling back to NoAccel\n");
pNv->NoAccel = TRUE;
pNv->ShadowFB = TRUE;
- pNv->exa_driver_pixmaps = FALSE;
pNv->wfb_enabled = FALSE;
pNv->tiled_scanout = FALSE;
pScrn->displayWidth = nv_pitch_align(pNv,
@@ -1086,7 +1051,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
- if (!pNv->NoAccel && pNv->exa_driver_pixmaps)
+ if (!pNv->NoAccel)
nouveau_dri2_init(pScreen);
/* Allocate and map memory areas we need */
diff --git a/src/nv_type.h b/src/nv_type.h
index e5a4e86..23340e8 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -47,7 +47,6 @@ typedef struct _NVRec {
int ShadowPitch;
ExaDriverPtr EXADriverPtr;
- Bool exa_driver_pixmaps;
Bool exa_force_cp;
Bool wfb_enabled;
Bool tiled_scanout;
@@ -174,39 +173,19 @@ Bool drmmode_is_rotate_pixmap(PixmapPtr, struct nouveau_bo **);
static inline struct nouveau_bo *
nouveau_pixmap_bo(PixmapPtr ppix)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
- NVPtr pNv = NVPTR(pScrn);
- struct nouveau_bo *bo;
-
- if (pNv->exa_driver_pixmaps) {
- struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
- return nvpix ? nvpix->bo : NULL;
- } else
- if (ppix == pScrn->pScreen->GetScreenPixmap(pScrn->pScreen))
- return pNv->scanout;
- else
- if (drmmode_is_rotate_pixmap(ppix, &bo))
- return bo;
+ struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
- return pNv->offscreen;
+ return nvpix ? nvpix->bo : NULL;
}
static inline unsigned
nouveau_pixmap_offset(PixmapPtr ppix)
{
- ScrnInfoPtr pScrn = xf86Screens[ppix->drawable.pScreen->myNum];
- NVPtr pNv = NVPTR(pScrn);
-
- if (pNv->exa_driver_pixmaps ||
- ppix == pScrn->pScreen->GetScreenPixmap(pScrn->pScreen) ||
- drmmode_is_rotate_pixmap(ppix, NULL))
- return 0;
-
- return exaGetPixmapOffset(ppix);
+ return 0;
}
static inline uint32_t
- nv_pitch_align(NVPtr pNv, uint32_t width, int bpp)
+nv_pitch_align(NVPtr pNv, uint32_t width, int bpp)
{
int mask;