From: Jani Nikula <jani.nikula@linux.intel.com>
To: Claudio Suarez <cssk@net-c.es>,
dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH] drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_{b,c}*.c
Date: Fri, 31 Dec 2021 11:07:32 +0200 [thread overview]
Message-ID: <878rw1jg6j.fsf@intel.com> (raw)
In-Reply-To: <Yc2Pd/DhQ7EpD+hD@gineta.localdomain>
On Thu, 30 Dec 2021, Claudio Suarez <cssk@net-c.es> wrote:
> DRM_DEBUG_* and DRM_* log calls are deprecated.
> Change them to drm_dbg_* / drm_{err,info,...} calls in drm core
> files.
>
> To avoid making a very big patch, this change is split in
> smaller patches. This one includes drm_{b,c}*.c
Personally, I'd split it further to smaller patches.
>
> Signed-off-by: Claudio Suarez <cssk@net-c.es>
> ---
> drivers/gpu/drm/drm_blend.c | 6 +-
> drivers/gpu/drm/drm_bridge.c | 6 +-
> drivers/gpu/drm/drm_bufs.c | 116 +++++++++++++--------------
> drivers/gpu/drm/drm_client_modeset.c | 109 +++++++++++++------------
> drivers/gpu/drm/drm_color_mgmt.c | 6 +-
> drivers/gpu/drm/drm_connector.c | 37 +++++----
> drivers/gpu/drm/drm_context.c | 18 ++---
> drivers/gpu/drm/drm_crtc.c | 40 ++++-----
> drivers/gpu/drm/drm_crtc_helper.c | 61 +++++++-------
> 9 files changed, 211 insertions(+), 188 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
> index ec37cbfabb50..4a988815f998 100644
> --- a/drivers/gpu/drm/drm_blend.c
> +++ b/drivers/gpu/drm/drm_blend.c
> @@ -450,7 +450,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc,
> int i, n = 0;
> int ret = 0;
>
> - DRM_DEBUG_ATOMIC("[CRTC:%d:%s] calculating normalized zpos values\n",
> + drm_dbg_atomic(dev, "[CRTC:%d:%s] calculating normalized zpos values\n",
> crtc->base.id, crtc->name);
Throughout the patch, please fix the indentation on the following
lines. The lines should be aligned at the next column after the opening
brace "(" in the function call, like they used to be.
>
> states = kmalloc_array(total_planes, sizeof(*states), GFP_KERNEL);
> @@ -469,7 +469,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc,
> goto done;
> }
> states[n++] = plane_state;
> - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] processing zpos value %d\n",
> + drm_dbg_atomic(dev, "[PLANE:%d:%s] processing zpos value %d\n",
> plane->base.id, plane->name,
> plane_state->zpos);
> }
> @@ -480,7 +480,7 @@ static int drm_atomic_helper_crtc_normalize_zpos(struct drm_crtc *crtc,
> plane = states[i]->plane;
>
> states[i]->normalized_zpos = i;
> - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] normalized zpos value %d\n",
> + drm_dbg_atomic(dev, "[PLANE:%d:%s] normalized zpos value %d\n",
> plane->base.id, plane->name, i);
> }
> crtc_state->zpos_changed = true;
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index c96847fc0ebc..b108377b4b40 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -288,10 +288,12 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
> list_del(&bridge->chain_node);
>
> #ifdef CONFIG_OF
> - DRM_ERROR("failed to attach bridge %pOF to encoder %s: %d\n",
> + drm_err(encoder->dev,
> + "failed to attach bridge %pOF to encoder %s: %d\n",
> bridge->of_node, encoder->name, ret);
> #else
> - DRM_ERROR("failed to attach bridge to encoder %s: %d\n",
> + drm_err(encoder->dev,
> + "failed to attach bridge to encoder %s: %d\n",
> encoder->name, ret);
> #endif
>
> diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
> index fcca21e8efac..dd8e100e120c 100644
> --- a/drivers/gpu/drm/drm_bufs.c
> +++ b/drivers/gpu/drm/drm_bufs.c
> @@ -171,8 +171,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
> kfree(map);
> return -EINVAL;
> }
> - DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n",
> - (unsigned long long)map->offset, map->size, map->type);
> + drm_dev_dbg(dev, "offset = 0x%08llx, size = 0x%08lx, type = %d\n",
> + (unsigned long long)map->offset, map->size, map->type);
Please avoid drm_dev_dbg() when struct drm_device is available,
throughout the patch. DRM_DEBUG() -> drm_dbg_core() in drm_*.[ch].
Clearly dev is struct drm_device here, and in a lot of places, so you're
passing an incompatible pointer to drm_dev_dbg(), which is for when you
only have struct device available.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
prev parent reply other threads:[~2021-12-31 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-30 10:52 [PATCH] drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_{b,c}*.c Claudio Suarez
2021-12-30 14:31 ` kernel test robot
2021-12-30 20:05 ` Claudio Suarez
2021-12-31 9:10 ` Jani Nikula
2021-12-31 9:07 ` Jani Nikula [this message]
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=878rw1jg6j.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=cssk@net-c.es \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--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