[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94882ab1-1eb0-b9f1-af70-dc070c96fd11@linaro.org>
Date: Sat, 11 Feb 2023 15:26:54 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Konrad Dybcio <konrad.dybcio@...aro.org>,
linux-arm-msm@...r.kernel.org, andersson@...nel.org,
agross@...nel.org, krzysztof.kozlowski@...aro.org
Cc: marijn.suijten@...ainline.org, Rob Clark <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Sean Paul <sean@...rly.run>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Neil Armstrong <neil.armstrong@...aro.org>,
Vinod Koul <vkoul@...nel.org>,
Douglas Anderson <dianders@...omium.org>,
Loic Poulain <loic.poulain@...aro.org>,
Vladimir Lypak <vladimir.lypak@...il.com>,
Archit Taneja <architt@...eaurora.org>,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/10] drm/msm/dsi: dsi_host: Fix DSI index detection when
version clash occurs
On 11/02/2023 13:51, Konrad Dybcio wrote:
> Now that msm_dsi_config is ready to accept multiple sets of registers
> (where array[n][idx] holds the base registers of DSI(idx) for the nth
> entry), loop through all available configs to resolve hw version
> clashes.
>
> Fixes: 32280d66fd44 ("drm/msm/dsi: Don't get DSI index from DT")
Do we really want to backport this patch (and other patches from this
series to older kernels?)
> Signed-off-by: Konrad Dybcio <konrad.dybcio@...aro.org>
> ---
> drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 +
> drivers/gpu/drm/msm/dsi/dsi_host.c | 12 +++++++-----
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> index 03493cc6b772..4a47705234bd 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
> @@ -43,6 +43,7 @@ struct msm_dsi_config {
> const int num_bus_clks;
> /* Allow + 1 entry for the zero-terminator */
> const resource_size_t io_start[VARIANTS_MAX][DSI_MAX + 1];
> + const int num_variants;
> };
>
> struct msm_dsi_host_cfg_ops {
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index f5092b4d0757..8dfa69bcff77 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1862,16 +1862,18 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host)
> struct platform_device *pdev = msm_host->pdev;
> const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
> struct resource *res;
> - int i;
> + int i, j, num_variants;
>
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl");
> if (!res)
> return -EINVAL;
>
> - for (i = 0; cfg->io_start[0][i]; i++) {
> - if (cfg->io_start[0][i] == res->start)
> - return i;
> - }
> + num_variants = cfg->num_variants ? cfg->num_variants : 1;
> +
> + for (i = 0; i < num_variants; i++)
> + for (j = 0; cfg->io_start[i][j]; j++)
> + if (cfg->io_start[i][j] == res->start)
> + return j;
>
> return -EINVAL;
> }
Please squash this together with the patch 'drm/msm/dsi: Turn
msm_dsi_config::io_start into a 2d array'.
--
With best wishes
Dmitry
Powered by blists - more mailing lists