exa: pixmap sharing infrastructure (v3)
This just adds exa interfaces for mixed exa so drivers can share and set shared pixmaps up correctly. v2: update for passing slave screen. v3: update for void * Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
fd6c1bf0a3
commit
0b0e714892
|
@ -782,6 +782,10 @@ exaCloseScreen(ScreenPtr pScreen)
|
||||||
unwrap(pExaScr, pScreen, ChangeWindowAttributes);
|
unwrap(pExaScr, pScreen, ChangeWindowAttributes);
|
||||||
unwrap(pExaScr, pScreen, BitmapToRegion);
|
unwrap(pExaScr, pScreen, BitmapToRegion);
|
||||||
unwrap(pExaScr, pScreen, CreateScreenResources);
|
unwrap(pExaScr, pScreen, CreateScreenResources);
|
||||||
|
if (pExaScr->SavedSharePixmapBacking)
|
||||||
|
unwrap(pExaScr, pScreen, SharePixmapBacking);
|
||||||
|
if (pExaScr->SavedSetSharedPixmapBacking)
|
||||||
|
unwrap(pExaScr, pScreen, SetSharedPixmapBacking);
|
||||||
unwrap(pExaScr, ps, Composite);
|
unwrap(pExaScr, ps, Composite);
|
||||||
if (pExaScr->SavedGlyphs)
|
if (pExaScr->SavedGlyphs)
|
||||||
unwrap(pExaScr, ps, Glyphs);
|
unwrap(pExaScr, ps, Glyphs);
|
||||||
|
@ -976,6 +980,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
|
||||||
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed);
|
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed);
|
||||||
wrap(pExaScr, pScreen, ModifyPixmapHeader,
|
wrap(pExaScr, pScreen, ModifyPixmapHeader,
|
||||||
exaModifyPixmapHeader_mixed);
|
exaModifyPixmapHeader_mixed);
|
||||||
|
wrap(pExaScr, pScreen, SharePixmapBacking, exaSharePixmapBacking_mixed);
|
||||||
|
wrap(pExaScr, pScreen, SetSharedPixmapBacking, exaSetSharedPixmapBacking_mixed);
|
||||||
|
|
||||||
pExaScr->do_migration = exaDoMigration_mixed;
|
pExaScr->do_migration = exaDoMigration_mixed;
|
||||||
pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_mixed;
|
pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_mixed;
|
||||||
pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
|
pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "fb.h"
|
#include "fb.h"
|
||||||
|
|
||||||
#define EXA_VERSION_MAJOR 2
|
#define EXA_VERSION_MAJOR 2
|
||||||
#define EXA_VERSION_MINOR 5
|
#define EXA_VERSION_MINOR 6
|
||||||
#define EXA_VERSION_RELEASE 0
|
#define EXA_VERSION_RELEASE 0
|
||||||
|
|
||||||
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
||||||
|
@ -694,6 +694,10 @@ typedef struct _ExaDriver {
|
||||||
int depth, int usage_hint, int bitsPerPixel,
|
int depth, int usage_hint, int bitsPerPixel,
|
||||||
int *new_fb_pitch);
|
int *new_fb_pitch);
|
||||||
/** @} */
|
/** @} */
|
||||||
|
Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
|
||||||
|
|
||||||
|
Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle);
|
||||||
|
|
||||||
} ExaDriverRec, *ExaDriverPtr;
|
} ExaDriverRec, *ExaDriverPtr;
|
||||||
|
|
||||||
/** @name EXA driver flags
|
/** @name EXA driver flags
|
||||||
|
|
|
@ -294,3 +294,36 @@ exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||||
|
ExaScreenPriv(pScreen);
|
||||||
|
Bool ret = FALSE;
|
||||||
|
|
||||||
|
exaMoveInPixmap(pPixmap);
|
||||||
|
/* get the driver to give us a handle */
|
||||||
|
if (pExaScr->info->SharePixmapBacking)
|
||||||
|
ret = pExaScr->info->SharePixmapBacking(pPixmap, slave, handle_p);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||||
|
ExaScreenPriv(pScreen);
|
||||||
|
Bool ret = FALSE;
|
||||||
|
|
||||||
|
if (pExaScr->info->SetSharedPixmapBacking)
|
||||||
|
ret = pExaScr->info->SetSharedPixmapBacking(pPixmap, handle);
|
||||||
|
|
||||||
|
if (ret == TRUE)
|
||||||
|
exaMoveInPixmap(pPixmap);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,8 @@ typedef struct {
|
||||||
BitmapToRegionProcPtr SavedBitmapToRegion;
|
BitmapToRegionProcPtr SavedBitmapToRegion;
|
||||||
CreateScreenResourcesProcPtr SavedCreateScreenResources;
|
CreateScreenResourcesProcPtr SavedCreateScreenResources;
|
||||||
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
|
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
|
||||||
|
SharePixmapBackingProcPtr SavedSharePixmapBacking;
|
||||||
|
SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking;
|
||||||
SourceValidateProcPtr SavedSourceValidate;
|
SourceValidateProcPtr SavedSourceValidate;
|
||||||
CompositeProcPtr SavedComposite;
|
CompositeProcPtr SavedComposite;
|
||||||
TrianglesProcPtr SavedTriangles;
|
TrianglesProcPtr SavedTriangles;
|
||||||
|
@ -658,6 +660,11 @@ void
|
||||||
void
|
void
|
||||||
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
|
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle);
|
||||||
|
Bool
|
||||||
|
exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p);
|
||||||
|
|
||||||
/* exa_render.c */
|
/* exa_render.c */
|
||||||
Bool
|
Bool
|
||||||
exaOpReadsDestination(CARD8 op);
|
exaOpReadsDestination(CARD8 op);
|
||||||
|
|
Loading…
Reference in New Issue