提交 f65a9c5b 编写于 作者: V Ville Syrjälä 提交者: Daniel Vetter

drm/i915: Parametrize PALETTE and LGC_PALETTE

Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: NJani Nikula <jani.nikula@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 c039b7f2
...@@ -2485,8 +2485,8 @@ enum skl_disp_power_wells { ...@@ -2485,8 +2485,8 @@ enum skl_disp_power_wells {
#define PALETTE_A_OFFSET 0xa000 #define PALETTE_A_OFFSET 0xa000
#define PALETTE_B_OFFSET 0xa800 #define PALETTE_B_OFFSET 0xa800
#define CHV_PALETTE_C_OFFSET 0xc000 #define CHV_PALETTE_C_OFFSET 0xc000
#define PALETTE(pipe) (dev_priv->info.palette_offsets[pipe] + \ #define PALETTE(pipe, i) (dev_priv->info.palette_offsets[pipe] + \
dev_priv->info.display_mmio_offset) dev_priv->info.display_mmio_offset + (i) * 4)
/* MCH MMIO space */ /* MCH MMIO space */
...@@ -5641,7 +5641,7 @@ enum skl_disp_power_wells { ...@@ -5641,7 +5641,7 @@ enum skl_disp_power_wells {
/* legacy palette */ /* legacy palette */
#define _LGC_PALETTE_A 0x4a000 #define _LGC_PALETTE_A 0x4a000
#define _LGC_PALETTE_B 0x4a800 #define _LGC_PALETTE_B 0x4a800
#define LGC_PALETTE(pipe) _PIPE(pipe, _LGC_PALETTE_A, _LGC_PALETTE_B) #define LGC_PALETTE(pipe, i) (_PIPE(pipe, _LGC_PALETTE_A, _LGC_PALETTE_B) + (i) * 4)
#define _GAMMA_MODE_A 0x4a480 #define _GAMMA_MODE_A 0x4a480
#define _GAMMA_MODE_B 0x4ac80 #define _GAMMA_MODE_B 0x4ac80
......
...@@ -4593,7 +4593,6 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc) ...@@ -4593,7 +4593,6 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
enum pipe pipe = intel_crtc->pipe; enum pipe pipe = intel_crtc->pipe;
int palreg = PALETTE(pipe);
int i; int i;
bool reenable_ips = false; bool reenable_ips = false;
...@@ -4608,10 +4607,6 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc) ...@@ -4608,10 +4607,6 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
assert_pll_enabled(dev_priv, pipe); assert_pll_enabled(dev_priv, pipe);
} }
/* use legacy palette for Ironlake */
if (!HAS_GMCH_DISPLAY(dev))
palreg = LGC_PALETTE(pipe);
/* Workaround : Do not read or write the pipe palette/gamma data while /* Workaround : Do not read or write the pipe palette/gamma data while
* GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled. * GAMMA_MODE is configured for split gamma and IPS_CTL has IPS enabled.
*/ */
...@@ -4623,7 +4618,14 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc) ...@@ -4623,7 +4618,14 @@ static void intel_crtc_load_lut(struct drm_crtc *crtc)
} }
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
I915_WRITE(palreg + 4 * i, u32 palreg;
if (HAS_GMCH_DISPLAY(dev))
palreg = PALETTE(pipe, i);
else
palreg = LGC_PALETTE(pipe, i);
I915_WRITE(palreg,
(intel_crtc->lut_r[i] << 16) | (intel_crtc->lut_r[i] << 16) |
(intel_crtc->lut_g[i] << 8) | (intel_crtc->lut_g[i] << 8) |
intel_crtc->lut_b[i]); intel_crtc->lut_b[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册