From 02ae85c4c93bbd0013c063ce0014b365a8ba061f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 23 Apr 2009 12:04:17 +1000 Subject: exa: add CreatePixmap2 hook for driver pixmaps. This adds a revised pixmap hook for driver pixmaps, which is required to support tiling on various chips. Signed-off-by: Dave Airlie --- exa/exa.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'exa/exa.c') diff --git a/exa/exa.c b/exa/exa.c index 10abf06c9..2de348a8d 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -289,7 +289,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, return NullPixmap; swap(pExaScr, pScreen, CreatePixmap); - if (!pExaScr->info->CreatePixmap) { + if (!pExaScr->info->CreatePixmap && !pExaScr->info->CreatePixmap2) { pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, usage_hint); } else { driver_alloc = 1; @@ -324,7 +324,10 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, */ pPixmap->devPrivate.ptr = NULL; - pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); + if (pExaScr->info->CreatePixmap2) + pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp); + else + pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); if (!pExaPixmap->driverPriv) { swap(pExaScr, pScreen, DestroyPixmap); pScreen->DestroyPixmap (pPixmap); @@ -1261,7 +1264,7 @@ exaDriverInit (ScreenPtr pScreen, wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader); - if (!pExaScr->info->CreatePixmap) { + if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) { LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n", pScreen->myNum, pExaScr->info->memorySize - pExaScr->info->offScreenBase); @@ -1274,7 +1277,7 @@ exaDriverInit (ScreenPtr pScreen, else LogMessage(X_INFO, "EXA(%d): No offscreen pixmaps\n", pScreen->myNum); - if (!pExaScr->info->CreatePixmap) { + if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) { DBG_PIXMAP(("============== %ld < %ld\n", pExaScr->info->offScreenBase, pExaScr->info->memorySize)); if (pExaScr->info->offScreenBase < pExaScr->info->memorySize) { -- cgit v1.2.3