Mesa (staging/21.1): frontend/dri: fix bool/int comparison

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 5 16:30:19 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 29b19d83d9d3f43346eb77cb2b67e5c09d543d1e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=29b19d83d9d3f43346eb77cb2b67e5c09d543d1e

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Tue Jun  1 14:02:46 2021 +0200

frontend/dri: fix bool/int comparison

Cast tex->bind & PIPE_BIND_PROTECTED to a bool before doing the
comparison, otherwise it'll incorrectly fail.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Fixes: 18b7cafc700 ("driconf: add disable_protected_content_check option")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11107>
(cherry picked from commit fcdfe91efa387dbcc01d5f18a4c711aaf5eb8d78)

---

 .pick_status.json                | 2 +-
 src/gallium/frontends/dri/dri2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7aea7a33908..5967c704ba4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -778,7 +778,7 @@
         "description": "frontend/dri: fix bool/int comparison",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "18b7cafc700055869f1209b32a3ecb9dc9ee6752"
     },
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index b6a05f47554..ec71fce8b8a 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -841,7 +841,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
        */
       const struct driOptionCache *optionCache = &screen->dev->option_cache;
       if (!driQueryOptionb(optionCache, "disable_protected_content_check") &&
-          (tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) {
+          (bool)(tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) {
          pipe_resource_reference(&img->texture, NULL);
          pipe_resource_reference(&tex, NULL);
          FREE(img);



More information about the mesa-commit mailing list