<div dir="ltr">Am I right in guessing this is only required for DRI2?</div><br><div class="gmail_quote"><div dir="ltr">On Wed, 28 Sep 2016 at 09:00 Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com" target="_blank">michel.daenzer@amd.com</a>><br>
<br>
This allows deferring shared pixmap updates between different drivers.<br>
<br>
(Ported from radeon commit 53be26b00e83f871f0afd39caa5a7a1d6ec4aea1)<br>
<br>
Signed-off-by: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com" target="_blank">michel.daenzer@amd.com</a>><br>
---<br>
 src/amdgpu_kms.c | 43 ++++++++++++++++++++++++++++++++++++++++++-<br>
 1 file changed, 42 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c<br>
index a159c84..4ae7995 100644<br>
--- a/src/amdgpu_kms.c<br>
+++ b/src/amdgpu_kms.c<br>
@@ -491,6 +491,35 @@ amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)<br>
        }<br>
 }<br>
<br>
+<br>
+#if HAS_SYNC_SHARED_PIXMAP<br>
+<br>
+static Bool<br>
+master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)<br>
+{<br>
+       ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen;<br>
+<br>
+       return master_screen->SyncSharedPixmap != NULL;<br>
+}<br>
+<br>
+static Bool<br>
+slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)<br>
+{<br>
+       ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen;<br>
+<br>
+       return slave_screen->SyncSharedPixmap != NULL;<br>
+}<br>
+<br>
+static void<br>
+call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)<br>
+{<br>
+       ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen;<br>
+<br>
+       master_screen->SyncSharedPixmap(dirty);<br>
+}<br>
+<br>
+#else /* !HAS_SYNC_SHARED_PIXMAP */<br>
+<br>
 static Bool<br>
 master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)<br>
 {<br>
@@ -507,6 +536,15 @@ slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)<br>
        return slave_scrn->driverName == scrn->driverName;<br>
 }<br>
<br>
+static void<br>
+call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty)<br>
+{<br>
+       amdgpu_sync_shared_pixmap(dirty);<br>
+}<br>
+<br>
+#endif /* HAS_SYNC_SHARED_PIXMAPS */<br>
+<br>
+<br>
 static Bool<br>
 amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id)<br>
 {<br>
@@ -524,7 +562,7 @@ amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id)<br>
                        RegionPtr region;<br>
<br>
                        if (master_has_sync_shared_pixmap(scrn, dirty))<br>
-                               amdgpu_sync_shared_pixmap(dirty);<br>
+                               call_sync_shared_pixmap(dirty);<br>
<br>
                        region = dirty_region(dirty);<br>
                        if (RegionNil(region))<br>
@@ -1803,6 +1841,9 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)<br>
 #ifdef AMDGPU_PIXMAP_SHARING<br>
        pScreen->StartPixmapTracking = PixmapStartDirtyTracking;<br>
        pScreen->StopPixmapTracking = PixmapStopDirtyTracking;<br>
+#if HAS_SYNC_SHARED_PIXMAP<br>
+       pScreen->SyncSharedPixmap = amdgpu_sync_shared_pixmap;<br>
+#endif<br>
 #endif<br>
<br>
        if (!xf86CrtcScreenInit(pScreen))<br>
--<br>
2.9.3<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</blockquote></div>