diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-02-05 11:08:39 -0500 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-02-07 14:45:39 -0500 |
commit | 87cefd57c88aecc877b35c89375fe688a8eb0868 (patch) | |
tree | de85921d7d5b12ff9264eb489012d0a810b82c69 /drivers/gpu | |
parent | 23b03a272c2beed43fa7468971b94a4b267cebbd (diff) |
drm/i915: Pull GAMMA_MODE write out from haswell_load_luts()
For bdw+ let's move the GAMMA_MODE write for the legacy LUT
mode into the .load_luts() funciton directly, rather than
relying on haswell_load_luts(). We'll be getting rid of
haswell_load_luts() entirely soon, and it's anyway cleaner
to have the GAMMA_MODE write in a single place.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190205160848.24662-5-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_color.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c index 96d4ece4870c..171dff60d62f 100644 --- a/drivers/gpu/drm/i915/intel_color.c +++ b/drivers/gpu/drm/i915/intel_color.c | |||
@@ -473,21 +473,20 @@ static void broadwell_load_luts(const struct intel_crtc_state *crtc_state) | |||
473 | enum pipe pipe = crtc->pipe; | 473 | enum pipe pipe = crtc->pipe; |
474 | 474 | ||
475 | if (crtc_state_is_legacy_gamma(crtc_state)) { | 475 | if (crtc_state_is_legacy_gamma(crtc_state)) { |
476 | haswell_load_luts(crtc_state); | 476 | i9xx_load_luts(crtc_state); |
477 | return; | 477 | } else { |
478 | } | 478 | bdw_load_degamma_lut(crtc_state); |
479 | bdw_load_gamma_lut(crtc_state, | ||
480 | INTEL_INFO(dev_priv)->color.degamma_lut_size); | ||
479 | 481 | ||
480 | bdw_load_degamma_lut(crtc_state); | 482 | /* |
481 | bdw_load_gamma_lut(crtc_state, | 483 | * Reset the index, otherwise it prevents the legacy palette to be |
482 | INTEL_INFO(dev_priv)->color.degamma_lut_size); | 484 | * written properly. |
485 | */ | ||
486 | I915_WRITE(PREC_PAL_INDEX(pipe), 0); | ||
487 | } | ||
483 | 488 | ||
484 | I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode); | 489 | I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode); |
485 | |||
486 | /* | ||
487 | * Reset the index, otherwise it prevents the legacy palette to be | ||
488 | * written properly. | ||
489 | */ | ||
490 | I915_WRITE(PREC_PAL_INDEX(pipe), 0); | ||
491 | } | 490 | } |
492 | 491 | ||
493 | static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state) | 492 | static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state) |
@@ -530,11 +529,16 @@ static void glk_load_luts(const struct intel_crtc_state *crtc_state) | |||
530 | glk_load_degamma_lut(crtc_state); | 529 | glk_load_degamma_lut(crtc_state); |
531 | 530 | ||
532 | if (crtc_state_is_legacy_gamma(crtc_state)) { | 531 | if (crtc_state_is_legacy_gamma(crtc_state)) { |
533 | haswell_load_luts(crtc_state); | 532 | i9xx_load_luts(crtc_state); |
534 | return; | 533 | } else { |
535 | } | 534 | bdw_load_gamma_lut(crtc_state, 0); |
536 | 535 | ||
537 | bdw_load_gamma_lut(crtc_state, 0); | 536 | /* |
537 | * Reset the index, otherwise it prevents the legacy palette to be | ||
538 | * written properly. | ||
539 | */ | ||
540 | I915_WRITE(PREC_PAL_INDEX(pipe), 0); | ||
541 | } | ||
538 | 542 | ||
539 | I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode); | 543 | I915_WRITE(GAMMA_MODE(pipe), crtc_state->gamma_mode); |
540 | } | 544 | } |