mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
Add support for ScreenPtr::SyncSharedPixmap
This allows deferring shared pixmap updates between different drivers. (Ported from radeon commit 53be26b00e83f871f0afd39caa5a7a1d6ec4aea1) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
97d7386caf
commit
bdee9f4dd4
@@ -491,6 +491,35 @@ amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if HAS_SYNC_SHARED_PIXMAP
|
||||
|
||||
static Bool
|
||||
master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
|
||||
{
|
||||
ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen;
|
||||
|
||||
return master_screen->SyncSharedPixmap != NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
|
||||
{
|
||||
ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen;
|
||||
|
||||
return slave_screen->SyncSharedPixmap != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)
|
||||
{
|
||||
ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen;
|
||||
|
||||
master_screen->SyncSharedPixmap(dirty);
|
||||
}
|
||||
|
||||
#else /* !HAS_SYNC_SHARED_PIXMAP */
|
||||
|
||||
static Bool
|
||||
master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
|
||||
{
|
||||
@@ -507,6 +536,15 @@ slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
|
||||
return slave_scrn->driverName == scrn->driverName;
|
||||
}
|
||||
|
||||
static void
|
||||
call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)
|
||||
{
|
||||
amdgpu_sync_shared_pixmap(dirty);
|
||||
}
|
||||
|
||||
#endif /* HAS_SYNC_SHARED_PIXMAPS */
|
||||
|
||||
|
||||
static Bool
|
||||
amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id)
|
||||
{
|
||||
@@ -524,7 +562,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id)
|
||||
RegionPtr region;
|
||||
|
||||
if (master_has_sync_shared_pixmap(scrn, dirty))
|
||||
amdgpu_sync_shared_pixmap(dirty);
|
||||
call_sync_shared_pixmap(dirty);
|
||||
|
||||
region = dirty_region(dirty);
|
||||
if (RegionNil(region))
|
||||
@@ -1803,6 +1841,9 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
|
||||
#ifdef AMDGPU_PIXMAP_SHARING
|
||||
pScreen->StartPixmapTracking = PixmapStartDirtyTracking;
|
||||
pScreen->StopPixmapTracking = PixmapStopDirtyTracking;
|
||||
#if HAS_SYNC_SHARED_PIXMAP
|
||||
pScreen->SyncSharedPixmap = amdgpu_sync_shared_pixmap;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!xf86CrtcScreenInit(pScreen))
|
||||
|
||||
Reference in New Issue
Block a user