lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19b4b043-7f14-7bd3-c4fa-817ae21009ca@pengutronix.de>
Date:   Fri, 2 Jun 2023 16:34:48 +0200
From:   Johannes Zink <j.zink@...gutronix.de>
To:     David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Sam Ravnborg <sam@...nborg.org>
Cc:     devicetree@...r.kernel.org,
        Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
        Dan Carpenter <error27@...il.com>,
        kernel test robot <lkp@...el.com>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        kernel@...gutronix.de, patchwork-jzi@...gutronix.de
Subject: Re: [PATCH v2 3/3] drm/panel-simple: allow LVDS format override

Hi,

gentle ping here - Do you have any feedback for me on this patch?

Thanks and best regards
Johannes

On 5/23/23 10:19, Johannes Zink wrote:
> Some panels support multiple LVDS data mapping formats, which can be
> used e.g. run displays on jeida-18 format when only 3 LVDS lanes are
> available.
> 
> Add parsing of an optional data-mapping devicetree property, which also
> touches up the bits per color to match the bus format.
> 
> Signed-off-by: Johannes Zink <j.zink@...gutronix.de>
> 
> ---
> 
> Changes:
> 
>    v1 -> v2: - fix missing unwind goto found by test robot
>                Reported-by: kernel test robot <lkp@...el.com>
>                Reported-by: Dan Carpenter <error27@...il.com>
>                Link: https://lore.kernel.org/r/202304160359.4LHmFOlU-lkp@intel.com/
> ---
>   drivers/gpu/drm/panel/panel-simple.c | 39 +++++++++++++++++++++++++++++++++++-
>   1 file changed, 38 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 2a9c1a785a5c..0a35fdb49ccb 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -40,6 +40,7 @@
>   #include <drm/drm_edid.h>
>   #include <drm/drm_mipi_dsi.h>
>   #include <drm/drm_panel.h>
> +#include <drm/drm_of.h>
>   
>   /**
>    * struct panel_desc - Describes a simple panel.
> @@ -559,7 +560,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>   	struct device_node *ddc;
>   	int connector_type;
>   	u32 bus_flags;
> -	int err;
> +	int err, ret;
>   
>   	panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
>   	if (!panel)
> @@ -605,6 +606,42 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>   			panel_simple_parse_panel_timing_node(dev, panel, &dt);
>   	}
>   
> +
> +	/* optional data-mapping property for overriding bus format */
> +	ret = drm_of_lvds_get_data_mapping(dev->of_node);
> +	if (ret == -EINVAL) {
> +		dev_warn(dev, "Ignore invalid data-mapping property");
> +	} else if (ret != -ENODEV) {
> +		int bpc;
> +
> +		switch (ret) {
> +		default:
> +			WARN_ON(1);
> +			fallthrough;
> +		case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
> +			fallthrough;
> +		case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
> +			bpc = 8;
> +			break;
> +		case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
> +			bpc = 6;
> +		}
> +
> +		if (desc->bpc != bpc || desc->bus_format != ret) {
> +			struct panel_desc *override_desc;
> +
> +			override_desc = devm_kmemdup(dev, desc, sizeof(*desc), GFP_KERNEL);
> +			if (!override_desc) {
> +				err = -ENOMEM;
> +				goto free_ddc;
> +			}
> +
> +			override_desc->bus_format = ret;
> +			override_desc->bpc = bpc;
> +			panel->desc = override_desc;
> +		}
> +	}
> +
>   	connector_type = desc->connector_type;
>   	/* Catch common mistakes for panels. */
>   	switch (connector_type) {
> 

-- 
Pengutronix e.K.                | Johannes Zink                  |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ