Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/fb: rename FB CMA helpers to FB DMA helpers

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 e57924d4ae80 ("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

authored by

Danilo Krummrich and committed by
Sam Ravnborg
6bcfe8ea 5e8bf00e

+168 -163
+4 -4
Documentation/gpu/drm-kms-helpers.rst
··· 122 122 .. kernel-doc:: drivers/gpu/drm/drm_format_helper.c 123 123 :export: 124 124 125 - Framebuffer CMA Helper Functions Reference 125 + Framebuffer DMA Helper Functions Reference 126 126 ========================================== 127 127 128 - .. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c 129 - :doc: framebuffer cma helper functions 128 + .. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c 129 + :doc: framebuffer dma helper functions 130 130 131 - .. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c 131 + .. kernel-doc:: drivers/gpu/drm/drm_fb_dma_helper.c 132 132 :export: 133 133 134 134 Framebuffer GEM Helper Reference
+1 -1
drivers/gpu/drm/Makefile
··· 41 41 obj-$(CONFIG_DRM_BUDDY) += drm_buddy.o 42 42 43 43 drm_cma_helper-y := drm_gem_cma_helper.o 44 - drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_cma_helper.o 44 + drm_cma_helper-$(CONFIG_DRM_KMS_HELPER) += drm_fb_dma_helper.o 45 45 obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o 46 46 47 47 drm_shmem_helper-y := drm_gem_shmem_helper.o
+2 -2
drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c
··· 5 5 * 6 6 */ 7 7 #include <drm/drm_device.h> 8 - #include <drm/drm_fb_cma_helper.h> 8 + #include <drm/drm_fb_dma_helper.h> 9 9 #include <drm/drm_gem.h> 10 10 #include <drm/drm_gem_cma_helper.h> 11 11 #include <drm/drm_gem_framebuffer_helper.h> ··· 247 247 return -EINVAL; 248 248 } 249 249 250 - obj = drm_fb_cma_get_gem_obj(fb, plane); 250 + obj = drm_fb_dma_get_gem_obj(fb, plane); 251 251 252 252 offset = fb->offsets[plane]; 253 253 if (!fb->modifier) {
+2 -2
drivers/gpu/drm/arm/hdlcd_crtc.c
··· 18 18 #include <drm/drm_atomic.h> 19 19 #include <drm/drm_atomic_helper.h> 20 20 #include <drm/drm_crtc.h> 21 - #include <drm/drm_fb_cma_helper.h> 21 + #include <drm/drm_fb_dma_helper.h> 22 22 #include <drm/drm_fb_helper.h> 23 23 #include <drm/drm_framebuffer.h> 24 24 #include <drm/drm_gem_cma_helper.h> ··· 273 273 return; 274 274 275 275 dest_h = drm_rect_height(&new_plane_state->dst); 276 - scanout_start = drm_fb_cma_get_gem_addr(fb, new_plane_state, 0); 276 + scanout_start = drm_fb_dma_get_gem_addr(fb, new_plane_state, 0); 277 277 278 278 hdlcd = plane->dev->dev_private; 279 279 hdlcd_write(hdlcd, HDLCD_REG_FB_LINE_LENGTH, fb->pitches[0]);
+2 -2
drivers/gpu/drm/arm/malidp_mw.c
··· 10 10 #include <drm/drm_atomic_helper.h> 11 11 #include <drm/drm_crtc.h> 12 12 #include <drm/drm_edid.h> 13 - #include <drm/drm_fb_cma_helper.h> 13 + #include <drm/drm_fb_dma_helper.h> 14 14 #include <drm/drm_fourcc.h> 15 15 #include <drm/drm_framebuffer.h> 16 16 #include <drm/drm_gem_cma_helper.h> ··· 160 160 161 161 n_planes = fb->format->num_planes; 162 162 for (i = 0; i < n_planes; i++) { 163 - struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, i); 163 + struct drm_gem_cma_object *obj = drm_fb_dma_get_gem_obj(fb, i); 164 164 /* memory write buffers are never rotated */ 165 165 u8 alignment = malidp_hw_get_pitch_align(malidp->dev, 0); 166 166
+4 -4
drivers/gpu/drm/arm/malidp_planes.c
··· 13 13 #include <drm/drm_atomic_helper.h> 14 14 #include <drm/drm_blend.h> 15 15 #include <drm/drm_drv.h> 16 - #include <drm/drm_fb_cma_helper.h> 16 + #include <drm/drm_fb_dma_helper.h> 17 17 #include <drm/drm_fourcc.h> 18 18 #include <drm/drm_framebuffer.h> 19 19 #include <drm/drm_gem_cma_helper.h> ··· 722 722 ptr = mp->layer->ptr + (plane_index << 4); 723 723 724 724 /* 725 - * drm_fb_cma_get_gem_addr() alters the physical base address of the 725 + * drm_fb_dma_get_gem_addr() alters the physical base address of the 726 726 * framebuffer as per the plane's src_x, src_y co-ordinates (ie to 727 727 * take care of source cropping). 728 728 * For AFBC, this is not needed as the cropping is handled by _AD_CROP_H 729 729 * and _AD_CROP_V registers. 730 730 */ 731 731 if (!afbc) { 732 - paddr = drm_fb_cma_get_gem_addr(fb, plane->state, 732 + paddr = drm_fb_dma_get_gem_addr(fb, plane->state, 733 733 plane_index); 734 734 } else { 735 735 struct drm_gem_cma_object *obj; 736 736 737 - obj = drm_fb_cma_get_gem_obj(fb, plane_index); 737 + obj = drm_fb_dma_get_gem_obj(fb, plane_index); 738 738 739 739 if (WARN_ON(!obj)) 740 740 return;
+2 -2
drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
··· 7 7 8 8 #include <drm/drm_crtc_helper.h> 9 9 #include <drm/drm_device.h> 10 - #include <drm/drm_fb_cma_helper.h> 10 + #include <drm/drm_fb_dma_helper.h> 11 11 #include <drm/drm_fourcc.h> 12 12 #include <drm/drm_framebuffer.h> 13 13 #include <drm/drm_gem_atomic_helper.h> ··· 185 185 if (!fb) 186 186 return; 187 187 188 - gem = drm_fb_cma_get_gem_obj(fb, 0); 188 + gem = drm_fb_dma_get_gem_obj(fb, 0); 189 189 if (!gem) 190 190 return; 191 191 writel(gem->paddr, priv->base + CRT_ADDR);
+2 -2
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
··· 12 12 #include <drm/drm_atomic.h> 13 13 #include <drm/drm_atomic_helper.h> 14 14 #include <drm/drm_blend.h> 15 - #include <drm/drm_fb_cma_helper.h> 15 + #include <drm/drm_fb_dma_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> 18 18 #include <drm/drm_gem_cma_helper.h> ··· 448 448 sr = atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_CHSR); 449 449 450 450 for (i = 0; i < state->nplanes; i++) { 451 - struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, i); 451 + struct drm_gem_cma_object *gem = drm_fb_dma_get_gem_obj(fb, i); 452 452 453 453 state->dscrs[i]->addr = gem->paddr + state->offsets[i]; 454 454
+24 -19
drivers/gpu/drm/drm_fb_cma_helper.c drivers/gpu/drm/drm_fb_dma_helper.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 - * drm kms/fb cma (contiguous memory allocator) helper functions 3 + * drm kms/fb dma helper functions 4 4 * 5 5 * Copyright (C) 2012 Analog Devices Inc. 6 6 * Author: Lars-Peter Clausen <lars@metafoo.de> ··· 10 10 */ 11 11 12 12 #include <drm/drm_damage_helper.h> 13 - #include <drm/drm_fb_cma_helper.h> 13 + #include <drm/drm_fb_dma_helper.h> 14 14 #include <drm/drm_fourcc.h> 15 15 #include <drm/drm_framebuffer.h> 16 16 #include <drm/drm_gem_cma_helper.h> ··· 20 20 #include <linux/module.h> 21 21 22 22 /** 23 - * DOC: framebuffer cma helper functions 23 + * DOC: framebuffer dma helper functions 24 24 * 25 - * Provides helper functions for creating a cma (contiguous memory allocator) 26 - * backed framebuffer. 25 + * Provides helper functions for creating a DMA-contiguous framebuffer. 26 + * 27 + * Depending on the platform, the buffers may be physically non-contiguous and 28 + * mapped through an IOMMU or a similar mechanism, or allocated from 29 + * physically-contiguous memory (using, for instance, CMA or a pool of memory 30 + * reserved at early boot). This is handled behind the scenes by the DMA mapping 31 + * API. 27 32 * 28 33 * drm_gem_fb_create() is used in the &drm_mode_config_funcs.fb_create 29 - * callback function to create a cma backed framebuffer. 34 + * callback function to create a DMA-contiguous framebuffer. 30 35 */ 31 36 32 37 /** 33 - * drm_fb_cma_get_gem_obj() - Get CMA GEM object for framebuffer 38 + * drm_fb_dma_get_gem_obj() - Get CMA GEM object for framebuffer 34 39 * @fb: The framebuffer 35 40 * @plane: Which plane 36 41 * ··· 43 38 * 44 39 * This function will usually be called from the CRTC callback functions. 45 40 */ 46 - struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, 41 + struct drm_gem_cma_object *drm_fb_dma_get_gem_obj(struct drm_framebuffer *fb, 47 42 unsigned int plane) 48 43 { 49 44 struct drm_gem_object *gem; ··· 54 49 55 50 return to_drm_gem_cma_obj(gem); 56 51 } 57 - EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj); 52 + EXPORT_SYMBOL_GPL(drm_fb_dma_get_gem_obj); 58 53 59 54 /** 60 - * drm_fb_cma_get_gem_addr() - Get physical address for framebuffer, for pixel 55 + * drm_fb_dma_get_gem_addr() - Get DMA (bus) address for framebuffer, for pixel 61 56 * formats where values are grouped in blocks this will get you the beginning of 62 57 * the block 63 58 * @fb: The framebuffer 64 59 * @state: Which state of drm plane 65 60 * @plane: Which plane 66 - * Return the CMA GEM address for given framebuffer. 61 + * Return the DMA GEM address for given framebuffer. 67 62 * 68 63 * This function will usually be called from the PLANE callback functions. 69 64 */ 70 - dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, 65 + dma_addr_t drm_fb_dma_get_gem_addr(struct drm_framebuffer *fb, 71 66 struct drm_plane_state *state, 72 67 unsigned int plane) 73 68 { ··· 82 77 u32 block_start_y; 83 78 u32 num_hblocks; 84 79 85 - obj = drm_fb_cma_get_gem_obj(fb, plane); 80 + obj = drm_fb_dma_get_gem_obj(fb, plane); 86 81 if (!obj) 87 82 return 0; 88 83 ··· 103 98 104 99 return paddr; 105 100 } 106 - EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_addr); 101 + EXPORT_SYMBOL_GPL(drm_fb_dma_get_gem_addr); 107 102 108 103 /** 109 - * drm_fb_cma_sync_non_coherent - Sync GEM object to non-coherent backing 104 + * drm_fb_dma_sync_non_coherent - Sync GEM object to non-coherent backing 110 105 * memory 111 106 * @drm: DRM device 112 107 * @old_state: Old plane state ··· 117 112 * in a plane's .atomic_update ensures that all the data in the backing 118 113 * memory have been written to RAM. 119 114 */ 120 - void drm_fb_cma_sync_non_coherent(struct drm_device *drm, 115 + void drm_fb_dma_sync_non_coherent(struct drm_device *drm, 121 116 struct drm_plane_state *old_state, 122 117 struct drm_plane_state *state) 123 118 { ··· 130 125 size_t nb_bytes; 131 126 132 127 for (i = 0; i < finfo->num_planes; i++) { 133 - cma_obj = drm_fb_cma_get_gem_obj(state->fb, i); 128 + cma_obj = drm_fb_dma_get_gem_obj(state->fb, i); 134 129 if (!cma_obj->map_noncoherent) 135 130 continue; 136 131 137 - daddr = drm_fb_cma_get_gem_addr(state->fb, state, i); 132 + daddr = drm_fb_dma_get_gem_addr(state->fb, state, i); 138 133 drm_atomic_helper_damage_iter_init(&iter, old_state, state); 139 134 140 135 drm_atomic_for_each_plane_damage(&iter, &clip) { ··· 147 142 } 148 143 } 149 144 } 150 - EXPORT_SYMBOL_GPL(drm_fb_cma_sync_non_coherent); 145 + EXPORT_SYMBOL_GPL(drm_fb_dma_sync_non_coherent);
+2 -2
drivers/gpu/drm/drm_format_helper.c
··· 54 54 const void *sbuf; 55 55 56 56 /* 57 - * Some source buffers, such as CMA memory, use write-combine 57 + * Some source buffers, such as DMA memory, use write-combine 58 58 * caching, so reads are uncached. Speed up access by fetching 59 59 * one line at a time. 60 60 */ ··· 676 676 dst_pitch = DIV_ROUND_UP(linepixels, 8); 677 677 678 678 /* 679 - * The cma memory is write-combined so reads are uncached. 679 + * The dma memory is write-combined so reads are uncached. 680 680 * Speed up by fetching one line at a time. 681 681 * 682 682 * Also, format conversion from XR24 to monochrome are done
+2 -2
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
··· 10 10 #include <drm/drm_atomic.h> 11 11 #include <drm/drm_atomic_helper.h> 12 12 #include <drm/drm_crtc.h> 13 - #include <drm/drm_fb_cma_helper.h> 13 + #include <drm/drm_fb_dma_helper.h> 14 14 #include <drm/drm_fourcc.h> 15 15 #include <drm/drm_framebuffer.h> 16 16 #include <drm/drm_gem_cma_helper.h> ··· 95 95 if (index < 0) 96 96 return; 97 97 98 - gem = drm_fb_cma_get_gem_obj(fb, 0); 98 + gem = drm_fb_dma_get_gem_obj(fb, 0); 99 99 100 100 switch (fb->format->format) { 101 101 case DRM_FORMAT_RGB565:
+2 -2
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
··· 24 24 #include <drm/drm_atomic_helper.h> 25 25 #include <drm/drm_crtc.h> 26 26 #include <drm/drm_drv.h> 27 - #include <drm/drm_fb_cma_helper.h> 27 + #include <drm/drm_fb_dma_helper.h> 28 28 #include <drm/drm_fourcc.h> 29 29 #include <drm/drm_framebuffer.h> 30 30 #include <drm/drm_gem_cma_helper.h> ··· 548 548 static void ade_rdma_set(void __iomem *base, struct drm_framebuffer *fb, 549 549 u32 ch, u32 y, u32 in_h, u32 fmt) 550 550 { 551 - struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, 0); 551 + struct drm_gem_cma_object *obj = drm_fb_dma_get_gem_obj(fb, 0); 552 552 u32 reg_ctrl, reg_addr, reg_size, reg_stride, reg_space, reg_en; 553 553 u32 stride = fb->pitches[0]; 554 554 u32 addr = (u32)obj->paddr + y * stride;
+3 -3
drivers/gpu/drm/imx/dcss/dcss-plane.c
··· 6 6 #include <drm/drm_atomic.h> 7 7 #include <drm/drm_atomic_helper.h> 8 8 #include <drm/drm_blend.h> 9 - #include <drm/drm_fb_cma_helper.h> 9 + #include <drm/drm_fb_dma_helper.h> 10 10 #include <drm/drm_framebuffer.h> 11 11 #include <drm/drm_gem_atomic_helper.h> 12 12 #include <drm/drm_gem_cma_helper.h> ··· 156 156 if (!fb || !new_plane_state->crtc) 157 157 return 0; 158 158 159 - cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 159 + cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 160 160 WARN_ON(!cma_obj); 161 161 162 162 crtc_state = drm_atomic_get_existing_crtc_state(state, ··· 218 218 struct dcss_dev *dcss = plane->dev->dev_private; 219 219 struct drm_framebuffer *fb = state->fb; 220 220 const struct drm_format_info *format = fb->format; 221 - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 221 + struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 222 222 unsigned long p1_ba = 0, p2_ba = 0; 223 223 224 224 if (!format->is_yuv ||
+4 -4
drivers/gpu/drm/imx/ipuv3-plane.c
··· 8 8 #include <drm/drm_atomic.h> 9 9 #include <drm/drm_atomic_helper.h> 10 10 #include <drm/drm_blend.h> 11 - #include <drm/drm_fb_cma_helper.h> 11 + #include <drm/drm_fb_dma_helper.h> 12 12 #include <drm/drm_fourcc.h> 13 13 #include <drm/drm_framebuffer.h> 14 14 #include <drm/drm_gem_atomic_helper.h> ··· 129 129 int x = state->src.x1 >> 16; 130 130 int y = state->src.y1 >> 16; 131 131 132 - cma_obj = drm_fb_cma_get_gem_obj(fb, plane); 132 + cma_obj = drm_fb_dma_get_gem_obj(fb, plane); 133 133 BUG_ON(!cma_obj); 134 134 135 135 return cma_obj->paddr + fb->offsets[plane] + fb->pitches[plane] * y + ··· 145 145 int x = state->src.x1 >> 16; 146 146 int y = state->src.y1 >> 16; 147 147 148 - cma_obj = drm_fb_cma_get_gem_obj(fb, 1); 148 + cma_obj = drm_fb_dma_get_gem_obj(fb, 1); 149 149 BUG_ON(!cma_obj); 150 150 151 151 x /= fb->format->hsub; ··· 164 164 int x = state->src.x1 >> 16; 165 165 int y = state->src.y1 >> 16; 166 166 167 - cma_obj = drm_fb_cma_get_gem_obj(fb, 2); 167 + cma_obj = drm_fb_dma_get_gem_obj(fb, 2); 168 168 BUG_ON(!cma_obj); 169 169 170 170 x /= fb->format->hsub;
+3 -3
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
··· 31 31 #include <drm/drm_drv.h> 32 32 #include <drm/drm_encoder.h> 33 33 #include <drm/drm_gem_cma_helper.h> 34 - #include <drm/drm_fb_cma_helper.h> 34 + #include <drm/drm_fb_dma_helper.h> 35 35 #include <drm/drm_fb_helper.h> 36 36 #include <drm/drm_fourcc.h> 37 37 #include <drm/drm_framebuffer.h> ··· 669 669 670 670 if (newstate && newstate->fb) { 671 671 if (priv->soc_info->map_noncoherent) 672 - drm_fb_cma_sync_non_coherent(&priv->drm, oldstate, newstate); 672 + drm_fb_dma_sync_non_coherent(&priv->drm, oldstate, newstate); 673 673 674 674 crtc_state = newstate->crtc->state; 675 675 plane_id = !!(priv->soc_info->has_osd && plane != &priv->f0); 676 676 677 - addr = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0); 677 + addr = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 0); 678 678 width = newstate->src_w >> 16; 679 679 height = newstate->src_h >> 16; 680 680 cpp = newstate->fb->format->cpp[0];
+5 -5
drivers/gpu/drm/ingenic/ingenic-ipu.c
··· 22 22 #include <drm/drm_atomic_helper.h> 23 23 #include <drm/drm_damage_helper.h> 24 24 #include <drm/drm_drv.h> 25 - #include <drm/drm_fb_cma_helper.h> 25 + #include <drm/drm_fb_dma_helper.h> 26 26 #include <drm/drm_fourcc.h> 27 27 #include <drm/drm_framebuffer.h> 28 28 #include <drm/drm_gem_atomic_helper.h> ··· 362 362 } 363 363 364 364 if (ingenic_drm_map_noncoherent(ipu->master)) 365 - drm_fb_cma_sync_non_coherent(ipu->drm, oldstate, newstate); 365 + drm_fb_dma_sync_non_coherent(ipu->drm, oldstate, newstate); 366 366 367 367 /* New addresses will be committed in vblank handler... */ 368 - ipu->addr_y = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 0); 368 + ipu->addr_y = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 0); 369 369 if (finfo->num_planes > 1) 370 - ipu->addr_u = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 370 + ipu->addr_u = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 371 371 1); 372 372 if (finfo->num_planes > 2) 373 - ipu->addr_v = drm_fb_cma_get_gem_addr(newstate->fb, newstate, 373 + ipu->addr_v = drm_fb_dma_get_gem_addr(newstate->fb, newstate, 374 374 2); 375 375 376 376 if (!needs_modeset)
+4 -4
drivers/gpu/drm/kmb/kmb_plane.c
··· 8 8 #include <drm/drm_blend.h> 9 9 #include <drm/drm_crtc.h> 10 10 #include <drm/drm_crtc_helper.h> 11 - #include <drm/drm_fb_cma_helper.h> 11 + #include <drm/drm_fb_dma_helper.h> 12 12 #include <drm/drm_fb_helper.h> 13 13 #include <drm/drm_fourcc.h> 14 14 #include <drm/drm_framebuffer.h> ··· 403 403 kmb_write_lcd(kmb, LCD_LAYERn_DMA_LINE_WIDTH(plane_id), 404 404 (width * fb->format->cpp[0])); 405 405 406 - addr[Y_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state, 0); 406 + addr[Y_PLANE] = drm_fb_dma_get_gem_addr(fb, new_plane_state, 0); 407 407 kmb_write_lcd(kmb, LCD_LAYERn_DMA_START_ADDR(plane_id), 408 408 addr[Y_PLANE] + fb->offsets[0]); 409 409 val = get_pixel_format(fb->format->format); ··· 415 415 kmb_write_lcd(kmb, LCD_LAYERn_DMA_CB_LINE_WIDTH(plane_id), 416 416 (width * fb->format->cpp[0])); 417 417 418 - addr[U_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state, 418 + addr[U_PLANE] = drm_fb_dma_get_gem_addr(fb, new_plane_state, 419 419 U_PLANE); 420 420 /* check if Cb/Cr is swapped*/ 421 421 if (num_planes == 3 && (val & LCD_LAYER_CRCB_ORDER)) ··· 436 436 LCD_LAYERn_DMA_CR_LINE_WIDTH(plane_id), 437 437 ((width) * fb->format->cpp[0])); 438 438 439 - addr[V_PLANE] = drm_fb_cma_get_gem_addr(fb, 439 + addr[V_PLANE] = drm_fb_dma_get_gem_addr(fb, 440 440 new_plane_state, 441 441 V_PLANE); 442 442
+1 -1
drivers/gpu/drm/logicvc/Kconfig
··· 3 3 depends on DRM 4 4 depends on OF || COMPILE_TEST 5 5 select DRM_KMS_HELPER 6 - select DRM_KMS_CMA_HELPER 6 + select DRM_KMS_DMA_HELPER 7 7 select DRM_GEM_CMA_HELPER 8 8 help 9 9 DRM display driver for the logiCVC programmable logic block from Xylon
+3 -3
drivers/gpu/drm/logicvc/logicvc_layer.c
··· 10 10 #include <drm/drm_atomic.h> 11 11 #include <drm/drm_atomic_helper.h> 12 12 #include <drm/drm_blend.h> 13 - #include <drm/drm_fb_cma_helper.h> 13 + #include <drm/drm_fb_dma_helper.h> 14 14 #include <drm/drm_fourcc.h> 15 15 #include <drm/drm_framebuffer.h> 16 16 #include <drm/drm_plane.h> ··· 157 157 new_state->crtc_h - 1); 158 158 159 159 if (logicvc->caps->layer_address) { 160 - phys_addr_t fb_addr = drm_fb_cma_get_gem_addr(fb, new_state, 0); 160 + phys_addr_t fb_addr = drm_fb_dma_get_gem_addr(fb, new_state, 0); 161 161 162 162 regmap_write(logicvc->regmap, LOGICVC_LAYER_ADDRESS_REG(index), 163 163 fb_addr); ··· 280 280 return -ENOMEM; 281 281 } 282 282 283 - fb_addr = drm_fb_cma_get_gem_addr(fb, state, 0); 283 + fb_addr = drm_fb_dma_get_gem_addr(fb, state, 0); 284 284 if (fb_addr < logicvc->reserved_mem_base) { 285 285 drm_err(drm_dev, 286 286 "Framebuffer memory below reserved memory base!\n");
+3 -3
drivers/gpu/drm/mcde/mcde_display.c
··· 11 11 #include <linux/media-bus-format.h> 12 12 13 13 #include <drm/drm_device.h> 14 - #include <drm/drm_fb_cma_helper.h> 14 + #include <drm/drm_fb_dma_helper.h> 15 15 #include <drm/drm_fourcc.h> 16 16 #include <drm/drm_framebuffer.h> 17 17 #include <drm/drm_gem_atomic_helper.h> ··· 165 165 struct drm_framebuffer *fb = pstate->fb; 166 166 167 167 if (fb) { 168 - u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0); 168 + u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0); 169 169 170 170 /* FB base address must be dword aligned. */ 171 171 if (offset & 3) { ··· 1424 1424 * from the DRM core before the display is enabled. 1425 1425 */ 1426 1426 if (fb) { 1427 - mcde_set_extsrc(mcde, drm_fb_cma_get_gem_addr(fb, pstate, 0)); 1427 + mcde_set_extsrc(mcde, drm_fb_dma_get_gem_addr(fb, pstate, 0)); 1428 1428 dev_info_once(mcde->dev, "first update of display contents\n"); 1429 1429 /* 1430 1430 * Usually the flow is already active, unless we are in
+2 -2
drivers/gpu/drm/mcde/mcde_drv.c
··· 37 37 * (effectively using channels 0..3) for concurrent use. 38 38 * 39 39 * In the current DRM/KMS setup, we use one external source, one overlay, 40 - * one FIFO and one formatter which we connect to the simple CMA framebuffer 40 + * one FIFO and one formatter which we connect to the simple DMA framebuffer 41 41 * helpers. We then provide a bridge to the DSI port, and on the DSI port 42 42 * bridge we connect hang a panel bridge or other bridge. This may be subject 43 43 * to change as we exploit more of the hardware capabilities. ··· 68 68 #include <drm/drm_atomic_helper.h> 69 69 #include <drm/drm_bridge.h> 70 70 #include <drm/drm_drv.h> 71 - #include <drm/drm_fb_cma_helper.h> 71 + #include <drm/drm_fb_dma_helper.h> 72 72 #include <drm/drm_fb_helper.h> 73 73 #include <drm/drm_gem.h> 74 74 #include <drm/drm_gem_cma_helper.h>
+4 -4
drivers/gpu/drm/meson/meson_overlay.c
··· 11 11 #include <drm/drm_atomic_helper.h> 12 12 #include <drm/drm_blend.h> 13 13 #include <drm/drm_device.h> 14 - #include <drm/drm_fb_cma_helper.h> 14 + #include <drm/drm_fb_dma_helper.h> 15 15 #include <drm/drm_fourcc.h> 16 16 #include <drm/drm_framebuffer.h> 17 17 #include <drm/drm_gem_atomic_helper.h> ··· 650 650 651 651 switch (priv->viu.vd1_planes) { 652 652 case 3: 653 - gem = drm_fb_cma_get_gem_obj(fb, 2); 653 + gem = drm_fb_dma_get_gem_obj(fb, 2); 654 654 priv->viu.vd1_addr2 = gem->paddr + fb->offsets[2]; 655 655 priv->viu.vd1_stride2 = fb->pitches[2]; 656 656 priv->viu.vd1_height2 = ··· 662 662 priv->viu.vd1_height2); 663 663 fallthrough; 664 664 case 2: 665 - gem = drm_fb_cma_get_gem_obj(fb, 1); 665 + gem = drm_fb_dma_get_gem_obj(fb, 1); 666 666 priv->viu.vd1_addr1 = gem->paddr + fb->offsets[1]; 667 667 priv->viu.vd1_stride1 = fb->pitches[1]; 668 668 priv->viu.vd1_height1 = ··· 674 674 priv->viu.vd1_height1); 675 675 fallthrough; 676 676 case 1: 677 - gem = drm_fb_cma_get_gem_obj(fb, 0); 677 + gem = drm_fb_dma_get_gem_obj(fb, 0); 678 678 priv->viu.vd1_addr0 = gem->paddr + fb->offsets[0]; 679 679 priv->viu.vd1_stride0 = fb->pitches[0]; 680 680 priv->viu.vd1_height0 =
+2 -2
drivers/gpu/drm/meson/meson_plane.c
··· 15 15 #include <drm/drm_atomic_helper.h> 16 16 #include <drm/drm_blend.h> 17 17 #include <drm/drm_device.h> 18 - #include <drm/drm_fb_cma_helper.h> 18 + #include <drm/drm_fb_dma_helper.h> 19 19 #include <drm/drm_fourcc.h> 20 20 #include <drm/drm_framebuffer.h> 21 21 #include <drm/drm_gem_atomic_helper.h> ··· 365 365 } 366 366 367 367 /* Update Canvas with buffer address */ 368 - gem = drm_fb_cma_get_gem_obj(fb, 0); 368 + gem = drm_fb_dma_get_gem_obj(fb, 0); 369 369 370 370 priv->viu.osd1_addr = gem->paddr; 371 371 priv->viu.osd1_stride = fb->pitches[0];
+3 -3
drivers/gpu/drm/mxsfb/lcdif_kms.c
··· 18 18 #include <drm/drm_crtc.h> 19 19 #include <drm/drm_encoder.h> 20 20 #include <drm/drm_framebuffer.h> 21 - #include <drm/drm_fb_cma_helper.h> 21 + #include <drm/drm_fb_dma_helper.h> 22 22 #include <drm/drm_fourcc.h> 23 23 #include <drm/drm_gem_atomic_helper.h> 24 24 #include <drm/drm_gem_cma_helper.h> ··· 296 296 lcdif_crtc_mode_set_nofb(lcdif, bridge_state, bus_format); 297 297 298 298 /* Write cur_buf as well to avoid an initial corrupt frame */ 299 - paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); 299 + paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); 300 300 if (paddr) { 301 301 writel(lower_32_bits(paddr), 302 302 lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4); ··· 405 405 plane); 406 406 dma_addr_t paddr; 407 407 408 - paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); 408 + paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); 409 409 if (paddr) { 410 410 writel(lower_32_bits(paddr), 411 411 lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4);
+4 -4
drivers/gpu/drm/mxsfb/mxsfb_kms.c
··· 20 20 #include <drm/drm_bridge.h> 21 21 #include <drm/drm_crtc.h> 22 22 #include <drm/drm_encoder.h> 23 - #include <drm/drm_fb_cma_helper.h> 23 + #include <drm/drm_fb_dma_helper.h> 24 24 #include <drm/drm_fourcc.h> 25 25 #include <drm/drm_framebuffer.h> 26 26 #include <drm/drm_gem_atomic_helper.h> ··· 388 388 mxsfb_crtc_mode_set_nofb(mxsfb, bridge_state, bus_format); 389 389 390 390 /* Write cur_buf as well to avoid an initial corrupt frame */ 391 - paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); 391 + paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); 392 392 if (paddr) { 393 393 writel(paddr, mxsfb->base + mxsfb->devdata->cur_buf); 394 394 writel(paddr, mxsfb->base + mxsfb->devdata->next_buf); ··· 543 543 plane); 544 544 dma_addr_t paddr; 545 545 546 - paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); 546 + paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); 547 547 if (paddr) 548 548 writel(paddr, mxsfb->base + mxsfb->devdata->next_buf); 549 549 } ··· 559 559 dma_addr_t paddr; 560 560 u32 ctrl; 561 561 562 - paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); 562 + paddr = drm_fb_dma_get_gem_addr(new_pstate->fb, new_pstate, 0); 563 563 if (!paddr) { 564 564 writel(0, mxsfb->base + LCDC_AS_CTRL); 565 565 return;
+3 -3
drivers/gpu/drm/pl111/pl111_display.c
··· 15 15 #include <linux/media-bus-format.h> 16 16 #include <linux/of_graph.h> 17 17 18 - #include <drm/drm_fb_cma_helper.h> 18 + #include <drm/drm_fb_dma_helper.h> 19 19 #include <drm/drm_fourcc.h> 20 20 #include <drm/drm_framebuffer.h> 21 21 #include <drm/drm_gem_atomic_helper.h> ··· 94 94 return -EINVAL; 95 95 96 96 if (fb) { 97 - u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0); 97 + u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0); 98 98 99 99 /* FB base address must be dword aligned. */ 100 100 if (offset & 3) ··· 398 398 struct drm_framebuffer *fb = pstate->fb; 399 399 400 400 if (fb) { 401 - u32 addr = drm_fb_cma_get_gem_addr(fb, pstate, 0); 401 + u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0); 402 402 403 403 writel(addr, priv->regs + CLCD_UBAS); 404 404 }
+2 -2
drivers/gpu/drm/rcar-du/rcar_du_plane.c
··· 12 12 #include <drm/drm_blend.h> 13 13 #include <drm/drm_crtc.h> 14 14 #include <drm/drm_device.h> 15 - #include <drm/drm_fb_cma_helper.h> 15 + #include <drm/drm_fb_dma_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> 18 18 #include <drm/drm_gem_cma_helper.h> ··· 350 350 pitch = fb->pitches[0] * 8 / state->format->bpp; 351 351 352 352 for (i = 0; i < state->format->planes; ++i) { 353 - gem = drm_fb_cma_get_gem_obj(fb, i); 353 + gem = drm_fb_dma_get_gem_obj(fb, i); 354 354 dma[i] = gem->paddr + fb->offsets[i]; 355 355 } 356 356 } else {
+2 -2
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
··· 11 11 #include <drm/drm_atomic_helper.h> 12 12 #include <drm/drm_blend.h> 13 13 #include <drm/drm_crtc.h> 14 - #include <drm/drm_fb_cma_helper.h> 14 + #include <drm/drm_fb_dma_helper.h> 15 15 #include <drm/drm_fourcc.h> 16 16 #include <drm/drm_framebuffer.h> 17 17 #include <drm/drm_gem_atomic_helper.h> ··· 183 183 int ret; 184 184 185 185 for (i = 0; i < fb->format->num_planes; ++i) { 186 - struct drm_gem_cma_object *gem = drm_fb_cma_get_gem_obj(fb, i); 186 + struct drm_gem_cma_object *gem = drm_fb_dma_get_gem_obj(fb, i); 187 187 struct sg_table *sgt = &sg_tables[i]; 188 188 189 189 if (gem->sgt) {
+3 -3
drivers/gpu/drm/shmobile/shmob_drm_crtc.c
··· 12 12 13 13 #include <drm/drm_crtc.h> 14 14 #include <drm/drm_crtc_helper.h> 15 - #include <drm/drm_fb_cma_helper.h> 15 + #include <drm/drm_fb_dma_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> 18 18 #include <drm/drm_gem_cma_helper.h> ··· 292 292 unsigned int bpp; 293 293 294 294 bpp = scrtc->format->yuv ? 8 : scrtc->format->bpp; 295 - gem = drm_fb_cma_get_gem_obj(fb, 0); 295 + gem = drm_fb_dma_get_gem_obj(fb, 0); 296 296 scrtc->dma[0] = gem->paddr + fb->offsets[0] 297 297 + y * fb->pitches[0] + x * bpp / 8; 298 298 299 299 if (scrtc->format->yuv) { 300 300 bpp = scrtc->format->bpp - 8; 301 - gem = drm_fb_cma_get_gem_obj(fb, 1); 301 + gem = drm_fb_dma_get_gem_obj(fb, 1); 302 302 scrtc->dma[1] = gem->paddr + fb->offsets[1] 303 303 + y / (bpp == 4 ? 2 : 1) * fb->pitches[1] 304 304 + x * (bpp == 16 ? 2 : 1);
+3 -3
drivers/gpu/drm/shmobile/shmob_drm_plane.c
··· 9 9 10 10 #include <drm/drm_crtc.h> 11 11 #include <drm/drm_crtc_helper.h> 12 - #include <drm/drm_fb_cma_helper.h> 12 + #include <drm/drm_fb_dma_helper.h> 13 13 #include <drm/drm_fourcc.h> 14 14 #include <drm/drm_framebuffer.h> 15 15 #include <drm/drm_gem_cma_helper.h> ··· 45 45 unsigned int bpp; 46 46 47 47 bpp = splane->format->yuv ? 8 : splane->format->bpp; 48 - gem = drm_fb_cma_get_gem_obj(fb, 0); 48 + gem = drm_fb_dma_get_gem_obj(fb, 0); 49 49 splane->dma[0] = gem->paddr + fb->offsets[0] 50 50 + y * fb->pitches[0] + x * bpp / 8; 51 51 52 52 if (splane->format->yuv) { 53 53 bpp = splane->format->bpp - 8; 54 - gem = drm_fb_cma_get_gem_obj(fb, 1); 54 + gem = drm_fb_dma_get_gem_obj(fb, 1); 55 55 splane->dma[1] = gem->paddr + fb->offsets[1] 56 56 + y / (bpp == 4 ? 2 : 1) * fb->pitches[1] 57 57 + x * (bpp == 16 ? 2 : 1);
+2 -2
drivers/gpu/drm/sprd/sprd_dpu.c
··· 19 19 #include <drm/drm_atomic_helper.h> 20 20 #include <drm/drm_blend.h> 21 21 #include <drm/drm_crtc_helper.h> 22 - #include <drm/drm_fb_cma_helper.h> 22 + #include <drm/drm_fb_dma_helper.h> 23 23 #include <drm/drm_framebuffer.h> 24 24 #include <drm/drm_gem_cma_helper.h> 25 25 #include <drm/drm_gem_framebuffer_helper.h> ··· 340 340 size = (src_w & 0xffff) | (src_h << 16); 341 341 342 342 for (i = 0; i < fb->format->num_planes; i++) { 343 - cma_obj = drm_fb_cma_get_gem_obj(fb, i); 343 + cma_obj = drm_fb_dma_get_gem_obj(fb, i); 344 344 addr = cma_obj->paddr + fb->offsets[i]; 345 345 346 346 if (i == 0)
+3 -3
drivers/gpu/drm/sti/sti_cursor.c
··· 11 11 12 12 #include <drm/drm_atomic.h> 13 13 #include <drm/drm_device.h> 14 - #include <drm/drm_fb_cma_helper.h> 14 + #include <drm/drm_fb_dma_helper.h> 15 15 #include <drm/drm_framebuffer.h> 16 16 #include <drm/drm_gem_cma_helper.h> 17 17 ··· 243 243 } 244 244 } 245 245 246 - if (!drm_fb_cma_get_gem_obj(fb, 0)) { 246 + if (!drm_fb_dma_get_gem_obj(fb, 0)) { 247 247 DRM_ERROR("Can't get CMA GEM object for fb\n"); 248 248 return -EINVAL; 249 249 } ··· 278 278 dst_x = newstate->crtc_x; 279 279 dst_y = newstate->crtc_y; 280 280 281 - cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 281 + cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 282 282 283 283 /* Convert ARGB8888 to CLUT8 */ 284 284 sti_cursor_argb8888_to_clut8(cursor, (u32 *)cma_obj->vaddr);
+3 -3
drivers/gpu/drm/sti/sti_gdp.c
··· 12 12 13 13 #include <drm/drm_atomic.h> 14 14 #include <drm/drm_device.h> 15 - #include <drm/drm_fb_cma_helper.h> 15 + #include <drm/drm_fb_dma_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> 18 18 #include <drm/drm_gem_cma_helper.h> ··· 658 658 return -EINVAL; 659 659 } 660 660 661 - if (!drm_fb_cma_get_gem_obj(fb, 0)) { 661 + if (!drm_fb_dma_get_gem_obj(fb, 0)) { 662 662 DRM_ERROR("Can't get CMA GEM object for fb\n"); 663 663 return -EINVAL; 664 664 } ··· 778 778 top_field->gam_gdp_ctl |= sti_gdp_get_alpharange(format); 779 779 top_field->gam_gdp_ppt &= ~GAM_GDP_PPT_IGNORE; 780 780 781 - cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 781 + cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 782 782 783 783 DRM_DEBUG_DRIVER("drm FB:%d format:%.4s phys@:0x%lx\n", fb->base.id, 784 784 (char *)&fb->format->format,
+3 -3
drivers/gpu/drm/sti/sti_hqvdp.c
··· 16 16 17 17 #include <drm/drm_atomic.h> 18 18 #include <drm/drm_device.h> 19 - #include <drm/drm_fb_cma_helper.h> 19 + #include <drm/drm_fb_dma_helper.h> 20 20 #include <drm/drm_fourcc.h> 21 21 #include <drm/drm_framebuffer.h> 22 22 #include <drm/drm_gem_cma_helper.h> ··· 1055 1055 return -EINVAL; 1056 1056 } 1057 1057 1058 - if (!drm_fb_cma_get_gem_obj(fb, 0)) { 1058 + if (!drm_fb_dma_get_gem_obj(fb, 0)) { 1059 1059 DRM_ERROR("Can't get CMA GEM object for fb\n"); 1060 1060 return -EINVAL; 1061 1061 } ··· 1178 1178 cmd->iqi.sat_gain = IQI_SAT_GAIN_DFLT; 1179 1179 cmd->iqi.pxf_conf = IQI_PXF_CONF_DFLT; 1180 1180 1181 - cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 1181 + cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 1182 1182 1183 1183 DRM_DEBUG_DRIVER("drm FB:%d format:%.4s phys@:0x%lx\n", fb->base.id, 1184 1184 (char *)&fb->format->format,
+7 -7
drivers/gpu/drm/stm/ltdc.c
··· 28 28 #include <drm/drm_bridge.h> 29 29 #include <drm/drm_device.h> 30 30 #include <drm/drm_edid.h> 31 - #include <drm/drm_fb_cma_helper.h> 31 + #include <drm/drm_fb_dma_helper.h> 32 32 #include <drm/drm_fourcc.h> 33 33 #include <drm/drm_framebuffer.h> 34 34 #include <drm/drm_gem_atomic_helper.h> ··· 1346 1346 } 1347 1347 1348 1348 /* Sets the FB address */ 1349 - paddr = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 0); 1349 + paddr = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 0); 1350 1350 1351 1351 if (newstate->rotation & DRM_MODE_REFLECT_X) 1352 1352 paddr += (fb->format->cpp[0] * (x1 - x0 + 1)) - 1; ··· 1380 1380 case DRM_FORMAT_NV12: 1381 1381 case DRM_FORMAT_NV21: 1382 1382 /* Configure the auxiliary frame buffer address 0 */ 1383 - paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1); 1383 + paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1); 1384 1384 1385 1385 if (newstate->rotation & DRM_MODE_REFLECT_X) 1386 1386 paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1; ··· 1392 1392 break; 1393 1393 case DRM_FORMAT_YUV420: 1394 1394 /* Configure the auxiliary frame buffer address 0 & 1 */ 1395 - paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1); 1396 - paddr2 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 2); 1395 + paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1); 1396 + paddr2 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 2); 1397 1397 1398 1398 if (newstate->rotation & DRM_MODE_REFLECT_X) { 1399 1399 paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1; ··· 1410 1410 break; 1411 1411 case DRM_FORMAT_YVU420: 1412 1412 /* Configure the auxiliary frame buffer address 0 & 1 */ 1413 - paddr1 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 2); 1414 - paddr2 = (u32)drm_fb_cma_get_gem_addr(fb, newstate, 1); 1413 + paddr1 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 2); 1414 + paddr2 = (u32)drm_fb_dma_get_gem_addr(fb, newstate, 1); 1415 1415 1416 1416 if (newstate->rotation & DRM_MODE_REFLECT_X) { 1417 1417 paddr1 += ((fb->format->cpp[1] * (x1 - x0 + 1)) >> 1) - 1;
+2 -2
drivers/gpu/drm/sun4i/sun4i_backend.c
··· 19 19 #include <drm/drm_atomic_helper.h> 20 20 #include <drm/drm_blend.h> 21 21 #include <drm/drm_crtc.h> 22 - #include <drm/drm_fb_cma_helper.h> 22 + #include <drm/drm_fb_dma_helper.h> 23 23 #include <drm/drm_fourcc.h> 24 24 #include <drm/drm_framebuffer.h> 25 25 #include <drm/drm_gem_cma_helper.h> ··· 338 338 fb->pitches[0] * 8); 339 339 340 340 /* Get the start of the displayed memory */ 341 - paddr = drm_fb_cma_get_gem_addr(fb, state, 0); 341 + paddr = drm_fb_dma_get_gem_addr(fb, state, 0); 342 342 DRM_DEBUG_DRIVER("Setting buffer address to %pad\n", &paddr); 343 343 344 344 if (fb->format->is_yuv)
+4 -4
drivers/gpu/drm/sun4i/sun4i_frontend.c
··· 14 14 #include <linux/reset.h> 15 15 16 16 #include <drm/drm_device.h> 17 - #include <drm/drm_fb_cma_helper.h> 17 + #include <drm/drm_fb_dma_helper.h> 18 18 #include <drm/drm_fourcc.h> 19 19 #include <drm/drm_framebuffer.h> 20 20 #include <drm/drm_gem_cma_helper.h> ··· 221 221 swap = sun4i_frontend_format_chroma_requires_swap(fb->format->format); 222 222 223 223 /* Set the physical address of the buffer in memory */ 224 - paddr = drm_fb_cma_get_gem_addr(fb, state, 0); 224 + paddr = drm_fb_dma_get_gem_addr(fb, state, 0); 225 225 DRM_DEBUG_DRIVER("Setting buffer #0 address to %pad\n", &paddr); 226 226 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR0_REG, paddr); 227 227 228 228 if (fb->format->num_planes > 1) { 229 - paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 2 : 1); 229 + paddr = drm_fb_dma_get_gem_addr(fb, state, swap ? 2 : 1); 230 230 DRM_DEBUG_DRIVER("Setting buffer #1 address to %pad\n", &paddr); 231 231 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR1_REG, 232 232 paddr); 233 233 } 234 234 235 235 if (fb->format->num_planes > 2) { 236 - paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 1 : 2); 236 + paddr = drm_fb_dma_get_gem_addr(fb, state, swap ? 1 : 2); 237 237 DRM_DEBUG_DRIVER("Setting buffer #2 address to %pad\n", &paddr); 238 238 regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR2_REG, 239 239 paddr);
+2 -2
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
··· 13 13 #include <drm/drm_atomic_helper.h> 14 14 #include <drm/drm_blend.h> 15 15 #include <drm/drm_crtc.h> 16 - #include <drm/drm_fb_cma_helper.h> 16 + #include <drm/drm_fb_dma_helper.h> 17 17 #include <drm/drm_fourcc.h> 18 18 #include <drm/drm_framebuffer.h> 19 19 #include <drm/drm_gem_atomic_helper.h> ··· 200 200 ch_base = sun8i_channel_base(mixer, channel); 201 201 202 202 /* Get the physical address of the buffer in memory */ 203 - gem = drm_fb_cma_get_gem_obj(fb, 0); 203 + gem = drm_fb_dma_get_gem_obj(fb, 0); 204 204 205 205 DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr); 206 206
+2 -2
drivers/gpu/drm/sun4i/sun8i_vi_layer.c
··· 7 7 #include <drm/drm_atomic_helper.h> 8 8 #include <drm/drm_blend.h> 9 9 #include <drm/drm_crtc.h> 10 - #include <drm/drm_fb_cma_helper.h> 10 + #include <drm/drm_fb_dma_helper.h> 11 11 #include <drm/drm_framebuffer.h> 12 12 #include <drm/drm_gem_atomic_helper.h> 13 13 #include <drm/drm_gem_cma_helper.h> ··· 322 322 323 323 for (i = 0; i < format->num_planes; i++) { 324 324 /* Get the physical address of the buffer in memory */ 325 - gem = drm_fb_cma_get_gem_obj(fb, i); 325 + gem = drm_fb_dma_get_gem_obj(fb, i); 326 326 327 327 DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr); 328 328
+1 -1
drivers/gpu/drm/tegra/fb.c
··· 3 3 * Copyright (C) 2012-2013 Avionic Design GmbH 4 4 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. 5 5 * 6 - * Based on the KMS/FB CMA helpers 6 + * Based on the KMS/FB DMA helpers 7 7 * Copyright (C) 2012 Analog Devices Inc. 8 8 */ 9 9
+3 -3
drivers/gpu/drm/tidss/tidss_dispc.c
··· 24 24 25 25 #include <drm/drm_blend.h> 26 26 #include <drm/drm_fourcc.h> 27 - #include <drm/drm_fb_cma_helper.h> 27 + #include <drm/drm_fb_dma_helper.h> 28 28 #include <drm/drm_framebuffer.h> 29 29 #include <drm/drm_gem_cma_helper.h> 30 30 #include <drm/drm_panel.h> ··· 1961 1961 u32 x = state->src_x >> 16; 1962 1962 u32 y = state->src_y >> 16; 1963 1963 1964 - gem = drm_fb_cma_get_gem_obj(state->fb, 0); 1964 + gem = drm_fb_dma_get_gem_obj(state->fb, 0); 1965 1965 1966 1966 return gem->paddr + fb->offsets[0] + x * fb->format->cpp[0] + 1967 1967 y * fb->pitches[0]; ··· 1978 1978 if (WARN_ON(state->fb->format->num_planes != 2)) 1979 1979 return 0; 1980 1980 1981 - gem = drm_fb_cma_get_gem_obj(fb, 1); 1981 + gem = drm_fb_dma_get_gem_obj(fb, 1); 1982 1982 1983 1983 return gem->paddr + fb->offsets[1] + 1984 1984 (x * fb->format->cpp[1] / fb->format->hsub) +
+2 -2
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
··· 12 12 #include <drm/drm_atomic.h> 13 13 #include <drm/drm_atomic_helper.h> 14 14 #include <drm/drm_crtc.h> 15 - #include <drm/drm_fb_cma_helper.h> 15 + #include <drm/drm_fb_dma_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> 18 18 #include <drm/drm_gem_cma_helper.h> ··· 68 68 dma_addr_t start, end; 69 69 u64 dma_base_and_ceiling; 70 70 71 - gem = drm_fb_cma_get_gem_obj(fb, 0); 71 + gem = drm_fb_dma_get_gem_obj(fb, 0); 72 72 73 73 start = gem->paddr + fb->offsets[0] + 74 74 crtc->y * fb->pitches[0] +
+2 -2
drivers/gpu/drm/tiny/arcpgu.c
··· 11 11 #include <drm/drm_device.h> 12 12 #include <drm/drm_drv.h> 13 13 #include <drm/drm_edid.h> 14 - #include <drm/drm_fb_cma_helper.h> 14 + #include <drm/drm_fb_dma_helper.h> 15 15 #include <drm/drm_fb_helper.h> 16 16 #include <drm/drm_fourcc.h> 17 17 #include <drm/drm_framebuffer.h> ··· 226 226 return; 227 227 228 228 arcpgu = pipe_to_arcpgu_priv(pipe); 229 - gem = drm_fb_cma_get_gem_obj(pipe->plane.state->fb, 0); 229 + gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0); 230 230 arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr); 231 231 } 232 232
+2 -2
drivers/gpu/drm/tiny/ili9225.c
··· 19 19 #include <drm/drm_atomic_helper.h> 20 20 #include <drm/drm_damage_helper.h> 21 21 #include <drm/drm_drv.h> 22 - #include <drm/drm_fb_cma_helper.h> 22 + #include <drm/drm_fb_dma_helper.h> 23 23 #include <drm/drm_fb_helper.h> 24 24 #include <drm/drm_fourcc.h> 25 25 #include <drm/drm_framebuffer.h> ··· 78 78 79 79 static void ili9225_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) 80 80 { 81 - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 81 + struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 82 82 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev); 83 83 unsigned int height = rect->y2 - rect->y1; 84 84 unsigned int width = rect->x2 - rect->x1;
+2 -2
drivers/gpu/drm/tiny/repaper.c
··· 25 25 #include <drm/drm_connector.h> 26 26 #include <drm/drm_damage_helper.h> 27 27 #include <drm/drm_drv.h> 28 - #include <drm/drm_fb_cma_helper.h> 28 + #include <drm/drm_fb_dma_helper.h> 29 29 #include <drm/drm_fb_helper.h> 30 30 #include <drm/drm_format_helper.h> 31 31 #include <drm/drm_framebuffer.h> ··· 511 511 512 512 static int repaper_fb_dirty(struct drm_framebuffer *fb) 513 513 { 514 - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 514 + struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 515 515 struct repaper_epd *epd = drm_to_epd(fb->dev); 516 516 struct drm_rect clip; 517 517 int idx, ret = 0;
+2 -2
drivers/gpu/drm/tiny/st7586.c
··· 15 15 #include <drm/drm_atomic_helper.h> 16 16 #include <drm/drm_damage_helper.h> 17 17 #include <drm/drm_drv.h> 18 - #include <drm/drm_fb_cma_helper.h> 18 + #include <drm/drm_fb_dma_helper.h> 19 19 #include <drm/drm_fb_helper.h> 20 20 #include <drm/drm_format_helper.h> 21 21 #include <drm/drm_framebuffer.h> ··· 92 92 static int st7586_buf_copy(void *dst, struct drm_framebuffer *fb, 93 93 struct drm_rect *clip) 94 94 { 95 - struct drm_gem_cma_object *cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 95 + struct drm_gem_cma_object *cma_obj = drm_fb_dma_get_gem_obj(fb, 0); 96 96 void *src = cma_obj->vaddr; 97 97 int ret = 0; 98 98
+5 -5
drivers/gpu/drm/tve200/tve200_display.c
··· 15 15 #include <linux/of_graph.h> 16 16 #include <linux/delay.h> 17 17 18 - #include <drm/drm_fb_cma_helper.h> 18 + #include <drm/drm_fb_dma_helper.h> 19 19 #include <drm/drm_fourcc.h> 20 20 #include <drm/drm_framebuffer.h> 21 21 #include <drm/drm_gem_atomic_helper.h> ··· 90 90 } 91 91 92 92 if (fb) { 93 - u32 offset = drm_fb_cma_get_gem_addr(fb, pstate, 0); 93 + u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0); 94 94 95 95 /* FB base address must be dword aligned. */ 96 96 if (offset & 3) { ··· 267 267 268 268 if (fb) { 269 269 /* For RGB, the Y component is used as base address */ 270 - writel(drm_fb_cma_get_gem_addr(fb, pstate, 0), 270 + writel(drm_fb_dma_get_gem_addr(fb, pstate, 0), 271 271 priv->regs + TVE200_Y_FRAME_BASE_ADDR); 272 272 273 273 /* For three plane YUV we need two more addresses */ 274 274 if (fb->format->format == DRM_FORMAT_YUV420) { 275 - writel(drm_fb_cma_get_gem_addr(fb, pstate, 1), 275 + writel(drm_fb_dma_get_gem_addr(fb, pstate, 1), 276 276 priv->regs + TVE200_U_FRAME_BASE_ADDR); 277 - writel(drm_fb_cma_get_gem_addr(fb, pstate, 2), 277 + writel(drm_fb_dma_get_gem_addr(fb, pstate, 2), 278 278 priv->regs + TVE200_V_FRAME_BASE_ADDR); 279 279 } 280 280 }
+4 -4
drivers/gpu/drm/vc4/vc4_crtc.c
··· 37 37 #include <drm/drm_atomic.h> 38 38 #include <drm/drm_atomic_helper.h> 39 39 #include <drm/drm_atomic_uapi.h> 40 - #include <drm/drm_fb_cma_helper.h> 40 + #include <drm/drm_fb_dma_helper.h> 41 41 #include <drm/drm_framebuffer.h> 42 42 #include <drm/drm_print.h> 43 43 #include <drm/drm_probe_helper.h> ··· 824 824 825 825 if (flip_state->old_fb) { 826 826 struct drm_gem_cma_object *cma_bo = 827 - drm_fb_cma_get_gem_obj(flip_state->old_fb, 0); 827 + drm_fb_dma_get_gem_obj(flip_state->old_fb, 0); 828 828 bo = to_vc4_bo(&cma_bo->base); 829 829 } 830 830 ··· 857 857 struct vc4_async_flip_state *flip_state) 858 858 { 859 859 struct drm_framebuffer *fb = flip_state->fb; 860 - struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); 860 + struct drm_gem_cma_object *cma_bo = drm_fb_dma_get_gem_obj(fb, 0); 861 861 struct vc4_dev *vc4 = to_vc4_dev(dev); 862 862 struct dma_fence *fence; 863 863 int ret; ··· 945 945 { 946 946 struct drm_device *dev = crtc->dev; 947 947 struct vc4_dev *vc4 = to_vc4_dev(dev); 948 - struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); 948 + struct drm_gem_cma_object *cma_bo = drm_fb_dma_get_gem_obj(fb, 0); 949 949 struct vc4_bo *bo = to_vc4_bo(&cma_bo->base); 950 950 int ret; 951 951
+5 -5
drivers/gpu/drm/vc4/vc4_plane.c
··· 19 19 #include <drm/drm_atomic_helper.h> 20 20 #include <drm/drm_atomic_uapi.h> 21 21 #include <drm/drm_blend.h> 22 - #include <drm/drm_fb_cma_helper.h> 22 + #include <drm/drm_fb_dma_helper.h> 23 23 #include <drm/drm_fourcc.h> 24 24 #include <drm/drm_framebuffer.h> 25 25 #include <drm/drm_gem_atomic_helper.h> ··· 339 339 { 340 340 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); 341 341 struct drm_framebuffer *fb = state->fb; 342 - struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); 342 + struct drm_gem_cma_object *bo = drm_fb_dma_get_gem_obj(fb, 0); 343 343 int num_planes = fb->format->num_planes; 344 344 struct drm_crtc_state *crtc_state; 345 345 u32 h_subsample = fb->format->hsub; ··· 1243 1243 void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) 1244 1244 { 1245 1245 struct vc4_plane_state *vc4_state = to_vc4_plane_state(plane->state); 1246 - struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); 1246 + struct drm_gem_cma_object *bo = drm_fb_dma_get_gem_obj(fb, 0); 1247 1247 uint32_t addr; 1248 1248 1249 1249 /* We're skipping the address adjustment for negative origin, ··· 1387 1387 if (!state->fb) 1388 1388 return 0; 1389 1389 1390 - bo = to_vc4_bo(&drm_fb_cma_get_gem_obj(state->fb, 0)->base); 1390 + bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base); 1391 1391 1392 1392 drm_gem_plane_helper_prepare_fb(plane, state); 1393 1393 ··· 1405 1405 if (plane->state->fb == state->fb || !state->fb) 1406 1406 return; 1407 1407 1408 - bo = to_vc4_bo(&drm_fb_cma_get_gem_obj(state->fb, 0)->base); 1408 + bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base); 1409 1409 vc4_bo_dec_usecnt(bo); 1410 1410 } 1411 1411
+2 -2
drivers/gpu/drm/vc4/vc4_txp.c
··· 17 17 #include <drm/drm_atomic_helper.h> 18 18 #include <drm/drm_drv.h> 19 19 #include <drm/drm_edid.h> 20 - #include <drm/drm_fb_cma_helper.h> 20 + #include <drm/drm_fb_dma_helper.h> 21 21 #include <drm/drm_fourcc.h> 22 22 #include <drm/drm_framebuffer.h> 23 23 #include <drm/drm_panel.h> ··· 317 317 if (!drm_dev_enter(drm, &idx)) 318 318 return; 319 319 320 - gem = drm_fb_cma_get_gem_obj(fb, 0); 320 + gem = drm_fb_dma_get_gem_obj(fb, 0); 321 321 TXP_WRITE(TXP_DST_PTR, gem->paddr + fb->offsets[0]); 322 322 TXP_WRITE(TXP_DST_PITCH, fb->pitches[0]); 323 323 TXP_WRITE(TXP_DIM,
+2 -2
drivers/gpu/drm/xlnx/zynqmp_disp.c
··· 15 15 #include <drm/drm_blend.h> 16 16 #include <drm/drm_crtc.h> 17 17 #include <drm/drm_device.h> 18 - #include <drm/drm_fb_cma_helper.h> 18 + #include <drm/drm_fb_dma_helper.h> 19 19 #include <drm/drm_fourcc.h> 20 20 #include <drm/drm_framebuffer.h> 21 21 #include <drm/drm_managed.h> ··· 1100 1100 struct dma_async_tx_descriptor *desc; 1101 1101 dma_addr_t paddr; 1102 1102 1103 - paddr = drm_fb_cma_get_gem_addr(state->fb, state, i); 1103 + paddr = drm_fb_dma_get_gem_addr(state->fb, state, i); 1104 1104 1105 1105 dma->xt.numf = height; 1106 1106 dma->sgl.size = width * info->cpp[i];
+5 -5
include/drm/drm_fb_cma_helper.h include/drm/drm_fb_dma_helper.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __DRM_FB_CMA_HELPER_H__ 3 - #define __DRM_FB_CMA_HELPER_H__ 2 + #ifndef __DRM_FB_DMA_HELPER_H__ 3 + #define __DRM_FB_DMA_HELPER_H__ 4 4 5 5 #include <linux/types.h> 6 6 ··· 8 8 struct drm_framebuffer; 9 9 struct drm_plane_state; 10 10 11 - struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, 11 + struct drm_gem_cma_object *drm_fb_dma_get_gem_obj(struct drm_framebuffer *fb, 12 12 unsigned int plane); 13 13 14 - dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, 14 + dma_addr_t drm_fb_dma_get_gem_addr(struct drm_framebuffer *fb, 15 15 struct drm_plane_state *state, 16 16 unsigned int plane); 17 17 18 - void drm_fb_cma_sync_non_coherent(struct drm_device *drm, 18 + void drm_fb_dma_sync_non_coherent(struct drm_device *drm, 19 19 struct drm_plane_state *old_state, 20 20 struct drm_plane_state *state); 21 21