Commit 60a44540 authored by Christian König's avatar Christian König

drm/radeon: avoid crash if VM command submission isn't available

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
parent 4b21ce1b
...@@ -342,10 +342,17 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) ...@@ -342,10 +342,17 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
return -EINVAL; return -EINVAL;
/* we only support VM on some SI+ rings */ /* we only support VM on some SI+ rings */
if ((p->rdev->asic->ring[p->ring]->cs_parse == NULL) && if ((p->cs_flags & RADEON_CS_USE_VM) == 0) {
((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); DRM_ERROR("Ring %d requires VM!\n", p->ring);
return -EINVAL; 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;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment