Skip to contentSkip to conversation

drm/radeon: fix UVD message buffer validation

PATCH Applied Christian König 2 participants 2 messages Aug 11, 2013 – Aug 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: fix UVD message buffer validation

From: Christian König <[email protected]>

When the message buffer is currently moving block until it is idle again.

---
 drivers/gpu/drm/radeon/radeon_uvd.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/radeon/radeon_uvd.c +8 -0
index f1c1575..b79f4f5 100644
@@ -356,6 +356,14 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
 		return -EINVAL;
 	}
 
+	if (bo->tbo.sync_obj) {
+		r = radeon_fence_wait(bo->tbo.sync_obj, false);
+		if (r) {
+			DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+			return r;
+		}
+	}
+
 	r = radeon_bo_kmap(bo, &ptr);
 	if (r) {
 		DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 6 lines · Christian König

From: Christian König <[email protected]>

When the message buffer is currently moving block until it is idle again.

Applied to my fixes tree.

Alex

Quoted 26 lines
---
 drivers/gpu/drm/radeon/radeon_uvd.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/radeon/radeon_uvd.c +8 -1
index f1c1575..b79f4f5 100644
@@ -356,6 +356,14 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
                return -EINVAL;
        }
 
+       if (bo->tbo.sync_obj) {
+               r = radeon_fence_wait(bo->tbo.sync_obj, false);
+               if (r) {
+                       DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+                       return r;
+               }
+       }
+
        r = radeon_bo_kmap(bo, &ptr);
        if (r) {
                DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
--

1.7.9.5