From: Hawking Zhang <[email protected]>

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 <[email protected]>
Reviewed-by: Qiang Yu <[email protected]>
---
 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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to