From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
Paloma Arellano <quic_parellan@quicinc.com>
Cc: Douglas Anderson <dianders@chromium.org>,
Stephen Boyd <swboyd@chromium.org>,
<linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 15/16] drm/msm/dp: read hw revision only once
Date: Mon, 16 Dec 2024 12:52:09 -0800 [thread overview]
Message-ID: <5a3f1bd2-436f-4886-90b5-bec205692fb1@quicinc.com> (raw)
In-Reply-To: <20241216-fd-dp-audio-fixup-v4-15-f8d1961cf22f@linaro.org>
On 12/15/2024 2:44 PM, Dmitry Baryshkov wrote:
> There is little point in rereading DP controller revision over and over
> again. Read it once, after the first software reset and propagate it to
> the dp_panel module.
>
Good idea, can be posted even separately in front of the catalog rework
as it fits in nicely even with current model.
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/dp/dp_catalog.c | 13 -------------
> drivers/gpu/drm/msm/dp/dp_catalog.h | 3 ---
> drivers/gpu/drm/msm/dp/dp_ctrl.c | 12 +++++++++---
> drivers/gpu/drm/msm/dp/dp_panel.c | 3 +--
> drivers/gpu/drm/msm/dp/dp_panel.h | 1 +
> 5 files changed, 11 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c
> index 2992a0df262e9ab167a21a270d1aa8fd1383033d..84adf3a38e4cf0619b15850c31416f1e67049a42 100644
> --- a/drivers/gpu/drm/msm/dp/dp_catalog.c
> +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c
> @@ -42,19 +42,6 @@ void msm_dp_catalog_snapshot(struct msm_dp_catalog *msm_dp_catalog, struct msm_d
> msm_dp_catalog->p0_len, msm_dp_catalog->p0_base, "dp_p0");
> }
>
> -/**
> - * msm_dp_catalog_hw_revision() - retrieve DP hw revision
> - *
> - * @msm_dp_catalog: DP catalog structure
> - *
> - * Return: DP controller hw revision
> - *
> - */
> -u32 msm_dp_catalog_hw_revision(const struct msm_dp_catalog *msm_dp_catalog)
> -{
> - return msm_dp_read_ahb(msm_dp_catalog, REG_DP_HW_VERSION);
> -}
> -
> static void __iomem *msm_dp_ioremap(struct platform_device *pdev, int idx, size_t *len)
> {
> struct resource *res;
> diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h
> index 310319619242df5fa0d91c89fbcc477f16c130ea..ddbae0fcf5fc428b2d37cd1eab1d5860a2f11a50 100644
> --- a/drivers/gpu/drm/msm/dp/dp_catalog.h
> +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h
> @@ -95,9 +95,6 @@ static inline void msm_dp_write_link(struct msm_dp_catalog *msm_dp_catalog,
> /* Debug module */
> void msm_dp_catalog_snapshot(struct msm_dp_catalog *msm_dp_catalog, struct msm_disp_state *disp_state);
>
> -/* DP Controller APIs */
> -u32 msm_dp_catalog_hw_revision(const struct msm_dp_catalog *msm_dp_catalog);
> -
> struct msm_dp_catalog *msm_dp_catalog_get(struct device *dev);
>
> #endif /* _DP_CATALOG_H_ */
> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> index b15b7ba599e29c4edd746e9c2a8bf2f4a8eedf15..60dbf7eab3fd184bc12035d267abb3758cce9f89 100644
> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> @@ -131,6 +131,8 @@ struct msm_dp_ctrl_private {
> struct completion psr_op_comp;
> struct completion video_comp;
>
> + u32 hw_revision;
> +
> bool core_clks_on;
> bool link_clks_on;
> bool stream_clks_on;
> @@ -173,6 +175,11 @@ void msm_dp_ctrl_reset(struct msm_dp_ctrl *msm_dp_ctrl)
>
> sw_reset &= ~DP_SW_RESET;
> msm_dp_write_ahb(msm_dp_catalog, REG_DP_SW_RESET, sw_reset);
> +
> + if (!ctrl->hw_revision) {
> + ctrl->hw_revision = msm_dp_read_ahb(msm_dp_catalog, REG_DP_HW_VERSION);
> + ctrl->panel->hw_revision = ctrl->hw_revision;
> + }
> }
>
> static u32 msm_dp_ctrl_get_aux_interrupt(struct msm_dp_ctrl_private *ctrl)
> @@ -307,12 +314,11 @@ static void msm_dp_ctrl_mainlink_disable(struct msm_dp_ctrl_private *ctrl)
> static void msm_dp_setup_peripheral_flush(struct msm_dp_ctrl_private *ctrl)
> {
> struct msm_dp_catalog *msm_dp_catalog = ctrl->catalog;
> - u32 mainlink_ctrl, hw_revision;
> + u32 mainlink_ctrl;
>
> mainlink_ctrl = msm_dp_read_link(msm_dp_catalog, REG_DP_MAINLINK_CTRL);
>
> - hw_revision = msm_dp_catalog_hw_revision(msm_dp_catalog);
> - if (hw_revision >= DP_HW_VERSION_1_2)
> + if (ctrl->hw_revision >= DP_HW_VERSION_1_2)
> mainlink_ctrl |= DP_MAINLINK_FLUSH_MODE_SDE_PERIPH_UPDATE;
> else
> mainlink_ctrl |= DP_MAINLINK_FLUSH_MODE_UPDATE_SDP;
> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
> index 3441c28e3ce332bfe932d7adee7f0ecbaa486c2e..969d618c909876fd7a13aeb6e6c9e117071bc682 100644
> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
> @@ -380,9 +380,8 @@ static void msm_dp_panel_send_vsc_sdp(struct msm_dp_panel_private *panel, struct
>
> static void msm_dp_panel_update_sdp(struct msm_dp_panel_private *panel)
> {
> - u32 hw_revision;
> + u32 hw_revision = panel->msm_dp_panel.hw_revision;
>
> - hw_revision = msm_dp_catalog_hw_revision(panel->catalog);
> if (hw_revision >= DP_HW_VERSION_1_0 &&
> hw_revision < DP_HW_VERSION_1_2) {
> msm_dp_write_link(panel->catalog, MMSS_DP_SDP_CFG3, UPDATE_SDP);
> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h
> index 8dde55b3a5ab64c0c12d69cb2dd5b5c733c83432..c348417bb07f33efdf1402a73c27ff99e394e5a3 100644
> --- a/drivers/gpu/drm/msm/dp/dp_panel.h
> +++ b/drivers/gpu/drm/msm/dp/dp_panel.h
> @@ -38,6 +38,7 @@ struct msm_dp_panel {
> struct msm_dp_panel_psr psr_cap;
> bool video_test;
> bool vsc_sdp_supported;
> + u32 hw_revision;
>
> u32 max_dp_lanes;
> u32 max_dp_link_rate;
>
next prev parent reply other threads:[~2024-12-16 20:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-15 22:44 [PATCH v4 00/16] drm/msm/dp: perform misc cleanups Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 01/16] drm/msm/dp: drop msm_dp_panel_dump_regs() and msm_dp_catalog_dump_regs() Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 02/16] drm/msm/dp: use msm_dp_utils_pack_sdp_header() for audio packets Dmitry Baryshkov
2024-12-16 18:28 ` Stephen Boyd
2024-12-16 19:32 ` Abhinav Kumar
2024-12-16 22:24 ` Dmitry Baryshkov
2024-12-16 23:15 ` Abhinav Kumar
2024-12-15 22:44 ` [PATCH v4 03/16] drm/msm/dp: drop obsolete audio headers access through catalog Dmitry Baryshkov
2024-12-16 19:37 ` Abhinav Kumar
2024-12-15 22:44 ` [PATCH v4 04/16] drm/msm/dp: drop struct msm_dp_panel_in Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 05/16] drm/msm/dp: stop passing panel to msm_dp_audio_get() Dmitry Baryshkov
2024-12-16 18:29 ` Stephen Boyd
2024-12-16 19:40 ` Abhinav Kumar
2024-12-15 22:44 ` [PATCH v4 06/16] drm/msm/dp: split MMSS_DP_DSC_DTO register write to a separate function Dmitry Baryshkov
2024-12-16 18:29 ` Stephen Boyd
2024-12-16 19:46 ` Abhinav Kumar
2024-12-16 22:24 ` Dmitry Baryshkov
2024-12-16 23:38 ` Abhinav Kumar
2024-12-15 22:44 ` [PATCH v4 07/16] drm/msm/dp: pull I/O data out of msm_dp_catalog_private() Dmitry Baryshkov
2024-12-16 19:48 ` Abhinav Kumar
2024-12-15 22:44 ` [PATCH v4 08/16] drm/msm/dp: move I/O functions to global header Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 09/16] drm/msm/dp: move/inline AUX register functions Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 10/16] drm/msm/dp: move/inline ctrl " Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 11/16] drm/msm/dp: move/inline panel related functions Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 12/16] drm/msm/dp: move/inline audio " Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 13/16] drm/msm/dp: move more AUX functions to dp_aux.c Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 14/16] drm/msm/dp: move interrupt handling to dp_ctrl Dmitry Baryshkov
2024-12-15 22:44 ` [PATCH v4 15/16] drm/msm/dp: read hw revision only once Dmitry Baryshkov
2024-12-16 18:29 ` Stephen Boyd
2024-12-16 20:52 ` Abhinav Kumar [this message]
2024-12-15 22:44 ` [PATCH v4 16/16] drm/msm/dp: drop the msm_dp_catalog module Dmitry Baryshkov
2024-12-16 18:30 ` Stephen Boyd
2024-12-22 7:31 ` [PATCH v4 00/16] drm/msm/dp: perform misc cleanups Dmitry Baryshkov
2024-12-24 20:41 ` Dmitry Baryshkov
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=5a3f1bd2-436f-4886-90b5-bec205692fb1@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=airlied@gmail.com \
--cc=dianders@chromium.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_parellan@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=swboyd@chromium.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
all inboxes | Powered by JetHome®