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:
 <OS0PR01MB6465F75E3277651A01A70483E0372@OS0PR01MB6465.jpnprd01.prod.outlook.com>
Date: Wed, 4 Dec 2024 08:11:44 +0000
From: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
To: "tomm.merciai@...il.com" <tomm.merciai@...il.com>
CC: "linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>, Biju Das
	<biju.das.jz@...renesas.com>, Liu Ying <victor.liu@....com>, Andrzej Hajda
	<andrzej.hajda@...el.com>, Neil Armstrong <neil.armstrong@...aro.org>, Robert
 Foss <rfoss@...nel.org>, laurent.pinchart
	<laurent.pinchart@...asonboard.com>, Jonas Karlman <jonas@...boo.se>, Jernej
 Skrabec <jernej.skrabec@...il.com>, Maarten Lankhorst
	<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] drm/bridge: ite-it6263: Support VESA input format



-----Original Message-----
From: tomm.merciai@...il.com <tomm.merciai@...il.com>
Sent: Tuesday, December 3, 2024 6:21 PM
To: tomm.merciai@...il.com
Cc: linux-renesas-soc@...r.kernel.org; dri-devel@...ts.freedesktop.org; Biju Das <biju.das.jz@...renesas.com>; Tommaso Merciai <tommaso.merciai.xr@...renesas.com>; Liu Ying <victor.liu@....com>; Andrzej Hajda <andrzej.hajda@...el.com>; Neil Armstrong <neil.armstrong@...aro.org>; Robert Foss <rfoss@...nel.org>; laurent.pinchart <laurent.pinchart@...asonboard.com>; Jonas Karlman <jonas@...boo.se>; Jernej Skrabec <jernej.skrabec@...il.com>; Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>; Maxime Ripard <mripard@...nel.org>; Thomas Zimmermann <tzimmermann@...e.de>; David Airlie <airlied@...il.com>; Simona Vetter <simona@...ll.ch>; linux-kernel@...r.kernel.org
Subject: [PATCH] drm/bridge: ite-it6263: Support VESA input format

From: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>

Introduce it6263_is_input_bus_fmt_valid() and refactor the
it6263_bridge_atomic_get_input_bus_fmts() function to support VESA format by selecting the LVDS input format based on the LVDS data mapping and thereby support both JEIDA and VESA input formats.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
---
 drivers/gpu/drm/bridge/ite-it6263.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ite-it6263.c b/drivers/gpu/drm/bridge/ite-it6263.c
index cbabd4e20d3e..83d1db29157a 100644
--- a/drivers/gpu/drm/bridge/ite-it6263.c
+++ b/drivers/gpu/drm/bridge/ite-it6263.c
@@ -48,6 +48,7 @@
 #define  REG_COL_DEP                   GENMASK(1, 0)
 #define  BIT8                          FIELD_PREP(REG_COL_DEP, 1)
 #define  OUT_MAP                       BIT(4)
+#define  VESA                          BIT(4)
 #define  JEIDA                         0
 #define  REG_DESSC_ENB                 BIT(6)
 #define  DMODE                         BIT(7)
@@ -428,12 +429,30 @@ static inline void it6263_lvds_reset(struct it6263 *it)
        fsleep(10000);
 }

+static bool it6263_is_input_bus_fmt_valid(u32 input_fmt) {
+       switch (input_fmt) {
+       case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
+       case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
+               return true;
+       }
+       return false;
+}
+
 static inline void it6263_lvds_set_interface(struct it6263 *it)  {
+       u8 fmt;
+
        /* color depth */
        regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, REG_COL_DEP, BIT8);
+
+       if (it->lvds_data_mapping == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG)
+               fmt = VESA;
+       else
+               fmt = JEIDA;
+
        /* output mapping */
-       regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, OUT_MAP, JEIDA);
+       regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, OUT_MAP, fmt);

        if (it->lvds_dual_link) {
                regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, DMODE, DISO); @@ -714,14 +733,14 @@ it6263_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,

        *num_input_fmts = 0;

-       if (it->lvds_data_mapping != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA)
+       if (!it6263_is_input_bus_fmt_valid(it->lvds_data_mapping))
                return NULL;

        input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL);
        if (!input_fmts)
                return NULL;

-       input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA;
+       input_fmts[0] = it->lvds_data_mapping;
        *num_input_fmts = 1;

        return input_fmts;
--
2.34.1

Acked-by: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
________________________________

Renesas Electronics Europe GmbH
Registered Office: Arcadiastrasse 10
DE-40472 Duesseldorf
Commercial Registry: Duesseldorf, HRB 3708
Managing Director: Carsten Jauch
VAT-No.: DE 14978647
Tax-ID-No: 105/5839/1793

Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ