[Mesa-dev] [PATCH] gallium/hud: = should rename the last added data source
Dieter Nützel
Dieter at nuetzel-hh.de
Mon Jun 11 01:31:07 UTC 2018
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
with glmark2, UH, UV, Blender 2.79, FreeCAD, Krita 4.0.3 under KDE
Plasma5
on my Polaris 20 / RX580.
Dieter
Am 09.06.2018 05:17, schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
> src/gallium/auxiliary/hud/hud_context.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/hud/hud_context.c
> b/src/gallium/auxiliary/hud/hud_context.c
> index 61db98b4b03..233202453ee 100644
> --- a/src/gallium/auxiliary/hud/hud_context.c
> +++ b/src/gallium/auxiliary/hud/hud_context.c
> @@ -1207,20 +1207,22 @@ hud_parse_env_var(struct hud_context *hud,
> struct pipe_screen *screen,
> */
> period_env = getenv("GALLIUM_HUD_PERIOD");
> if (period_env) {
> float p = (float) atof(period_env);
> if (p >= 0.0f) {
> period = (unsigned) (p * 1000 * 1000);
> }
> }
>
> while ((num = parse_string(env, name_a)) != 0) {
> + bool added = true;
> +
> env += num;
>
> /* check for explicit location, size and etc. settings */
> name = read_pane_settings(name_a, &x, &y, &width, &height,
> &ceiling,
> &dyn_ceiling, &reset_colors,
> &sort_items);
>
> /*
> * Keep track of overall column width to avoid pane overlapping
> in case
> * later we create a new column while the bottom pane in the
> current
> * column is less wide than the rest of the panes in it.
> @@ -1379,20 +1381,21 @@ hud_parse_env_var(struct hud_context *hud,
> struct pipe_screen *screen,
> processed = TRUE;
> }
> }
>
> /* driver queries */
> if (!processed) {
> if (!hud_driver_query_install(&hud->batch_query, pane,
> screen, name)) {
> fprintf(stderr, "gallium_hud: unknown driver query
> '%s'\n", name);
> fflush(stderr);
> + added = false;
> }
> }
> }
>
> if (*env == ':') {
> env++;
>
> if (!pane) {
> fprintf(stderr, "gallium_hud: syntax error: unexpected
> ':', "
> "expected a name\n");
> @@ -1421,21 +1424,21 @@ hud_parse_env_var(struct hud_context *hud,
> struct pipe_screen *screen,
> fprintf(stderr, "gallium_hud: syntax error: unexpected
> '=', "
> "expected a name\n");
> fflush(stderr);
> break;
> }
>
> num = parse_string(env, s);
> env += num;
>
> strip_hyphens(s);
> - if (!LIST_IS_EMPTY(&pane->graph_list)) {
> + if (added && !LIST_IS_EMPTY(&pane->graph_list)) {
> struct hud_graph *graph;
> graph = LIST_ENTRY(struct hud_graph,
> pane->graph_list.prev, head);
> strncpy(graph->name, s, sizeof(graph->name)-1);
> graph->name[sizeof(graph->name)-1] = 0;
> }
> }
>
> if (*env == 0)
> break;
More information about the mesa-dev
mailing list