<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;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net><br>
<b>Sent:</b> Thursday, October 18, 2018 4:13:58 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> [PATCH xf86-video-ati] dri3: Handle radeon_get_pixmap_bo returning NULL</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Michel Dänzer <michel.daenzer@amd.com><br>
<br>
We were trying to already, but testing the wrong pointer.<br>
<br>
Fixes: b85b7b11f5b5 "Add struct radeon_buffer"<br>
Bug: <a href="https://bugs.debian.org/910846">https://bugs.debian.org/910846</a><br>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com><br>
---<br>
 src/radeon_dri3.c | 10 +++++-----<br>
 1 file changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c<br>
index 7e89a2f0b..25078bae1 100644<br>
--- a/src/radeon_dri3.c<br>
+++ b/src/radeon_dri3.c<br>
@@ -212,7 +212,7 @@ static int radeon_dri3_fd_from_pixmap(ScreenPtr screen,<br>
                                       CARD16 *stride,<br>
                                       CARD32 *size)<br>
 {<br>
-       struct radeon_bo *bo;<br>
+       struct radeon_buffer *bo;<br>
         int fd;<br>
 #ifdef USE_GLAMOR<br>
         ScrnInfoPtr scrn = xf86ScreenToScrn(screen);<br>
@@ -222,10 +222,10 @@ static int radeon_dri3_fd_from_pixmap(ScreenPtr screen,<br>
                 return glamor_fd_from_pixmap(screen, pixmap, stride, size);<br>
 #endif<br>
 <br>
-       bo = radeon_get_pixmap_bo(pixmap)->bo.radeon;<br>
+       bo = radeon_get_pixmap_bo(pixmap);<br>
         if (!bo) {<br>
                 exaMoveInPixmap(pixmap);<br>
-               bo = radeon_get_pixmap_bo(pixmap)->bo.radeon;<br>
+               bo = radeon_get_pixmap_bo(pixmap);<br>
                 if (!bo)<br>
                         return -1;<br>
         }<br>
@@ -233,11 +233,11 @@ static int radeon_dri3_fd_from_pixmap(ScreenPtr screen,<br>
         if (pixmap->devKind > UINT16_MAX)<br>
                 return -1;<br>
 <br>
-       if (radeon_gem_prime_share_bo(bo, &fd) < 0)<br>
+       if (radeon_gem_prime_share_bo(bo->bo.radeon, &fd) < 0)<br>
                 return -1;<br>
 <br>
         *stride = pixmap->devKind;<br>
-       *size = bo->size;<br>
+       *size = bo->bo.radeon->size;<br>
         return fd;<br>
 }<br>
 <br>
-- <br>
2.19.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>