summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_uvd.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2013-04-14 14:45:43 +0400
committerAlex Deucher <alexander.deucher@amd.com>2013-04-22 18:39:10 +0400
commita92c7d554fbfa5ec1008e4c856a2206c2cce45a4 (patch)
tree37f4013fff99233b005b59dcce2a8803b85a6661 /drivers/gpu/drm/radeon/radeon_uvd.c
parentabf1457bbbe4c62066bd03c6d31837dea28644dc (diff)
downloadlinux-a92c7d554fbfa5ec1008e4c856a2206c2cce45a4.tar.xz
drm/radeon: cleanup UVD address checks
Message and feedback buffers must be at start of VRAM, not at start of address space. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_uvd.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_uvd.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index 30a94609672a..2fb4d6cf26b6 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -415,24 +415,26 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p,
return -EINVAL;
}
- if (cmd == 0) {
- if (end & 0xFFFFFFFFF0000000) {
- DRM_ERROR("msg buffer %LX-%LX out of 256MB segment!\n",
- start, end);
- return -EINVAL;
- }
-
- r = radeon_uvd_cs_msg(p, reloc->robj, offset, buf_sizes);
- if (r)
- return r;
+ if ((start >> 28) != (end >> 28)) {
+ DRM_ERROR("reloc %LX-%LX crossing 256MB boundary!\n",
+ start, end);
+ return -EINVAL;
}
- if ((start & 0xFFFFFFFFF0000000) != (end & 0xFFFFFFFFF0000000)) {
- DRM_ERROR("reloc %LX-%LX crossing 256MB boundary!\n",
+ /* TODO: is this still necessary on NI+ ? */
+ if ((cmd == 0 || cmd == 0x3) &&
+ (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {
+ DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",
start, end);
return -EINVAL;
}
+ if (cmd == 0) {
+ r = radeon_uvd_cs_msg(p, reloc->robj, offset, buf_sizes);
+ if (r)
+ return r;
+ }
+
return 0;
}