[PATCH xf86-video-amdgpu 3/6] Do not fail the X request when there is just BadDrawable/BadMatch

Nicholas Kazlauskas nicholas.kazlauskas at amd.com
Tue Sep 11 16:18:39 UTC 2018


From: Hawking Zhang <Hawking.Zhang at amd.com>

There is BadDrawable/BadMatch case for dixLookupDrawable. But DDX driver don't
need to fail the request with BadValue. Instead, only make sure the drawable is
successfully found and check its size

Change-Id: I1ca6e04d611b2d5e81a54e500c90fb1644675f67
Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
Reviewed-by: Qiang Yu <Qiang.Yu at amd.com>
---
 src/amdgpu_extension.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/amdgpu_extension.c b/src/amdgpu_extension.c
index eadb742..ab7d6e3 100644
--- a/src/amdgpu_extension.c
+++ b/src/amdgpu_extension.c
@@ -56,11 +56,13 @@ static int ProcAMDGPUFreesyncCapability(ClientPtr client)
 	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
 	XID cliResId;
 	DrawablePtr pDrawable = NULL;
-	if (dixLookupDrawable(&pDrawable, (Drawable)stuff->drawable,
-			      client, 0, DixReadAccess))
-		return BadValue;
+	int ret = -1;
+
+	ret = dixLookupDrawable(&pDrawable, (Drawable)stuff->drawable,
+				client, 0, DixReadAccess);
 
-	if (info->freesync_capable_client == NULL &&
+	if (!ret &&
+	    info->freesync_capable_client == NULL &&
 	    pDrawable->x == pDrawable->pScreen->x &&
 	    pDrawable->y == pDrawable->pScreen->y &&
 	    pDrawable->width == pDrawable->pScreen->width &&
-- 
2.18.0



More information about the amd-gfx mailing list