aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-05-21 17:43:59 +0200
committerChristian König <christian.koenig@amd.com>2014-05-30 14:21:44 +0200
commit60a445405a1731bac2279eab354173c9c3156747 (patch)
tree2a3c1a801b553e66c8f2026852ef33c2eb0c27bc
parent4b21ce1b4b5d262e7d4656b8ececc891fc3cb806 (diff)
downloadlinux-60a445405a1731bac2279eab354173c9c3156747.tar.gz
drm/radeon: avoid crash if VM command submission isn't available
Signed-off-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 2b6e0ebcc13..4b6f5b82415 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -342,10 +342,17 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
return -EINVAL;
/* we only support VM on some SI+ rings */
- if ((p->rdev->asic->ring[p->ring]->cs_parse == NULL) &&
- ((p->cs_flags & RADEON_CS_USE_VM) == 0)) {
- DRM_ERROR("Ring %d requires VM!\n", p->ring);
- return -EINVAL;
+ if ((p->cs_flags & RADEON_CS_USE_VM) == 0) {
+ if (p->rdev->asic->ring[p->ring]->cs_parse == NULL) {
+ DRM_ERROR("Ring %d requires VM!\n", p->ring);
+ return -EINVAL;
+ }
+ } else {
+ if (p->rdev->asic->ring[p->ring]->ib_parse == NULL) {
+ DRM_ERROR("VM not supported on ring %d!\n",
+ p->ring);
+ return -EINVAL;
+ }
}
}