diff options
author | Christian König <christian.koenig@amd.com> | 2014-05-21 17:43:59 +0200 |
---|---|---|
committer | Show Liu <show.liu@linaro.org> | 2014-06-18 12:05:24 +0800 |
commit | 9166844797dcd1b3d5573828d9ec47d2fbcfe938 (patch) | |
tree | 7bd71466a62143557dc2c293215cb90b4ac3e0c1 | |
parent | f4c60f94f1a1385602a488cfc1ef2180e15309bb (diff) |
drm/radeon: avoid crash if VM command submission isn't available
commit 60a445405a1731bac2279eab354173c9c3156747 upstream.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cs.c | 15 |
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 dfb5a1db87d..7993aec86ac 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -276,10 +276,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; + } } } |