Commit c35e8a25 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Rename pipe CSC to use ilk_ prefix

The pipe CSC was introduced by ILK, so change everything related
to use ilk_ as the prefix.

Cc: Johnson Lin <johnson.lin@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180222214232.6064-3-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
parent db61d160
...@@ -66,13 +66,13 @@ ...@@ -66,13 +66,13 @@
* of the CTM coefficient and we write the value from bit 3. We also round the * of the CTM coefficient and we write the value from bit 3. We also round the
* value. * value.
*/ */
#define I9XX_CSC_COEFF_FP(coeff, fbits) \ #define ILK_CSC_COEFF_FP(coeff, fbits) \
(clamp_val(((coeff) >> (32 - (fbits) - 3)) + 4, 0, 0xfff) & 0xff8) (clamp_val(((coeff) >> (32 - (fbits) - 3)) + 4, 0, 0xfff) & 0xff8)
#define I9XX_CSC_COEFF_LIMITED_RANGE \ #define ILK_CSC_COEFF_LIMITED_RANGE \
I9XX_CSC_COEFF_FP(CTM_COEFF_LIMITED_RANGE, 9) ILK_CSC_COEFF_FP(CTM_COEFF_LIMITED_RANGE, 9)
#define I9XX_CSC_COEFF_1_0 \ #define ILK_CSC_COEFF_1_0 \
((7 << 12) | I9XX_CSC_COEFF_FP(CTM_COEFF_1_0, 8)) ((7 << 12) | ILK_CSC_COEFF_FP(CTM_COEFF_1_0, 8))
static bool crtc_state_is_legacy_gamma(struct drm_crtc_state *state) static bool crtc_state_is_legacy_gamma(struct drm_crtc_state *state)
{ {
...@@ -108,7 +108,7 @@ static u64 *ctm_mult_by_limited(u64 *result, const u64 *input) ...@@ -108,7 +108,7 @@ static u64 *ctm_mult_by_limited(u64 *result, const u64 *input)
return result; return result;
} }
static void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc) static void ilk_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
{ {
int pipe = intel_crtc->pipe; int pipe = intel_crtc->pipe;
struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
...@@ -132,8 +132,7 @@ static void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc) ...@@ -132,8 +132,7 @@ static void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
I915_WRITE(PIPE_CSC_MODE(pipe), 0); I915_WRITE(PIPE_CSC_MODE(pipe), 0);
} }
/* Set up the pipe CSC unit. */ static void ilk_load_csc_matrix(struct drm_crtc_state *crtc_state)
static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
{ {
struct drm_crtc *crtc = crtc_state->crtc; struct drm_crtc *crtc = crtc_state->crtc;
struct drm_i915_private *dev_priv = to_i915(crtc->dev); struct drm_i915_private *dev_priv = to_i915(crtc->dev);
...@@ -143,7 +142,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state) ...@@ -143,7 +142,7 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
struct intel_crtc_state *intel_crtc_state = to_intel_crtc_state(crtc_state); struct intel_crtc_state *intel_crtc_state = to_intel_crtc_state(crtc_state);
if (intel_crtc_state->ycbcr420) { if (intel_crtc_state->ycbcr420) {
i9xx_load_ycbcr_conversion_matrix(intel_crtc); ilk_load_ycbcr_conversion_matrix(intel_crtc);
return; return;
} else if (crtc_state->ctm) { } else if (crtc_state->ctm) {
struct drm_color_ctm *ctm = struct drm_color_ctm *ctm =
...@@ -175,21 +174,21 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state) ...@@ -175,21 +174,21 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
if (abs_coeff < CTM_COEFF_0_125) if (abs_coeff < CTM_COEFF_0_125)
coeffs[i] |= (3 << 12) | coeffs[i] |= (3 << 12) |
I9XX_CSC_COEFF_FP(abs_coeff, 12); ILK_CSC_COEFF_FP(abs_coeff, 12);
else if (abs_coeff < CTM_COEFF_0_25) else if (abs_coeff < CTM_COEFF_0_25)
coeffs[i] |= (2 << 12) | coeffs[i] |= (2 << 12) |
I9XX_CSC_COEFF_FP(abs_coeff, 11); ILK_CSC_COEFF_FP(abs_coeff, 11);
else if (abs_coeff < CTM_COEFF_0_5) else if (abs_coeff < CTM_COEFF_0_5)
coeffs[i] |= (1 << 12) | coeffs[i] |= (1 << 12) |
I9XX_CSC_COEFF_FP(abs_coeff, 10); ILK_CSC_COEFF_FP(abs_coeff, 10);
else if (abs_coeff < CTM_COEFF_1_0) else if (abs_coeff < CTM_COEFF_1_0)
coeffs[i] |= I9XX_CSC_COEFF_FP(abs_coeff, 9); coeffs[i] |= ILK_CSC_COEFF_FP(abs_coeff, 9);
else if (abs_coeff < CTM_COEFF_2_0) else if (abs_coeff < CTM_COEFF_2_0)
coeffs[i] |= (7 << 12) | coeffs[i] |= (7 << 12) |
I9XX_CSC_COEFF_FP(abs_coeff, 8); ILK_CSC_COEFF_FP(abs_coeff, 8);
else else
coeffs[i] |= (6 << 12) | coeffs[i] |= (6 << 12) |
I9XX_CSC_COEFF_FP(abs_coeff, 7); ILK_CSC_COEFF_FP(abs_coeff, 7);
} }
} else { } else {
/* /*
...@@ -203,9 +202,9 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state) ...@@ -203,9 +202,9 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (intel_crtc_state->limited_color_range) if (intel_crtc_state->limited_color_range)
coeffs[i * 3 + i] = coeffs[i * 3 + i] =
I9XX_CSC_COEFF_LIMITED_RANGE; ILK_CSC_COEFF_LIMITED_RANGE;
else else
coeffs[i * 3 + i] = I9XX_CSC_COEFF_1_0; coeffs[i * 3 + i] = ILK_CSC_COEFF_1_0;
} }
} }
...@@ -651,14 +650,14 @@ void intel_color_init(struct drm_crtc *crtc) ...@@ -651,14 +650,14 @@ void intel_color_init(struct drm_crtc *crtc)
dev_priv->display.load_csc_matrix = cherryview_load_csc_matrix; dev_priv->display.load_csc_matrix = cherryview_load_csc_matrix;
dev_priv->display.load_luts = cherryview_load_luts; dev_priv->display.load_luts = cherryview_load_luts;
} else if (IS_HASWELL(dev_priv)) { } else if (IS_HASWELL(dev_priv)) {
dev_priv->display.load_csc_matrix = i9xx_load_csc_matrix; dev_priv->display.load_csc_matrix = ilk_load_csc_matrix;
dev_priv->display.load_luts = haswell_load_luts; dev_priv->display.load_luts = haswell_load_luts;
} else if (IS_BROADWELL(dev_priv) || IS_GEN9_BC(dev_priv) || } else if (IS_BROADWELL(dev_priv) || IS_GEN9_BC(dev_priv) ||
IS_BROXTON(dev_priv)) { IS_BROXTON(dev_priv)) {
dev_priv->display.load_csc_matrix = i9xx_load_csc_matrix; dev_priv->display.load_csc_matrix = ilk_load_csc_matrix;
dev_priv->display.load_luts = broadwell_load_luts; dev_priv->display.load_luts = broadwell_load_luts;
} else if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) { } else if (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) {
dev_priv->display.load_csc_matrix = i9xx_load_csc_matrix; dev_priv->display.load_csc_matrix = ilk_load_csc_matrix;
dev_priv->display.load_luts = glk_load_luts; dev_priv->display.load_luts = glk_load_luts;
} else { } else {
dev_priv->display.load_luts = i9xx_load_luts; dev_priv->display.load_luts = i9xx_load_luts;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment