[Mesa-dev] [PATCH] nv50, nvc0: warn on not-explicitly-handled caps
Ilia Mirkin
imirkin at alum.mit.edu
Fri Oct 19 12:24:45 UTC 2018
On Fri, Oct 19, 2018 at 6:32 AM Gert Wollny <gw.fossdev at gmail.com> wrote:
>
> 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).
People got annoyed by having to edit every driver. The default
statement takes care of that.
I wanted to be notified when new caps were added so I could evaluate
how they needed to be set on nouveau.
I think the current situation works out nicely...
-ilia
More information about the mesa-dev
mailing list