<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Michel,</p>
<p><br>
</p>
<p>I've tested your patches. There's one problem:</p>
<p>1. sudo service lightdm start</p>
<p>2. DRI_PRIME=1 glxgears</p>
<p>The glxgears window is shown black. But after resize or tap a 'Alt' key to</p>
<p>show the command bar, the gears come out. My platform is a A+A (two Tonga Pro)</p>
<p>with Ubuntu 16.04.</p>
<p><br>
</p>
<p>It seems not the DDX problem but the mesa client not handling DRI2InvalidateBuffers</p>
<p>event in the Compiz side for the glxgears window pixmap after the <span>PixmapShareToSlave()</span></p>
<p><span></span>call.</p>
<p><br>
</p>
<p>Regards,</p>
<p>Qiang</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Wednesday, June 8, 2016 4:45:19 PM<br>
<b>To:</b> xorg-driver-ati@lists.x.org<br>
<b>Cc:</b> Yu, Qiang<br>
<b>Subject:</b> [PATCH xf86-video-amdgpu 6/6] glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">From: Michel Dänzer <michel.daenzer@amd.com><br>
<br>
Fixes corruption when using DRI2 PRIME render offloading with the master<br>
screen using this driver.<br>
<br>
Reported-by: Qiang Yu <qiang.yu@amd.com><br>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com><br>
---<br>
 src/amdgpu_glamor.c | 18 ++++++++++++++++++<br>
 1 file changed, 18 insertions(+)<br>
<br>
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c<br>
index 1159e29..53ba277 100644<br>
--- a/src/amdgpu_glamor.c<br>
+++ b/src/amdgpu_glamor.c<br>
@@ -328,10 +328,28 @@ amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave,<br>
                                    void **handle_p)<br>
 {<br>
         ScreenPtr screen = pixmap->drawable.pScreen;<br>
+       uint64_t tiling_info;<br>
         CARD16 stride;<br>
         CARD32 size;<br>
         int fd;<br>
 <br>
+       tiling_info = amdgpu_pixmap_get_tiling_info(pixmap);<br>
+       if (AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) != 0) {<br>
+               PixmapPtr linear;<br>
+<br>
+               /* We don't want to re-allocate the screen pixmap as<br>
+                * linear, to avoid trouble with page flipping<br>
+                */<br>
+               if (screen->GetScreenPixmap(screen) == pixmap)<br>
+                       return FALSE;<br>
+<br>
+               linear = screen->CreatePixmap(screen, pixmap->drawable.width,<br>
+                                             pixmap->drawable.height,<br>
+                                             pixmap->drawable.depth,<br>
+                                             CREATE_PIXMAP_USAGE_SHARED);<br>
+               amdgpu_glamor_set_pixmap_bo(&pixmap->drawable, linear);<br>
+       }<br>
+<br>
         fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);<br>
         if (fd < 0)<br>
                 return FALSE;<br>
-- <br>
2.8.1<br>
<br>
</div>
</span></font>
</body>
</html>