From: Hawking Zhang <hawking.zh...@amd.com>

OGL send freesync request to ddx driver when it makes a drawable as current
DDX driver only set the client to be freesync capable when it is a fullscreen
size one.

Change-Id: Ie25ff11f58104546c52a253d6a5f85aa62532d4d
Signed-off-by: Hawking Zhang <hawking.zh...@amd.com>
Reviewed-by: Flora Cui <flora....@amd.com>
---
 src/amdgpu_extension.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/amdgpu_extension.c b/src/amdgpu_extension.c
index 1c984df..eadb742 100644
--- a/src/amdgpu_extension.c
+++ b/src/amdgpu_extension.c
@@ -32,6 +32,8 @@
 #include "extnsionst.h"
 #include "resource.h"
 #include "scrnintstr.h"
+#include "dixaccess.h"
+#include "pixmap.h"
 
 #include "amdgpu_drm.h"
 #include "amdgpu_extension.h"
@@ -53,8 +55,16 @@ static int ProcAMDGPUFreesyncCapability(ClientPtr client)
        ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
        AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
        XID cliResId;
+       DrawablePtr pDrawable = NULL;
+       if (dixLookupDrawable(&pDrawable, (Drawable)stuff->drawable,
+                             client, 0, DixReadAccess))
+               return BadValue;
 
-       if (info->freesync_capable_client == NULL) {
+       if (info->freesync_capable_client == NULL &&
+           pDrawable->x == pDrawable->pScreen->x &&
+           pDrawable->y == pDrawable->pScreen->y &&
+           pDrawable->width == pDrawable->pScreen->width &&
+           pDrawable->height == pDrawable->pScreen->height) {
                info->freesync_capable_client = client;
                cliResId = FakeClientID(client->index);
                if (AddResource(cliResId, RT_AMDGPUCLIENT, (void *)pScrn))
-- 
2.18.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to