2021-12-18 21:52:58

by Antonio Borneo

[permalink] [raw]
Subject: [PATCH 1/3] drm/stm: dsi: move lane capability detection in probe()

There is no need to re-compute the dsi lane capability because it
only depends on dsi hw version.
Since dsi hw version is detected at probe(), move there also the
assignment of dsi lane capability.

Signed-off-by: Antonio Borneo <[email protected]>
---
To: David Airlie <[email protected]>
To: Daniel Vetter <[email protected]>
To: Andrzej Hajda <[email protected]>
To: Neil Armstrong <[email protected]>
To: Robert Foss <[email protected]>
To: Laurent Pinchart <[email protected]>
To: Jonas Karlman <[email protected]>
To: Jernej Skrabec <[email protected]>
To: Yannick Fertre <[email protected]>
To: Philippe Cornu <[email protected]>
To: Benjamin Gaignard <[email protected]>
To: Maxime Coquelin <[email protected]>
To: Alexandre Torgue <[email protected]>
To: Philipp Zabel <[email protected]>
To: [email protected]
To: [email protected]
To: [email protected]
Cc: [email protected]
---
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 32cb41b2202f..480fdf256f01 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -247,14 +247,6 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, const struct drm_display_mode *mode,
int ret, bpp;
u32 val;

- /* Update lane capabilities according to hw version */
- dsi->lane_min_kbps = LANE_MIN_KBPS;
- dsi->lane_max_kbps = LANE_MAX_KBPS;
- if (dsi->hw_version == HWVER_131) {
- dsi->lane_min_kbps *= 2;
- dsi->lane_max_kbps *= 2;
- }
-
pll_in_khz = (unsigned int)(clk_get_rate(dsi->pllref_clk) / 1000);

/* Compute requested pll out */
@@ -417,6 +409,14 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
goto err_dsi_probe;
}

+ /* set lane capabilities according to hw version */
+ dsi->lane_min_kbps = LANE_MIN_KBPS;
+ dsi->lane_max_kbps = LANE_MAX_KBPS;
+ if (dsi->hw_version == HWVER_131) {
+ dsi->lane_min_kbps *= 2;
+ dsi->lane_max_kbps *= 2;
+ }
+
dw_mipi_dsi_stm_plat_data.base = dsi->base;
dw_mipi_dsi_stm_plat_data.priv_data = dsi;


base-commit: 70704fbf67ddc07ffc81073a3af1f7b2171697eb
--
2.34.1



2021-12-18 21:52:59

by Antonio Borneo

[permalink] [raw]
Subject: [PATCH 2/3] drm/bridge/synopsys: dsi: extend the prototype of mode_valid()

To evaluate the validity of a video mode, some additional internal
value has to be passed to the platform implementation.

Extend the prototype of mode_valid().

Signed-off-by: Antonio Borneo <[email protected]>
---
To: David Airlie <[email protected]>
To: Daniel Vetter <[email protected]>
To: Andrzej Hajda <[email protected]>
To: Neil Armstrong <[email protected]>
To: Robert Foss <[email protected]>
To: Laurent Pinchart <[email protected]>
To: Jonas Karlman <[email protected]>
To: Jernej Skrabec <[email protected]>
To: Yannick Fertre <[email protected]>
To: Philippe Cornu <[email protected]>
To: Benjamin Gaignard <[email protected]>
To: Maxime Coquelin <[email protected]>
To: Alexandre Torgue <[email protected]>
To: Philipp Zabel <[email protected]>
To: [email protected]
To: [email protected]
To: [email protected]
Cc: [email protected]
---
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 5 ++++-
include/drm/bridge/dw_mipi_dsi.h | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index e44e18a0112a..3f6564762e24 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -998,7 +998,10 @@ dw_mipi_dsi_bridge_mode_valid(struct drm_bridge *bridge,
enum drm_mode_status mode_status = MODE_OK;

if (pdata->mode_valid)
- mode_status = pdata->mode_valid(pdata->priv_data, mode);
+ mode_status = pdata->mode_valid(pdata->priv_data, mode,
+ dsi->mode_flags,
+ dw_mipi_dsi_get_lanes(dsi),
+ dsi->format);

return mode_status;
}
diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h
index bda8aa7c2280..5286a53a1875 100644
--- a/include/drm/bridge/dw_mipi_dsi.h
+++ b/include/drm/bridge/dw_mipi_dsi.h
@@ -51,7 +51,9 @@ struct dw_mipi_dsi_plat_data {
unsigned int max_data_lanes;

enum drm_mode_status (*mode_valid)(void *priv_data,
- const struct drm_display_mode *mode);
+ const struct drm_display_mode *mode,
+ unsigned long mode_flags,
+ u32 lanes, u32 format);

const struct dw_mipi_dsi_phy_ops *phy_ops;
const struct dw_mipi_dsi_host_ops *host_ops;
--
2.34.1


2022-01-04 10:47:29

by Philippe CORNU

[permalink] [raw]
Subject: Re: [PATCH 1/3] drm/stm: dsi: move lane capability detection in probe()



On 12/18/21 10:50 PM, Antonio Borneo wrote:
> There is no need to re-compute the dsi lane capability because it
> only depends on dsi hw version.
> Since dsi hw version is detected at probe(), move there also the
> assignment of dsi lane capability.
>
> Signed-off-by: Antonio Borneo <[email protected]>
> ---
> To: David Airlie <[email protected]>
> To: Daniel Vetter <[email protected]>
> To: Andrzej Hajda <[email protected]>
> To: Neil Armstrong <[email protected]>
> To: Robert Foss <[email protected]>
> To: Laurent Pinchart <[email protected]>
> To: Jonas Karlman <[email protected]>
> To: Jernej Skrabec <[email protected]>
> To: Yannick Fertre <[email protected]>
> To: Philippe Cornu <[email protected]>
> To: Benjamin Gaignard <[email protected]>
> To: Maxime Coquelin <[email protected]>
> To: Alexandre Torgue <[email protected]>
> To: Philipp Zabel <[email protected]>
> To: [email protected]
> To: [email protected]
> To: [email protected]
> Cc: [email protected]
> ---
> drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>

Hi Antonio,
many thanks for your patch.
Acked-by: Philippe Cornu <[email protected]>
Reviewed-by: Philippe Cornu <[email protected]>
Philippe :-)

2022-01-04 10:56:05

by Philippe CORNU

[permalink] [raw]
Subject: Re: [PATCH 2/3] drm/bridge/synopsys: dsi: extend the prototype of mode_valid()



On 12/18/21 10:50 PM, Antonio Borneo wrote:
> To evaluate the validity of a video mode, some additional internal
> value has to be passed to the platform implementation.
>
> Extend the prototype of mode_valid().
>
> Signed-off-by: Antonio Borneo <[email protected]>
> ---
> To: David Airlie <[email protected]>
> To: Daniel Vetter <[email protected]>
> To: Andrzej Hajda <[email protected]>
> To: Neil Armstrong <[email protected]>
> To: Robert Foss <[email protected]>
> To: Laurent Pinchart <[email protected]>
> To: Jonas Karlman <[email protected]>
> To: Jernej Skrabec <[email protected]>
> To: Yannick Fertre <[email protected]>
> To: Philippe Cornu <[email protected]>
> To: Benjamin Gaignard <[email protected]>
> To: Maxime Coquelin <[email protected]>
> To: Alexandre Torgue <[email protected]>
> To: Philipp Zabel <[email protected]>
> To: [email protected]
> To: [email protected]
> To: [email protected]
> Cc: [email protected]
> ---
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 5 ++++-
> include/drm/bridge/dw_mipi_dsi.h | 4 +++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>

Hi Antonio,
many thanks for your patch.
(I should have done like that from the beginning as validating a mode in
dsi requires dsi related information...)
Reviewed-by: Philippe Cornu <[email protected]>
Philippe :-)

2022-01-04 11:57:05

by Robert Foss

[permalink] [raw]
Subject: Re: [PATCH 1/3] drm/stm: dsi: move lane capability detection in probe()

On Tue, 4 Jan 2022 at 11:47, Philippe CORNU <[email protected]> wrote:
>
>
>
> On 12/18/21 10:50 PM, Antonio Borneo wrote:
> > There is no need to re-compute the dsi lane capability because it
> > only depends on dsi hw version.
> > Since dsi hw version is detected at probe(), move there also the
> > assignment of dsi lane capability.
> >
> > Signed-off-by: Antonio Borneo <[email protected]>
> > ---
> > To: David Airlie <[email protected]>
> > To: Daniel Vetter <[email protected]>
> > To: Andrzej Hajda <[email protected]>
> > To: Neil Armstrong <[email protected]>
> > To: Robert Foss <[email protected]>
> > To: Laurent Pinchart <[email protected]>
> > To: Jonas Karlman <[email protected]>
> > To: Jernej Skrabec <[email protected]>
> > To: Yannick Fertre <[email protected]>
> > To: Philippe Cornu <[email protected]>
> > To: Benjamin Gaignard <[email protected]>
> > To: Maxime Coquelin <[email protected]>
> > To: Alexandre Torgue <[email protected]>
> > To: Philipp Zabel <[email protected]>
> > To: [email protected]
> > To: [email protected]
> > To: [email protected]
> > Cc: [email protected]
> > ---
> > drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >
>
> Hi Antonio,
> many thanks for your patch.
> Acked-by: Philippe Cornu <[email protected]>
> Reviewed-by: Philippe Cornu <[email protected]>
> Philippe :-)

Thanks for the series and the Acks.

Applied series to drm-misc-next