Mesa (staging/21.2): gallium/hud: initialize query

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 3 18:09:02 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: a5dec10d8362ae036ee50231bf7de8f69a190098
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5dec10d8362ae036ee50231bf7de8f69a190098

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Tue Aug  3 13:05:23 2021 +0200

gallium/hud: initialize query

Most of the drivers don't set up the maximum value in the query info. So
when later hud_pane_set_max_value() is invoked, we are using a rather
"random" number.

Turns out that in some 32bit cases, this random number is big enough
that `leftmost_digit` is 0 because DIV_ROUND_UP() overflows, aborting
with an assertion.

Fixes: c91cf7d7d2c ("gallium: implement a heads-up display module")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12181>
(cherry picked from commit 10541d1fade07e57441b591a36b0bf02f5eca299)

---

 .pick_status.json                            | 2 +-
 src/gallium/auxiliary/hud/hud_driver_query.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index fb2287d5a10..ba540c59be3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
         "description": "gallium/hud: initialize query",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "c91cf7d7d2c8cc377945c79be87799c31ce9ae59"
     },
diff --git a/src/gallium/auxiliary/hud/hud_driver_query.c b/src/gallium/auxiliary/hud/hud_driver_query.c
index 382de1af028..f15c7104460 100644
--- a/src/gallium/auxiliary/hud/hud_driver_query.c
+++ b/src/gallium/auxiliary/hud/hud_driver_query.c
@@ -424,7 +424,7 @@ hud_driver_query_install(struct hud_batch_query_context **pbq,
                          struct hud_pane *pane, struct pipe_screen *screen,
                          const char *name)
 {
-   struct pipe_driver_query_info query;
+   struct pipe_driver_query_info query = { 0 };
    unsigned num_queries, i;
    boolean found = FALSE;
 



More information about the mesa-commit mailing list