Re: [PATCH 06/16] drm/mgag200: Fix logic in mgag200_bo_pin()

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

 



On Wed, Jul 17, 2013 at 11:07 PM, Egbert Eich <eich@xxxxxxxx> wrote:
> Signed-off-by: Egbert Eich <eich@xxxxxxx>

Is this just missing a return 0; ? in the bo->pin_count > 0 case?
seems like a simpler patch.

Dave.

> ---
>  drivers/gpu/drm/mgag200/mgag200_ttm.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> index 6461fd2..2606031 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> @@ -350,20 +350,16 @@ int mgag200_bo_pin(struct mgag200_bo *bo, u32 pl_flag, u64 *gpu_addr)
>  {
>         int i, ret;
>
> -       if (bo->pin_count) {
> -               bo->pin_count++;
> -               if (gpu_addr)
> -                       *gpu_addr = mgag200_bo_gpu_offset(bo);
> -       }
> -
> -       mgag200_ttm_placement(bo, pl_flag);
> -       for (i = 0; i < bo->placement.num_placement; i++)
> -               bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
> -       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
> -       if (ret)
> -               return ret;
>
> -       bo->pin_count = 1;
> +       if (!bo->pin_count) {
> +               mgag200_ttm_placement(bo, pl_flag);
> +               for (i = 0; i < bo->placement.num_placement; i++)
> +                       bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
> +               ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
> +               if (ret)
> +                       return ret;
> +       }
> +       bo->pin_count++;
>         if (gpu_addr)
>                 *gpu_addr = mgag200_bo_gpu_offset(bo);
>         return 0;
> --
> 1.8.1.4
>
> _______________________________________________
> 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