From: "Andy Yan" <andyshrk@163.com>
To: "Jani Nikula" <jani.nikula@linux.intel.com>
Cc: robh@kernel.org, conor+dt@kernel.org, algea.cao@rock-chips.com,
rfoss@kernel.org, heiko@sntech.de, devicetree@vger.kernel.org,
linux-phy@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
vkoul@kernel.org, dri-devel@lists.freedesktop.org,
sebastian.reichel@collabora.com, kever.yang@rock-chips.com,
dmitry.baryshkov@linaro.org,
Damon Ding <damon.ding@rock-chips.com>,
hjc@rock-chips.com, andy.yan@rock-chips.com, krzk+dt@kernel.org,
linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de
Subject: Re:Re: [PATCH v5 05/20] drm/rockchip: analogix_dp: Replace DRM_...() functions with drm_...() or dev_...()
Date: Fri, 24 Jan 2025 17:41:58 +0800 (CST) [thread overview]
Message-ID: <6007b76a.6021.19497b090d4.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <87ed0tn29l.fsf@intel.com>
Hi,
At 2025-01-23 20:27:50, "Jani Nikula" <jani.nikula@linux.intel.com> wrote:
>On Wed, 22 Jan 2025, Damon Ding <damon.ding@rock-chips.com> wrote:
>> Hi Andy,
>>
>> On 2025/1/9 14:28, Andy Yan wrote:
>>>
>>> Hi Damon,
>>>
>>> At 2025-01-09 11:27:10, "Damon Ding" <damon.ding@rock-chips.com> wrote:
>>>> According to the comments in include/drm/drm_print.h, the DRM_...()
>>>> functions are deprecated in favor of drm_...() or dev_...() functions.
>>>>
>>>> Use drm_err()/drm_dbg_core()/drm_dbg_kms() instead of
>>>> DRM_DEV_ERROR()/DRM_ERROR()/DRM_DEV_DEBUG()/DRM_DEBUG_KMS() after
>>>> rockchip_dp_bind() is called, and replace DRM_DEV_ERROR() with dev_err()
>>>> before calling it.
>>>>
>>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>>> ---
>>>> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 29 ++++++++++---------
>>>> 1 file changed, 15 insertions(+), 14 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>>>> index 546d13f19f9b..8114c3238609 100644
>>>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>>>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>>>> @@ -100,13 +100,13 @@ static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data)
>>>>
>>>> ret = clk_prepare_enable(dp->pclk);
>>>> if (ret < 0) {
>>>> - DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
>>>> + drm_err(dp->drm_dev, "failed to enable pclk %d\n", ret);
>>>
>>> You just need to pass dp here:
>>> drm_err(dp, "failed to enable pclk %d\n", ret);
>>>
>>
>> I see. It is really better to pass dp instead of dp->drm_dev. I will
>> update all relevant logs in the next version.
>
>No, this was bad review feedback. You're absolutely expected to pass
>struct drm_device to drm_err() and friends.
No, I didn't see how the drm_err macro and friends restrict/expect the passing of only the drm_device pointer.
As for the platform device driver itself, we hope that when an error occurs, the log clearly indicates
the specific device that the log corresponds to, rather than a generic drm_device.
The original code of this driver used the macro related to DRM_DEV_ERROR to do just that.
And similar patches have been merged before
Please also refer to the discussion here.[0]
[0]https://lore.kernel.org/linux-rockchip/20250109032725.1102465-1-damon.ding@rock-chips.com/T/#m54bd842be660031773834cedea6c73a5033ca973
>
>BR,
>Jani.
>
>
>>
>>>> return ret;
>>>> }
>>>>
>>>> ret = rockchip_dp_pre_init(dp);
>>>> if (ret < 0) {
>>>> - DRM_DEV_ERROR(dp->dev, "failed to dp pre init %d\n", ret);
>>>> + drm_err(dp->drm_dev, "failed to dp pre init %d\n", ret);
>>>> clk_disable_unprepare(dp->pclk);
>>>> return ret;
>>>> }
>>>> @@ -126,12 +126,13 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
>>>> static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
>>>> struct drm_connector *connector)
>>>> {
>>>> + struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
>>>> struct drm_display_info *di = &connector->display_info;
>>>> /* VOP couldn't output YUV video format for eDP rightly */
>>>> u32 mask = DRM_COLOR_FORMAT_YCBCR444 | DRM_COLOR_FORMAT_YCBCR422;
>>>>
>>>> if ((di->color_formats & mask)) {
>>>> - DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
>>>> + drm_dbg_kms(dp->drm_dev, "Swapping display color format from YUV to RGB\n");
>>>> di->color_formats &= ~mask;
>>>> di->color_formats |= DRM_COLOR_FORMAT_RGB444;
>>>> di->bpc = 8;
>>>> @@ -201,17 +202,17 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder,
>>>> else
>>>> val = dp->data->lcdsel_big;
>>>>
>>>> - DRM_DEV_DEBUG(dp->dev, "vop %s output to dp\n", (ret) ? "LIT" : "BIG");
>>>> + drm_dbg_core(dp->drm_dev, "vop %s output to dp\n", (ret) ? "LIT" : "BIG");
>>>>
>>>> ret = clk_prepare_enable(dp->grfclk);
>>>> if (ret < 0) {
>>>> - DRM_DEV_ERROR(dp->dev, "failed to enable grfclk %d\n", ret);
>>>> + drm_err(dp->drm_dev, "failed to enable grfclk %d\n", ret);
>>>> return;
>>>> }
>>>>
>>>> ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val);
>>>> if (ret != 0)
>>>> - DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", ret);
>>>> + drm_err(dp->drm_dev, "Could not write to GRF: %d\n", ret);
>>>>
>>>> clk_disable_unprepare(dp->grfclk);
>>>> }
>>>> @@ -236,7 +237,7 @@ static void rockchip_dp_drm_encoder_disable(struct drm_encoder *encoder,
>>>>
>>>> ret = rockchip_drm_wait_vact_end(crtc, PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
>>>> if (ret)
>>>> - DRM_DEV_ERROR(dp->dev, "line flag irq timed out\n");
>>>> + drm_err(dp->drm_dev, "line flag irq timed out\n");
>>>> }
>>>>
>>>> static int
>>>> @@ -277,7 +278,7 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
>>>>
>>>> dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
>>>> if (IS_ERR(dp->grf)) {
>>>> - DRM_DEV_ERROR(dev, "failed to get rockchip,grf property\n");
>>>> + dev_err(dev, "failed to get rockchip,grf property\n");
>>>> return PTR_ERR(dp->grf);
>>>> }
>>>>
>>>> @@ -287,19 +288,19 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
>>>> } else if (PTR_ERR(dp->grfclk) == -EPROBE_DEFER) {
>>>> return -EPROBE_DEFER;
>>>> } else if (IS_ERR(dp->grfclk)) {
>>>> - DRM_DEV_ERROR(dev, "failed to get grf clock\n");
>>>> + dev_err(dev, "failed to get grf clock\n");
>>>> return PTR_ERR(dp->grfclk);
>>>> }
>>>>
>>>> dp->pclk = devm_clk_get(dev, "pclk");
>>>> if (IS_ERR(dp->pclk)) {
>>>> - DRM_DEV_ERROR(dev, "failed to get pclk property\n");
>>>> + dev_err(dev, "failed to get pclk property\n");
>>>> return PTR_ERR(dp->pclk);
>>>> }
>>>>
>>>> dp->rst = devm_reset_control_get(dev, "dp");
>>>> if (IS_ERR(dp->rst)) {
>>>> - DRM_DEV_ERROR(dev, "failed to get dp reset control\n");
>>>> + dev_err(dev, "failed to get dp reset control\n");
>>>> return PTR_ERR(dp->rst);
>>>> }
>>>>
>>>> @@ -315,12 +316,12 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
>>>>
>>>> encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev,
>>>> dev->of_node);
>>>> - DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
>>>> + drm_dbg_kms(drm_dev, "possible_crtcs = 0x%x\n", encoder->possible_crtcs);
>>>>
>>>> ret = drm_simple_encoder_init(drm_dev, encoder,
>>>> DRM_MODE_ENCODER_TMDS);
>>>> if (ret) {
>>>> - DRM_ERROR("failed to initialize encoder with drm\n");
>>>> + drm_err(drm_dev, "failed to initialize encoder with drm\n");
>>>> return ret;
>>>> }
>>>>
>>>> @@ -340,7 +341,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
>>>>
>>>> ret = rockchip_dp_drm_create_encoder(dp);
>>>> if (ret) {
>>>> - DRM_ERROR("failed to create drm encoder\n");
>>>> + drm_err(drm_dev, "failed to create drm encoder\n");
>>>> return ret;
>>>> }
>>>>
>>>> --
>>>> 2.34.1
>>>>
>>
>> Best regards,
>> Damon
>
>--
>Jani Nikula, Intel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2025-01-24 9:45 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 3:27 [PATCH v5 00/20] Add eDP support for RK3588 Damon Ding
2025-01-09 3:27 ` [PATCH v5 01/20] phy: phy-rockchip-samsung-hdptx: Swap the definitions of LCPLL_REF and ROPLL_REF Damon Ding
2025-01-09 3:27 ` [PATCH v5 02/20] phy: phy-rockchip-samsung-hdptx: Supplement some register names with their full version Damon Ding
2025-01-09 3:27 ` [PATCH v5 03/20] phy: phy-rockchip-samsung-hdptx: Add the '_MASK' suffix to all registers Damon Ding
2025-01-09 3:27 ` [PATCH v5 04/20] phy: phy-rockchip-samsung-hdptx: Add eDP mode support for RK3588 Damon Ding
2025-01-09 12:39 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 05/20] drm/rockchip: analogix_dp: Replace DRM_...() functions with drm_...() or dev_...() Damon Ding
2025-01-09 6:28 ` Andy Yan
2025-01-22 8:46 ` [PATCH " Damon Ding
2025-01-23 12:27 ` Jani Nikula
2025-01-24 9:41 ` Andy Yan [this message]
2025-01-24 10:55 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 06/20] drm/rockchip: analogix_dp: Use formalized struct definition for grf field Damon Ding
2025-01-09 3:27 ` [PATCH v5 07/20] drm/rockchip: analogix_dp: Expand device data to support multiple edp display Damon Ding
2025-01-10 6:24 ` kernel test robot
2025-01-09 3:27 ` [PATCH v5 08/20] drm/bridge: analogix_dp: Add support for phy configuration Damon Ding
2025-01-09 12:41 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 09/20] dt-bindings: display: rockchip: analogix-dp: Add support to get panel from the DP AUX bus Damon Ding
2025-01-09 3:27 ` [PATCH v5 10/20] drm/bridge: analogix_dp: support to get &analogix_dp_device.plat_data and &analogix_dp_device.aux Damon Ding
2025-01-09 12:42 ` Dmitry Baryshkov
2025-01-09 12:58 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 11/20] drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus Damon Ding
2025-01-09 12:45 ` Dmitry Baryshkov
2025-01-22 8:06 ` Damon Ding
2025-01-09 3:27 ` [PATCH v5 12/20] drm/rockchip: " Damon Ding
2025-01-09 12:48 ` Dmitry Baryshkov
2025-01-22 8:17 ` Damon Ding
2025-01-22 9:37 ` Damon Ding
2025-01-22 18:56 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 13/20] dt-bindings: display: rockchip: analogix-dp: Add support for RK3588 Damon Ding
2025-01-09 8:54 ` Krzysztof Kozlowski
2025-01-20 7:08 ` Damon Ding
2025-01-09 3:27 ` [PATCH v5 14/20] drm/bridge: analogix_dp: " Damon Ding
2025-01-09 12:49 ` Dmitry Baryshkov
2025-01-09 3:27 ` [PATCH v5 15/20] drm/rockchip: " Damon Ding
2025-01-09 3:27 ` [PATCH v5 16/20] drm/edp-panel: Add LG Display panel model LP079QX1-SP0V Damon Ding
2025-01-09 3:27 ` [PATCH v5 17/20] dt-bindings: display: rockchip: Fix label name of hdptxphy for RK3588 HDMI TX Controller Damon Ding
2025-01-09 3:27 ` [PATCH v5 18/20] arm64: dts: rockchip: Fix label name of hdptxphy for RK3588 Damon Ding
2025-01-09 3:27 ` [PATCH v5 19/20] arm64: dts: rockchip: Add eDP0 node " Damon Ding
2025-01-09 3:27 ` [PATCH v5 20/20] arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board Damon Ding
2025-01-11 10:28 ` Andy Yan
2025-01-22 9:05 ` [PATCH " Damon Ding
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=6007b76a.6021.19497b090d4.Coremail.andyshrk@163.com \
--to=andyshrk@163.com \
--cc=algea.cao@rock-chips.com \
--cc=andy.yan@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=damon.ding@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=jani.nikula@linux.intel.com \
--cc=kever.yang@rock-chips.com \
--cc=krzk+dt@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=vkoul@kernel.org \
/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