diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-04-24 23:54:40 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-05-05 10:56:57 +0200 |
commit | b8866ef82d4f6c5361c8edd5199fe0cd19b947e3 (patch) | |
tree | d21804aa9dbeb0a111458033d49e16c640411f87 /drivers/gpu/drm/i915 | |
parent | 8cb92203bf223053ab6044211cfffe7b674cf526 (diff) | |
download | linux-stable-b8866ef82d4f6c5361c8edd5199fe0cd19b947e3.tar.gz linux-stable-b8866ef82d4f6c5361c8edd5199fe0cd19b947e3.tar.bz2 linux-stable-b8866ef82d4f6c5361c8edd5199fe0cd19b947e3.zip |
drm/i915/tv: extract set_color_conversion
intel_tv_mode_set is still too bug.
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 04bf8caaac0c..a6acaeec7d69 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -993,6 +993,26 @@ set_tv_mode_timings(struct drm_i915_private *dev_priv, I915_WRITE(TV_V_CTL_7, vctl7); } +static void set_color_conversion(struct drm_i915_private *dev_priv, + const struct color_conversion *color_conversion) +{ + if (!color_conversion) + return; + + I915_WRITE(TV_CSC_Y, (color_conversion->ry << 16) | + color_conversion->gy); + I915_WRITE(TV_CSC_Y2, (color_conversion->by << 16) | + color_conversion->ay); + I915_WRITE(TV_CSC_U, (color_conversion->ru << 16) | + color_conversion->gu); + I915_WRITE(TV_CSC_U2, (color_conversion->bu << 16) | + color_conversion->au); + I915_WRITE(TV_CSC_V, (color_conversion->rv << 16) | + color_conversion->gv); + I915_WRITE(TV_CSC_V2, (color_conversion->bv << 16) | + color_conversion->av); +} + static void intel_tv_mode_set(struct intel_encoder *encoder) { struct drm_device *dev = encoder->base.dev; @@ -1079,20 +1099,7 @@ static void intel_tv_mode_set(struct intel_encoder *encoder) I915_WRITE(TV_SC_CTL_2, scctl2); I915_WRITE(TV_SC_CTL_3, scctl3); - if (color_conversion) { - I915_WRITE(TV_CSC_Y, (color_conversion->ry << 16) | - color_conversion->gy); - I915_WRITE(TV_CSC_Y2, (color_conversion->by << 16) | - color_conversion->ay); - I915_WRITE(TV_CSC_U, (color_conversion->ru << 16) | - color_conversion->gu); - I915_WRITE(TV_CSC_U2, (color_conversion->bu << 16) | - color_conversion->au); - I915_WRITE(TV_CSC_V, (color_conversion->rv << 16) | - color_conversion->gv); - I915_WRITE(TV_CSC_V2, (color_conversion->bv << 16) | - color_conversion->av); - } + set_color_conversion(dev_priv, color_conversion); if (INTEL_INFO(dev)->gen >= 4) I915_WRITE(TV_CLR_KNOBS, 0x00404000); |