diff mbox series

[07/11] drm/i915: Pass limited_range explicitly to ilk_csc_convert_ctm()

Message ID 20221026113906.10551-8-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: More gamma work | expand

Commit Message

Ville Syrjälä Oct. 26, 2022, 11:39 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Since pre-icl vs. icl+ handle the limited range
output stuff a bit differently it's probably
less confusing if we just pass that information
explicitly into ilk_csc_convert_ctm().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_color.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Nautiyal, Ankit K Nov. 3, 2022, 10:04 a.m. UTC | #1
Looks good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

On 10/26/2022 5:09 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Since pre-icl vs. icl+ handle the limited range
> output stuff a bit differently it's probably
> less confusing if we just pass that information
> explicitly into ilk_csc_convert_ctm().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_color.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
> index e881c95ee451..946fb767f3e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_color.c
> +++ b/drivers/gpu/drm/i915/display/intel_color.c
> @@ -259,14 +259,14 @@ static bool ilk_csc_limited_range(const struct intel_crtc_state *crtc_state)
>   }
>   
>   static void ilk_csc_convert_ctm(const struct intel_crtc_state *crtc_state,
> -				u16 coeffs[9])
> +				u16 coeffs[9], bool limited_color_range)
>   {
>   	const struct drm_color_ctm *ctm = crtc_state->hw.ctm->data;
>   	const u64 *input;
>   	u64 temp[9];
>   	int i;
>   
> -	if (ilk_csc_limited_range(crtc_state))
> +	if (limited_color_range)
>   		input = ctm_mult_by_limited(temp, ctm->matrix);
>   	else
>   		input = ctm->matrix;
> @@ -319,7 +319,7 @@ static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state)
>   	if (crtc_state->hw.ctm) {
>   		u16 coeff[9];
>   
> -		ilk_csc_convert_ctm(crtc_state, coeff);
> +		ilk_csc_convert_ctm(crtc_state, coeff, limited_color_range);
>   		ilk_update_pipe_csc(crtc, ilk_csc_off_zero, coeff,
>   				    limited_color_range ?
>   				    ilk_csc_postoff_limited_range :
> @@ -354,7 +354,7 @@ static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state)
>   	if (crtc_state->hw.ctm) {
>   		u16 coeff[9];
>   
> -		ilk_csc_convert_ctm(crtc_state, coeff);
> +		ilk_csc_convert_ctm(crtc_state, coeff, false);

>   		ilk_update_pipe_csc(crtc, ilk_csc_off_zero,
>   				    coeff, ilk_csc_off_zero);
>   	}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index e881c95ee451..946fb767f3e0 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -259,14 +259,14 @@  static bool ilk_csc_limited_range(const struct intel_crtc_state *crtc_state)
 }
 
 static void ilk_csc_convert_ctm(const struct intel_crtc_state *crtc_state,
-				u16 coeffs[9])
+				u16 coeffs[9], bool limited_color_range)
 {
 	const struct drm_color_ctm *ctm = crtc_state->hw.ctm->data;
 	const u64 *input;
 	u64 temp[9];
 	int i;
 
-	if (ilk_csc_limited_range(crtc_state))
+	if (limited_color_range)
 		input = ctm_mult_by_limited(temp, ctm->matrix);
 	else
 		input = ctm->matrix;
@@ -319,7 +319,7 @@  static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state)
 	if (crtc_state->hw.ctm) {
 		u16 coeff[9];
 
-		ilk_csc_convert_ctm(crtc_state, coeff);
+		ilk_csc_convert_ctm(crtc_state, coeff, limited_color_range);
 		ilk_update_pipe_csc(crtc, ilk_csc_off_zero, coeff,
 				    limited_color_range ?
 				    ilk_csc_postoff_limited_range :
@@ -354,7 +354,7 @@  static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state)
 	if (crtc_state->hw.ctm) {
 		u16 coeff[9];
 
-		ilk_csc_convert_ctm(crtc_state, coeff);
+		ilk_csc_convert_ctm(crtc_state, coeff, false);
 		ilk_update_pipe_csc(crtc, ilk_csc_off_zero,
 				    coeff, ilk_csc_off_zero);
 	}