Commit 064751a6 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Split up intel_color_init()

intel_color_init() does both device level and crtc level stuff.
Split it up accordingly.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220929071521.26612-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 319b0869
...@@ -2206,13 +2206,21 @@ static const struct intel_color_funcs ilk_color_funcs = { ...@@ -2206,13 +2206,21 @@ static const struct intel_color_funcs ilk_color_funcs = {
.read_luts = ilk_read_luts, .read_luts = ilk_read_luts,
}; };
void intel_color_init(struct intel_crtc *crtc) void intel_crtc_color_init(struct intel_crtc *crtc)
{ {
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
bool has_ctm = INTEL_INFO(dev_priv)->display.color.degamma_lut_size != 0; bool has_ctm = INTEL_INFO(dev_priv)->display.color.degamma_lut_size != 0;
drm_mode_crtc_set_gamma_size(&crtc->base, 256); drm_mode_crtc_set_gamma_size(&crtc->base, 256);
drm_crtc_enable_color_mgmt(&crtc->base,
INTEL_INFO(dev_priv)->display.color.degamma_lut_size,
has_ctm,
INTEL_INFO(dev_priv)->display.color.gamma_lut_size);
}
void intel_color_init_hooks(struct drm_i915_private *dev_priv)
{
if (HAS_GMCH(dev_priv)) { if (HAS_GMCH(dev_priv)) {
if (IS_CHERRYVIEW(dev_priv)) { if (IS_CHERRYVIEW(dev_priv)) {
dev_priv->display.funcs.color = &chv_color_funcs; dev_priv->display.funcs.color = &chv_color_funcs;
...@@ -2238,9 +2246,4 @@ void intel_color_init(struct intel_crtc *crtc) ...@@ -2238,9 +2246,4 @@ void intel_color_init(struct intel_crtc *crtc)
} else } else
dev_priv->display.funcs.color = &ilk_color_funcs; dev_priv->display.funcs.color = &ilk_color_funcs;
} }
drm_crtc_enable_color_mgmt(&crtc->base,
INTEL_INFO(dev_priv)->display.color.degamma_lut_size,
has_ctm,
INTEL_INFO(dev_priv)->display.color.gamma_lut_size);
} }
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
struct intel_crtc_state; struct intel_crtc_state;
struct intel_crtc; struct intel_crtc;
struct drm_i915_private;
struct drm_property_blob; struct drm_property_blob;
void intel_color_init(struct intel_crtc *crtc); void intel_color_init_hooks(struct drm_i915_private *i915);
void intel_crtc_color_init(struct intel_crtc *crtc);
int intel_color_check(struct intel_crtc_state *crtc_state); int intel_color_check(struct intel_crtc_state *crtc_state);
void intel_color_commit_noarm(const struct intel_crtc_state *crtc_state); void intel_color_commit_noarm(const struct intel_crtc_state *crtc_state);
void intel_color_commit_arm(const struct intel_crtc_state *crtc_state); void intel_color_commit_arm(const struct intel_crtc_state *crtc_state);
......
...@@ -365,8 +365,7 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -365,8 +365,7 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
BIT(DRM_SCALING_FILTER_DEFAULT) | BIT(DRM_SCALING_FILTER_DEFAULT) |
BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR)); BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR));
intel_color_init(crtc); intel_crtc_color_init(crtc);
intel_crtc_drrs_init(crtc); intel_crtc_drrs_init(crtc);
intel_crtc_crc_init(crtc); intel_crtc_crc_init(crtc);
......
...@@ -8326,6 +8326,7 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv) ...@@ -8326,6 +8326,7 @@ void intel_init_display_hooks(struct drm_i915_private *dev_priv)
if (!HAS_DISPLAY(dev_priv)) if (!HAS_DISPLAY(dev_priv))
return; return;
intel_color_init_hooks(dev_priv);
intel_init_cdclk_hooks(dev_priv); intel_init_cdclk_hooks(dev_priv);
intel_audio_hooks_init(dev_priv); intel_audio_hooks_init(dev_priv);
......
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