mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aradhya Bhatia <a-bhatia1@ti.com>
To: Max Krummenacher <max.oss.09@gmail.com>, <max.krummenacher@toradex.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Herring <robh@kernel.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Maxime Ripard <mripard@kernel.org>, Marek Vasut <marex@denx.de>,
	Christoph Niedermaier <cniedermaier@dh-electronics.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Sam Ravnborg <sam@ravnborg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 4/4] drm/panel: simple: add bus-format support for panel-dpi
Date: Wed, 3 Aug 2022 12:15:12 +0530	[thread overview]
Message-ID: <a010d333-70b1-bc58-ddf8-d3fa911a6852@ti.com> (raw)
In-Reply-To: <20220628181838.2031-5-max.oss.09@gmail.com>



On 28-Jun-22 23:48, Max Krummenacher wrote:
> From: Max Krummenacher <max.krummenacher@toradex.com>
> 
> Evaluate the device tree bus-format property to set bus_format for
> a 'panel-dpi' panel. Additionally infer the bpc value from the
> given bus-format.
> 
> Valid values for bus-format are found in:
> <include/dt-bindings/display/dt-media-bus-format.h>
> 
> This completes the addition of panel-dpi to completely specify
> a panel-simple panel from the device tree.
> 
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> 
> ---
> 
> Changes in v3:
> - Moved the bus-format property under the port/endpoint node as
>    suggested by Rob Herring
> 
> Changes in v2:
> - Fix errors found by dt_binding_check
> 
>   drivers/gpu/drm/panel/panel-simple.c | 49 ++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 4a2e580a2f7b..f1a457f1069e 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -21,9 +21,11 @@
>    * DEALINGS IN THE SOFTWARE.
>    */
>   
> +#include <dt-bindings/display/dt-media-bus-format.h>
>   #include <linux/delay.h>
>   #include <linux/gpio/consumer.h>
>   #include <linux/module.h>
> +#include <linux/of_graph.h>
>   #include <linux/of_platform.h>
>   #include <linux/platform_device.h>
>   #include <linux/pm_runtime.h>
> @@ -449,10 +451,12 @@ static int panel_dpi_probe(struct device *dev,
>   			   struct panel_simple *panel)
>   {
>   	struct display_timing *timing;
> +	struct device_node *endpoint;
>   	const struct device_node *np;
>   	struct panel_desc *desc;
>   	unsigned int bus_flags;
>   	struct videomode vm;
> +	u32 bus_format;
>   	int ret;
>   
>   	np = dev->of_node;
> @@ -477,6 +481,51 @@ static int panel_dpi_probe(struct device *dev,
>   	of_property_read_u32(np, "width-mm", &desc->size.width);
>   	of_property_read_u32(np, "height-mm", &desc->size.height);
>   
> +	endpoint = of_graph_get_endpoint_by_regs(np, -1, -1);
> +	if (endpoint &&
> +	    !of_property_read_u32(endpoint, "bus-format", &bus_format)) {
> +		/* infer bpc from bus-format */
> +		switch (bus_format) {
> +		case DT_MEDIA_BUS_FMT_RGB565_1X16:
> +			desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
> +			desc->bpc = 6;
> +			break;
> +		case DT_MEDIA_BUS_FMT_RGB666_1X18:
> +			desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
> +			desc->bpc = 6;
> +			break;
> +		case DT_MEDIA_BUS_FMT_RGB666_1X24_CPADHI:
> +			desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
> +			desc->bpc = 6;
> +			break;
> +		case DT_MEDIA_BUS_FMT_BGR888_1X24:
> +			desc->bus_format = MEDIA_BUS_FMT_BGR888_1X24;
> +			desc->bpc = 8;
> +			break;
> +		case DT_MEDIA_BUS_FMT_GBR888_1X24:
> +			desc->bus_format = MEDIA_BUS_FMT_GBR888_1X24;
> +			desc->bpc = 8;
> +			break;
> +		case DT_MEDIA_BUS_FMT_RBG888_1X24:
> +			desc->bus_format = MEDIA_BUS_FMT_RBG888_1X24;
> +			desc->bpc = 8;
> +			break;
> +		case DT_MEDIA_BUS_FMT_RGB888_1X24:
> +			desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
> +			desc->bpc = 8;
> +			break;
> +		case DT_MEDIA_BUS_FMT_RGB888_1X32_PADHI:
> +			desc->bus_format = MEDIA_BUS_FMT_RGB888_1X32_PADHI;
> +			desc->bpc = 8;
> +			break;
> +		default:
> +			dev_err(dev, "%pOF: unknown bus-format property\n", np);
> +			return -EINVAL;
> +		}
> +	}
> +
> +	of_node_put(endpoint);
> +
>   	/* Extract bus_flags from display_timing */
>   	bus_flags = 0;
>   	vm.flags = timing->flags;

I understand that it is important to add a bus-format property for dumb
dpi-panels, and I agree with the implementation in the patch-set.

However,
I do not yet fully understand Rob's comments on the dt-bindings side of
patch set (patch 1/4) and what consequences it may cause if that remains
unresolved.

Given that the bus-format property gets added, I do not see any concern
with the panel-simple driver patch.


Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>


Regards
Aradhya

  reply	other threads:[~2022-08-03  6:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 18:18 [PATCH v3 0/4] " Max Krummenacher
2022-06-28 18:18 ` [PATCH v3 1/4] dt-bindings: display: panel-common: allow for additional port node properties Max Krummenacher
2022-07-01 17:08   ` Rob Herring
2022-06-28 18:18 ` [PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi Max Krummenacher
2022-08-03  8:21   ` Marek Vasut
2022-08-08 13:56     ` Max Krummenacher
2022-08-09  1:25       ` Marek Vasut
2022-10-13 12:58   ` Francesco Dolcini
2022-10-14 14:08     ` Dave Stevenson
2022-10-16  1:32       ` Laurent Pinchart
2022-10-19 12:53         ` Max Krummenacher
2022-10-19 15:37         ` Dave Stevenson
2022-06-28 18:18 ` [PATCH v3 3/4] dt-bindings: display: startek,startek-kd050c: allow bus-format property Max Krummenacher
2022-06-28 18:18 ` [PATCH v3 4/4] drm/panel: simple: add bus-format support for panel-dpi Max Krummenacher
2022-08-03  6:45   ` Aradhya Bhatia [this message]
2022-08-08 14:01     ` Max Krummenacher
2022-07-26 11:53 ` [PATCH v3 0/4] " Francesco Dolcini

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=a010d333-70b1-bc58-ddf8-d3fa911a6852@ti.com \
    --to=a-bhatia1@ti.com \
    --cc=airlied@linux.ie \
    --cc=cniedermaier@dh-electronics.com \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francesco.dolcini@toradex.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=max.krummenacher@toradex.com \
    --cc=max.oss.09@gmail.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®