drm: omapdrm: Rename GEM DMA sync functions
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 20 Apr 2017 21:33:55 +0000 (00:33 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 2 Jun 2017 07:57:06 +0000 (10:57 +0300)
The omap_gem_cpu_sync() function operates at a page level, while the
omap_gem_dma_sync() function operates at a buffer level. Rename them to
omap_gem_cpu_sync_page() and omap_gem_dma_sync_buffer() respectively to
avoid confusion.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/omap_drv.h
drivers/gpu/drm/omapdrm/omap_fb.c
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c

index f2db84767bf8b1ab0c78d50cff1e82e2b1d438e0..621f5aa0142fbbf66516e1698fb1b792fbfaf69c 100644 (file)
@@ -185,8 +185,8 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj,
                struct vm_area_struct *vma);
 int omap_gem_fault(struct vm_fault *vmf);
 int omap_gem_roll(struct drm_gem_object *obj, uint32_t roll);
-void omap_gem_cpu_sync(struct drm_gem_object *obj, int pgoff);
-void omap_gem_dma_sync(struct drm_gem_object *obj,
+void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff);
+void omap_gem_dma_sync_buffer(struct drm_gem_object *obj,
                enum dma_data_direction dir);
 int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr);
 void omap_gem_unpin(struct drm_gem_object *obj);
index 2e8d77166e1f8861d20432bdef68630d33144fb2..ee615fa048a5f367cc2c0604c957d933df756030 100644 (file)
@@ -262,7 +262,7 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb)
                ret = omap_gem_pin(plane->bo, &plane->dma_addr);
                if (ret)
                        goto fail;
-               omap_gem_dma_sync(plane->bo, DMA_TO_DEVICE);
+               omap_gem_dma_sync_buffer(plane->bo, DMA_TO_DEVICE);
        }
 
        omap_fb->pin_count++;
index 6a5a4d07f675f123554b43796568ff798b85a954..86567e591f4ed88ee4687040abbe1b90b1976fee 100644 (file)
@@ -388,7 +388,7 @@ static int fault_1d(struct drm_gem_object *obj,
        pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
 
        if (omap_obj->pages) {
-               omap_gem_cpu_sync(obj, pgoff);
+               omap_gem_cpu_sync_page(obj, pgoff);
                pfn = page_to_pfn(omap_obj->pages[pgoff]);
        } else {
                BUG_ON(!is_contiguous(omap_obj));
@@ -734,7 +734,7 @@ static inline bool is_cached_coherent(struct drm_gem_object *obj)
 /* Sync the buffer for CPU access.. note pages should already be
  * attached, ie. omap_gem_get_pages()
  */
-void omap_gem_cpu_sync(struct drm_gem_object *obj, int pgoff)
+void omap_gem_cpu_sync_page(struct drm_gem_object *obj, int pgoff)
 {
        struct drm_device *dev = obj->dev;
        struct omap_gem_object *omap_obj = to_omap_bo(obj);
@@ -747,7 +747,7 @@ void omap_gem_cpu_sync(struct drm_gem_object *obj, int pgoff)
 }
 
 /* sync the buffer for DMA access */
-void omap_gem_dma_sync(struct drm_gem_object *obj,
+void omap_gem_dma_sync_buffer(struct drm_gem_object *obj,
                enum dma_data_direction dir)
 {
        struct drm_device *dev = obj->dev;
index 6aaf28311f3aa6eed5cd78c1b0eb52702e754a74..a2b91368c0b7278c5acb8af9162ec123dcb21dde 100644 (file)
@@ -55,7 +55,7 @@ static struct sg_table *omap_gem_map_dma_buf(
        sg_dma_address(sg->sgl) = dma_addr;
 
        /* this must be after omap_gem_pin() to ensure we have pages attached */
-       omap_gem_dma_sync(obj, dir);
+       omap_gem_dma_sync_buffer(obj, dir);
 
        return sg;
 out:
@@ -112,7 +112,7 @@ static void *omap_gem_dmabuf_kmap_atomic(struct dma_buf *buffer,
        struct drm_gem_object *obj = buffer->priv;
        struct page **pages;
        omap_gem_get_pages(obj, &pages, false);
-       omap_gem_cpu_sync(obj, page_num);
+       omap_gem_cpu_sync_page(obj, page_num);
        return kmap_atomic(pages[page_num]);
 }
 
@@ -128,7 +128,7 @@ static void *omap_gem_dmabuf_kmap(struct dma_buf *buffer,
        struct drm_gem_object *obj = buffer->priv;
        struct page **pages;
        omap_gem_get_pages(obj, &pages, false);
-       omap_gem_cpu_sync(obj, page_num);
+       omap_gem_cpu_sync_page(obj, page_num);
        return kmap(pages[page_num]);
 }