Re: [Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
Hi, about to push out a revision 4 of the series, which has all the r-b's of Tapani and Marek tacked on, rebased onto current master, and remaining suggestions by Tapani and Marek implemented and tested. That one should be totally ready to push if you are happy with it. Just one last test to do... -mario On 12/13/2017 05:27 PM, Marek Olšák wrote: Mario, can we push these patches? Marek On Wed, Nov 29, 2017 at 5:21 AM, Mario Kleinerwrote: Some clients may not like rgb10 fbconfigs and visuals. Support driconf option 'allow_rgb10_configs' on gallium to allow per application enable/disable.h The option defaults to enabled. Signed-off-by: Mario Kleiner --- src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + src/gallium/state_trackers/dri/dri_screen.c | 8 2 files changed, 9 insertions(+) diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index d2d2c9d..db0d633 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -31,4 +31,5 @@ DRI_CONF_SECTION_END DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false") DRI_CONF_GLSL_ZERO_INIT("false") + DRI_CONF_ALLOW_RGB10_CONFIGS("true") DRI_CONF_SECTION_END diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 04afe71..d307b4f 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -156,6 +156,7 @@ dri_fill_in_modes(struct dri_screen *screen) struct pipe_screen *p_screen = screen->base.screen; boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32; boolean mixed_color_depth; + boolean allow_rgb10; static const GLenum back_buffer_modes[] = { __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED, @@ -172,6 +173,8 @@ dri_fill_in_modes(struct dri_screen *screen) depth_buffer_factor = 1; } + allow_rgb10 = driQueryOptionb(>dev->option_cache, "allow_rgb10_configs"); + msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS_MASK) ? MSAA_VISUAL_MAX_SAMPLES : 1; @@ -231,6 +234,11 @@ dri_fill_in_modes(struct dri_screen *screen) unsigned num_msaa_modes = 0; /* includes a single-sample mode */ uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; + if (!allow_rgb10 && + (mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM || + mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM)) + continue; + if (!p_screen->is_format_supported(p_screen, pipe_formats[format], PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET)) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
On Wed, Dec 13, 2017 at 10:45 PM, Mario Kleinerwrote: > On 12/13/2017 05:27 PM, Marek Olšák wrote: >> >> Mario, can we push these patches? >> >> Marek >> > > Sorry for the late response and thanks for the reviews! Was a bit sick the > last days, so couldn't think or do anything about the recent comments so > far. > > I think all patches have a r-b by you and/or Tapani, except the nouveau > patch 20/22 on which Ilia commented. Not sure about that one. If we leave it > out then stuff breaks on nouveau. If we leave it in, then as far as i > understand Ilia's comments, we have a slight violation of spec atm. - If a > app asks for a framebuffer without alpha channel (xrgb2101010), but then > enables blending with DST_ALPHA it would potentially get random 2 x-bit > trash instead of a well defined 1.0 DST_ALPHA. Otoh. it would be legal but a > bit non-sensical for an app to ask for no alpha channel, but then choose > blend functions that only make sense with an alpha channel? > > The third option would be to replace that patch with one that disables the > rgb10 support for visuals on nouveau completely until we have a solution for > properly emulating xrgb201010 on nouveau to cover such corner cases? Hold on ... my understanding was that without that patch, nouveau just wouldn't work with 30-bit. Which is the current status quo. I'd like to investigate first-hand what the breakage is, perhaps it's actually unrelated to the missing format, and can be made to work just fine with the st using argb2101010. Am I misunderstanding the state of things? I really don't want nouveau to be holding anything up. -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
On 12/13/2017 05:27 PM, Marek Olšák wrote: Mario, can we push these patches? Marek Sorry for the late response and thanks for the reviews! Was a bit sick the last days, so couldn't think or do anything about the recent comments so far. I think all patches have a r-b by you and/or Tapani, except the nouveau patch 20/22 on which Ilia commented. Not sure about that one. If we leave it out then stuff breaks on nouveau. If we leave it in, then as far as i understand Ilia's comments, we have a slight violation of spec atm. - If a app asks for a framebuffer without alpha channel (xrgb2101010), but then enables blending with DST_ALPHA it would potentially get random 2 x-bit trash instead of a well defined 1.0 DST_ALPHA. Otoh. it would be legal but a bit non-sensical for an app to ask for no alpha channel, but then choose blend functions that only make sense with an alpha channel? The third option would be to replace that patch with one that disables the rgb10 support for visuals on nouveau completely until we have a solution for properly emulating xrgb201010 on nouveau to cover such corner cases? -mario On Wed, Nov 29, 2017 at 5:21 AM, Mario Kleinerwrote: Some clients may not like rgb10 fbconfigs and visuals. Support driconf option 'allow_rgb10_configs' on gallium to allow per application enable/disable. The option defaults to enabled. Signed-off-by: Mario Kleiner --- src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + src/gallium/state_trackers/dri/dri_screen.c | 8 2 files changed, 9 insertions(+) diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index d2d2c9d..db0d633 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -31,4 +31,5 @@ DRI_CONF_SECTION_END DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false") DRI_CONF_GLSL_ZERO_INIT("false") + DRI_CONF_ALLOW_RGB10_CONFIGS("true") DRI_CONF_SECTION_END diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 04afe71..d307b4f 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -156,6 +156,7 @@ dri_fill_in_modes(struct dri_screen *screen) struct pipe_screen *p_screen = screen->base.screen; boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32; boolean mixed_color_depth; + boolean allow_rgb10; static const GLenum back_buffer_modes[] = { __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED, @@ -172,6 +173,8 @@ dri_fill_in_modes(struct dri_screen *screen) depth_buffer_factor = 1; } + allow_rgb10 = driQueryOptionb(>dev->option_cache, "allow_rgb10_configs"); + msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS_MASK) ? MSAA_VISUAL_MAX_SAMPLES : 1; @@ -231,6 +234,11 @@ dri_fill_in_modes(struct dri_screen *screen) unsigned num_msaa_modes = 0; /* includes a single-sample mode */ uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; + if (!allow_rgb10 && + (mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM || + mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM)) + continue; + if (!p_screen->is_format_supported(p_screen, pipe_formats[format], PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET)) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
Mario, can we push these patches? Marek On Wed, Nov 29, 2017 at 5:21 AM, Mario Kleinerwrote: > Some clients may not like rgb10 fbconfigs and visuals. > Support driconf option 'allow_rgb10_configs' on gallium > to allow per application enable/disable. > > The option defaults to enabled. > > Signed-off-by: Mario Kleiner > --- > src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + > src/gallium/state_trackers/dri/dri_screen.c | 8 > 2 files changed, 9 insertions(+) > > diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > index d2d2c9d..db0d633 100644 > --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > @@ -31,4 +31,5 @@ DRI_CONF_SECTION_END > DRI_CONF_SECTION_MISCELLANEOUS > DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false") > DRI_CONF_GLSL_ZERO_INIT("false") > + DRI_CONF_ALLOW_RGB10_CONFIGS("true") > DRI_CONF_SECTION_END > diff --git a/src/gallium/state_trackers/dri/dri_screen.c > b/src/gallium/state_trackers/dri/dri_screen.c > index 04afe71..d307b4f 100644 > --- a/src/gallium/state_trackers/dri/dri_screen.c > +++ b/src/gallium/state_trackers/dri/dri_screen.c > @@ -156,6 +156,7 @@ dri_fill_in_modes(struct dri_screen *screen) > struct pipe_screen *p_screen = screen->base.screen; > boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32; > boolean mixed_color_depth; > + boolean allow_rgb10; > > static const GLenum back_buffer_modes[] = { >__DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED, > @@ -172,6 +173,8 @@ dri_fill_in_modes(struct dri_screen *screen) >depth_buffer_factor = 1; > } > > + allow_rgb10 = driQueryOptionb(>dev->option_cache, > "allow_rgb10_configs"); > + > msaa_samples_max = (screen->st_api->feature_mask & > ST_API_FEATURE_MS_VISUALS_MASK) >? MSAA_VISUAL_MAX_SAMPLES : 1; > > @@ -231,6 +234,11 @@ dri_fill_in_modes(struct dri_screen *screen) >unsigned num_msaa_modes = 0; /* includes a single-sample mode */ >uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; > > + if (!allow_rgb10 && > + (mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM || > + mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM)) > + continue; > + >if (!p_screen->is_format_supported(p_screen, pipe_formats[format], > PIPE_TEXTURE_2D, 0, > PIPE_BIND_RENDER_TARGET)) > -- > 2.7.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
For patches 4-5, 7, 9-19, 21-22: Reviewed-by: Marek OlšákMarek On Wed, Nov 29, 2017 at 5:21 AM, Mario Kleiner wrote: > Some clients may not like rgb10 fbconfigs and visuals. > Support driconf option 'allow_rgb10_configs' on gallium > to allow per application enable/disable. > > The option defaults to enabled. > > Signed-off-by: Mario Kleiner > --- > src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + > src/gallium/state_trackers/dri/dri_screen.c | 8 > 2 files changed, 9 insertions(+) > > diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > index d2d2c9d..db0d633 100644 > --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h > @@ -31,4 +31,5 @@ DRI_CONF_SECTION_END > DRI_CONF_SECTION_MISCELLANEOUS > DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false") > DRI_CONF_GLSL_ZERO_INIT("false") > + DRI_CONF_ALLOW_RGB10_CONFIGS("true") > DRI_CONF_SECTION_END > diff --git a/src/gallium/state_trackers/dri/dri_screen.c > b/src/gallium/state_trackers/dri/dri_screen.c > index 04afe71..d307b4f 100644 > --- a/src/gallium/state_trackers/dri/dri_screen.c > +++ b/src/gallium/state_trackers/dri/dri_screen.c > @@ -156,6 +156,7 @@ dri_fill_in_modes(struct dri_screen *screen) > struct pipe_screen *p_screen = screen->base.screen; > boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32; > boolean mixed_color_depth; > + boolean allow_rgb10; > > static const GLenum back_buffer_modes[] = { >__DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED, > @@ -172,6 +173,8 @@ dri_fill_in_modes(struct dri_screen *screen) >depth_buffer_factor = 1; > } > > + allow_rgb10 = driQueryOptionb(>dev->option_cache, > "allow_rgb10_configs"); > + > msaa_samples_max = (screen->st_api->feature_mask & > ST_API_FEATURE_MS_VISUALS_MASK) >? MSAA_VISUAL_MAX_SAMPLES : 1; > > @@ -231,6 +234,11 @@ dri_fill_in_modes(struct dri_screen *screen) >unsigned num_msaa_modes = 0; /* includes a single-sample mode */ >uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; > > + if (!allow_rgb10 && > + (mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM || > + mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM)) > + continue; > + >if (!p_screen->is_format_supported(p_screen, pipe_formats[format], > PIPE_TEXTURE_2D, 0, > PIPE_BIND_RENDER_TARGET)) > -- > 2.7.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 22/22] st/dri: Add option to control exposure of 10 bpc color configs.
Some clients may not like rgb10 fbconfigs and visuals. Support driconf option 'allow_rgb10_configs' on gallium to allow per application enable/disable. The option defaults to enabled. Signed-off-by: Mario Kleiner--- src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + src/gallium/state_trackers/dri/dri_screen.c | 8 2 files changed, 9 insertions(+) diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index d2d2c9d..db0d633 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -31,4 +31,5 @@ DRI_CONF_SECTION_END DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false") DRI_CONF_GLSL_ZERO_INIT("false") + DRI_CONF_ALLOW_RGB10_CONFIGS("true") DRI_CONF_SECTION_END diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 04afe71..d307b4f 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -156,6 +156,7 @@ dri_fill_in_modes(struct dri_screen *screen) struct pipe_screen *p_screen = screen->base.screen; boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32; boolean mixed_color_depth; + boolean allow_rgb10; static const GLenum back_buffer_modes[] = { __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED, @@ -172,6 +173,8 @@ dri_fill_in_modes(struct dri_screen *screen) depth_buffer_factor = 1; } + allow_rgb10 = driQueryOptionb(>dev->option_cache, "allow_rgb10_configs"); + msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS_MASK) ? MSAA_VISUAL_MAX_SAMPLES : 1; @@ -231,6 +234,11 @@ dri_fill_in_modes(struct dri_screen *screen) unsigned num_msaa_modes = 0; /* includes a single-sample mode */ uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES]; + if (!allow_rgb10 && + (mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM || + mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM)) + continue; + if (!p_screen->is_format_supported(p_screen, pipe_formats[format], PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET)) -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev