aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 23:37:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 23:37:06 -0400
commitb83db1deb29eb4eea9bf5992431d26978e039ce6 (patch)
treea59a4d94c41de6889be93b6963c791aa64181f25
parent7d2f280e75f05919314e250cadf361a327ed555c (diff)
parent7e94250312d8b32a18e7e96cee19f2795d224e8c (diff)
Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/radeon/kms: enable unmappable vram for evergreen drm/radeon/kms: fix tiled db height calculation on 6xx/7xx drm/radeon/kms: fix handling of tex lookup disable in cs checker on r2xx
-rw-r--r--drivers/gpu/drm/radeon/evergreen_blit_kms.c2
-rw-r--r--drivers/gpu/drm/radeon/r100.c3
-rw-r--r--drivers/gpu/drm/radeon/r100_track.h1
-rw-r--r--drivers/gpu/drm/radeon/r200.c2
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c14
-rw-r--r--drivers/gpu/drm/radeon/radeon_reg.h1
6 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
index 086b9b0416c4..ac3b6dde23db 100644
--- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c
+++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
@@ -495,6 +495,7 @@ done:
495 dev_err(rdev->dev, "(%d) pin blit object failed\n", r); 495 dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
496 return r; 496 return r;
497 } 497 }
498 rdev->mc.active_vram_size = rdev->mc.real_vram_size;
498 return 0; 499 return 0;
499} 500}
500 501
@@ -502,6 +503,7 @@ void evergreen_blit_fini(struct radeon_device *rdev)
502{ 503{
503 int r; 504 int r;
504 505
506 rdev->mc.active_vram_size = rdev->mc.visible_vram_size;
505 if (rdev->r600_blit.shader_obj == NULL) 507 if (rdev->r600_blit.shader_obj == NULL)
506 return; 508 return;
507 /* If we can't reserve the bo, unref should be enough to destroy 509 /* If we can't reserve the bo, unref should be enough to destroy
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 6d1540c0bfed..0e8f28a68927 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3180,6 +3180,8 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev,
3180 for (u = 0; u < track->num_texture; u++) { 3180 for (u = 0; u < track->num_texture; u++) {
3181 if (!track->textures[u].enabled) 3181 if (!track->textures[u].enabled)
3182 continue; 3182 continue;
3183 if (track->textures[u].lookup_disable)
3184 continue;
3183 robj = track->textures[u].robj; 3185 robj = track->textures[u].robj;
3184 if (robj == NULL) { 3186 if (robj == NULL) {
3185 DRM_ERROR("No texture bound to unit %u\n", u); 3187 DRM_ERROR("No texture bound to unit %u\n", u);
@@ -3414,6 +3416,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track
3414 track->textures[i].robj = NULL; 3416 track->textures[i].robj = NULL;
3415 /* CS IB emission code makes sure texture unit are disabled */ 3417 /* CS IB emission code makes sure texture unit are disabled */
3416 track->textures[i].enabled = false; 3418 track->textures[i].enabled = false;
3419 track->textures[i].lookup_disable = false;
3417 track->textures[i].roundup_w = true; 3420 track->textures[i].roundup_w = true;
3418 track->textures[i].roundup_h = true; 3421 track->textures[i].roundup_h = true;
3419 if (track->separate_cube) 3422 if (track->separate_cube)
diff --git a/drivers/gpu/drm/radeon/r100_track.h b/drivers/gpu/drm/radeon/r100_track.h
index f47cdca1c004..af65600e6564 100644
--- a/drivers/gpu/drm/radeon/r100_track.h
+++ b/drivers/gpu/drm/radeon/r100_track.h
@@ -46,6 +46,7 @@ struct r100_cs_track_texture {
46 unsigned height_11; 46 unsigned height_11;
47 bool use_pitch; 47 bool use_pitch;
48 bool enabled; 48 bool enabled;
49 bool lookup_disable;
49 bool roundup_w; 50 bool roundup_w;
50 bool roundup_h; 51 bool roundup_h;
51 unsigned compress_format; 52 unsigned compress_format;
diff --git a/drivers/gpu/drm/radeon/r200.c b/drivers/gpu/drm/radeon/r200.c
index 0266d72e0a4c..d2408c395619 100644
--- a/drivers/gpu/drm/radeon/r200.c
+++ b/drivers/gpu/drm/radeon/r200.c
@@ -447,6 +447,8 @@ int r200_packet0_check(struct radeon_cs_parser *p,
447 track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK); 447 track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK);
448 track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK); 448 track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK);
449 } 449 }
450 if (idx_value & R200_TXFORMAT_LOOKUP_DISABLE)
451 track->textures[i].lookup_disable = true;
450 switch ((idx_value & RADEON_TXFORMAT_FORMAT_MASK)) { 452 switch ((idx_value & RADEON_TXFORMAT_FORMAT_MASK)) {
451 case R200_TXFORMAT_I8: 453 case R200_TXFORMAT_I8:
452 case R200_TXFORMAT_RGB332: 454 case R200_TXFORMAT_RGB332:
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 7b294c127c5f..37cc2aa9f923 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -310,7 +310,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
310 /* Check depth buffer */ 310 /* Check depth buffer */
311 if (G_028800_STENCIL_ENABLE(track->db_depth_control) || 311 if (G_028800_STENCIL_ENABLE(track->db_depth_control) ||
312 G_028800_Z_ENABLE(track->db_depth_control)) { 312 G_028800_Z_ENABLE(track->db_depth_control)) {
313 u32 nviews, bpe, ntiles, pitch, pitch_align, height, size; 313 u32 nviews, bpe, ntiles, pitch, pitch_align, height, size, slice_tile_max;
314 if (track->db_bo == NULL) { 314 if (track->db_bo == NULL) {
315 dev_warn(p->dev, "z/stencil with no depth buffer\n"); 315 dev_warn(p->dev, "z/stencil with no depth buffer\n");
316 return -EINVAL; 316 return -EINVAL;
@@ -354,11 +354,11 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
354 } else { 354 } else {
355 size = radeon_bo_size(track->db_bo); 355 size = radeon_bo_size(track->db_bo);
356 pitch = G_028000_PITCH_TILE_MAX(track->db_depth_size) + 1; 356 pitch = G_028000_PITCH_TILE_MAX(track->db_depth_size) + 1;
357 height = size / (pitch * 8 * bpe); 357 slice_tile_max = G_028000_SLICE_TILE_MAX(track->db_depth_size) + 1;
358 height &= ~0x7; 358 slice_tile_max *= 64;
359 if (!height) 359 height = slice_tile_max / (pitch * 8);
360 height = 8; 360 if (height > 8192)
361 361 height = 8192;
362 switch (G_028010_ARRAY_MODE(track->db_depth_info)) { 362 switch (G_028010_ARRAY_MODE(track->db_depth_info)) {
363 case V_028010_ARRAY_1D_TILED_THIN1: 363 case V_028010_ARRAY_1D_TILED_THIN1:
364 pitch_align = (max((u32)8, (u32)(track->group_size / (8 * bpe))) / 8); 364 pitch_align = (max((u32)8, (u32)(track->group_size / (8 * bpe))) / 8);
@@ -367,6 +367,8 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
367 __func__, __LINE__, pitch); 367 __func__, __LINE__, pitch);
368 return -EINVAL; 368 return -EINVAL;
369 } 369 }
370 /* don't break userspace */
371 height &= ~0x7;
370 if (!IS_ALIGNED(height, 8)) { 372 if (!IS_ALIGNED(height, 8)) {
371 dev_warn(p->dev, "%s:%d db height (%d) invalid\n", 373 dev_warn(p->dev, "%s:%d db height (%d) invalid\n",
372 __func__, __LINE__, height); 374 __func__, __LINE__, height);
diff --git a/drivers/gpu/drm/radeon/radeon_reg.h b/drivers/gpu/drm/radeon/radeon_reg.h
index c332f46340d5..64928814de53 100644
--- a/drivers/gpu/drm/radeon/radeon_reg.h
+++ b/drivers/gpu/drm/radeon/radeon_reg.h
@@ -2836,6 +2836,7 @@
2836# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) 2836# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24)
2837# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) 2837# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24)
2838# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 2838# define R200_TXFORMAT_ST_ROUTE_SHIFT 24
2839# define R200_TXFORMAT_LOOKUP_DISABLE (1 << 27)
2839# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) 2840# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
2840# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) 2841# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
2841# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) 2842# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)