[Mesa-dev] [PATCH 2/2] gallium/hud: add GALLIUM_HUD_PERIOD env var
Marek Olšák
maraeo at gmail.com
Thu Apr 4 15:54:18 PDT 2013
Reviewed-by: Marek Olšák <maraeo at gmail.com>
Marek
On Fri, Apr 5, 2013 at 12:38 AM, Brian Paul <brianp at vmware.com> wrote:
> To set the graph update rate, in seconds. The default update rate
> has also been changed to 1/2 second.
> ---
> src/gallium/auxiliary/hud/hud_context.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/src/gallium/auxiliary/hud/hud_context.c
> b/src/gallium/auxiliary/hud/hud_context.c
> index 5722df3..a5145c2 100644
> --- a/src/gallium/auxiliary/hud/hud_context.c
> +++ b/src/gallium/auxiliary/hud/hud_context.c
> @@ -703,12 +703,27 @@ hud_parse_env_var(struct hud_context *hud, const
> char *env)
> struct hud_pane *pane = NULL;
> unsigned x = 10, y = 10;
> unsigned width = 251, height = 100;
> + unsigned period = 500 * 1000; /* default period (1/2 second) */
> + const char *period_env;
> +
> + /*
> + * The GALLIUM_HUD_PERIOD env var sets the graph update rate.
> + * The env var is in seconds (a float).
> + * Zero means update after every frame.
> + */
> + period_env = getenv("GALLIUM_HUD_PERIOD");
> + if (period_env) {
> + float p = atof(period_env);
> + if (p >= 0.0) {
> + period = (unsigned) (p * 1000 * 1000);
> + }
> + }
>
> while ((num = parse_string(env, name)) != 0) {
> env += num;
>
> if (!pane) {
> - pane = hud_pane_create(x, y, x + width, y + height, 40000, 10);
> + pane = hud_pane_create(x, y, x + width, y + height, period, 10);
> if (!pane)
> return;
> }
> --
> 1.7.3.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130405/b3c8cf1b/attachment.html>
More information about the mesa-dev
mailing list