[Mesa-dev] [PATCH] nv50, nvc0: warn on not-explicitly-handled caps

Gert Wollny gw.fossdev at gmail.com
Fri Oct 19 10:32:41 UTC 2018


Am Donnerstag, den 06.09.2018, 22:36 -0400 schrieb Ilia Mirkin:
> Not handling caps explicitly means that we're likely getting
> incorrect values -- these need to be reviewed and set appropriately.
> 
> While we're at it, add in some missing caps, and set all the subpixel
> stuff to 8 as that seems to be what the blob reports.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c | 16 +++++++++++-----
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 24 +++++++++++++++-
> --------
>  2 files changed, 26 insertions(+), 14 deletions(-)
> 
> 
[...]
> @@ -341,6 +346,7 @@ nvc0_screen_get_param(struct pipe_screen
> *pscreen, enum pipe_cap param)
>     case PIPE_CAP_UMA:
>        return 0;
>     default:
> +      debug_printf("%s: unhandled cap %d\n", __func__, param);
>        return u_pipe_screen_get_param_defaults(pscreen, param);
>     }
>  }

I understand your reasoning here, because with each new cap introduced
one should check for each driver whether the default is appropriate, or
whether a special handling is needed, but then it might be better to
remove the "default:" statement and move the call to 
u_pipe_screen_get_param_defaults after the switch statement. This way
you will get a warning about the unhandled switch case at compile time
and see that you have to handle this without having to run some program
that happens to trigger the cap (You could also keep the debug
statement before this if you deem it necessary). 

Best, 
Gert 






More information about the mesa-dev mailing list