diff options
author | Dave Airlie <airlied@redhat.com> | 2010-03-01 01:08:57 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-03-01 01:08:57 -0500 |
commit | 68de7745822f0dc2eea940e3c1fc65896d7afc88 (patch) | |
tree | 8ee06f4ee466b58fc224a7d447dd90a1168896e0 /drivers/gpu | |
parent | cf7934a2a0ec55759fcf6861a868baadfd522300 (diff) | |
parent | 566d84d172161cb6c0c4dd834c34abbac6bf7b38 (diff) |
Merge branch 'drm-radeon-testing' of /ssd/git/drm-radeon-next into drm-next-stage
* 'drm-radeon-testing' of /ssd/git/drm-radeon-next:
drm/radeon: r100/r200 ums: block ability for userspace app to trash 0 page and beyond
drm/ttm: fix function prototype to match implementation
drm/radeon: use ALIGN instead of open coding it
drm/radeon/kms: initialize set_surface_reg reg for rs600 asic
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit_kms.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cp.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_state.c | 6 |
6 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c index 5ea432347589..f4fb88ece2bb 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c | |||
@@ -49,7 +49,7 @@ set_render_target(drm_radeon_private_t *dev_priv, int format, int w, int h, u64 | |||
49 | RING_LOCALS; | 49 | RING_LOCALS; |
50 | DRM_DEBUG("\n"); | 50 | DRM_DEBUG("\n"); |
51 | 51 | ||
52 | h = (h + 7) & ~7; | 52 | h = ALIGN(h, 8); |
53 | if (h < 8) | 53 | if (h < 8) |
54 | h = 8; | 54 | h = 8; |
55 | 55 | ||
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index de8bbbcfe117..f6c6c77db7e0 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
@@ -25,7 +25,7 @@ set_render_target(struct radeon_device *rdev, int format, | |||
25 | u32 cb_color_info; | 25 | u32 cb_color_info; |
26 | int pitch, slice; | 26 | int pitch, slice; |
27 | 27 | ||
28 | h = (h + 7) & ~7; | 28 | h = ALIGN(h, 8); |
29 | if (h < 8) | 29 | if (h < 8) |
30 | h = 8; | 30 | h = 8; |
31 | 31 | ||
@@ -396,7 +396,7 @@ set_default_state(struct radeon_device *rdev) | |||
396 | NUM_ES_STACK_ENTRIES(num_es_stack_entries)); | 396 | NUM_ES_STACK_ENTRIES(num_es_stack_entries)); |
397 | 397 | ||
398 | /* emit an IB pointing at default state */ | 398 | /* emit an IB pointing at default state */ |
399 | dwords = (rdev->r600_blit.state_len + 0xf) & ~0xf; | 399 | dwords = ALIGN(rdev->r600_blit.state_len, 0x10); |
400 | gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; | 400 | gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; |
401 | radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); | 401 | radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); |
402 | radeon_ring_write(rdev, gpu_addr & 0xFFFFFFFC); | 402 | radeon_ring_write(rdev, gpu_addr & 0xFFFFFFFC); |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 4572a6699884..d3a157b2bcb7 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -407,6 +407,8 @@ static struct radeon_asic rs600_asic = { | |||
407 | .get_pcie_lanes = NULL, | 407 | .get_pcie_lanes = NULL, |
408 | .set_pcie_lanes = NULL, | 408 | .set_pcie_lanes = NULL, |
409 | .set_clock_gating = &radeon_atom_set_clock_gating, | 409 | .set_clock_gating = &radeon_atom_set_clock_gating, |
410 | .set_surface_reg = r100_set_surface_reg, | ||
411 | .clear_surface_reg = r100_clear_surface_reg, | ||
410 | .bandwidth_update = &rs600_bandwidth_update, | 412 | .bandwidth_update = &rs600_bandwidth_update, |
411 | .hpd_init = &rs600_hpd_init, | 413 | .hpd_init = &rs600_hpd_init, |
412 | .hpd_fini = &rs600_hpd_fini, | 414 | .hpd_fini = &rs600_hpd_fini, |
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 06123ba31d31..dc6eba6b96dd 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -1644,6 +1644,7 @@ static int radeon_do_resume_cp(struct drm_device *dev, struct drm_file *file_pri | |||
1644 | radeon_cp_load_microcode(dev_priv); | 1644 | radeon_cp_load_microcode(dev_priv); |
1645 | radeon_cp_init_ring_buffer(dev, dev_priv, file_priv); | 1645 | radeon_cp_init_ring_buffer(dev, dev_priv, file_priv); |
1646 | 1646 | ||
1647 | dev_priv->have_z_offset = 0; | ||
1647 | radeon_do_engine_reset(dev); | 1648 | radeon_do_engine_reset(dev); |
1648 | radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); | 1649 | radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); |
1649 | 1650 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h index 88f4d8669d84..cf911859eac2 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h | |||
@@ -268,6 +268,8 @@ typedef struct drm_radeon_private { | |||
268 | 268 | ||
269 | u32 scratch_ages[5]; | 269 | u32 scratch_ages[5]; |
270 | 270 | ||
271 | int have_z_offset; | ||
272 | |||
271 | /* starting from here on, data is preserved accross an open */ | 273 | /* starting from here on, data is preserved accross an open */ |
272 | uint32_t flags; /* see radeon_chip_flags */ | 274 | uint32_t flags; /* see radeon_chip_flags */ |
273 | resource_size_t fb_aper_offset; | 275 | resource_size_t fb_aper_offset; |
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c index 32971b8272cf..3c32f840dcd2 100644 --- a/drivers/gpu/drm/radeon/radeon_state.c +++ b/drivers/gpu/drm/radeon/radeon_state.c | |||
@@ -105,6 +105,7 @@ static __inline__ int radeon_check_and_fixup_packets(drm_radeon_private_t * | |||
105 | DRM_ERROR("Invalid depth buffer offset\n"); | 105 | DRM_ERROR("Invalid depth buffer offset\n"); |
106 | return -EINVAL; | 106 | return -EINVAL; |
107 | } | 107 | } |
108 | dev_priv->have_z_offset = 1; | ||
108 | break; | 109 | break; |
109 | 110 | ||
110 | case RADEON_EMIT_PP_CNTL: | 111 | case RADEON_EMIT_PP_CNTL: |
@@ -898,6 +899,11 @@ static void radeon_cp_dispatch_clear(struct drm_device * dev, | |||
898 | if (tmp & RADEON_BACK) | 899 | if (tmp & RADEON_BACK) |
899 | flags |= RADEON_FRONT; | 900 | flags |= RADEON_FRONT; |
900 | } | 901 | } |
902 | if (flags & (RADEON_DEPTH|RADEON_STENCIL)) { | ||
903 | if (!dev_priv->have_z_offset) | ||
904 | printk_once(KERN_ERR "radeon: illegal depth clear request. Buggy mesa detected - please update.\n"); | ||
905 | flags &= ~(RADEON_DEPTH | RADEON_STENCIL); | ||
906 | } | ||
901 | 907 | ||
902 | if (flags & (RADEON_FRONT | RADEON_BACK)) { | 908 | if (flags & (RADEON_FRONT | RADEON_BACK)) { |
903 | 909 | ||