On Fri, Oct 19, 2018 at 6:32 AM Gert Wollny <gw.foss...@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 <imir...@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 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev