aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv770.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-01-22 09:19:00 -0500
committerDave Airlie <airlied@redhat.com>2010-01-31 20:33:11 -0500
commitff82f052d2a187dd0fa0e431ba70eb457c71a40e (patch)
tree65bf2788445c3087cdb6c05fe2d40e81629ffd3b /drivers/gpu/drm/radeon/rv770.c
parent5ffdb658f605cbc420944e7c7eeec9fbb8a73772 (diff)
drm/radeon/kms: Bailout of blit if error happen & protect with mutex V3
If an error happen in r600_blit_prepare_copy report it rather than WARNING and keeping execution. For instance if ib allocation failed we did just warn about but then latter tried to access NULL ib ptr causing oops. This patch also protect r600_copy_blit with a mutex as otherwise one process might overwrite blit temporary data with new one possibly leading to GPU lockup. Should partialy or totaly fix: https://bugzilla.redhat.com/show_bug.cgi?id=553279 V2 failing blit initialization is not fatal, fallback to memcpy when this happen V3 init blit before startup as we pin in startup, remove duplicate code (this one was actualy tested unlike V2) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rv770.c')
-rw-r--r--drivers/gpu/drm/radeon/rv770.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index cf8f2b17d62..2d465768ac7 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -887,26 +887,19 @@ static int rv770_startup(struct radeon_device *rdev)
887 return r; 887 return r;
888 } 888 }
889 rv770_gpu_init(rdev); 889 rv770_gpu_init(rdev);
890 890 /* pin copy shader into vram */
891 if (!rdev->r600_blit.shader_obj) { 891 if (rdev->r600_blit.shader_obj) {
892 r = r600_blit_init(rdev); 892 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
893 if (unlikely(r != 0))
894 return r;
895 r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
896 &rdev->r600_blit.shader_gpu_addr);
897 radeon_bo_unreserve(rdev->r600_blit.shader_obj);
893 if (r) { 898 if (r) {
894 DRM_ERROR("radeon: failed blitter (%d).\n", r); 899 DRM_ERROR("failed to pin blit object %d\n", r);
895 return r; 900 return r;
896 } 901 }
897 } 902 }
898
899 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
900 if (unlikely(r != 0))
901 return r;
902 r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
903 &rdev->r600_blit.shader_gpu_addr);
904 radeon_bo_unreserve(rdev->r600_blit.shader_obj);
905 if (r) {
906 DRM_ERROR("failed to pin blit object %d\n", r);
907 return r;
908 }
909
910 /* Enable IRQ */ 903 /* Enable IRQ */
911 r = r600_irq_init(rdev); 904 r = r600_irq_init(rdev);
912 if (r) { 905 if (r) {
@@ -1062,6 +1055,12 @@ int rv770_init(struct radeon_device *rdev)
1062 r = r600_pcie_gart_init(rdev); 1055 r = r600_pcie_gart_init(rdev);
1063 if (r) 1056 if (r)
1064 return r; 1057 return r;
1058 r = r600_blit_init(rdev);
1059 if (r) {
1060 r600_blit_fini(rdev);
1061 rdev->asic->copy = NULL;
1062 dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r);
1063 }
1065 1064
1066 rdev->accel_working = true; 1065 rdev->accel_working = true;
1067 r = rv770_startup(rdev); 1066 r = rv770_startup(rdev);