Re: [PATCH 3/3] drm/exynos: implement kmap/kunmap/kmap_atomic/kunmap_atomic functions of dma_buf_ops

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

 



2012/7/10, Cooper Yuan <cooperyuan@xxxxxxxxx>:
> Implement kmap/kmap_atomic, kunmap/kunmap_atomic functions of dma_buf_ops.
>
> Signed-off-by: Cooper Yuan <cooperyuan@xxxxxxxxx>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |   17 +++++++++++------
>  1 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> index 913a23e..805b344 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
> @@ -138,30 +138,35 @@ static void exynos_dmabuf_release(struct dma_buf
> *dmabuf)
>  static void *exynos_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf,
>  						unsigned long page_num)
>  {
> -	/* TODO */
> +	struct exynos_drm_gem_obj *exynos_gem_obj = dma_buf->priv;
> +	struct exynos_drm_gem_buf *buf = exynos_gem_obj->buffer;
>
> -	return NULL;

kmap is used for cpu access so you should consider cache operation (dev to cpu).

> +	return kmap_atomic(buf->pages[page_num]);
>  }
>
>  static void exynos_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf,
>  						unsigned long page_num,
>  						void *addr)
>  {
> -	/* TODO */
> +	kunmap_atomic(addr);
>  }
>
>  static void *exynos_gem_dmabuf_kmap(struct dma_buf *dma_buf,
>  					unsigned long page_num)
>  {
> -	/* TODO */
> +	struct exynos_drm_gem_obj *exynos_gem_obj = dma_buf->priv;
> +	struct exynos_drm_gem_buf *buf = exynos_gem_obj->buffer;
>
> -	return NULL;

ditto.

> +	return kmap(buf->pages[page_num]);
>  }
>
>  static void exynos_gem_dmabuf_kunmap(struct dma_buf *dma_buf,
>  					unsigned long page_num, void *addr)
>  {
> -	/* TODO */
> +	struct exynos_drm_gem_obj *exynos_gem_obj = dma_buf->priv;
> +	struct exynos_drm_gem_buf *buf = exynos_gem_obj->buffer;
> +
> +	kunmap(buf->pages[page_num]);
>  }
>
>  static int exynos_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct
> vm_area_struct *vma)
> --
> 1.7.0.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