diff mbox series

drm/amd/display: Allow spatial dither to 10 bpc on all != DCE-11.0.

Message ID 20210212222954.6510-1-mario.kleiner.de@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: Allow spatial dither to 10 bpc on all != DCE-11.0. | expand

Commit Message

Mario Kleiner Feb. 12, 2021, 10:29 p.m. UTC
Spatial dithering to 10 bpc depth was disabled for all DCE's.
Restrict this to DCE-11.0, but allow it on other DCE's.

Testing on DCE-8.3 and DCE-11.2 did not show any obvious ill
effects, but a measureable precision improvement (via colorimeter)
when displaying a fp16 framebuffer to a 10 bpc DP or HDMI connected
HDR-10 monitor.

Alex suggests this may have been a workaround for some DCE-11.0
Carrizo and Stoney Asics, so lets try to restrict this to DCE 11.0.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Alex Deucher Feb. 15, 2021, 7:09 p.m. UTC | #1
On Fri, Feb 12, 2021 at 5:30 PM Mario Kleiner
<mario.kleiner.de@gmail.com> wrote:
>
> Spatial dithering to 10 bpc depth was disabled for all DCE's.
> Restrict this to DCE-11.0, but allow it on other DCE's.
>
> Testing on DCE-8.3 and DCE-11.2 did not show any obvious ill
> effects, but a measureable precision improvement (via colorimeter)
> when displaying a fp16 framebuffer to a 10 bpc DP or HDMI connected
> HDR-10 monitor.
>
> Alex suggests this may have been a workaround for some DCE-11.0
> Carrizo and Stoney Asics, so lets try to restrict this to DCE 11.0.
>
> Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
> Cc: Alex Deucher <alexdeucher@gmail.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> index 4600231da6cb..4ed886cdb8d8 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> @@ -216,9 +216,12 @@ static void set_spatial_dither(
>         REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
>                 FMT_TEMPORAL_DITHER_EN, 0);
>
> -       /* no 10bpc on DCE11*/
> -       if (params->flags.SPATIAL_DITHER_ENABLED == 0 ||
> -               params->flags.SPATIAL_DITHER_DEPTH == 2)
> +       if (params->flags.SPATIAL_DITHER_ENABLED == 0)
> +               return;
> +
> +       /* No dithering to 10 bpc on DCE-11.0 */
> +       if (params->flags.SPATIAL_DITHER_DEPTH == 2 &&
> +               opp110->base.ctx->dce_version == DCE_VERSION_11_0)
>                 return;

I'm inclined to just remove this check altogether.  This is just the
dithering control.  I think the limitations are more around the
formats (e.g., FP formats) than the dithering.

Alex


>
>         /* only use FRAME_COUNTER_MAX if frameRandom == 1*/
> --
> 2.25.1
>
Mario Kleiner Feb. 15, 2021, 9:32 p.m. UTC | #2
On Mon, Feb 15, 2021 at 8:09 PM Alex Deucher <alexdeucher@gmail.com> wrote:

> On Fri, Feb 12, 2021 at 5:30 PM Mario Kleiner
> <mario.kleiner.de@gmail.com> wrote:
> >
> > Spatial dithering to 10 bpc depth was disabled for all DCE's.
> > Restrict this to DCE-11.0, but allow it on other DCE's.
> >
> > Testing on DCE-8.3 and DCE-11.2 did not show any obvious ill
> > effects, but a measureable precision improvement (via colorimeter)
> > when displaying a fp16 framebuffer to a 10 bpc DP or HDMI connected
> > HDR-10 monitor.
> >
> > Alex suggests this may have been a workaround for some DCE-11.0
> > Carrizo and Stoney Asics, so lets try to restrict this to DCE 11.0.
> >
> > Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
> > Cc: Alex Deucher <alexdeucher@gmail.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> > index 4600231da6cb..4ed886cdb8d8 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
> > @@ -216,9 +216,12 @@ static void set_spatial_dither(
> >         REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
> >                 FMT_TEMPORAL_DITHER_EN, 0);
> >
> > -       /* no 10bpc on DCE11*/
> > -       if (params->flags.SPATIAL_DITHER_ENABLED == 0 ||
> > -               params->flags.SPATIAL_DITHER_DEPTH == 2)
> > +       if (params->flags.SPATIAL_DITHER_ENABLED == 0)
> > +               return;
> > +
> > +       /* No dithering to 10 bpc on DCE-11.0 */
> > +       if (params->flags.SPATIAL_DITHER_DEPTH == 2 &&
> > +               opp110->base.ctx->dce_version == DCE_VERSION_11_0)
> >                 return;
>
> I'm inclined to just remove this check altogether.  This is just the
> dithering control.  I think the limitations are more around the
> formats (e.g., FP formats) than the dithering.
>
> Alex
>
>
Certainly no objections from myself.
-mario



>
> >
> >         /* only use FRAME_COUNTER_MAX if frameRandom == 1*/
> > --
> > 2.25.1
> >
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
index 4600231da6cb..4ed886cdb8d8 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
@@ -216,9 +216,12 @@  static void set_spatial_dither(
 	REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
 		FMT_TEMPORAL_DITHER_EN, 0);
 
-	/* no 10bpc on DCE11*/
-	if (params->flags.SPATIAL_DITHER_ENABLED == 0 ||
-		params->flags.SPATIAL_DITHER_DEPTH == 2)
+	if (params->flags.SPATIAL_DITHER_ENABLED == 0)
+		return;
+
+	/* No dithering to 10 bpc on DCE-11.0 */
+	if (params->flags.SPATIAL_DITHER_DEPTH == 2 &&
+		opp110->base.ctx->dce_version == DCE_VERSION_11_0)
 		return;
 
 	/* only use FRAME_COUNTER_MAX if frameRandom == 1*/