summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2024-04-11 11:26:24 +0200
committerMarge Bot <emma+marge@anholt.net>2024-04-12 07:25:55 +0000
commit4dc7e99840cb9318ceeb3c11e382e46bb282aad5 (patch)
tree81e285f8d1e5d14bea61b2527e2546c297c8b5eb
parent82d3b8ff059dd32656d2829c65e25c09bd0ba424 (diff)
xwayland: Use drmDevicesEqual in xwl_dmabuf_feedback_tranche_done
xwl_dmabuf_feedback_tranche_target_device always allocates a new drmDevice for xwl_feedback->tmp_tranche.drm_dev, so the pointers are never equal here. Fixes: 6f0b9deed668 ("xwayland: use drmDevice to compare DRM devices") v2: * Flip order of checks, so drmDevicesEqual is called only if the supports_scanout flags match. Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1484>
-rw-r--r--hw/xwayland/xwayland-dmabuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-dmabuf.c b/hw/xwayland/xwayland-dmabuf.c
index 0c5ed1c86..db7dc44ee 100644
--- a/hw/xwayland/xwayland-dmabuf.c
+++ b/hw/xwayland/xwayland-dmabuf.c
@@ -580,8 +580,8 @@ xwl_dmabuf_feedback_tranche_done(void *data,
*/
for (int i = 0; i < xwl_feedback->dev_formats_len; i++) {
tranche = &xwl_feedback->dev_formats[i];
- if (tranche->drm_dev == xwl_feedback->tmp_tranche.drm_dev &&
- tranche->supports_scanout == xwl_feedback->tmp_tranche.supports_scanout) {
+ if (tranche->supports_scanout == xwl_feedback->tmp_tranche.supports_scanout &&
+ drmDevicesEqual(tranche->drm_dev, xwl_feedback->tmp_tranche.drm_dev)) {
appended = TRUE;
/* Add all format/mods to this tranche */