[PATCH/RFC,09/12] drm: rcar-du: lvds: Fix companion's mode
diff mbox series

Message ID 1564731249-22671-10-git-send-email-fabrizio.castro@bp.renesas.com
State New
Delegated to: Kieran Bingham
Headers show
Series
  • Add dual-LVDS panel support to EK874
Related show

Commit Message

Fabrizio Castro Aug. 2, 2019, 7:34 a.m. UTC
The companion encoder needs to be told to use the same
mode as the primary encoder.

Fixes: e9e8798ab7b8 ("drm: rcar-du: lvds: Add support for dual-link mode")
Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Aug. 2, 2019, 8:26 a.m. UTC | #1
Hi Fabrizio,

Thank you for the patch.

On Fri, Aug 02, 2019 at 08:34:06AM +0100, Fabrizio Castro wrote:
> The companion encoder needs to be told to use the same
> mode as the primary encoder.
> 
> Fixes: e9e8798ab7b8 ("drm: rcar-du: lvds: Add support for dual-link mode")
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_lvds.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index edd63f5..7944ae9 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -415,8 +415,12 @@ static void rcar_lvds_enable(struct drm_bridge *bridge)
>  		return;
>  
>  	/* Enable the companion LVDS encoder in dual-link mode. */
> -	if (lvds->dual_link && lvds->companion)
> +	if (lvds->dual_link && lvds->companion) {
> +		struct rcar_lvds *companion_lvds = bridge_to_rcar_lvds(
> +							lvds->companion);
> +		companion_lvds->mode = lvds->mode;
>  		lvds->companion->funcs->enable(lvds->companion);
> +	}

Would it make sense to do this in rcar_lvds_mode_set() instead, to keep
the mode set code grouped in a single place ?

>  
>  	/*
>  	 * Hardcode the channels and control signals routing for now.
Fabrizio Castro Aug. 5, 2019, 9:15 a.m. UTC | #2
Hi Laurent,

Thank you for your feedback!

> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: 02 August 2019 09:26
> Subject: Re: [PATCH/RFC 09/12] drm: rcar-du: lvds: Fix companion's mode
> 
> Hi Fabrizio,
> 
> Thank you for the patch.
> 
> On Fri, Aug 02, 2019 at 08:34:06AM +0100, Fabrizio Castro wrote:
> > The companion encoder needs to be told to use the same
> > mode as the primary encoder.
> >
> > Fixes: e9e8798ab7b8 ("drm: rcar-du: lvds: Add support for dual-link mode")
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > ---
> >  drivers/gpu/drm/rcar-du/rcar_lvds.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > index edd63f5..7944ae9 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > @@ -415,8 +415,12 @@ static void rcar_lvds_enable(struct drm_bridge *bridge)
> >  		return;
> >
> >  	/* Enable the companion LVDS encoder in dual-link mode. */
> > -	if (lvds->dual_link && lvds->companion)
> > +	if (lvds->dual_link && lvds->companion) {
> > +		struct rcar_lvds *companion_lvds = bridge_to_rcar_lvds(
> > +							lvds->companion);
> > +		companion_lvds->mode = lvds->mode;
> >  		lvds->companion->funcs->enable(lvds->companion);
> > +	}
> 
> Would it make sense to do this in rcar_lvds_mode_set() instead, to keep
> the mode set code grouped in a single place ?

I need to looks into this, as the initialization of lvds1 is a bit special.
I'll get back to you.

Thanks,
Fab

> 
> >
> >  	/*
> >  	 * Hardcode the channels and control signals routing for now.
> 
> --
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index edd63f5..7944ae9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -415,8 +415,12 @@  static void rcar_lvds_enable(struct drm_bridge *bridge)
 		return;
 
 	/* Enable the companion LVDS encoder in dual-link mode. */
-	if (lvds->dual_link && lvds->companion)
+	if (lvds->dual_link && lvds->companion) {
+		struct rcar_lvds *companion_lvds = bridge_to_rcar_lvds(
+							lvds->companion);
+		companion_lvds->mode = lvds->mode;
 		lvds->companion->funcs->enable(lvds->companion);
+	}
 
 	/*
 	 * Hardcode the channels and control signals routing for now.