Re: [PATCH 01/14] drm/cirrus: split out bo unpinning from cirrus_bo_push_sysram

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

 



Varad Gautam <varadgautam@xxxxxxxxx> writes:


>  int cirrus_bo_push_sysram(struct cirrus_bo *bo)
>  {
>  	int i, ret;
> -	if (!bo->pin_count) {
> +
> +	ret = cirrus_bo_reserve(bo, false);
> +	if (ret)
> +		return ret;
> +
> +	if (bo->pin_count) {
>  		DRM_ERROR("unpin bad %p\n", bo);
> -		return 0;
> +		goto out;
>  	}
> -	bo->pin_count--;
> -	if (bo->pin_count)
> -		return 0;

Can you adjust this to also use your version of cirrus_bo_unpin()?

Also, If I'm not mistaken, this hunk unbalances pin_count, since you
no longer decrement it after unpinning.

>  
>  	if (bo->kmap.virtual)
>  		ttm_bo_kunmap(&bo->kmap);
> @@ -400,9 +432,12 @@ int cirrus_bo_push_sysram(struct cirrus_bo *bo)
>  	ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
>  	if (ret) {
>  		DRM_ERROR("pushing to VRAM failed\n");
> -		return ret;
> +		goto out;
>  	}
> -	return 0;
> +
> +out:
> +	cirrus_bo_unreserve(bo);
> +	return ret;
>  }
>  
>  int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)

-- 
Gabriel Krisman Bertazi
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://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