All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/color: For MTL convert 24 bit lut values to 16 bit
Date: Mon, 26 Jun 2023 15:23:26 +0300	[thread overview]
Message-ID: <87jzvqv2dd.fsf@intel.com> (raw)
In-Reply-To: <20230626055444.1113796-3-chaitanya.kumar.borah@intel.com>

On Mon, 26 Jun 2023, Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> wrote:
> For MTL and beyond, convert back the 24 bit lut values
> read from HW to 16 bit values to maintain parity with
> userspace values. This way we avoid pipe config mismatch
> for pre-csc lut values.
>
> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_color.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index 25c73e2e6fa3..856191640e71 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -3477,6 +3477,14 @@ static struct drm_property_blob *glk_read_degamma_lut(struct intel_crtc *crtc)
>  	for (i = 0; i < lut_size; i++) {
>  		u32 val = intel_de_read_fw(dev_priv, PRE_CSC_GAMC_DATA(pipe));
>  
> +		/*
> +		 * For MTL and beyond, convert back the 24 bit lut values
> +		 * read from HW to 16 bit values to maintain parity with
> +		 * userspace values
> +		 */
> +		if (DISPLAY_VER(dev_priv) >= 14)
> +			val = mul_u32_u32(val, (1 << 16)) / (1 << 24);
> +

Here too please add a small helper for the conversion.

BR,
Jani.

>  		lut[i].red = val;
>  		lut[i].green = val;
>  		lut[i].blue = val;

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-06-26 12:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  5:54 [Intel-gfx] [PATCH 0/2] MTL Degamma implementation Chaitanya Kumar Borah
2023-06-26  5:54 ` [Intel-gfx] [PATCH 1/2] drm/i915/color: Add function to load degamma LUT in MTL Chaitanya Kumar Borah
2023-06-26 12:21   ` Jani Nikula
2023-07-10 13:46     ` Borah, Chaitanya Kumar
2023-06-26  5:54 ` [Intel-gfx] [PATCH 2/2] drm/i915/color: For MTL convert 24 bit lut values to 16 bit Chaitanya Kumar Borah
2023-06-26 12:23   ` Jani Nikula [this message]
2023-07-10 13:47     ` Borah, Chaitanya Kumar
2023-06-26  8:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success for MTL Degamma implementation Patchwork
2023-06-26 14:06 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=87jzvqv2dd.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.