public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@redhat.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}
Date: Thu, 7 Jul 2022 12:00:04 +0200	[thread overview]
Message-ID: <a063d7f3-cacf-c51a-a306-5acd85b680d8@redhat.com> (raw)
In-Reply-To: <YsXGPfKYhPsayHpv@pendragon.ideasonboard.com>

Hi Laurent,

On 7/6/22 19:28, Laurent Pinchart wrote:
> Hi Danilo,
> 
> Thank you for the patch.
> 
> On Wed, Jul 06, 2022 at 02:43:51PM +0200, Danilo Krummrich wrote:
>> The field paddr of struct drm_gem_dma_object holds a DMA address, which
>> might actually be a physical address. However, depending on the platform,
>> it can also be a bus address or a virtual address managed by an IOMMU.
>>
>> Hence, rename the field to dma_addr, which is more applicable.
>>
>> Since 'paddr' is a very commonly used term and symbol name a simple regex
>> does not do the trick. Instead, users of the struct were fixed up
>> iteratively with a trial and error approach building with
>> `make allyesconfig && make drivers/gpu/drm`.
> 
> Not for this patch as you've already done the work manually, but can I
> recommend the excellent coccinelle tool ? Its semantic patches can very
> easily rename structure members.
Actually, I should have and I will. It seems like there are a few 
drivers I missed with that - the ones not using CONFIG_COMPILE_TEST.

Additionally, I will also test cross-compiling for ARM and ARM64.

- Danilo
> 
>> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
>> ---
>>   .../arm/display/komeda/komeda_framebuffer.c   |  4 ++--
>>   drivers/gpu/drm/arm/malidp_mw.c               |  2 +-
>>   drivers/gpu/drm/arm/malidp_planes.c           | 12 +++++-----
>>   drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c      |  2 +-
>>   drivers/gpu/drm/drm_fb_dma_helper.c           | 10 ++++----
>>   drivers/gpu/drm/drm_gem_dma_helper.c          | 23 +++++++++++--------
>>   drivers/gpu/drm/imx/ipuv3-plane.c             |  6 ++---
>>   drivers/gpu/drm/sprd/sprd_dpu.c               |  2 +-
>>   drivers/gpu/drm/sun4i/sun8i_ui_layer.c        | 14 +++++------
>>   drivers/gpu/drm/sun4i/sun8i_vi_layer.c        | 14 +++++------
>>   drivers/gpu/drm/tidss/tidss_dispc.c           | 16 ++++++-------
>>   drivers/gpu/drm/tiny/arcpgu.c                 |  2 +-
>>   drivers/gpu/drm/vc4/vc4_bo.c                  |  2 +-
>>   drivers/gpu/drm/vc4/vc4_gem.c                 |  8 +++----
>>   drivers/gpu/drm/vc4/vc4_irq.c                 |  2 +-
>>   drivers/gpu/drm/vc4/vc4_plane.c               |  4 ++--
>>   drivers/gpu/drm/vc4/vc4_render_cl.c           | 14 +++++------
>>   drivers/gpu/drm/vc4/vc4_txp.c                 |  2 +-
>>   drivers/gpu/drm/vc4/vc4_v3d.c                 |  4 ++--
>>   drivers/gpu/drm/vc4/vc4_validate.c            | 12 +++++-----
>>   include/drm/drm_gem_dma_helper.h              |  4 ++--
>>   21 files changed, 81 insertions(+), 78 deletions(-)
> 
> [snip]
> 
>> diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
>> index 56fc1a1e7f87..8851d294bb53 100644
>> --- a/drivers/gpu/drm/drm_gem_dma_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_dma_helper.c
> 
> [snip]
> 
>> @@ -460,10 +461,11 @@ drm_gem_dma_prime_import_sg_table(struct drm_device *dev,
>>   	if (IS_ERR(dma_obj))
>>   		return ERR_CAST(dma_obj);
>>   
>> -	dma_obj->paddr = sg_dma_address(sgt->sgl);
>> +	dma_obj->dma_addr = sg_dma_address(sgt->sgl);
>>   	dma_obj->sgt = sgt;
>>   
>> -	DRM_DEBUG_PRIME("dma_addr = %pad, size = %zu\n", &dma_obj->paddr, attach->dmabuf->size);
>> +	DRM_DEBUG_PRIME("dma_addr = %pad, size = %zu\n", &dma_obj->dma_addr,
>> +							 attach->dmabuf->size);
> 
> The second line should be aligned left, just right of the opening
> parenthesis.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
>>   
>>   	return &dma_obj->base;
>>   }
> 
> [snip]
> 


  reply	other threads:[~2022-07-07 10:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 12:43 [PATCH v2 0/4] drm: rename CMA helpers to DMA helpers Danilo Krummrich
2022-07-06 12:43 ` [PATCH v2 1/4] drm/fb: rename FB CMA helpers to FB " Danilo Krummrich
2022-07-06 12:43 ` [PATCH v2 2/4] drm/gem: rename GEM CMA helpers to GEM " Danilo Krummrich
2022-07-06 12:43 ` [PATCH v2 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} Danilo Krummrich
2022-07-06 17:28   ` Laurent Pinchart
2022-07-07 10:00     ` Danilo Krummrich [this message]
2022-07-06 12:43 ` [PATCH v2 4/4] drm/todo: remove task to rename CMA helpers Danilo Krummrich
     [not found] <202207070426.Bj47lRp2-lkp@intel.com>
2022-07-07  5:19 ` [PATCH v2 3/4] drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr} kernel test robot
     [not found] <202207070526.dLjM1DgB-lkp@intel.com>
2022-07-07  5:22 ` kernel test robot

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=a063d7f3-cacf-c51a-a306-5acd85b680d8@redhat.com \
    --to=dakr@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.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