Re: [PATCH] drm/radeon: avoid crash if VM command submission isn't available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 22, 2014 at 7:58 AM, Christian König
<deathsimple@xxxxxxxxxxx> wrote:
> From: Christian König <christian.koenig@xxxxxxx>
>
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>
> CC: stable@xxxxxxxxxxxxxxx

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  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@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux