Re: [PATCH 08/14] drm/exynos: create a fake mmap offset with gem creation

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

 



On 2015년 07월 28일 17:53, Joonyoung Shim wrote:
> Don't create a fake mmap offset in exynos_drm_gem_dumb_map_offset. If
> not, it will call drm_gem_create_mmap_offset whenever user requests
> DRM_IOCTL_MODE_MAP_DUMB ioctl.

This patch makes drm_gem_create_mmap_offset to be called even in case of
not using dumb* interfaces. I.e.,
exynos_drm_gem_create_ioctl -> exynos_drm_gem_mmap

And drm_gem_create_mmap_offset checks if vma_node was already allocated
or not so this patch doesn't make sense.

Thanks,
Inki Dae

> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index 550d267..c76aa8a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -151,6 +151,13 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
>  		return ERR_PTR(ret);
>  	}
>  
> +	ret = drm_gem_create_mmap_offset(obj);
> +	if (ret < 0) {
> +		drm_gem_object_release(obj);
> +		kfree(exynos_gem_obj);
> +		return ERR_PTR(ret);
> +	}
> +
>  	DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp);
>  
>  	return exynos_gem_obj;
> @@ -521,14 +528,9 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
>  		goto unlock;
>  	}
>  
> -	ret = drm_gem_create_mmap_offset(obj);
> -	if (ret)
> -		goto out;
> -
>  	*offset = drm_vma_node_offset_addr(&obj->vma_node);
>  	DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
>  
> -out:
>  	drm_gem_object_unreference(obj);
>  unlock:
>  	mutex_unlock(&dev->struct_mutex);
> 

_______________________________________________
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