2019-07-26 09:51:26

by Guido Günther

[permalink] [raw]
Subject: [PATCH 0/1] drm/mxsfb: Read bus flags from bridge if present

The bridge might have special requirmentes on the input bus. This
is e.g. used by the imx-nwl bridge.

Robert, maybe you can add this patch to your 'Improvements and fixes for mxsfb
DRM driver' since it depends on the first patch in this series anyway?

Tested with 'Improvements and fixes for mxsfb DRM driver'[0] and 'drm: bridge:
Add NWL MIPI DSI host controller support'[1] on next-20190725.

[0]: https://patchwork.freedesktop.org/series/62822/
[1]: https://patchwork.freedesktop.org/series/64185/

Guido Günther (1):
drm/mxsfb: Read bus flags from bridge if present

drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--
2.20.1



2019-07-26 09:51:46

by Guido Günther

[permalink] [raw]
Subject: [PATCH 1/1] drm/mxsfb: Read bus flags from bridge if present

The bridge might have special requirmentes on the input bus. This
is e.g. used by the imx-nwl bridge.

Signed-off-by: Guido Günther <[email protected]>
---
drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
index e84bac3a541d..3b8eb3ac13b6 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
@@ -215,7 +215,7 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
{
struct drm_device *drm = mxsfb->pipe.crtc.dev;
struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
- const u32 bus_flags = mxsfb->connector->display_info.bus_flags;
+ u32 bus_flags = mxsfb->connector->display_info.bus_flags;
u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
int err;

@@ -239,6 +239,9 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)

clk_set_rate(mxsfb->clk, m->crtc_clock * 1000);

+ if (mxsfb->bridge && mxsfb->bridge->timings)
+ bus_flags = mxsfb->bridge->timings->input_bus_flags;
+
DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
m->crtc_clock,
(int)(clk_get_rate(mxsfb->clk) / 1000));
--
2.20.1


2019-07-26 11:28:36

by Stefan Agner

[permalink] [raw]
Subject: Re: [PATCH 1/1] drm/mxsfb: Read bus flags from bridge if present

On 2019-07-26 11:49, Guido Günther wrote:
> The bridge might have special requirmentes on the input bus. This
> is e.g. used by the imx-nwl bridge.
>
> Signed-off-by: Guido Günther <[email protected]>

Looks good to me.

Reviewed-by: Stefan Agner <[email protected]>


That is similar to what I sent for the imx DRM driver:

https://lkml.org/lkml/2018/9/12/913

I probably should follow up on that patchset.

--
Stefan

> ---
> drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index e84bac3a541d..3b8eb3ac13b6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -215,7 +215,7 @@ static void mxsfb_crtc_mode_set_nofb(struct
> mxsfb_drm_private *mxsfb)
> {
> struct drm_device *drm = mxsfb->pipe.crtc.dev;
> struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
> - const u32 bus_flags = mxsfb->connector->display_info.bus_flags;
> + u32 bus_flags = mxsfb->connector->display_info.bus_flags;
> u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
> int err;
>
> @@ -239,6 +239,9 @@ static void mxsfb_crtc_mode_set_nofb(struct
> mxsfb_drm_private *mxsfb)
>
> clk_set_rate(mxsfb->clk, m->crtc_clock * 1000);
>
> + if (mxsfb->bridge && mxsfb->bridge->timings)
> + bus_flags = mxsfb->bridge->timings->input_bus_flags;
> +
> DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
> m->crtc_clock,
> (int)(clk_get_rate(mxsfb->clk) / 1000));