Commit cecdea15 authored by Jani Nikula's avatar Jani Nikula

drm/i915: move ILK+ CSC mode read to intel_color

Abstract the platform specific register access better.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8f34c577c663839020405e96cdb464319c2881d4.1692287501.git.jani.nikula@intel.com
parent efe6fcb2
...@@ -1025,11 +1025,19 @@ static u32 hsw_read_gamma_mode(struct intel_crtc *crtc) ...@@ -1025,11 +1025,19 @@ static u32 hsw_read_gamma_mode(struct intel_crtc *crtc)
return intel_de_read(i915, GAMMA_MODE(crtc->pipe)); return intel_de_read(i915, GAMMA_MODE(crtc->pipe));
} }
static u32 ilk_read_csc_mode(struct intel_crtc *crtc)
{
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
return intel_de_read(i915, PIPE_CSC_MODE(crtc->pipe));
}
static void hsw_get_config(struct intel_crtc_state *crtc_state) static void hsw_get_config(struct intel_crtc_state *crtc_state)
{ {
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
crtc_state->gamma_mode = hsw_read_gamma_mode(crtc); crtc_state->gamma_mode = hsw_read_gamma_mode(crtc);
crtc_state->csc_mode = ilk_read_csc_mode(crtc);
} }
static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state) static void skl_color_commit_arm(const struct intel_crtc_state *crtc_state)
...@@ -3297,6 +3305,13 @@ static struct drm_property_blob *ilk_read_lut_10(struct intel_crtc *crtc) ...@@ -3297,6 +3305,13 @@ static struct drm_property_blob *ilk_read_lut_10(struct intel_crtc *crtc)
return blob; return blob;
} }
static void ilk_get_config(struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
crtc_state->csc_mode = ilk_read_csc_mode(crtc);
}
static void ilk_read_luts(struct intel_crtc_state *crtc_state) static void ilk_read_luts(struct intel_crtc_state *crtc_state)
{ {
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
...@@ -3706,6 +3721,7 @@ static const struct intel_color_funcs ivb_color_funcs = { ...@@ -3706,6 +3721,7 @@ static const struct intel_color_funcs ivb_color_funcs = {
.read_luts = ivb_read_luts, .read_luts = ivb_read_luts,
.lut_equal = ivb_lut_equal, .lut_equal = ivb_lut_equal,
.read_csc = ilk_read_csc, .read_csc = ilk_read_csc,
.get_config = ilk_get_config,
}; };
static const struct intel_color_funcs ilk_color_funcs = { static const struct intel_color_funcs ilk_color_funcs = {
...@@ -3716,6 +3732,7 @@ static const struct intel_color_funcs ilk_color_funcs = { ...@@ -3716,6 +3732,7 @@ static const struct intel_color_funcs ilk_color_funcs = {
.read_luts = ilk_read_luts, .read_luts = ilk_read_luts,
.lut_equal = ilk_lut_equal, .lut_equal = ilk_lut_equal,
.read_csc = ilk_read_csc, .read_csc = ilk_read_csc,
.get_config = ilk_get_config,
}; };
void intel_color_crtc_init(struct intel_crtc *crtc) void intel_color_crtc_init(struct intel_crtc *crtc)
......
...@@ -3341,9 +3341,6 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc, ...@@ -3341,9 +3341,6 @@ static bool ilk_get_pipe_config(struct intel_crtc *crtc,
pipe_config->msa_timing_delay = REG_FIELD_GET(TRANSCONF_MSA_TIMING_DELAY_MASK, tmp); pipe_config->msa_timing_delay = REG_FIELD_GET(TRANSCONF_MSA_TIMING_DELAY_MASK, tmp);
pipe_config->csc_mode = intel_de_read(dev_priv,
PIPE_CSC_MODE(crtc->pipe));
i9xx_get_pipe_color_config(pipe_config); i9xx_get_pipe_color_config(pipe_config);
intel_color_get_config(pipe_config); intel_color_get_config(pipe_config);
...@@ -3735,9 +3732,6 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc, ...@@ -3735,9 +3732,6 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
pipe_config->sink_format = pipe_config->output_format; pipe_config->sink_format = pipe_config->output_format;
pipe_config->csc_mode = intel_de_read(dev_priv,
PIPE_CSC_MODE(crtc->pipe));
if (DISPLAY_VER(dev_priv) >= 9) { if (DISPLAY_VER(dev_priv) >= 9) {
tmp = intel_de_read(dev_priv, SKL_BOTTOM_COLOR(crtc->pipe)); tmp = intel_de_read(dev_priv, SKL_BOTTOM_COLOR(crtc->pipe));
......
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