Commit 6aa5e85d authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Inki Dae

drm/exynos: use directly DMA mapping APIs on g2d

There is no reason to be wapper functions to use DMA mapping APIs. Use
directly DMA mapping APIs and remove the wapper functions.
Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent b85881dd
...@@ -383,8 +383,8 @@ static void g2d_userptr_put_dma_addr(struct drm_device *drm_dev, ...@@ -383,8 +383,8 @@ static void g2d_userptr_put_dma_addr(struct drm_device *drm_dev,
return; return;
out: out:
exynos_gem_unmap_sgt_from_dma(drm_dev, g2d_userptr->sgt, dma_unmap_sg(to_dma_dev(drm_dev), g2d_userptr->sgt->sgl,
DMA_BIDIRECTIONAL); g2d_userptr->sgt->nents, DMA_BIDIRECTIONAL);
pages = frame_vector_pages(g2d_userptr->vec); pages = frame_vector_pages(g2d_userptr->vec);
if (!IS_ERR(pages)) { if (!IS_ERR(pages)) {
...@@ -501,10 +501,10 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, ...@@ -501,10 +501,10 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
g2d_userptr->sgt = sgt; g2d_userptr->sgt = sgt;
ret = exynos_gem_map_sgt_with_dma(drm_dev, g2d_userptr->sgt, if (!dma_map_sg(to_dma_dev(drm_dev), sgt->sgl, sgt->nents,
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL)) {
if (ret < 0) {
DRM_ERROR("failed to map sgt with dma region.\n"); DRM_ERROR("failed to map sgt with dma region.\n");
ret = -ENOMEM;
goto err_sg_free_table; goto err_sg_free_table;
} }
......
...@@ -378,28 +378,6 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, ...@@ -378,28 +378,6 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
return 0; return 0;
} }
int exynos_gem_map_sgt_with_dma(struct drm_device *drm_dev,
struct sg_table *sgt,
enum dma_data_direction dir)
{
int nents;
nents = dma_map_sg(to_dma_dev(drm_dev), sgt->sgl, sgt->nents, dir);
if (!nents) {
DRM_ERROR("failed to map sgl with dma.\n");
return nents;
}
return 0;
}
void exynos_gem_unmap_sgt_from_dma(struct drm_device *drm_dev,
struct sg_table *sgt,
enum dma_data_direction dir)
{
dma_unmap_sg(to_dma_dev(drm_dev), sgt->sgl, sgt->nents, dir);
}
void exynos_drm_gem_free_object(struct drm_gem_object *obj) void exynos_drm_gem_free_object(struct drm_gem_object *obj)
{ {
exynos_drm_gem_destroy(to_exynos_gem(obj)); exynos_drm_gem_destroy(to_exynos_gem(obj));
......
...@@ -121,16 +121,6 @@ int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); ...@@ -121,16 +121,6 @@ int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
/* set vm_flags and we can change the vm attribute to other one at here. */ /* set vm_flags and we can change the vm attribute to other one at here. */
int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
/* map sgt with dma region. */
int exynos_gem_map_sgt_with_dma(struct drm_device *drm_dev,
struct sg_table *sgt,
enum dma_data_direction dir);
/* unmap sgt from dma region. */
void exynos_gem_unmap_sgt_from_dma(struct drm_device *drm_dev,
struct sg_table *sgt,
enum dma_data_direction dir);
/* low-level interface prime helpers */ /* low-level interface prime helpers */
struct sg_table *exynos_drm_gem_prime_get_sg_table(struct drm_gem_object *obj); struct sg_table *exynos_drm_gem_prime_get_sg_table(struct drm_gem_object *obj);
struct drm_gem_object * struct drm_gem_object *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment