Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60a4454

Browse files
drm/radeon: avoid crash if VM command submission isn't available
Signed-off-by: Christian König <[email protected]> CC: [email protected]
1 parent 4b21ce1 commit 60a4454

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/radeon/radeon_cs.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,17 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
342342
return -EINVAL;
343343

344344
/* we only support VM on some SI+ rings */
345-
if ((p->rdev->asic->ring[p->ring]->cs_parse == NULL) &&
346-
((p->cs_flags & RADEON_CS_USE_VM) == 0)) {
347-
DRM_ERROR("Ring %d requires VM!\n", p->ring);
348-
return -EINVAL;
345+
if ((p->cs_flags & RADEON_CS_USE_VM) == 0) {
346+
if (p->rdev->asic->ring[p->ring]->cs_parse == NULL) {
347+
DRM_ERROR("Ring %d requires VM!\n", p->ring);
348+
return -EINVAL;
349+
}
350+
} else {
351+
if (p->rdev->asic->ring[p->ring]->ib_parse == NULL) {
352+
DRM_ERROR("VM not supported on ring %d!\n",
353+
p->ring);
354+
return -EINVAL;
355+
}
349356
}
350357
}
351358

0 commit comments

Comments
 (0)