<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>grep for TSTD below</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<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> xorg-driver-ati <xorg-driver-ati-bounces@lists.x.org> on behalf of Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Wednesday, June 8, 2016 04:45<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);</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">TSTD:  If CreatePixmap fails won't linear be NULL?  </div>
<div class="PlainText"><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>
_______________________________________________<br>
xorg-driver-ati mailing list<br>
xorg-driver-ati@lists.x.org<br>
<a href="https://lists.x.org/mailman/listinfo/xorg-driver-ati" id="LPlnk421768">https://lists.x.org/mailman/listinfo/xorg-driver-ati</a><br>
</div>
</span></font></div>
</div>
</body>
</html>