From: Jani Nikula <jani.nikula@intel.com>
To: Nischal Varide <nischal.varide@intel.com>,
intel-gfx@lists.freedesktop.org, nischal.varide@intel.com,
uma.shankar@intel.com, anshuman.gupta@intel.com
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/xelpd: Enabling dithering after the CC1
Date: Tue, 29 Jun 2021 14:40:45 +0300 [thread overview]
Message-ID: <87a6n8sxtu.fsf@intel.com> (raw)
In-Reply-To: <20210611025447.17234-1-nischal.varide@intel.com>
Cc: Ville and Daniel for archeology...
On Fri, 11 Jun 2021, Nischal Varide <nischal.varide@intel.com> wrote:
> If the panel is 12bpc then Dithering is not enabled in the Legacy
> dithering block , instead its Enabled after the C1 CC1 pipe post
> color space conversion.For a 6bpc pannel Dithering is enabled in
> Legacy block.
Currently, we only ever enable dithering for 6 bpc displays. See commit
e8fa4270536d ("drm/i915: Only dither on 6bpc panels"). This is decided
at the end of intel_modeset_pipe_config().
The big question here is if we want to expand the use of dithering. I
guess we could be able to reduce banding if we did?
> Signed-off-by: Nischal Varide <nischal.varide@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_color.c | 7 +++++++
> drivers/gpu/drm/i915/display/intel_display.c | 11 ++++++++++-
> drivers/gpu/drm/i915/i915_reg.h | 1 +
> 3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index dab892d2251b..c7af583200c4 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -1574,6 +1574,7 @@ static int glk_color_check(struct intel_crtc_state *crtc_state)
> static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
> {
> u32 gamma_mode = 0;
> + struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
>
> if (crtc_state->hw.degamma_lut)
> gamma_mode |= PRE_CSC_GAMMA_ENABLE;
> @@ -1588,6 +1589,12 @@ static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
> else
> gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;
>
> + if (DISPLAY_VER(i915) >= 13) {
> + if (!crtc_state->dither_force_disable &&
> + (crtc_state->pipe_bpp == 36))
> + gamma_mode |= POST_CC1_DITHER_ENABLE;
> + }
This enables dithering independent of crtc_state->dither. That doesn't
seem like a good idea. I think the decision should be made at the end of
intel_modeset_pipe_config().
if (DISPLAY_VER(i915) >= 13 && crtc_state->dither &&
crtc_state->pipe_bpp == 36)
gamma_mode |= POST_CC1_DITHER_ENABLE;
Obviously, as we currently only enable dithering for 6 bpc, this would
become a nop if it looked at crtc_state->dither and pipe_bpp only.
> +
> return gamma_mode;
> }
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 362bff9beb5c..3a7feb246745 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -5762,7 +5762,16 @@ static void bdw_set_pipemisc(const struct intel_crtc_state *crtc_state)
> break;
> }
>
> - if (crtc_state->dither)
> + /*
> + * If 12bpc panel then, Enables dithering after the CC1 pipe
> + * post color space conversion and not here for display_ver
> + * greater than or equal to thirteen.
> + */
> +
> + if (crtc_state->dither && (crtc_state->pipe_bpp != 36))
> + val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
> +
> + if (crtc_state->dither && (crtc_state->pipe_bpp == 36) && (DISPLAY_VER(dev_priv) < 13))
> val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
This is what you're trying to say:
/* 12 bpc dithering is done at post CSC gamma for display 13+ */
if (crtc_state->dither &&
(crtc_state->pipe_bpp != 36 || DISPLAY_VER(dev_priv) < 13))
val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
Again, this is a nop until we decide to use dithering more.
>
> if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420 ||
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index e915ec034c98..33dba13fa94d 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -7743,6 +7743,7 @@ enum {
> #define GAMMA_MODE(pipe) _MMIO_PIPE(pipe, _GAMMA_MODE_A, _GAMMA_MODE_B)
> #define PRE_CSC_GAMMA_ENABLE (1 << 31)
> #define POST_CSC_GAMMA_ENABLE (1 << 30)
> +#define POST_CC1_DITHER_ENABLE (1 << 26)
> #define GAMMA_MODE_MODE_MASK (3 << 0)
> #define GAMMA_MODE_MODE_8BIT (0 << 0)
> #define GAMMA_MODE_MODE_10BIT (1 << 0)
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2021-06-29 11:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 2:54 [Intel-gfx] [PATCH] drm/i915/xelpd: Enabling dithering after the CC1 Nischal Varide
2021-06-11 13:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-06-11 14:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-06-11 16:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-06-29 11:40 ` Jani Nikula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6n8sxtu.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=nischal.varide@intel.com \
--cc=uma.shankar@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox