[PATCH] drm/radeon: avoid crash if VM command submission isn't available
Alex Deucher
alexdeucher at gmail.com
Thu May 22 06:14:29 PDT 2014
On Thu, May 22, 2014 at 7:58 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> CC: stable at vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/radeon/radeon_cs.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
> index 2b6e0eb..4b6f5b8 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;
> + }
> }
> }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list