[igt-dev] [PATCH i-g-t] overlay: Believe in 0MHz

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Nov 29 11:37:07 UTC 2019


On 28/11/2019 18:04, Chris Wilson wrote:
> Tvrtko proposed reporting 0MHz when idle, but the overlay didn't believe
> that would be possible and stripped from its graphs!
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>   overlay/overlay.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/overlay/overlay.c b/overlay/overlay.c
> index dd4fca29e..77302181c 100644
> --- a/overlay/overlay.c
> +++ b/overlay/overlay.c
> @@ -599,10 +599,8 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq *
>   	}
>   
>   	if (has_freq) {
> -		if (gf->gpu_freq.current)
> -			chart_add_sample(&gf->current, gf->gpu_freq.current);
> -		if (gf->gpu_freq.request)
> -			chart_add_sample(&gf->request, gf->gpu_freq.request);
> +		chart_add_sample(&gf->current, gf->gpu_freq.current);
> +		chart_add_sample(&gf->request, gf->gpu_freq.request);
>   
>   		chart_draw(&gf->request, ctx->cr);
>   		chart_draw(&gf->current, ctx->cr);
> @@ -647,9 +645,8 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq *
>   		cairo_text_extents_t extents;
>   
>   		len = sprintf(buf, "Frequency: %dMHz", gf->gpu_freq.current);
> -		if (gf->gpu_freq.request)
>   		cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1);
> -			sprintf(buf + len, " (requested %dMHz)", gf->gpu_freq.request);
> +		sprintf(buf + len, " (requested %dMHz)", gf->gpu_freq.request);
>   		cairo_move_to(ctx->cr, PAD, y);
>   		cairo_show_text(ctx->cr, buf);
>   		y += 12;
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

For if/when we decide to go with it. You made me a little bit unsure 
with the sysfs angle although from the other hand I don't see that it is 
useful to report non-zero while idle.

Regards,

Tvrtko


More information about the igt-dev mailing list