diff options
Diffstat (limited to 'drivers/char/drm/radeon_cp.c')
-rw-r--r-- | drivers/char/drm/radeon_cp.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c index fc0820c2b4b4..8fce12e73403 100644 --- a/drivers/char/drm/radeon_cp.c +++ b/drivers/char/drm/radeon_cp.c | |||
@@ -161,16 +161,36 @@ static int radeon_do_pixcache_flush(drm_radeon_private_t * dev_priv) | |||
161 | 161 | ||
162 | dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; | 162 | dev_priv->stats.boxes |= RADEON_BOX_WAIT_IDLE; |
163 | 163 | ||
164 | tmp = RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT); | 164 | if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { |
165 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; | 165 | tmp = RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT); |
166 | RADEON_WRITE(RADEON_RB3D_DSTCACHE_CTLSTAT, tmp); | 166 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; |
167 | 167 | RADEON_WRITE(RADEON_RB3D_DSTCACHE_CTLSTAT, tmp); | |
168 | for (i = 0; i < dev_priv->usec_timeout; i++) { | 168 | |
169 | if (!(RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT) | 169 | for (i = 0; i < dev_priv->usec_timeout; i++) { |
170 | & RADEON_RB3D_DC_BUSY)) { | 170 | if (!(RADEON_READ(RADEON_RB3D_DSTCACHE_CTLSTAT) |
171 | return 0; | 171 | & RADEON_RB3D_DC_BUSY)) { |
172 | return 0; | ||
173 | } | ||
174 | DRM_UDELAY(1); | ||
175 | } | ||
176 | } else { | ||
177 | /* 3D */ | ||
178 | tmp = RADEON_READ(R300_RB3D_DSTCACHE_CTLSTAT); | ||
179 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; | ||
180 | RADEON_WRITE(R300_RB3D_DSTCACHE_CTLSTAT, tmp); | ||
181 | |||
182 | /* 2D */ | ||
183 | tmp = RADEON_READ(RADEON_RB2D_DSTCACHE_CTLSTAT); | ||
184 | tmp |= RADEON_RB3D_DC_FLUSH_ALL; | ||
185 | RADEON_WRITE(RADEON_RB3D_DSTCACHE_CTLSTAT, tmp); | ||
186 | |||
187 | for (i = 0; i < dev_priv->usec_timeout; i++) { | ||
188 | if (!(RADEON_READ(RADEON_RB2D_DSTCACHE_CTLSTAT) | ||
189 | & RADEON_RB3D_DC_BUSY)) { | ||
190 | return 0; | ||
191 | } | ||
192 | DRM_UDELAY(1); | ||
172 | } | 193 | } |
173 | DRM_UDELAY(1); | ||
174 | } | 194 | } |
175 | 195 | ||
176 | #if RADEON_FIFO_DEBUG | 196 | #if RADEON_FIFO_DEBUG |