All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Paul Kocialkowski <contact@paulk.fr>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Thierry Reding <thierry.reding@gmail.com>,
	David Airlie <airlied@linux.ie>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Chen-Yu Tsai <wens@csie.org>,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup
Date: Mon, 5 Nov 2018 09:59:27 +0100	[thread overview]
Message-ID: <20181105085927.tvg5vy3oyygw65z6@flea> (raw)
In-Reply-To: <20181101200045.6078-2-contact@paulk.fr>

[-- Attachment #1: Type: text/plain, Size: 3033 bytes --]

Hi,

On Thu, Nov 01, 2018 at 09:00:39PM +0100, Paul Kocialkowski wrote:
> Features such as dithering and pixel data edge configuration currently
> rely on the panel registered with the TCON driver. However, bridges are
> also supported in addition panels.
> 
> Instead of retrieving the connector from the panel, pass the encoder
> from the calling function, as is done for other interfaces.
> 
> The connector is then retrieved from the encoder with the dedicated
> helper. Even in the case of bridges, the connector is registered with
> the encoder from our driver and is accessible when iterating connectors.
> 
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> ---
>  drivers/gpu/drm/sun4i/sun4i_tcon.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index f949287d926c..262ffb6b0f82 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -478,8 +478,11 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
>  }
>  
>  static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> +				     const struct drm_encoder *encoder,
>  				     const struct drm_display_mode *mode)
>  {
> +	struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
> +	struct drm_display_info display_info = connector->display_info;
>  	unsigned int bp, hsync, vsync;
>  	u8 clk_delay;
>  	u32 val = 0;
> @@ -491,8 +494,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	sun4i_tcon0_mode_set_common(tcon, mode);
>  
>  	/* Set dithering if needed */
> -	if (tcon->panel)
> -		sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector);
> +	sun4i_tcon0_mode_set_dithering(tcon, connector);
>  
>  	/* Adjust clock delay */
>  	clk_delay = sun4i_tcon_get_clk_delay(mode, 0);
> @@ -556,17 +558,11 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	 * Following code is a way to avoid quirks all around TCON
>  	 * and DOTCLOCK drivers.
>  	 */
> -	if (tcon->panel) {
> -		struct drm_panel *panel = tcon->panel;
> -		struct drm_connector *connector = panel->connector;
> -		struct drm_display_info display_info = connector->display_info;
> -
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> -			clk_set_phase(tcon->dclk, 240);
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> +		clk_set_phase(tcon->dclk, 240);
>  
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> -			clk_set_phase(tcon->dclk, 0);
> -	}
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> +		clk_set_phase(tcon->dclk, 0);

You're doing multiple things here: you're changing the function API,
and then moving the display info checks outside of the tcon->panel
condition.

You should do two separate patches for that.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID
From: Maxime Ripard <maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
To: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup
Date: Mon, 5 Nov 2018 09:59:27 +0100	[thread overview]
Message-ID: <20181105085927.tvg5vy3oyygw65z6@flea> (raw)
In-Reply-To: <20181101200045.6078-2-contact-W9ppeneeCTY@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2975 bytes --]

Hi,

On Thu, Nov 01, 2018 at 09:00:39PM +0100, Paul Kocialkowski wrote:
> Features such as dithering and pixel data edge configuration currently
> rely on the panel registered with the TCON driver. However, bridges are
> also supported in addition panels.
> 
> Instead of retrieving the connector from the panel, pass the encoder
> from the calling function, as is done for other interfaces.
> 
> The connector is then retrieved from the encoder with the dedicated
> helper. Even in the case of bridges, the connector is registered with
> the encoder from our driver and is accessible when iterating connectors.
> 
> Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
> ---
>  drivers/gpu/drm/sun4i/sun4i_tcon.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index f949287d926c..262ffb6b0f82 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -478,8 +478,11 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
>  }
>  
>  static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> +				     const struct drm_encoder *encoder,
>  				     const struct drm_display_mode *mode)
>  {
> +	struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
> +	struct drm_display_info display_info = connector->display_info;
>  	unsigned int bp, hsync, vsync;
>  	u8 clk_delay;
>  	u32 val = 0;
> @@ -491,8 +494,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	sun4i_tcon0_mode_set_common(tcon, mode);
>  
>  	/* Set dithering if needed */
> -	if (tcon->panel)
> -		sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector);
> +	sun4i_tcon0_mode_set_dithering(tcon, connector);
>  
>  	/* Adjust clock delay */
>  	clk_delay = sun4i_tcon_get_clk_delay(mode, 0);
> @@ -556,17 +558,11 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	 * Following code is a way to avoid quirks all around TCON
>  	 * and DOTCLOCK drivers.
>  	 */
> -	if (tcon->panel) {
> -		struct drm_panel *panel = tcon->panel;
> -		struct drm_connector *connector = panel->connector;
> -		struct drm_display_info display_info = connector->display_info;
> -
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> -			clk_set_phase(tcon->dclk, 240);
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> +		clk_set_phase(tcon->dclk, 240);
>  
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> -			clk_set_phase(tcon->dclk, 0);
> -	}
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> +		clk_set_phase(tcon->dclk, 0);

You're doing multiple things here: you're changing the function API,
and then moving the display info checks outside of the tcon->panel
condition.

You should do two separate patches for that.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

WARNING: multiple messages have this Message-ID
From: maxime.ripard@bootlin.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup
Date: Mon, 5 Nov 2018 09:59:27 +0100	[thread overview]
Message-ID: <20181105085927.tvg5vy3oyygw65z6@flea> (raw)
In-Reply-To: <20181101200045.6078-2-contact@paulk.fr>

Hi,

On Thu, Nov 01, 2018 at 09:00:39PM +0100, Paul Kocialkowski wrote:
> Features such as dithering and pixel data edge configuration currently
> rely on the panel registered with the TCON driver. However, bridges are
> also supported in addition panels.
> 
> Instead of retrieving the connector from the panel, pass the encoder
> from the calling function, as is done for other interfaces.
> 
> The connector is then retrieved from the encoder with the dedicated
> helper. Even in the case of bridges, the connector is registered with
> the encoder from our driver and is accessible when iterating connectors.
> 
> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> ---
>  drivers/gpu/drm/sun4i/sun4i_tcon.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index f949287d926c..262ffb6b0f82 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -478,8 +478,11 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
>  }
>  
>  static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> +				     const struct drm_encoder *encoder,
>  				     const struct drm_display_mode *mode)
>  {
> +	struct drm_connector *connector = sun4i_tcon_get_connector(encoder);
> +	struct drm_display_info display_info = connector->display_info;
>  	unsigned int bp, hsync, vsync;
>  	u8 clk_delay;
>  	u32 val = 0;
> @@ -491,8 +494,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	sun4i_tcon0_mode_set_common(tcon, mode);
>  
>  	/* Set dithering if needed */
> -	if (tcon->panel)
> -		sun4i_tcon0_mode_set_dithering(tcon, tcon->panel->connector);
> +	sun4i_tcon0_mode_set_dithering(tcon, connector);
>  
>  	/* Adjust clock delay */
>  	clk_delay = sun4i_tcon_get_clk_delay(mode, 0);
> @@ -556,17 +558,11 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
>  	 * Following code is a way to avoid quirks all around TCON
>  	 * and DOTCLOCK drivers.
>  	 */
> -	if (tcon->panel) {
> -		struct drm_panel *panel = tcon->panel;
> -		struct drm_connector *connector = panel->connector;
> -		struct drm_display_info display_info = connector->display_info;
> -
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> -			clk_set_phase(tcon->dclk, 240);
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
> +		clk_set_phase(tcon->dclk, 240);
>  
> -		if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> -			clk_set_phase(tcon->dclk, 0);
> -	}
> +	if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
> +		clk_set_phase(tcon->dclk, 0);

You're doing multiple things here: you're changing the function API,
and then moving the display info checks outside of the tcon->panel
condition.

You should do two separate patches for that.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181105/c953947c/attachment-0001.sig>

  reply	other threads:[~2018-11-05  8:59 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 20:00 [PATCH v2 0/7] BL035-RGB-002 3.5" LCD sunxi DRM support Paul Kocialkowski
2018-11-01 20:00 ` Paul Kocialkowski
2018-11-01 20:00 ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-05  8:59   ` Maxime Ripard [this message]
2018-11-05  8:59     ` Maxime Ripard
2018-11-05  8:59     ` Maxime Ripard
2018-11-05 10:21     ` Paul Kocialkowski
2018-11-05 10:21       ` Paul Kocialkowski
2018-11-05 10:21       ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH v2 2/7] drm/sun4i: tcon: Support an active-low DE signal with RGB interface Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH v2 3/7] dt-bindings: Add vendor prefix for LeMaker Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-05 22:08   ` Rob Herring
2018-11-05 22:08     ` Rob Herring
2018-11-05 22:08     ` Rob Herring
2018-11-07 14:26     ` Paul Kocialkowski
2018-11-07 14:26       ` Paul Kocialkowski
2018-11-07 14:26       ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH v2 4/7] dt-bindings: Add bindings for the LeMaker BL035-RGB-002 LCD panel Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-05 22:09   ` Rob Herring
2018-11-05 22:09     ` Rob Herring
2018-11-05 22:09     ` Rob Herring
2018-11-01 20:00 ` [PATCH v2 5/7] drm/panel: simple: Add support for the LeMaker BL035-RGB-002 3.5" LCD Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH NOT FOR MERGE v2 6/7] ARM: dts: sun7i: Add pinmux configuration for LCD0 RGB888 pins Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00 ` [PATCH NOT FOR MERGE v2 7/7] ARM: dts: sun7i-a20-bananapi: Add bindings for the LeMaker 3.5" LCD Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:00   ` Paul Kocialkowski
2018-11-01 20:33 ` [PATCH v2 0/7] BL035-RGB-002 3.5" LCD sunxi DRM support Paul Kocialkowski
2018-11-01 20:33   ` Paul Kocialkowski
2018-11-01 20:33   ` Paul Kocialkowski

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=20181105085927.tvg5vy3oyygw65z6@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=contact@paulk.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=wens@csie.org \
    --subject='Re: [PATCH v2 1/7] drm/sun4i: tcon: Pass encoder instead of using panel for RGB setup' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.