All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Rahul Kumar <rk0006818@gmail.com>
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] drm/komeda: Convert logging in d71_dev.c to drm_* with drm_device parameter
Date: Tue, 2 Dec 2025 13:33:43 +0000	[thread overview]
Message-ID: <aS7qty8ABRjwQWaF@e142607> (raw)
In-Reply-To: <CAKY2RyYgvr3z_KZKjEgcVLqKZ8Sq0hb+eoXkhFTPfFqU3N=STg@mail.gmail.com>

On Tue, Nov 25, 2025 at 12:15:28PM +0530, Rahul Kumar wrote:
> Hi Liviu,

Hi Rahul,

Sorry, you caught me with your new series just before going on holiday so
did not started the review. Since coming back I had some other internal
issues to take care of, I will have a look at your series next week when
I should have more time for it.

Best regards,
Liviu

> 
> On Tue, Nov 18, 2025 at 4:32 PM Rahul Kumar <rk0006818@gmail.com> wrote:
> >
> > Replace DRM_DEBUG() and DRM_ERROR() calls in
> > drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c with the
> > drm_dbg() and drm_err() helpers in functions where a drm_device
> > parameter is available.
> >
> > The drm_*() logging macros require a struct drm_device * parameter,
> > which allows the DRM core to prefix log messages with the device
> > instance. This improves debugging clarity when multiple Komeda or
> > other DRM devices are present.
> >
> > Logging in early hardware probing functions such as d71_identify()
> > is intentionally left unchanged because they do not have access to
> > a drm_device pointer at that stage of initialization.
> >
> > This conversion follows the DRM TODO entry:
> > "Convert logging to drm_* functions with drm_device parameter".
> >
> > Signed-off-by: Rahul Kumar <rk0006818@gmail.com>
> > ---
> > Changes since v1:
> > - Fixed incorrect use of dev_get_drvdata(): it returns struct komeda_drv *,
> >   not struct komeda_kms_dev *, as pointed out by Liviu Dudau.
> > - Updated DRM device pointer retrieval to use drv->kms.
> > - Combined both changes into a 0/3 series.
> > Link to v1:
> > https://lore.kernel.org/all/aRdT1qscQqO7-U6h@e110455-lin.cambridge.arm.com/
> > ---
> >  .../gpu/drm/arm/display/komeda/d71/d71_dev.c  | 24 +++++++++++++------
> >  1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> > index 80973975bfdb..39c51bbe2bb9 100644
> > --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> > +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> > @@ -9,6 +9,7 @@
> >  #include <drm/drm_print.h>
> >  #include "d71_dev.h"
> >  #include "malidp_io.h"
> > +#include "komeda_drv.h"
> >
> >  static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
> >  {
> > @@ -348,6 +349,9 @@ static void d71_cleanup(struct komeda_dev *mdev)
> >
> >  static int d71_enum_resources(struct komeda_dev *mdev)
> >  {
> > +       struct komeda_drv *drv = dev_get_drvdata(mdev->dev);
> > +       struct komeda_kms_dev *kms = drv->kms;
> > +       struct drm_device *drm = &kms->base;
> >         struct d71_dev *d71;
> >         struct komeda_pipeline *pipe;
> >         struct block_header blk;
> > @@ -366,7 +370,7 @@ static int d71_enum_resources(struct komeda_dev *mdev)
> >
> >         err = d71_reset(d71);
> >         if (err) {
> > -               DRM_ERROR("Fail to reset d71 device.\n");
> > +               drm_err(drm, "Fail to reset d71 device.\n");
> >                 goto err_cleanup;
> >         }
> >
> > @@ -376,8 +380,8 @@ static int d71_enum_resources(struct komeda_dev *mdev)
> >         d71->num_pipelines = (value >> 8) & 0x7;
> >
> >         if (d71->num_pipelines > D71_MAX_PIPELINE) {
> > -               DRM_ERROR("d71 supports %d pipelines, but got: %d.\n",
> > -                         D71_MAX_PIPELINE, d71->num_pipelines);
> > +               drm_err(drm, "d71 supports %d pipelines, but got: %d.\n",
> > +                       D71_MAX_PIPELINE, d71->num_pipelines);
> >                 err = -EINVAL;
> >                 goto err_cleanup;
> >         }
> > @@ -455,8 +459,8 @@ static int d71_enum_resources(struct komeda_dev *mdev)
> >                 offset += D71_BLOCK_SIZE;
> >         }
> >
> > -       DRM_DEBUG("total %d (out of %d) blocks are found.\n",
> > -                 i, d71->num_blocks);
> > +       drm_dbg(drm, "total %d (out of %d) blocks are found.\n",
> > +               i, d71->num_blocks);
> >
> >         return 0;
> >
> > @@ -555,6 +559,9 @@ static void d71_init_fmt_tbl(struct komeda_dev *mdev)
> >
> >  static int d71_connect_iommu(struct komeda_dev *mdev)
> >  {
> > +       struct komeda_drv *drv = dev_get_drvdata(mdev->dev);
> > +       struct komeda_kms_dev *kms = drv->kms;
> > +       struct drm_device *drm = &kms->base;
> >         struct d71_dev *d71 = mdev->chip_data;
> >         u32 __iomem *reg = d71->gcu_addr;
> >         u32 check_bits = (d71->num_pipelines == 2) ?
> > @@ -569,7 +576,7 @@ static int d71_connect_iommu(struct komeda_dev *mdev)
> >         ret = dp_wait_cond(has_bits(check_bits, malidp_read32(reg, BLK_STATUS)),
> >                         100, 1000, 1000);
> >         if (ret < 0) {
> > -               DRM_ERROR("timed out connecting to TCU!\n");
> > +               drm_err(drm, "timed out connecting to TCU!\n");
> >                 malidp_write32_mask(reg, BLK_CONTROL, 0x7, INACTIVE_MODE);
> >                 return ret;
> >         }
> > @@ -582,6 +589,9 @@ static int d71_connect_iommu(struct komeda_dev *mdev)
> >
> >  static int d71_disconnect_iommu(struct komeda_dev *mdev)
> >  {
> > +       struct komeda_drv *drv = dev_get_drvdata(mdev->dev);
> > +       struct komeda_kms_dev *kms = drv->kms;
> > +       struct drm_device *drm = &kms->base;
> >         struct d71_dev *d71 = mdev->chip_data;
> >         u32 __iomem *reg = d71->gcu_addr;
> >         u32 check_bits = (d71->num_pipelines == 2) ?
> > @@ -593,7 +603,7 @@ static int d71_disconnect_iommu(struct komeda_dev *mdev)
> >         ret = dp_wait_cond(((malidp_read32(reg, BLK_STATUS) & check_bits) == 0),
> >                         100, 1000, 1000);
> >         if (ret < 0) {
> > -               DRM_ERROR("timed out disconnecting from TCU!\n");
> > +               drm_err(drm, "timed out disconnecting from TCU!\n");
> >                 malidp_write32_mask(reg, BLK_CONTROL, 0x7, INACTIVE_MODE);
> >         }
> >
> > --
> > 2.43.0
> 
> 
> Just following up on my v2 Komeda logging patch series.
> Please let me know if any changes or suggestions are needed.
> 
> Thanks,
> Rahul

  reply	other threads:[~2025-12-02 13:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 10:59 [PATCH v2 0/3] drm/komeda: Convert logging to drm_* helpers Rahul Kumar
2025-11-18 10:59 ` [PATCH v2 1/3] drm/komeda: Add komeda_drv.h to make struct komeda_drv available Rahul Kumar
2025-11-18 10:59 ` [PATCH v2 2/3] drm/komeda: Convert logging in komeda_pipeline.c to drm_* with drm_device parameter Rahul Kumar
2025-11-18 10:59 ` [PATCH v2 3/3] drm/komeda: Convert logging in d71_dev.c " Rahul Kumar
2025-11-25  6:45   ` Rahul Kumar
2025-12-02 13:33     ` Liviu Dudau [this message]
2025-12-02 13:43       ` Rahul Kumar
2025-12-10 16:47 ` [PATCH v2 0/3] drm/komeda: Convert logging to drm_* helpers Liviu Dudau

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=aS7qty8ABRjwQWaF@e142607 \
    --to=liviu.dudau@arm.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rk0006818@gmail.com \
    --cc=simona@ffwll.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.