diff options
author | Dave Airlie <airlied@redhat.com> | 2011-04-08 16:06:31 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-04-08 16:06:31 +1000 |
commit | 34fc83257169d39821fb4a4b819afd69286bf99c (patch) | |
tree | 9983d2bf7cec5ed6f7d4e0c326e25a67b2e4ac3d | |
parent | 8fda0ad807a2be124f5560b899912c86d74e20da (diff) |
exa: move into gpu layer even furtherimpedance
-rw-r--r-- | exa/exa.c | 55 | ||||
-rw-r--r-- | exa/exa_priv.h | 7 | ||||
-rw-r--r-- | exa/exa_unaccel.c | 4 |
3 files changed, 28 insertions, 38 deletions
@@ -541,31 +541,21 @@ exaCreateGC (GCPtr pGC) return ret; } -static Bool -exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) +static void +exaPixmapWindowFixup(PixmapPtr *ppPixmap, int bpp) { - Bool ret; - ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen = (*ppPixmap)->drawable.pScreen; ExaScreenPriv(pScreen); - if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) - exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - - if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) - exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); + exaPrepareAccess(&(*ppPixmap)->drawable, EXA_PREPARE_SRC); pExaScr->fallback_counter++; - swap(pExaScr, pScreen, ChangeWindowAttributes); - ret = pScreen->ChangeWindowAttributes(pWin, mask); - swap(pExaScr, pScreen, ChangeWindowAttributes); + swap(pExaScr, (&pScreen->gpu), PixmapWindowFixup); + pScreen->gpu.PixmapWindowFixup(ppPixmap, bpp); + swap(pExaScr, (&pScreen->gpu), PixmapWindowFixup); pExaScr->fallback_counter--; - if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) - exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) - exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); - - return ret; + exaFinishAccess(&(*ppPixmap)->drawable, EXA_PREPARE_SRC); } static RegionPtr @@ -708,15 +698,14 @@ exaCloseScreen(int i, ScreenPtr pScreen) unwrap(pExaScr, pScreen, WakeupHandler); unwrap(pExaScr, (&pScreen->gpu), CreateGC); unwrap(pExaScr, pScreen, CloseScreen); - unwrap(pExaScr, pScreen, GetImage); - unwrap(pExaScr, pScreen, GetSpans); + unwrap(pExaScr, (&pScreen->gpu), GetImage); + unwrap(pExaScr, (&pScreen->gpu), GetSpans); if (pExaScr->SavedCreatePixmap) - unwrap(pExaScr, pScreen, CreatePixmap); + unwrap(pExaScr, (&pScreen->gpu), CreatePixmap); if (pExaScr->SavedDestroyPixmap) - unwrap(pExaScr, pScreen, DestroyPixmap); + unwrap(pExaScr, (&pScreen->gpu), DestroyPixmap); if (pExaScr->SavedModifyPixmapHeader) unwrap(pExaScr, pScreen, ModifyPixmapHeader); - unwrap(pExaScr, pScreen, ChangeWindowAttributes); unwrap(pExaScr, (&pScreen->gpu), PixmapToRegion); unwrap(pExaScr, pScreen, CreateScreenResources); unwrap(pExaScr, ps, Composite); @@ -726,7 +715,7 @@ exaCloseScreen(int i, ScreenPtr pScreen) unwrap(pExaScr, ps, Triangles); unwrap(pExaScr, ps, AddTraps); - + unwrap(pExaScr, (&pScreen->gpu), PixmapWindowFixup); unwrap(pExaScr, (&pScreen->gpu), GetCopyAreaFunction); unwrap(pExaScr, (&pScreen->gpu), GetCopyPlaneFunction); @@ -876,12 +865,12 @@ exaDriverInit (ScreenPtr pScreen, wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); wrap(pExaScr, (&pScreen->gpu), CreateGC, exaCreateGC); wrap(pExaScr, pScreen, CloseScreen, exaCloseScreen); - wrap(pExaScr, pScreen, GetImage, exaGetImage); - wrap(pExaScr, pScreen, GetSpans, ExaCheckGetSpans); - wrap(pExaScr, pScreen, ChangeWindowAttributes, exaChangeWindowAttributes); + wrap(pExaScr, (&pScreen->gpu), GetImage, exaGetImage); + wrap(pExaScr, (&pScreen->gpu), GetSpans, ExaCheckGetSpans); wrap(pExaScr, (&pScreen->gpu), PixmapToRegion, exaPixmapToRegion); wrap(pExaScr, pScreen, CreateScreenResources, exaCreateScreenResources); + wrap(pExaScr, (&pScreen->gpu), PixmapWindowFixup, exaPixmapWindowFixup); wrap(pExaScr, (&pScreen->gpu), GetCopyAreaFunction, exaGetCopyAreaFunction); wrap(pExaScr, (&pScreen->gpu), GetCopyPlaneFunction, exaGetCopyPlaneFunction); if (ps) { @@ -915,8 +904,8 @@ exaDriverInit (ScreenPtr pScreen, } if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) { if (pExaScr->info->flags & EXA_MIXED_PIXMAPS) { - wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_mixed); - wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed); + wrap(pExaScr, (&pScreen->gpu), CreatePixmap, exaCreatePixmap_mixed); + wrap(pExaScr, (&pScreen->gpu), DestroyPixmap, exaDestroyPixmap_mixed); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_mixed); pExaScr->do_migration = exaDoMigration_mixed; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_mixed; @@ -924,8 +913,8 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->do_move_out_pixmap = NULL; pExaScr->prepare_access_reg = exaPrepareAccessReg_mixed; } else { - wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver); - wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver); + wrap(pExaScr, (&pScreen->gpu), CreatePixmap, exaCreatePixmap_driver); + wrap(pExaScr, (&pScreen->gpu), DestroyPixmap, exaDestroyPixmap_driver); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_driver); pExaScr->do_migration = NULL; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_driver; @@ -934,8 +923,8 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->prepare_access_reg = NULL; } } else { - wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic); - wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_classic); + wrap(pExaScr, (&pScreen->gpu), CreatePixmap, exaCreatePixmap_classic); + wrap(pExaScr, (&pScreen->gpu), DestroyPixmap, exaDestroyPixmap_classic); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_classic); pExaScr->do_migration = exaDoMigration_classic; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_classic; diff --git a/exa/exa_priv.h b/exa/exa_priv.h index cd296a7e3..7802c251c 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -158,8 +158,6 @@ typedef struct { GetSpansProcPtr SavedGetSpans; CreatePixmapProcPtr SavedCreatePixmap; DestroyPixmapProcPtr SavedDestroyPixmap; - ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; - BitmapToRegionProcPtr SavedPixmapToRegion; CreateScreenResourcesProcPtr SavedCreateScreenResources; ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; SourceValidateProcPtr SavedSourceValidate; @@ -169,8 +167,11 @@ typedef struct { TrapezoidsProcPtr SavedTrapezoids; AddTrapsProcPtr SavedAddTraps; + BitmapToRegionProcPtr SavedPixmapToRegion; + + PixmapWindowFixupProcPtr SavedPixmapWindowFixup; GetCopyAreaFunctionProcPtr SavedGetCopyAreaFunction; - GetCopyPlaneFunctionProcPtr SavedGetCopyPlaneFunction; + GetCopyPlaneFunctionProcPtr SavedGetCopyPlaneFunction; void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel); Bool (*pixmap_has_gpu_copy) (PixmapPtr pPixmap); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index c7ed41d08..26de9c009 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -374,7 +374,7 @@ ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, ExaFallbackPrepareReg(pDrawable, NULL, x, y, w, h, EXA_PREPARE_SRC, FALSE); swap(pExaScr, pScreen, GetImage); - pScreen->GetImage (pDrawable, x, y, w, h, format, planeMask, d); + pScreen->gpu.GetImage (pDrawable, x, y, w, h, format, planeMask, d); swap(pExaScr, pScreen, GetImage); exaFinishAccess (pDrawable, EXA_PREPARE_SRC); EXA_POST_FALLBACK(pScreen); @@ -394,7 +394,7 @@ ExaCheckGetSpans (DrawablePtr pDrawable, EXA_FALLBACK(("from %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); exaPrepareAccess (pDrawable, EXA_PREPARE_SRC); swap(pExaScr, pScreen, GetSpans); - pScreen->GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); + pScreen->gpu.GetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); swap(pExaScr, pScreen, GetSpans); exaFinishAccess (pDrawable, EXA_PREPARE_SRC); EXA_POST_FALLBACK(pScreen); |