diff options
author | Danilo Krummrich <dakr@redhat.com> | 2022-08-02 02:04:03 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2022-08-03 18:31:49 +0200 |
commit | 4a83c26a1d8702c516db77fc4423ae896ee904f1 (patch) | |
tree | 49f446a2b2c46d999f785a69a11a3f8ac6de31e1 /drivers/gpu/drm/sti | |
parent | drm/fb: rename FB CMA helpers to FB DMA helpers (diff) | |
download | linux-4a83c26a1d8702c516db77fc4423ae896ee904f1.tar.xz linux-4a83c26a1d8702c516db77fc4423ae896ee904f1.zip |
drm/gem: rename GEM CMA helpers to GEM DMA helpers
Rename "GEM CMA" helpers to "GEM DMA" helpers - considering the
hierarchy of APIs (mm/cma -> dma -> gem dma) calling them "GEM
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}*)(GEM)_CMA_(${REGEX_SYM_UPPER}*)"
REGEX_GREP_LOWER="(${REGEX_SYM_LOWER}*)(gem)_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
# Rename all 'cma_obj's to 'dma_obj'.
for ff in $(grep -RiHl "cma_obj" $DIRS)
do
sed -i -E "s/cma_obj/dma_obj/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 "GEM CMA", but not "FB CMA".
Also drivers/gpu/drm/Makefile was fixed up manually after renaming
drm_gem_cma_helper.c to drm_gem_dma_helper.c.
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-4-dakr@redhat.com
Diffstat (limited to 'drivers/gpu/drm/sti')
-rw-r--r-- | drivers/gpu/drm/sti/Kconfig | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_cursor.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_drv.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_gdp.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_hqvdp.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_plane.c | 2 |
6 files changed, 24 insertions, 24 deletions
diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig index 246a94afbe74..f2a880c48485 100644 --- a/drivers/gpu/drm/sti/Kconfig +++ b/drivers/gpu/drm/sti/Kconfig @@ -4,7 +4,7 @@ config DRM_STI depends on OF && DRM && (ARCH_STI || ARCH_MULTIPLATFORM) select RESET_CONTROLLER select DRM_KMS_HELPER - select DRM_GEM_CMA_HELPER + select DRM_GEM_DMA_HELPER select DRM_PANEL select FW_LOADER select SND_SOC_HDMI_CODEC if SND_SOC diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index d374fa50be60..db0a1eb53532 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -13,7 +13,7 @@ #include <drm/drm_device.h> #include <drm/drm_fb_dma_helper.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_dma_helper.h> #include "sti_compositor.h" #include "sti_cursor.h" @@ -244,7 +244,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane, } if (!drm_fb_dma_get_gem_obj(fb, 0)) { - DRM_ERROR("Can't get CMA GEM object for fb\n"); + DRM_ERROR("Can't get DMA GEM object for fb\n"); return -EINVAL; } @@ -267,7 +267,7 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane, struct drm_framebuffer *fb = newstate->fb; struct drm_display_mode *mode; int dst_x, dst_y; - struct drm_gem_cma_object *cma_obj; + struct drm_gem_dma_object *dma_obj; u32 y, x; u32 val; @@ -278,10 +278,10 @@ 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_dma_get_gem_obj(fb, 0); + dma_obj = drm_fb_dma_get_gem_obj(fb, 0); /* Convert ARGB8888 to CLUT8 */ - sti_cursor_argb8888_to_clut8(cursor, (u32 *)cma_obj->vaddr); + sti_cursor_argb8888_to_clut8(cursor, (u32 *)dma_obj->vaddr); /* AWS and AWE depend on the mode */ y = sti_vtg_get_line_number(*mode, 0); diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index c0fbdb8cf6eb..7abf010a3293 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -15,7 +15,7 @@ #include <drm/drm_debugfs.h> #include <drm/drm_drv.h> #include <drm/drm_fb_helper.h> -#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_dma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include <drm/drm_probe_helper.h> @@ -127,12 +127,12 @@ static void sti_mode_config_init(struct drm_device *dev) dev->mode_config.normalize_zpos = true; } -DEFINE_DRM_GEM_CMA_FOPS(sti_driver_fops); +DEFINE_DRM_GEM_DMA_FOPS(sti_driver_fops); static const struct drm_driver sti_driver = { .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, .fops = &sti_driver_fops, - DRM_GEM_CMA_DRIVER_OPS, + DRM_GEM_DMA_DRIVER_OPS, .debugfs_init = sti_drm_dbg_init, diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 623a09163f9f..3ce9d4992176 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -15,7 +15,7 @@ #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_dma_helper.h> #include "sti_compositor.h" #include "sti_gdp.h" @@ -659,7 +659,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane, } if (!drm_fb_dma_get_gem_obj(fb, 0)) { - DRM_ERROR("Can't get CMA GEM object for fb\n"); + DRM_ERROR("Can't get DMA GEM object for fb\n"); return -EINVAL; } @@ -714,7 +714,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane, struct drm_display_mode *mode; int dst_x, dst_y, dst_w, dst_h; int src_x, src_y, src_w, src_h; - struct drm_gem_cma_object *cma_obj; + struct drm_gem_dma_object *dma_obj; struct sti_gdp_node_list *list; struct sti_gdp_node_list *curr_list; struct sti_gdp_node *top_field, *btm_field; @@ -778,15 +778,15 @@ 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_dma_get_gem_obj(fb, 0); + dma_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, - (unsigned long)cma_obj->paddr); + (unsigned long)dma_obj->paddr); /* pixel memory location */ bpp = fb->format->cpp[0]; - top_field->gam_gdp_pml = (u32)cma_obj->paddr + fb->offsets[0]; + top_field->gam_gdp_pml = (u32)dma_obj->paddr + fb->offsets[0]; top_field->gam_gdp_pml += src_x * bpp; top_field->gam_gdp_pml += src_y * fb->pitches[0]; @@ -831,7 +831,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane, dev_dbg(gdp->dev, "Current NVN:0x%X\n", readl(gdp->regs + GAM_GDP_NVN_OFFSET)); dev_dbg(gdp->dev, "Posted buff: %lx current buff: %x\n", - (unsigned long)cma_obj->paddr, + (unsigned long)dma_obj->paddr, readl(gdp->regs + GAM_GDP_PML_OFFSET)); if (!curr_list) { diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 26284c5f5b22..ee274140274d 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -19,7 +19,7 @@ #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_dma_helper.h> #include "sti_compositor.h" #include "sti_drv.h" @@ -1056,7 +1056,7 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane, } if (!drm_fb_dma_get_gem_obj(fb, 0)) { - DRM_ERROR("Can't get CMA GEM object for fb\n"); + DRM_ERROR("Can't get DMA GEM object for fb\n"); return -EINVAL; } @@ -1124,7 +1124,7 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane, struct drm_display_mode *mode; int dst_x, dst_y, dst_w, dst_h; int src_x, src_y, src_w, src_h; - struct drm_gem_cma_object *cma_obj; + struct drm_gem_dma_object *dma_obj; struct sti_hqvdp_cmd *cmd; int scale_h, scale_v; int cmd_offset; @@ -1178,15 +1178,15 @@ 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_dma_get_gem_obj(fb, 0); + dma_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, - (unsigned long)cma_obj->paddr); + (unsigned long)dma_obj->paddr); /* Buffer planes address */ - cmd->top.current_luma = (u32)cma_obj->paddr + fb->offsets[0]; - cmd->top.current_chroma = (u32)cma_obj->paddr + fb->offsets[1]; + cmd->top.current_luma = (u32)dma_obj->paddr + fb->offsets[0]; + cmd->top.current_chroma = (u32)dma_obj->paddr + fb->offsets[1]; /* Pitches */ cmd->top.luma_processed_pitch = fb->pitches[0]; diff --git a/drivers/gpu/drm/sti/sti_plane.c b/drivers/gpu/drm/sti/sti_plane.c index 0a55180be22b..29e669ccec5b 100644 --- a/drivers/gpu/drm/sti/sti_plane.c +++ b/drivers/gpu/drm/sti/sti_plane.c @@ -11,7 +11,7 @@ #include <drm/drm_blend.h> #include <drm/drm_fourcc.h> #include <drm/drm_framebuffer.h> -#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_dma_helper.h> #include "sti_compositor.h" #include "sti_drv.h" |