]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/fb: rename FB CMA helpers to FB DMA helpers
authorDanilo Krummrich <dakr@redhat.com>
Tue, 2 Aug 2022 00:04:02 +0000 (02:04 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Wed, 3 Aug 2022 16:30:55 +0000 (18:30 +0200)
Rename "FB CMA" helpers to "FB DMA" helpers - considering the hierarchy
of APIs (mm/cma -> dma -> fb dma) calling them "FB DMA" seems to be
more applicable.

Besides that, commit 234df3ea69dd ("drm/doc: Task to rename CMA helpers")
requests to rename the CMA helpers and implies that people seem to be
confused about the naming.

In order to do this renaming the following script was used:

```
#!/bin/bash

DIRS="drivers/gpu include/drm Documentation/gpu"

REGEX_SYM_UPPER="[0-9A-Z_\-]"
REGEX_SYM_LOWER="[0-9a-z_\-]"

REGEX_GREP_UPPER="(${REGEX_SYM_UPPER}*)(FB)_CMA_(${REGEX_SYM_UPPER}*)"
REGEX_GREP_LOWER="(${REGEX_SYM_LOWER}*)(fb)_cma_(${REGEX_SYM_LOWER}*)"

REGEX_SED_UPPER="s/${REGEX_GREP_UPPER}/\1\2_DMA_\3/g"
REGEX_SED_LOWER="s/${REGEX_GREP_LOWER}/\1\2_dma_\3/g"

# Find all upper case 'CMA' symbols and replace them with 'DMA'.
for ff in $(grep -REHl "${REGEX_GREP_UPPER}" $DIRS)
do
       sed -i -E "$REGEX_SED_UPPER" $ff
done

# Find all lower case 'cma' symbols and replace them with 'dma'.
for ff in $(grep -REHl "${REGEX_GREP_LOWER}" $DIRS)
do
       sed -i -E "$REGEX_SED_LOWER" $ff
done

# Replace all occurrences of 'CMA' / 'cma' in comments and
# documentation files with 'DMA' / 'dma'.
for ff in $(grep -RiHl " cma " $DIRS)
do
sed -i -E "s/ cma / dma /g" $ff
sed -i -E "s/ CMA / DMA /g" $ff
done
```

Only a few more manual modifications were needed, e.g. reverting the
following modifications in some DRM Kconfig files

    -       select CMA if HAVE_DMA_CONTIGUOUS
    +       select DMA if HAVE_DMA_CONTIGUOUS

as well as manually picking the occurrences of 'CMA'/'cma' in comments and
documentation which relate to "FB CMA", but not "GEM CMA".

This patch is compile-time tested building a x86_64 kernel with
`make allyesconfig && make drivers/gpu/drm`.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> #drivers/gpu/drm/arm
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-3-dakr@redhat.com
54 files changed:
Documentation/gpu/drm-kms-helpers.rst
drivers/gpu/drm/Makefile
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
drivers/gpu/drm/arm/hdlcd_crtc.c
drivers/gpu/drm/arm/malidp_mw.c
drivers/gpu/drm/arm/malidp_planes.c
drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
drivers/gpu/drm/drm_fb_cma_helper.c [deleted file]
drivers/gpu/drm/drm_fb_dma_helper.c [new file with mode: 0644]
drivers/gpu/drm/drm_format_helper.c
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
drivers/gpu/drm/imx/dcss/dcss-plane.c
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
drivers/gpu/drm/ingenic/ingenic-ipu.c
drivers/gpu/drm/kmb/kmb_plane.c
drivers/gpu/drm/logicvc/Kconfig
drivers/gpu/drm/logicvc/logicvc_layer.c
drivers/gpu/drm/mcde/mcde_display.c
drivers/gpu/drm/mcde/mcde_drv.c
drivers/gpu/drm/meson/meson_overlay.c
drivers/gpu/drm/meson/meson_plane.c
drivers/gpu/drm/mxsfb/lcdif_kms.c
drivers/gpu/drm/mxsfb/mxsfb_kms.c
drivers/gpu/drm/pl111/pl111_display.c
drivers/gpu/drm/rcar-du/rcar_du_plane.c
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
drivers/gpu/drm/shmobile/shmob_drm_crtc.c
drivers/gpu/drm/shmobile/shmob_drm_plane.c
drivers/gpu/drm/sprd/sprd_dpu.c
drivers/gpu/drm/sti/sti_cursor.c
drivers/gpu/drm/sti/sti_gdp.c
drivers/gpu/drm/sti/sti_hqvdp.c
drivers/gpu/drm/stm/ltdc.c
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_frontend.c
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/tidss/tidss_dispc.c
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
drivers/gpu/drm/tiny/arcpgu.c
drivers/gpu/drm/tiny/ili9225.c
drivers/gpu/drm/tiny/repaper.c
drivers/gpu/drm/tiny/st7586.c
drivers/gpu/drm/tve200/tve200_display.c
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_plane.c
drivers/gpu/drm/vc4/vc4_txp.c
drivers/gpu/drm/xlnx/zynqmp_disp.c
include/drm/drm_fb_cma_helper.h [deleted file]
include/drm/drm_fb_dma_helper.h [new file with mode: 0644]

index 2d473bc64c9f399d21af16a63c583857850b5317..dbc85fd7a9718b9b506473db0ffa8ef9233c9be8 100644 (file)
@@ -122,13 +122,13 @@ format Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/drm_format_helper.c
    :export:
 
-Framebuffer CMA Helper Functions Reference
+Framebuffer DMA Helper Functions Reference
 ==========================================
 
-.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
-   :doc: framebuffer cma helper functions
+.. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
+   :doc: framebuffer dma helper functions
 
-.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
+.. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c
    :export:
 
 Framebuffer GEM Helper Reference
index 25016dcab55efd90bcc1aae3f104dab7501f0cbd..1d6e4f672b59c97b32dd8792a92b268cbb1a3cee 100644 (file)
@@ -41,7 +41,7 @@ obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) += drm_panel_orientation_quirks.o
 obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o
 
 drm_cma_helper-y := drm_gem_cma_helper.o
-drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o
+drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_dma_helper.o
 obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o
 
 drm_shmem_helper-y := drm_gem_shmem_helper.o
index 3c372d2deb0a697bbb4a20287ba3a48c4e74f29d..ea45da663dfb71350d2d1f9410f70b888f64cd8e 100644 (file)
@@ -5,7 +5,7 @@
  *
  */
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
@@ -247,7 +247,7 @@ komeda_fb_get_pixel_addr(struct komeda_fb *kfb, int x, int y, int plane)
                return -EINVAL;
        }
 
-       obj = drm_fb_cma_get_gem_obj(fb, plane);
+       obj = drm_fb_dma_get_gem_obj(fb, plane);
 
        offset = fb->offsets[plane];
        if (!fb->modifier) {
index 636ef9447830247caa6b09e29e91cae64c927726..d3cf788c0fa9c35614dbab5b091eee076fec9476 100644 (file)
@@ -18,7 +18,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -273,7 +273,7 @@ static void hdlcd_plane_atomic_update(struct drm_plane *plane,
                return;
 
        dest_h = drm_rect_height(&new_plane_state->dst);
-       scanout_start = drm_fb_cma_get_gem_addr(fb, new_plane_state, 0);
+       scanout_start = drm_fb_dma_get_gem_addr(fb, new_plane_state, 0);
 
        hdlcd = plane->dev->dev_private;
        hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
index b66ca5b33a7f4837e5e5b19a49cc2325318dab0f..7a9c900626ecd6c51c62c00e27a4ff90fb3dfc1b 100644 (file)
@@ -10,7 +10,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -160,7 +160,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder,
 
        n_planes = fb->format->num_planes;
        for (i = 0; i < n_planes; i++) {
-               struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, i);
+               struct drm_gem_cma_object *obj = drm_fb_dma_get_gem_obj(fb, i);
                /* memory write buffers are never rotated */
                u8 alignment = malidp_hw_get_pitch_align(malidp->dev, 0);
 
index a1cee1a5b5234c821fc93e11123970c9c65a003b..72e0162735fa2544b4db9d85d7dd8f8b00a637fb 100644 (file)
@@ -13,7 +13,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -722,19 +722,19 @@ static void malidp_set_plane_base_addr(struct drm_framebuffer *fb,
        ptr = mp->layer->ptr + (plane_index << 4);
 
        /*
-        * drm_fb_cma_get_gem_addr() alters the physical base address of the
+        * drm_fb_dma_get_gem_addr() alters the physical base address of the
         * framebuffer as per the plane's src_x, src_y co-ordinates (ie to
         * take care of source cropping).
         * For AFBC, this is not needed as the cropping is handled by _AD_CROP_H
         * and _AD_CROP_V registers.
         */
        if (!afbc) {
-               paddr = drm_fb_cma_get_gem_addr(fb, plane->state,
+               paddr = drm_fb_dma_get_gem_addr(fb, plane->state,
                                                plane_index);
        } else {
                struct drm_gem_cma_object *obj;
 
-               obj = drm_fb_cma_get_gem_obj(fb, plane_index);
+               obj = drm_fb_dma_get_gem_obj(fb, plane_index);
 
                if (WARN_ON(!obj))
                        return;
index f3788d7d82d6b30bec915f4c69d2d4b6d2b2ca2b..cc4d0fa6262ce17c94b016b863ddd2b7b4943bd4 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -185,7 +185,7 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
        if (!fb)
                return;
 
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
        if (!gem)
                return;
        writel(gem->paddr, priv->base + CRT_ADDR);
index 10f31faf140c62cb4affff6d3d1fbb4f3017cfd7..ddcbfe7ea0c88f2af51a70c2e002981f74b962a2 100644 (file)
@@ -12,7 +12,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -448,7 +448,7 @@ static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
        sr = atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_CHSR);
 
        for (i = 0; i < state->nplanes; i++) {
-               struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, i);
+               struct drm_gem_cma_object *gem = drm_fb_dma_get_gem_obj(fb, i);
 
                state->dscrs[i]->addr = gem->paddr + state->offsets[i];
 
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
deleted file mode 100644 (file)
index 69c5727..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * drm kms/fb cma (contiguous memory allocator) helper functions
- *
- * Copyright (C) 2012 Analog Devices Inc.
- *   Author: Lars-Peter Clausen <lars@metafoo.de>
- *
- * Based on udl_fbdev.c
- *  Copyright (C) 2012 Red Hat
- */
-
-#include <drm/drm_damage_helper.h>
-#include <drm/drm_fb_cma_helper.h>
-#include <drm/drm_fourcc.h>
-#include <drm/drm_framebuffer.h>
-#include <drm/drm_gem_cma_helper.h>
-#include <drm/drm_gem_framebuffer_helper.h>
-#include <drm/drm_plane.h>
-#include <linux/dma-mapping.h>
-#include <linux/module.h>
-
-/**
- * DOC: framebuffer cma helper functions
- *
- * Provides helper functions for creating a cma (contiguous memory allocator)
- * backed framebuffer.
- *
- * drm_gem_fb_create() is used in the &drm_mode_config_funcs.fb_create
- * callback function to create a cma backed framebuffer.
- */
-
-/**
- * drm_fb_cma_get_gem_obj() - Get CMA GEM object for framebuffer
- * @fb: The framebuffer
- * @plane: Which plane
- *
- * Return the CMA GEM object for given framebuffer.
- *
- * This function will usually be called from the CRTC callback functions.
- */
-struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
-                                                 unsigned int plane)
-{
-       struct drm_gem_object *gem;
-
-       gem = drm_gem_fb_get_obj(fb, plane);
-       if (!gem)
-               return NULL;
-
-       return to_drm_gem_cma_obj(gem);
-}
-EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj);
-
-/**
- * drm_fb_cma_get_gem_addr() - Get physical address for framebuffer, for pixel
- * formats where values are grouped in blocks this will get you the beginning of
- * the block
- * @fb: The framebuffer
- * @state: Which state of drm plane
- * @plane: Which plane
- * Return the CMA GEM address for given framebuffer.
- *
- * This function will usually be called from the PLANE callback functions.
- */
-dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
-                                  struct drm_plane_state *state,
-                                  unsigned int plane)
-{
-       struct drm_gem_cma_object *obj;
-       dma_addr_t paddr;
-       u8 h_div = 1, v_div = 1;
-       u32 block_w = drm_format_info_block_width(fb->format, plane);
-       u32 block_h = drm_format_info_block_height(fb->format, plane);
-       u32 block_size = fb->format->char_per_block[plane];
-       u32 sample_x;
-       u32 sample_y;
-       u32 block_start_y;
-       u32 num_hblocks;
-
-       obj = drm_fb_cma_get_gem_obj(fb, plane);
-       if (!obj)
-               return 0;
-
-       paddr = obj->paddr + fb->offsets[plane];
-
-       if (plane > 0) {
-               h_div = fb->format->hsub;
-               v_div = fb->format->vsub;
-       }
-
-       sample_x = (state->src_x >> 16) / h_div;
-       sample_y = (state->src_y >> 16) / v_div;
-       block_start_y = (sample_y / block_h) * block_h;
-       num_hblocks = sample_x / block_w;
-
-       paddr += fb->pitches[plane] * block_start_y;
-       paddr += block_size * num_hblocks;
-
-       return paddr;
-}
-EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_addr);
-
-/**
- * drm_fb_cma_sync_non_coherent - Sync GEM object to non-coherent backing
- *     memory
- * @drm: DRM device
- * @old_state: Old plane state
- * @state: New plane state
- *
- * This function can be used by drivers that use damage clips and have
- * CMA GEM objects backed by non-coherent memory. Calling this function
- * in a plane's .atomic_update ensures that all the data in the backing
- * memory have been written to RAM.
- */
-void drm_fb_cma_sync_non_coherent(struct drm_device *drm,
-                                 struct drm_plane_state *old_state,
-                                 struct drm_plane_state *state)
-{
-       const struct drm_format_info *finfo = state->fb->format;
-       struct drm_atomic_helper_damage_iter iter;
-       const struct drm_gem_cma_object *cma_obj;
-       unsigned int offset, i;
-       struct drm_rect clip;
-       dma_addr_t daddr;
-       size_t nb_bytes;
-
-       for (i = 0; i < finfo->num_planes; i++) {
-               cma_obj = drm_fb_cma_get_gem_obj(state->fb, i);
-               if (!cma_obj->map_noncoherent)
-                       continue;
-
-               daddr = drm_fb_cma_get_gem_addr(state->fb, state, i);
-               drm_atomic_helper_damage_iter_init(&iter, old_state, state);
-
-               drm_atomic_for_each_plane_damage(&iter, &clip) {
-                       /* Ignore x1/x2 values, invalidate complete lines */
-                       offset = clip.y1 * state->fb->pitches[i];
-
-                       nb_bytes = (clip.y2 - clip.y1) * state->fb->pitches[i];
-                       dma_sync_single_for_device(drm->dev, daddr + offset,
-                                                  nb_bytes, DMA_TO_DEVICE);
-               }
-       }
-}
-EXPORT_SYMBOL_GPL(drm_fb_cma_sync_non_coherent);
diff --git a/drivers/gpu/drm/drm_fb_dma_helper.c b/drivers/gpu/drm/drm_fb_dma_helper.c
new file mode 100644 (file)
index 0000000..85fd21c
--- /dev/null
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * drm kms/fb dma helper functions
+ *
+ * Copyright (C) 2012 Analog Devices Inc.
+ *   Author: Lars-Peter Clausen <lars@metafoo.de>
+ *
+ * Based on udl_fbdev.c
+ *  Copyright (C) 2012 Red Hat
+ */
+
+#include <drm/drm_damage_helper.h>
+#include <drm/drm_fb_dma_helper.h>
+#include <drm/drm_fourcc.h>
+#include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_plane.h>
+#include <linux/dma-mapping.h>
+#include <linux/module.h>
+
+/**
+ * DOC: framebuffer dma helper functions
+ *
+ * Provides helper functions for creating a DMA-contiguous framebuffer.
+ *
+ * Depending on the platform, the buffers may be physically non-contiguous and
+ * mapped through an IOMMU or a similar mechanism, or allocated from
+ * physically-contiguous memory (using, for instance, CMA or a pool of memory
+ * reserved at early boot). This is handled behind the scenes by the DMA mapping
+ * API.
+ *
+ * drm_gem_fb_create() is used in the &drm_mode_config_funcs.fb_create
+ * callback function to create a DMA-contiguous framebuffer.
+ */
+
+/**
+ * drm_fb_dma_get_gem_obj() - Get CMA GEM object for framebuffer
+ * @fb: The framebuffer
+ * @plane: Which plane
+ *
+ * Return the CMA GEM object for given framebuffer.
+ *
+ * This function will usually be called from the CRTC callback functions.
+ */
+struct drm_gem_cma_object *drm_fb_dma_get_gem_obj(struct drm_framebuffer *fb,
+                                                 unsigned int plane)
+{
+       struct drm_gem_object *gem;
+
+       gem = drm_gem_fb_get_obj(fb, plane);
+       if (!gem)
+               return NULL;
+
+       return to_drm_gem_cma_obj(gem);
+}
+EXPORT_SYMBOL_GPL(drm_fb_dma_get_gem_obj);
+
+/**
+ * drm_fb_dma_get_gem_addr() - Get DMA (bus) address for framebuffer, for pixel
+ * formats where values are grouped in blocks this will get you the beginning of
+ * the block
+ * @fb: The framebuffer
+ * @state: Which state of drm plane
+ * @plane: Which plane
+ * Return the DMA GEM address for given framebuffer.
+ *
+ * This function will usually be called from the PLANE callback functions.
+ */
+dma_addr_t drm_fb_dma_get_gem_addr(struct drm_framebuffer *fb,
+                                  struct drm_plane_state *state,
+                                  unsigned int plane)
+{
+       struct drm_gem_cma_object *obj;
+       dma_addr_t paddr;
+       u8 h_div = 1, v_div = 1;
+       u32 block_w = drm_format_info_block_width(fb->format, plane);
+       u32 block_h = drm_format_info_block_height(fb->format, plane);
+       u32 block_size = fb->format->char_per_block[plane];
+       u32 sample_x;
+       u32 sample_y;
+       u32 block_start_y;
+       u32 num_hblocks;
+
+       obj = drm_fb_dma_get_gem_obj(fb, plane);
+       if (!obj)
+               return 0;
+
+       paddr = obj->paddr + fb->offsets[plane];
+
+       if (plane > 0) {
+               h_div = fb->format->hsub;
+               v_div = fb->format->vsub;
+       }
+
+       sample_x = (state->src_x >> 16) / h_div;
+       sample_y = (state->src_y >> 16) / v_div;
+       block_start_y = (sample_y / block_h) * block_h;
+       num_hblocks = sample_x / block_w;
+
+       paddr += fb->pitches[plane] * block_start_y;
+       paddr += block_size * num_hblocks;
+
+       return paddr;
+}
+EXPORT_SYMBOL_GPL(drm_fb_dma_get_gem_addr);
+
+/**
+ * drm_fb_dma_sync_non_coherent - Sync GEM object to non-coherent backing
+ *     memory
+ * @drm: DRM device
+ * @old_state: Old plane state
+ * @state: New plane state
+ *
+ * This function can be used by drivers that use damage clips and have
+ * CMA GEM objects backed by non-coherent memory. Calling this function
+ * in a plane's .atomic_update ensures that all the data in the backing
+ * memory have been written to RAM.
+ */
+void drm_fb_dma_sync_non_coherent(struct drm_device *drm,
+                                 struct drm_plane_state *old_state,
+                                 struct drm_plane_state *state)
+{
+       const struct drm_format_info *finfo = state->fb->format;
+       struct drm_atomic_helper_damage_iter iter;
+       const struct drm_gem_cma_object *cma_obj;
+       unsigned int offset, i;
+       struct drm_rect clip;
+       dma_addr_t daddr;
+       size_t nb_bytes;
+
+       for (i = 0; i < finfo->num_planes; i++) {
+               cma_obj = drm_fb_dma_get_gem_obj(state->fb, i);
+               if (!cma_obj->map_noncoherent)
+                       continue;
+
+               daddr = drm_fb_dma_get_gem_addr(state->fb, state, i);
+               drm_atomic_helper_damage_iter_init(&iter, old_state, state);
+
+               drm_atomic_for_each_plane_damage(&iter, &clip) {
+                       /* Ignore x1/x2 values, invalidate complete lines */
+                       offset = clip.y1 * state->fb->pitches[i];
+
+                       nb_bytes = (clip.y2 - clip.y1) * state->fb->pitches[i];
+                       dma_sync_single_for_device(drm->dev, daddr + offset,
+                                                  nb_bytes, DMA_TO_DEVICE);
+               }
+       }
+}
+EXPORT_SYMBOL_GPL(drm_fb_dma_sync_non_coherent);
index c6182b5de78b0bd88d1d752b871c9d8fedc7e2dd..400b16d9147dadec75bc5a74aba59ba64ec0d796 100644 (file)
@@ -54,7 +54,7 @@ static int drm_fb_xfrm(void *dst, unsigned long dst_pitch, unsigned long dst_pix
        const void *sbuf;
 
        /*
-        * Some source buffers, such as CMA memory, use write-combine
+        * Some source buffers, such as DMA memory, use write-combine
         * caching, so reads are uncached. Speed up access by fetching
         * one line at a time.
         */
@@ -676,7 +676,7 @@ void drm_fb_xrgb8888_to_mono(void *dst, unsigned int dst_pitch, const void *vadd
                dst_pitch = DIV_ROUND_UP(linepixels, 8);
 
        /*
-        * The cma memory is write-combined so reads are uncached.
+        * The dma memory is write-combined so reads are uncached.
         * Speed up by fetching one line at a time.
         *
         * Also, format conversion from XR24 to monochrome are done
index 3b20e79158c86a15643fda1e632032edfe0ddba3..aba2b714e8a6d31586df34e503e7091886272c6a 100644 (file)
@@ -10,7 +10,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -95,7 +95,7 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
        if (index < 0)
                return;
 
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
 
        switch (fb->format->format) {
        case DRM_FORMAT_RGB565:
index 2c7059b775a15be8caa5cbec35ae802e10007bec..c5d304826c3b6bf9f806755704a65f4f00a8a896 100644 (file)
@@ -24,7 +24,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -548,7 +548,7 @@ static const struct drm_crtc_funcs ade_crtc_funcs = {
 static void ade_rdma_set(void __iomem *base, struct drm_framebuffer *fb,
                         u32 ch, u32 y, u32 in_h, u32 fmt)
 {
-       struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *obj = drm_fb_dma_get_gem_obj(fb, 0);
        u32 reg_ctrl, reg_addr, reg_size, reg_stride, reg_space, reg_en;
        u32 stride = fb->pitches[0];
        u32 addr = (u32)obj->paddr + y * stride;
index c29f343f33e5d13a43f1e8f8c444fb7d714bd55e..a333c13c9ebc8b1b0639c4d3da03ee968d0e8883 100644 (file)
@@ -6,7 +6,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -156,7 +156,7 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
        if (!fb || !new_plane_state->crtc)
                return 0;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
        WARN_ON(!cma_obj);
 
        crtc_state = drm_atomic_get_existing_crtc_state(state,
@@ -218,7 +218,7 @@ static void dcss_plane_atomic_set_base(struct dcss_plane *dcss_plane)
        struct dcss_dev *dcss = plane->dev->dev_private;
        struct drm_framebuffer *fb = state->fb;
        const struct drm_format_info *format = fb->format;
-       struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
        unsigned long p1_ba = 0, p2_ba = 0;
 
        if (!format->is_yuv ||
index f1b397693af8d6f88fac3f59b69c9833122649eb..27bd164180028d4ed82b4d7b9203bf84eb20ffdf 100644 (file)
@@ -8,7 +8,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -129,7 +129,7 @@ drm_plane_state_to_eba(struct drm_plane_state *state, int plane)
        int x = state->src.x1 >> 16;
        int y = state->src.y1 >> 16;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, plane);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, plane);
        BUG_ON(!cma_obj);
 
        return cma_obj->paddr + fb->offsets[plane] + fb->pitches[plane] * y +
@@ -145,7 +145,7 @@ drm_plane_state_to_ubo(struct drm_plane_state *state)
        int x = state->src.x1 >> 16;
        int y = state->src.y1 >> 16;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 1);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 1);
        BUG_ON(!cma_obj);
 
        x /= fb->format->hsub;
@@ -164,7 +164,7 @@ drm_plane_state_to_vbo(struct drm_plane_state *state)
        int x = state->src.x1 >> 16;
        int y = state->src.y1 >> 16;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 2);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 2);
        BUG_ON(!cma_obj);
 
        x /= fb->format->hsub;
index f5835e6bf8770981948b9de1f975c9d31385a40e..1dd78145b4b938010557630ec9b8057a38fcc5e4 100644 (file)
@@ -31,7 +31,7 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_gem_cma_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -669,12 +669,12 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 
        if (newstate && newstate->fb) {
                if (priv->soc_info->map_noncoherent)
-                       drm_fb_cma_sync_non_coherent(&priv->drm, oldstate, newstate);
+                       drm_fb_dma_sync_non_coherent(&priv->drm, oldstate, newstate);
 
                crtc_state = newstate->crtc->state;
                plane_id = !!(priv->soc_info->has_osd && plane != &priv->f0);
 
-               addr = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0);
+               addr = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 0);
                width = newstate->src_w >> 16;
                height = newstate->src_h >> 16;
                cpp = newstate->fb->format->cpp[0];
index c117073fd61e1a66e7c08ac90d5d0bd8e2273e86..21052600cef4c9188d7b6cd44bcab4c015b67c4e 100644 (file)
@@ -22,7 +22,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -362,15 +362,15 @@ static void ingenic_ipu_plane_atomic_update(struct drm_plane *plane,
        }
 
        if (ingenic_drm_map_noncoherent(ipu->master))
-               drm_fb_cma_sync_non_coherent(ipu->drm, oldstate, newstate);
+               drm_fb_dma_sync_non_coherent(ipu->drm, oldstate, newstate);
 
        /* New addresses will be committed in vblank handler... */
-       ipu->addr_y = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0);
+       ipu->addr_y = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 0);
        if (finfo->num_planes > 1)
-               ipu->addr_u = drm_fb_cma_get_gem_addr(newstate->fb, newstate,
+               ipu->addr_u = drm_fb_dma_get_gem_addr(newstate->fb, newstate,
                                                      1);
        if (finfo->num_planes > 2)
-               ipu->addr_v = drm_fb_cma_get_gem_addr(newstate->fb, newstate,
+               ipu->addr_v = drm_fb_dma_get_gem_addr(newstate->fb, newstate,
                                                      2);
 
        if (!needs_modeset)
index e385b8741776cfc90f7f24e2b30ac7309e972e8a..ca3246e48e45b83762bc0c68ce8b3cdaa0e1d63d 100644 (file)
@@ -8,7 +8,7 @@
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -403,7 +403,7 @@ static void kmb_plane_atomic_update(struct drm_plane *plane,
        kmb_write_lcd(kmb, LCD_LAYERn_DMA_LINE_WIDTH(plane_id),
                      (width * fb->format->cpp[0]));
 
-       addr[Y_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state, 0);
+       addr[Y_PLANE] = drm_fb_dma_get_gem_addr(fb, new_plane_state, 0);
        kmb_write_lcd(kmb, LCD_LAYERn_DMA_START_ADDR(plane_id),
                      addr[Y_PLANE] + fb->offsets[0]);
        val = get_pixel_format(fb->format->format);
@@ -415,7 +415,7 @@ static void kmb_plane_atomic_update(struct drm_plane *plane,
                kmb_write_lcd(kmb, LCD_LAYERn_DMA_CB_LINE_WIDTH(plane_id),
                              (width * fb->format->cpp[0]));
 
-               addr[U_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state,
+               addr[U_PLANE] = drm_fb_dma_get_gem_addr(fb, new_plane_state,
                                                        U_PLANE);
                /* check if Cb/Cr is swapped*/
                if (num_planes == 3 && (val & LCD_LAYER_CRCB_ORDER))
@@ -436,7 +436,7 @@ static void kmb_plane_atomic_update(struct drm_plane *plane,
                                      LCD_LAYERn_DMA_CR_LINE_WIDTH(plane_id),
                                      ((width) * fb->format->cpp[0]));
 
-                       addr[V_PLANE] = drm_fb_cma_get_gem_addr(fb,
+                       addr[V_PLANE] = drm_fb_dma_get_gem_addr(fb,
                                                                new_plane_state,
                                                                V_PLANE);
 
index 300b2be07385bb9b39ceaf9b58b4a2b84ad23fb0..73be27cc749c63ed22730f10129bc11787170608 100644 (file)
@@ -3,7 +3,7 @@ config DRM_LOGICVC
        depends on DRM
        depends on OF || COMPILE_TEST
        select DRM_KMS_HELPER
-       select DRM_KMS_CMA_HELPER
+       select DRM_KMS_DMA_HELPER
        select DRM_GEM_CMA_HELPER
        help
          DRM display driver for the logiCVC programmable logic block from Xylon
index 466f9bd88bc1e5a68296781d2711e14390381bc0..464000aea765378894002fdb02dab16d197c27b1 100644 (file)
@@ -10,7 +10,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_plane.h>
@@ -157,7 +157,7 @@ static void logicvc_plane_atomic_update(struct drm_plane *drm_plane,
                     new_state->crtc_h - 1);
 
        if (logicvc->caps->layer_address) {
-               phys_addr_t fb_addr = drm_fb_cma_get_gem_addr(fb, new_state, 0);
+               phys_addr_t fb_addr = drm_fb_dma_get_gem_addr(fb, new_state, 0);
 
                regmap_write(logicvc->regmap, LOGICVC_LAYER_ADDRESS_REG(index),
                             fb_addr);
@@ -280,7 +280,7 @@ int logicvc_layer_buffer_find_setup(struct logicvc_drm *logicvc,
                return -ENOMEM;
        }
 
-       fb_addr = drm_fb_cma_get_gem_addr(fb, state, 0);
+       fb_addr = drm_fb_dma_get_gem_addr(fb, state, 0);
        if (fb_addr < logicvc->reserved_mem_base) {
                drm_err(drm_dev,
                        "Framebuffer memory below reserved memory base!\n");
index 4df477540d07430d0bad5acf39d5a894cfaad0f6..9247da47f0cfcc79c9161404deeeae89ae5a4e6d 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/media-bus-format.h>
 
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -165,7 +165,7 @@ static int mcde_display_check(struct drm_simple_display_pipe *pipe,
        struct drm_framebuffer *fb = pstate->fb;
 
        if (fb) {
-               u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0);
+               u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
                /* FB base address must be dword aligned. */
                if (offset & 3) {
@@ -1424,7 +1424,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
         * from the DRM core before the display is enabled.
         */
        if (fb) {
-               mcde_set_extsrc(mcde, drm_fb_cma_get_gem_addr(fb, pstate, 0));
+               mcde_set_extsrc(mcde, drm_fb_dma_get_gem_addr(fb, pstate, 0));
                dev_info_once(mcde->dev, "first update of display contents\n");
                /*
                 * Usually the flow is already active, unless we are in
index e601baa87e55ce82d5d4882409607f44a4e71667..509c2b03bc420961f4f3b40b3da8d0dd3717719b 100644 (file)
@@ -37,7 +37,7 @@
  * (effectively using channels 0..3) for concurrent use.
  *
  * In the current DRM/KMS setup, we use one external source, one overlay,
- * one FIFO and one formatter which we connect to the simple CMA framebuffer
+ * one FIFO and one formatter which we connect to the simple DMA framebuffer
  * helpers. We then provide a bridge to the DSI port, and on the DSI port
  * bridge we connect hang a panel bridge or other bridge. This may be subject
  * to change as we exploit more of the hardware capabilities.
@@ -68,7 +68,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_gem_cma_helper.h>
index 93c1cd2aab437165c208235384fd9a88ab4d4e22..bfebf45d8402f9a98c81c2d40f3a2b438f8fa6d8 100644 (file)
@@ -11,7 +11,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -650,7 +650,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
 
        switch (priv->viu.vd1_planes) {
        case 3:
-               gem = drm_fb_cma_get_gem_obj(fb, 2);
+               gem = drm_fb_dma_get_gem_obj(fb, 2);
                priv->viu.vd1_addr2 = gem->paddr + fb->offsets[2];
                priv->viu.vd1_stride2 = fb->pitches[2];
                priv->viu.vd1_height2 =
@@ -662,7 +662,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
                         priv->viu.vd1_height2);
                fallthrough;
        case 2:
-               gem = drm_fb_cma_get_gem_obj(fb, 1);
+               gem = drm_fb_dma_get_gem_obj(fb, 1);
                priv->viu.vd1_addr1 = gem->paddr + fb->offsets[1];
                priv->viu.vd1_stride1 = fb->pitches[1];
                priv->viu.vd1_height1 =
@@ -674,7 +674,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,
                         priv->viu.vd1_height1);
                fallthrough;
        case 1:
-               gem = drm_fb_cma_get_gem_obj(fb, 0);
+               gem = drm_fb_dma_get_gem_obj(fb, 0);
                priv->viu.vd1_addr0 = gem->paddr + fb->offsets[0];
                priv->viu.vd1_stride0 = fb->pitches[0];
                priv->viu.vd1_height0 =
index f3d49e81acf4c5924c9fd9b7d8bed54116daa2dc..51479715cce7eabe39725b0f98313c7941d14225 100644 (file)
@@ -15,7 +15,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -365,7 +365,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
        }
 
        /* Update Canvas with buffer address */
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
 
        priv->viu.osd1_addr = gem->paddr;
        priv->viu.osd1_stride = fb->pitches[0];
index b27a54e31343c7349b55f65caf19fcebe2bcf885..0df418774035bcdf252b6ce39959e761f8b1fc73 100644 (file)
@@ -18,7 +18,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_framebuffer.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -296,7 +296,7 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc,
        lcdif_crtc_mode_set_nofb(lcdif, bridge_state, bus_format);
 
        /* Write cur_buf as well to avoid an initial corrupt frame */
-       paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
+       paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0);
        if (paddr) {
                writel(lower_32_bits(paddr),
                       lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4);
@@ -405,7 +405,7 @@ static void lcdif_plane_primary_atomic_update(struct drm_plane *plane,
                                                                            plane);
        dma_addr_t paddr;
 
-       paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
+       paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0);
        if (paddr) {
                writel(lower_32_bits(paddr),
                       lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4);
index 2da2be6c11f21a72c78b557b5e8df67cfe3c2ad6..e55e9262afb28d892460b10e34b834f2213aa94e 100644 (file)
@@ -20,7 +20,7 @@
 #include <drm/drm_bridge.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_encoder.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -388,7 +388,7 @@ static void mxsfb_crtc_atomic_enable(struct drm_crtc *crtc,
        mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format);
 
        /* Write cur_buf as well to avoid an initial corrupt frame */
-       paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
+       paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0);
        if (paddr) {
                writel(paddr, mxsfb->base + mxsfb->devdata->cur_buf);
                writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
@@ -543,7 +543,7 @@ static void mxsfb_plane_primary_atomic_update(struct drm_plane *plane,
                                                                            plane);
        dma_addr_t paddr;
 
-       paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
+       paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0);
        if (paddr)
                writel(paddr, mxsfb->base + mxsfb->devdata->next_buf);
 }
@@ -559,7 +559,7 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane,
        dma_addr_t paddr;
        u32 ctrl;
 
-       paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0);
+       paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0);
        if (!paddr) {
                writel(0, mxsfb->base + LCDC_AS_CTRL);
                return;
index 6263346f24c6c287319a6cc1efd04f68eb6a2a7c..5f2429c3633ef51978a287526b344600684810a4 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/of_graph.h>
 
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -94,7 +94,7 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
                return -EINVAL;
 
        if (fb) {
-               u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0);
+               u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
                /* FB base address must be dword aligned. */
                if (offset & 3)
@@ -398,7 +398,7 @@ static void pl111_display_update(struct drm_simple_display_pipe *pipe,
        struct drm_framebuffer *fb = pstate->fb;
 
        if (fb) {
-               u32 addr = drm_fb_cma_get_gem_addr(fb, pstate, 0);
+               u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
                writel(addr, priv->regs + CLCD_UBAS);
        }
index 07ba6bff5f5d6811cdec9f7da7a40b4b0cc12a35..4ae444346991867b470203bdbf030439e5218bb0 100644 (file)
@@ -12,7 +12,7 @@
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -350,7 +350,7 @@ static void rcar_du_plane_setup_scanout(struct rcar_du_group *rgrp,
                        pitch = fb->pitches[0] * 8 / state->format->bpp;
 
                for (i = 0; i < state->format->planes; ++i) {
-                       gem = drm_fb_cma_get_gem_obj(fb, i);
+                       gem = drm_fb_dma_get_gem_obj(fb, i);
                        dma[i] = gem->paddr + fb->offsets[i];
                }
        } else {
index 5e985d46d68e2ab7f906cef17e6c655edf91516c..99d32f42e46d53b6990453abb2fd167d814a4e6c 100644 (file)
@@ -11,7 +11,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -183,7 +183,7 @@ int rcar_du_vsp_map_fb(struct rcar_du_vsp *vsp, struct drm_framebuffer *fb,
        int ret;
 
        for (i = 0; i < fb->format->num_planes; ++i) {
-               struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, i);
+               struct drm_gem_cma_object *gem = drm_fb_dma_get_gem_obj(fb, i);
                struct sg_table *sgt = &sg_tables[i];
 
                if (gem->sgt) {
index 387fbd2ab32d9fd448bbda3a08e3b69971a8c7f0..94318f858ed6f31c36bc60b81d949107c636e552 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -292,13 +292,13 @@ static void shmob_drm_crtc_compute_base(struct shmob_drm_crtc *scrtc,
        unsigned int bpp;
 
        bpp = scrtc->format->yuv ? 8 : scrtc->format->bpp;
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
        scrtc->dma[0] = gem->paddr + fb->offsets[0]
                      + y * fb->pitches[0] + x * bpp / 8;
 
        if (scrtc->format->yuv) {
                bpp = scrtc->format->bpp - 8;
-               gem = drm_fb_cma_get_gem_obj(fb, 1);
+               gem = drm_fb_dma_get_gem_obj(fb, 1);
                scrtc->dma[1] = gem->paddr + fb->offsets[1]
                              + y / (bpp == 4 ? 2 : 1) * fb->pitches[1]
                              + x * (bpp == 16 ? 2 : 1);
index 4763ea8e1af02a3d14b6fa84fce14bf20f1b18a9..6fa64bce0c91b95405368fb6239c200357cd618e 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -45,13 +45,13 @@ static void shmob_drm_plane_compute_base(struct shmob_drm_plane *splane,
        unsigned int bpp;
 
        bpp = splane->format->yuv ? 8 : splane->format->bpp;
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
        splane->dma[0] = gem->paddr + fb->offsets[0]
                       + y * fb->pitches[0] + x * bpp / 8;
 
        if (splane->format->yuv) {
                bpp = splane->format->bpp - 8;
-               gem = drm_fb_cma_get_gem_obj(fb, 1);
+               gem = drm_fb_dma_get_gem_obj(fb, 1);
                splane->dma[1] = gem->paddr + fb->offsets[1]
                               + y / (bpp == 4 ? 2 : 1) * fb->pitches[1]
                               + x * (bpp == 16 ? 2 : 1);
index 10d21f7ab02d1a28c0167274c3bf22bab51436ee..5ea104e0beb82bcd6e348bfa28b50f68d1f9ed86 100644 (file)
@@ -19,7 +19,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
@@ -340,7 +340,7 @@ static void sprd_dpu_layer(struct sprd_dpu *dpu, struct drm_plane_state *state)
        size = (src_w & 0xffff) | (src_h << 16);
 
        for (i = 0; i < fb->format->num_planes; i++) {
-               cma_obj = drm_fb_cma_get_gem_obj(fb, i);
+               cma_obj = drm_fb_dma_get_gem_obj(fb, i);
                addr = cma_obj->paddr + fb->offsets[i];
 
                if (i == 0)
index 1e9bd4241f10252c9b6e88934fa0c0e2ad812dfa..d374fa50be600a5a4753f7663b8c5cd964d76920 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
 
@@ -243,7 +243,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
                }
        }
 
-       if (!drm_fb_cma_get_gem_obj(fb, 0)) {
+       if (!drm_fb_dma_get_gem_obj(fb, 0)) {
                DRM_ERROR("Can't get CMA GEM object for fb\n");
                return -EINVAL;
        }
@@ -278,7 +278,7 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
        dst_x = newstate->crtc_x;
        dst_y = newstate->crtc_y;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
 
        /* Convert ARGB8888 to CLUT8 */
        sti_cursor_argb8888_to_clut8(cursor, (u32 *)cma_obj->vaddr);
index af783f599306c3d7ff92eef48cab152a529b7d21..623a09163f9f5b4b10b2307778b6f1d50b633a7a 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -658,7 +658,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
                return -EINVAL;
        }
 
-       if (!drm_fb_cma_get_gem_obj(fb, 0)) {
+       if (!drm_fb_dma_get_gem_obj(fb, 0)) {
                DRM_ERROR("Can't get CMA GEM object for fb\n");
                return -EINVAL;
        }
@@ -778,7 +778,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,
        top_field->gam_gdp_ctl |= sti_gdp_get_alpharange(format);
        top_field->gam_gdp_ppt &= ~GAM_GDP_PPT_IGNORE;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
 
        DRM_DEBUG_DRIVER("drm FB:%d format:%.4s phys@:0x%lx\n", fb->base.id,
                         (char *)&fb->format->format,
index 2719820804379f9da656a5033a0bbe54a5c0a7ec..26284c5f5b224480c12205eaa40081be2f173a81 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -1055,7 +1055,7 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
                return -EINVAL;
        }
 
-       if (!drm_fb_cma_get_gem_obj(fb, 0)) {
+       if (!drm_fb_dma_get_gem_obj(fb, 0)) {
                DRM_ERROR("Can't get CMA GEM object for fb\n");
                return -EINVAL;
        }
@@ -1178,7 +1178,7 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,
        cmd->iqi.sat_gain = IQI_SAT_GAIN_DFLT;
        cmd->iqi.pxf_conf = IQI_PXF_CONF_DFLT;
 
-       cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
 
        DRM_DEBUG_DRIVER("drm FB:%d format:%.4s phys@:0x%lx\n", fb->base.id,
                         (char *)&fb->format->format,
index 8f3307b279e7f5259082ee41906a63713b44849d..42a98ef73d033edc8f3b2218cfcf3de7eeec3e33 100644 (file)
@@ -28,7 +28,7 @@
 #include <drm/drm_bridge.h>
 #include <drm/drm_device.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -1346,7 +1346,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
        }
 
        /* Sets the FB address */
-       paddr = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 0);
+       paddr = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 0);
 
        if (newstate->rotation & DRM_MODE_REFLECT_X)
                paddr += (fb->format->cpp[0] * (x1 - x0 + 1)) - 1;
@@ -1380,7 +1380,7 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
                        case DRM_FORMAT_NV12:
                        case DRM_FORMAT_NV21:
                        /* Configure the auxiliary frame buffer address 0 */
-                       paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1);
+                       paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1);
 
                        if (newstate->rotation & DRM_MODE_REFLECT_X)
                                paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1;
@@ -1392,8 +1392,8 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
                        break;
                        case DRM_FORMAT_YUV420:
                        /* Configure the auxiliary frame buffer address 0 & 1 */
-                       paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1);
-                       paddr2 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 2);
+                       paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1);
+                       paddr2 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 2);
 
                        if (newstate->rotation & DRM_MODE_REFLECT_X) {
                                paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1;
@@ -1410,8 +1410,8 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
                        break;
                        case DRM_FORMAT_YVU420:
                        /* Configure the auxiliary frame buffer address 0 & 1 */
-                       paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 2);
-                       paddr2 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1);
+                       paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 2);
+                       paddr2 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1);
 
                        if (newstate->rotation & DRM_MODE_REFLECT_X) {
                                paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1;
index 0c69eab1fd3765347ae0c1c3360372aabb933bdf..fa4539c3b149ee3d446509745e379e4910e22c0e 100644 (file)
@@ -19,7 +19,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -338,7 +338,7 @@ int sun4i_backend_update_layer_buffer(struct sun4i_backend *backend,
                     fb->pitches[0] * 8);
 
        /* Get the start of the displayed memory */
-       paddr = drm_fb_cma_get_gem_addr(fb, state, 0);
+       paddr = drm_fb_dma_get_gem_addr(fb, state, 0);
        DRM_DEBUG_DRIVER("Setting buffer address to %pad\n", &paddr);
 
        if (fb->format->is_yuv)
index 462fae73eae98e13a9c09502513135afbdcbb1c8..4a811e803dacf8bcd5d4b7283fd20d2fa8fbc4c9 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/reset.h>
 
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -221,19 +221,19 @@ void sun4i_frontend_update_buffer(struct sun4i_frontend *frontend,
        swap = sun4i_frontend_format_chroma_requires_swap(fb->format->format);
 
        /* Set the physical address of the buffer in memory */
-       paddr = drm_fb_cma_get_gem_addr(fb, state, 0);
+       paddr = drm_fb_dma_get_gem_addr(fb, state, 0);
        DRM_DEBUG_DRIVER("Setting buffer #0 address to %pad\n", &paddr);
        regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR0_REG, paddr);
 
        if (fb->format->num_planes > 1) {
-               paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 2 : 1);
+               paddr = drm_fb_dma_get_gem_addr(fb, state, swap ? 2 : 1);
                DRM_DEBUG_DRIVER("Setting buffer #1 address to %pad\n", &paddr);
                regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR1_REG,
                             paddr);
        }
 
        if (fb->format->num_planes > 2) {
-               paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 1 : 2);
+               paddr = drm_fb_dma_get_gem_addr(fb, state, swap ? 1 : 2);
                DRM_DEBUG_DRIVER("Setting buffer #2 address to %pad\n", &paddr);
                regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR2_REG,
                             paddr);
index 06ed571c37f04abb858e615ff11efc17bb6e6d46..900c71c47a3b519ba36ed7d245ddfd1e954fb222 100644 (file)
@@ -13,7 +13,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -200,7 +200,7 @@ static int sun8i_ui_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
        ch_base = sun8i_channel_base(mixer, channel);
 
        /* Get the physical address of the buffer in memory */
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
 
        DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr);
 
index b9473efa308df18248a269f42cd09b445f52c4be..8b5dae30c8c5fb838953eacbc7e5855eed087274 100644 (file)
@@ -7,7 +7,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -322,7 +322,7 @@ static int sun8i_vi_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
 
        for (i = 0; i < format->num_planes; i++) {
                /* Get the physical address of the buffer in memory */
-               gem = drm_fb_cma_get_gem_obj(fb, i);
+               gem = drm_fb_dma_get_gem_obj(fb, i);
 
                DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr);
 
index ed828de5ac01494e876c3d4e9ebd309ac5dc272a..9291209154a7a947e6d7d2bbfb4057e6e592b4d4 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2012-2013 Avionic Design GmbH
  * Copyright (C) 2012 NVIDIA CORPORATION.  All rights reserved.
  *
- * Based on the KMS/FB CMA helpers
+ * Based on the KMS/FB DMA helpers
  *   Copyright (C) 2012 Analog Devices Inc.
  */
 
index dd3c6a606ae22a95ff4ccd6103a9b0814bed547f..cdd9a64f97365404a83effe0804079cae7b28350 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <drm/drm_blend.h>
 #include <drm/drm_fourcc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_panel.h>
@@ -1961,7 +1961,7 @@ dma_addr_t dispc_plane_state_paddr(const struct drm_plane_state *state)
        u32 x = state->src_x >> 16;
        u32 y = state->src_y >> 16;
 
-       gem = drm_fb_cma_get_gem_obj(state->fb, 0);
+       gem = drm_fb_dma_get_gem_obj(state->fb, 0);
 
        return gem->paddr + fb->offsets[0] + x * fb->format->cpp[0] +
                y * fb->pitches[0];
@@ -1978,7 +1978,7 @@ dma_addr_t dispc_plane_state_p_uv_addr(const struct drm_plane_state *state)
        if (WARN_ON(state->fb->format->num_planes != 2))
                return 0;
 
-       gem = drm_fb_cma_get_gem_obj(fb, 1);
+       gem = drm_fb_dma_get_gem_obj(fb, 1);
 
        return gem->paddr + fb->offsets[1] +
                (x * fb->format->cpp[1] / fb->format->hsub) +
index 509fbae8c9a621d648c7877544ec0a5da80f3887..bd4f52242c0a43263245ca55cb3919bd4724a645 100644 (file)
@@ -12,7 +12,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -68,7 +68,7 @@ static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb)
        dma_addr_t start, end;
        u64 dma_base_and_ceiling;
 
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
 
        start = gem->paddr + fb->offsets[0] +
                crtc->y * fb->pitches[0] +
index 7461cb4014071cd04b151733ae1fe141d930040d..cdf320c547fbfa31b15466de535521593a153ccf 100644 (file)
@@ -11,7 +11,7 @@
 #include <drm/drm_device.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -226,7 +226,7 @@ static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
                return;
 
        arcpgu = pipe_to_arcpgu_priv(pipe);
-       gem = drm_fb_cma_get_gem_obj(pipe->plane.state->fb, 0);
+       gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
        arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);
 }
 
index 8d686eecd5f499ed49a44ed44ba8de8ba06a45be..fc73ffa46a198345c879b8e28c9204453523400a 100644 (file)
@@ -19,7 +19,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -78,7 +78,7 @@ static inline int ili9225_command(struct mipi_dbi *dbi, u8 cmd, u16 data)
 
 static void ili9225_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
 {
-       struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
        struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev);
        unsigned int height = rect->y2 - rect->y1;
        unsigned int width = rect->x2 - rect->x1;
index 013790c45d0a22f66a5aeef7c544f29f1f87af3c..6d3b5b3cb955a26684d667de4c194fa555f5f2a1 100644 (file)
@@ -25,7 +25,7 @@
 #include <drm/drm_connector.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_format_helper.h>
 #include <drm/drm_framebuffer.h>
@@ -511,7 +511,7 @@ static void repaper_get_temperature(struct repaper_epd *epd)
 
 static int repaper_fb_dirty(struct drm_framebuffer *fb)
 {
-       struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
        struct repaper_epd *epd = drm_to_epd(fb->dev);
        struct drm_rect clip;
        int idx, ret = 0;
index 8eddb020c43e1e907495bf3d9c39ae5a8d05283d..b1584b362c79b1fce1b5973f8b9bd9e7e22d9c14 100644 (file)
@@ -15,7 +15,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_damage_helper.h>
 #include <drm/drm_drv.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_format_helper.h>
 #include <drm/drm_framebuffer.h>
@@ -92,7 +92,7 @@ static void st7586_xrgb8888_to_gray332(u8 *dst, void *vaddr,
 static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb,
                           struct drm_rect *clip)
 {
-       struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0);
        void *src = cma_obj->vaddr;
        int ret = 0;
 
index 771bad881714da385b66894c4bd9d0a5c3afb58c..6647aab8a25e28ce6b71bdc0ab85a589676ece40 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/of_graph.h>
 #include <linux/delay.h>
 
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -90,7 +90,7 @@ static int tve200_display_check(struct drm_simple_display_pipe *pipe,
        }
 
        if (fb) {
-               u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0);
+               u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
                /* FB base address must be dword aligned. */
                if (offset & 3) {
@@ -267,14 +267,14 @@ static void tve200_display_update(struct drm_simple_display_pipe *pipe,
 
        if (fb) {
                /* For RGB, the Y component is used as base address */
-               writel(drm_fb_cma_get_gem_addr(fb, pstate, 0),
+               writel(drm_fb_dma_get_gem_addr(fb, pstate, 0),
                       priv->regs + TVE200_Y_FRAME_BASE_ADDR);
 
                /* For three plane YUV we need two more addresses */
                if (fb->format->format == DRM_FORMAT_YUV420) {
-                       writel(drm_fb_cma_get_gem_addr(fb, pstate, 1),
+                       writel(drm_fb_dma_get_gem_addr(fb, pstate, 1),
                               priv->regs + TVE200_U_FRAME_BASE_ADDR);
-                       writel(drm_fb_cma_get_gem_addr(fb, pstate, 2),
+                       writel(drm_fb_dma_get_gem_addr(fb, pstate, 2),
                               priv->regs + TVE200_V_FRAME_BASE_ADDR);
                }
        }
index d3efa7e5b5ed186b5d9fcd6f4c9b2ebc35070f8f..f857884017072d9adc3b844ca041047bd2d4db9b 100644 (file)
@@ -37,7 +37,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_uapi.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
@@ -824,7 +824,7 @@ static void vc4_async_page_flip_seqno_complete(struct vc4_seqno_cb *cb)
 
        if (flip_state->old_fb) {
                struct drm_gem_cma_object *cma_bo =
-                       drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
+                       drm_fb_dma_get_gem_obj(flip_state->old_fb, 0);
                bo = to_vc4_bo(&cma_bo->base);
        }
 
@@ -857,7 +857,7 @@ static int vc4_async_set_fence_cb(struct drm_device *dev,
                                  struct vc4_async_flip_state *flip_state)
 {
        struct drm_framebuffer *fb = flip_state->fb;
-       struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_bo = drm_fb_dma_get_gem_obj(fb, 0);
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct dma_fence *fence;
        int ret;
@@ -945,7 +945,7 @@ static int vc4_async_page_flip(struct drm_crtc *crtc,
 {
        struct drm_device *dev = crtc->dev;
        struct vc4_dev *vc4 = to_vc4_dev(dev);
-       struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *cma_bo = drm_fb_dma_get_gem_obj(fb, 0);
        struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
        int ret;
 
index 243b29ab6f856d1c458543d6a2efbbd466630205..51e0e8aa2135aec12bfa51a7d8ead3f262e61961 100644 (file)
@@ -19,7 +19,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_uapi.h>
 #include <drm/drm_blend.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem_atomic_helper.h>
@@ -339,7 +339,7 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
 {
        struct vc4_plane_state *vc4_state = to_vc4_plane_state(state);
        struct drm_framebuffer *fb = state->fb;
-       struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *bo = drm_fb_dma_get_gem_obj(fb, 0);
        int num_planes = fb->format->num_planes;
        struct drm_crtc_state *crtc_state;
        u32 h_subsample = fb->format->hsub;
@@ -1243,7 +1243,7 @@ u32 vc4_plane_dlist_size(const struct drm_plane_state *state)
 void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
 {
        struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state);
-       struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct drm_gem_cma_object *bo = drm_fb_dma_get_gem_obj(fb, 0);
        uint32_t addr;
 
        /* We're skipping the address adjustment for negative origin,
@@ -1387,7 +1387,7 @@ static int vc4_prepare_fb(struct drm_plane *plane,
        if (!state->fb)
                return 0;
 
-       bo = to_vc4_bo(&drm_fb_cma_get_gem_obj(state->fb, 0)->base);
+       bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);
 
        drm_gem_plane_helper_prepare_fb(plane, state);
 
@@ -1405,7 +1405,7 @@ static void vc4_cleanup_fb(struct drm_plane *plane,
        if (plane->state->fb == state->fb || !state->fb)
                return;
 
-       bo = to_vc4_bo(&drm_fb_cma_get_gem_obj(state->fb, 0)->base);
+       bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);
        vc4_bo_dec_usecnt(bo);
 }
 
index 913e26dd62d45c6682cc46a7c7442b6c09947c71..af48ae68f213e3ee5ae3a797df911fe659d071d9 100644 (file)
@@ -17,7 +17,7 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_edid.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_panel.h>
@@ -317,7 +317,7 @@ static void vc4_txp_connector_atomic_commit(struct drm_connector *conn,
        if (!drm_dev_enter(drm, &idx))
                return;
 
-       gem = drm_fb_cma_get_gem_obj(fb, 0);
+       gem = drm_fb_dma_get_gem_obj(fb, 0);
        TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]);
        TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]);
        TXP_WRITE(TXP_DIM,
index a769422e3f1db86b2c00911d06cc0a3eae9ae91f..3bcb71c71db03e408ab6d3760fec934aa9f3e7ca 100644 (file)
@@ -15,7 +15,7 @@
 #include <drm/drm_blend.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_device.h>
-#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_managed.h>
@@ -1100,7 +1100,7 @@ static int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer,
                struct dma_async_tx_descriptor *desc;
                dma_addr_t paddr;
 
-               paddr = drm_fb_cma_get_gem_addr(state->fb, state, i);
+               paddr = drm_fb_dma_get_gem_addr(state->fb, state, i);
 
                dma->xt.numf = height;
                dma->sgl.size = width * info->cpp[i];
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
deleted file mode 100644 (file)
index 6447e34..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __DRM_FB_CMA_HELPER_H__
-#define __DRM_FB_CMA_HELPER_H__
-
-#include <linux/types.h>
-
-struct drm_device;
-struct drm_framebuffer;
-struct drm_plane_state;
-
-struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
-       unsigned int plane);
-
-dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,
-                                  struct drm_plane_state *state,
-                                  unsigned int plane);
-
-void drm_fb_cma_sync_non_coherent(struct drm_device *drm,
-                                 struct drm_plane_state *old_state,
-                                 struct drm_plane_state *state);
-
-#endif
-
diff --git a/include/drm/drm_fb_dma_helper.h b/include/drm/drm_fb_dma_helper.h
new file mode 100644 (file)
index 0000000..05f6573
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DRM_FB_DMA_HELPER_H__
+#define __DRM_FB_DMA_HELPER_H__
+
+#include <linux/types.h>
+
+struct drm_device;
+struct drm_framebuffer;
+struct drm_plane_state;
+
+struct drm_gem_cma_object *drm_fb_dma_get_gem_obj(struct drm_framebuffer *fb,
+       unsigned int plane);
+
+dma_addr_t drm_fb_dma_get_gem_addr(struct drm_framebuffer *fb,
+                                  struct drm_plane_state *state,
+                                  unsigned int plane);
+
+void drm_fb_dma_sync_non_coherent(struct drm_device *drm,
+                                 struct drm_plane_state *old_state,
+                                 struct drm_plane_state *state);
+
+#endif
+