From: Sam Ravnborg <sam@ravnborg.org>
To: Danilo Krummrich <dakr@redhat.com>
Cc: daniel@ffwll.ch, laurent.pinchart@ideasonboard.com,
airlied@linux.ie, tzimmermann@suse.de, mripard@kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH drm-misc-next v5 1/4] drm/fb: rename FB CMA helpers to FB DMA helpers
Date: Wed, 20 Jul 2022 19:23:03 +0200 [thread overview]
Message-ID: <Ytg596Lk4kumqeRD@ravnborg.org> (raw)
In-Reply-To: <20220720153128.526876-2-dakr@redhat.com>
Hi Danilo,
On Wed, Jul 20, 2022 at 05:31:25PM +0200, Danilo Krummrich wrote:
> 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: Thomas Zimmermann <tzimmermann@suse.de>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
For the most part I like the patch.
But there is a few cases I would like to see fixed.
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index e89ae0ec60eb..fab18135f12b 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -25,7 +25,7 @@
> #include <drm/drm_crtc.h>
> #include <drm/drm_debugfs.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_cma_helper.h>
> #include <drm/drm_gem_framebuffer_helper.h>
The only change in the file above is the rename of the include file.
This is a strong hint that the include is not needed and the correct fix
is to drop the include. There are more cases like the above.
This is a manual process on top of what you could automate, but then I
suggest to identify them and remove the includes before you change the
file name.
Or if anyone applies the patches then at least do it in a follow-up at
the places will never be easier to spot.
So with this cleanup done either before or after this patch.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Sam
next prev parent reply other threads:[~2022-07-20 17:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 15:31 [PATCH drm-misc-next v5 0/4] drm: rename CMA helpers to DMA helpers Danilo Krummrich
2022-07-20 15:31 ` [PATCH drm-misc-next v5 1/4] drm/fb: rename FB CMA helpers to FB " Danilo Krummrich
2022-07-20 17:23 ` Sam Ravnborg [this message]
2022-07-21 10:42 ` Danilo Krummrich
2022-07-20 15:31 ` [PATCH drm-misc-next v5 2/4] drm/gem: rename GEM CMA helpers to GEM " Danilo Krummrich
2022-07-20 17:27 ` Sam Ravnborg
2022-07-20 15:35 ` [PATCH drm-misc-next v5 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} Danilo Krummrich
2022-07-20 17:28 ` Sam Ravnborg
2022-07-20 15:35 ` [PATCH drm-misc-next v5 4/4] drm/todo: remove task to rename CMA helpers Danilo Krummrich
2022-07-20 17:29 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ytg596Lk4kumqeRD@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=dakr@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox