[Intel-gfx] [PATCH] drm/i915: fix tiling on IGDNG

Jesse Barnes jbarnes at virtuousgeek.org
Tue Sep 1 17:41:58 CEST 2009


On Tue,  1 Sep 2009 11:07:24 +0800
Zhenyu Wang <zhenyuw at linux.intel.com> wrote:

> 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.
> 
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_tiling.c |   15 +++++++--------
>  drivers/gpu/drm/i915/i915_reg.h        |    4 ++++
>  drivers/gpu/drm/i915/intel_display.c   |   13 +++++++++++++
>  3 files changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c
> b/drivers/gpu/drm/i915/i915_gem_tiling.c index a2d527b..e774a4a 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) uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
>  	bool need_disable;
>  
> -	if (!IS_I9XX(dev)) {
> +	if (IS_IGDNG(dev)) {
> +		/* On IGDNG whatever DRAM config, GPU always do
> +		 * same swizzling setup.
> +		 */
> +		swizzle_x = I915_BIT_6_SWIZZLE_9_10;
> +		swizzle_y = I915_BIT_6_SWIZZLE_9;
> +	} else if (!IS_I9XX(dev)) {

This doesn't seem equivalent... shouldn't it be if (IS_IGDNG(dev)
|| !IS_9XX)?

> +	if (IS_IGDNG(dev)) {
> +		/* must be set */
> +		dspcntr |= DISPPLANE_TRICKLE_FEED_ENABLE;
> +
> +		if (obj_priv->tiling_mode != I915_TILING_NONE) {
> +			int dsp_arb;
> +			dsp_arb = I915_READ(DISP_ARB_CTL);
> +			I915_WRITE(DISP_ARB_CTL, dsp_arb |
> +					DISP_TILE_SURFACE_SWIZZLING);
> +		}

Do you need an

else {
	int dsp_arb;
	dsp_arb = I915_READ(DISP_ARB_CTL);
	I915_WRITE(DISP_ARB_CTL, dsp_arb &
			(~DISP_TILE_SURFACE_SWIZZLING));
}

for the non-tiled case?  Or can you just set this once at setup time
and forget it?

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list