aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyuw@linux.intel.com>2009-09-01 22:57:52 -0400
committerEric Anholt <eric@anholt.net>2009-09-04 16:05:44 -0400
commit553bd149bb2de7848b2b84642876f27202421368 (patch)
treee74d910f9937d61c3128526ad10a8f61ba2649fa /drivers
parent65655d4ab72456c4c3e503fead55fabf8211a79d (diff)
drm/i915: fix tiling on IGDNG
It seems that on IGDNG the same swizzling setup always applys. And front buffer tiling needs to set address swizzle in display arb control too. Fix plane tricle feed setting in v1 which should be disable bit, and always setup address swizzle to let hardware care for buffer tiling in all cases. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c15
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h4
-rw-r--r--drivers/gpu/drm/i915/intel_display.c10
3 files changed, 21 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index a2d527b22ec4..e774a4a1a503 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -234,7 +234,13 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
234 uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; 234 uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
235 bool need_disable; 235 bool need_disable;
236 236
237 if (!IS_I9XX(dev)) { 237 if (IS_IGDNG(dev)) {
238 /* On IGDNG whatever DRAM config, GPU always do
239 * same swizzling setup.
240 */
241 swizzle_x = I915_BIT_6_SWIZZLE_9_10;
242 swizzle_y = I915_BIT_6_SWIZZLE_9;
243 } else if (!IS_I9XX(dev)) {
238 /* As far as we know, the 865 doesn't have these bit 6 244 /* As far as we know, the 865 doesn't have these bit 6
239 * swizzling issues. 245 * swizzling issues.
240 */ 246 */
@@ -317,13 +323,6 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
317 } 323 }
318 } 324 }
319 325
320 /* FIXME: check with memory config on IGDNG */
321 if (IS_IGDNG(dev)) {
322 DRM_ERROR("disable tiling on IGDNG...\n");
323 swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
324 swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
325 }
326
327 dev_priv->mm.bit_6_swizzle_x = swizzle_x; 326 dev_priv->mm.bit_6_swizzle_x = swizzle_x;
328 dev_priv->mm.bit_6_swizzle_y = swizzle_y; 327 dev_priv->mm.bit_6_swizzle_y = swizzle_y;
329} 328}
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 884757ce5b67..e38cd21161c8 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1864,6 +1864,7 @@
1864#define DISPPLANE_NO_LINE_DOUBLE 0 1864#define DISPPLANE_NO_LINE_DOUBLE 0
1865#define DISPPLANE_STEREO_POLARITY_FIRST 0 1865#define DISPPLANE_STEREO_POLARITY_FIRST 0
1866#define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) 1866#define DISPPLANE_STEREO_POLARITY_SECOND (1<<18)
1867#define DISPPLANE_TRICKLE_FEED_DISABLE (1<<14) /* IGDNG */
1867#define DISPPLANE_TILED (1<<10) 1868#define DISPPLANE_TILED (1<<10)
1868#define DSPAADDR 0x70184 1869#define DSPAADDR 0x70184
1869#define DSPASTRIDE 0x70188 1870#define DSPASTRIDE 0x70188
@@ -2044,6 +2045,9 @@
2044#define GTIIR 0x44018 2045#define GTIIR 0x44018
2045#define GTIER 0x4401c 2046#define GTIER 0x4401c
2046 2047
2048#define DISP_ARB_CTL 0x45000
2049#define DISP_TILE_SURFACE_SWIZZLING (1<<13)
2050
2047/* PCH */ 2051/* PCH */
2048 2052
2049/* south display engine interrupt */ 2053/* south display engine interrupt */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 867a969980ec..d7c7fa489872 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1064,6 +1064,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
1064 dspcntr &= ~DISPPLANE_TILED; 1064 dspcntr &= ~DISPPLANE_TILED;
1065 } 1065 }
1066 1066
1067 if (IS_IGDNG(dev))
1068 /* must disable */
1069 dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE;
1070
1067 I915_WRITE(dspcntr_reg, dspcntr); 1071 I915_WRITE(dspcntr_reg, dspcntr);
1068 1072
1069 Start = obj_priv->gtt_offset; 1073 Start = obj_priv->gtt_offset;
@@ -2719,6 +2723,12 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2719 2723
2720 intel_wait_for_vblank(dev); 2724 intel_wait_for_vblank(dev);
2721 2725
2726 if (IS_IGDNG(dev)) {
2727 /* enable address swizzle for tiling buffer */
2728 temp = I915_READ(DISP_ARB_CTL);
2729 I915_WRITE(DISP_ARB_CTL, temp | DISP_TILE_SURFACE_SWIZZLING);
2730 }
2731
2722 I915_WRITE(dspcntr_reg, dspcntr); 2732 I915_WRITE(dspcntr_reg, dspcntr);
2723 2733
2724 /* Flush the plane changes */ 2734 /* Flush the plane changes */