提交 60a44540 编写于 作者: C Christian König

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

Signed-off-by: NChristian König <christian.koenig@amd.com>
CC: stable@vger.kernel.org
上级 4b21ce1b
...@@ -342,11 +342,18 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) ...@@ -342,11 +342,18 @@ 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;
}
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册