linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] drm/vc4: dpi: Various improvements
@ 2022-12-01  8:42 Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 1/7] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI Maxime Ripard
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

Hi,

Those patches have been in the downstream RaspberryPi tree for a while and help
to support more DPI displays.

Let me know what you think,
Maxime

To: Emma Anholt <emma@anholt.net>
To: Maxime Ripard <mripard@kernel.org>
To: David Airlie <airlied@linux.ie>
To: Daniel Vetter <daniel@ffwll.ch>
To: Eric Anholt <eric@anholt.net>
To: Rob Herring <robh@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Chris Morgan <macromorgan@hotmail.com>
Cc: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>

---
Changes in v3:
- Rebased on drm-misc-next-2022-11-24
- Fixed the order of the new defines and documentation
- Link to v2: https://lore.kernel.org/r/20221013-rpi-dpi-improvements-v2-0-7691903fb9c8@cerno.tech

Changes in v2:
- Documentation for the media bus formats
- Reword the commit log of patch 5
- Link to v1: https://lore.kernel.org/r/20221013-rpi-dpi-improvements-v1-0-8a7a96949cb0@cerno.tech

---
Chris Morgan (2):
      media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI
      drm/vc4: dpi: Support RGB565 format

Dave Stevenson (2):
      drm/vc4: dpi: Change the default DPI format to being 18bpp, not 24.
      drm/vc4: dpi: Fix format mapping for RGB565

Joerg Quinten (3):
      media: uapi: add MEDIA_BUS_FMT_BGR666_1X18
      media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI
      drm/vc4: dpi: Support BGR666 formats

 .../userspace-api/media/v4l/subdev-formats.rst     | 111 +++++++++++++++++++++
 drivers/gpu/drm/vc4/vc4_dpi.c                      |  16 ++-
 include/uapi/linux/media-bus-format.h              |   5 +-
 3 files changed, 128 insertions(+), 4 deletions(-)
---
base-commit: 6fb6c979ca628583d4d0c59a0f8ff977e581ecc0
change-id: 20221013-rpi-dpi-improvements-c3d755531c39

Best regards,
-- 
Maxime Ripard <maxime@cerno.tech>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/7] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 2/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X18 Maxime Ripard
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Chris Morgan <macromorgan@hotmail.com>

Add the MEDIA_BUS_FMT_RGB565_1X24_CPADHI format used by the Geekworm
MZP280 panel for the Raspberry Pi.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../userspace-api/media/v4l/subdev-formats.rst     | 37 ++++++++++++++++++++++
 include/uapi/linux/media-bus-format.h              |  3 +-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
index d21d532eee15..aa549c42e798 100644
--- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
+++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
@@ -1023,6 +1023,43 @@ The following tables list existing packed RGB formats.
       - b\ :sub:`2`
       - b\ :sub:`1`
       - b\ :sub:`0`
+    * .. _MEDIA-BUS-FMT-RGB565-1X24_CPADHI:
+
+      - MEDIA_BUS_FMT_RGB565_1X24_CPADHI
+      - 0x1022
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      - 0
+      - 0
+      - 0
+      - r\ :sub:`4`
+      - r\ :sub:`3`
+      - r\ :sub:`2`
+      - r\ :sub:`1`
+      - r\ :sub:`0`
+      - 0
+      - 0
+      - g\ :sub:`5`
+      - g\ :sub:`4`
+      - g\ :sub:`3`
+      - g\ :sub:`2`
+      - g\ :sub:`1`
+      - g\ :sub:`0`
+      - 0
+      - 0
+      - 0
+      - b\ :sub:`4`
+      - b\ :sub:`3`
+      - b\ :sub:`2`
+      - b\ :sub:`1`
+      - b\ :sub:`0`
     * .. _MEDIA-BUS-FMT-BGR888-1X24:
 
       - MEDIA_BUS_FMT_BGR888_1X24
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index ec3323dbb927..8e159e6b4d21 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -34,7 +34,7 @@
 
 #define MEDIA_BUS_FMT_FIXED			0x0001
 
-/* RGB - next is	0x1022 */
+/* RGB - next is	0x1023 */
 #define MEDIA_BUS_FMT_RGB444_1X12		0x1016
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
@@ -48,6 +48,7 @@
 #define MEDIA_BUS_FMT_RGB666_1X18		0x1009
 #define MEDIA_BUS_FMT_RBG888_1X24		0x100e
 #define MEDIA_BUS_FMT_RGB666_1X24_CPADHI	0x1015
+#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI	0x1022
 #define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG		0x1010
 #define MEDIA_BUS_FMT_BGR888_1X24		0x1013
 #define MEDIA_BUS_FMT_BGR888_3X8		0x101b

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X18
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 1/7] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI Maxime Ripard
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Joerg Quinten <aBUGSworstnightmare@gmail.com>

Add the BGR666 format MEDIA_BUS_FMT_BGR666_1X18 supported by the
RaspberryPi.

Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../userspace-api/media/v4l/subdev-formats.rst     | 37 ++++++++++++++++++++++
 include/uapi/linux/media-bus-format.h              |  3 +-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
index aa549c42e798..6605c056cc7c 100644
--- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
+++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
@@ -949,6 +949,43 @@ The following tables list existing packed RGB formats.
       - b\ :sub:`2`
       - b\ :sub:`1`
       - b\ :sub:`0`
+    * .. _MEDIA-BUS-FMT-BGR666-1X18:
+
+      - MEDIA_BUS_FMT_BGR666_1X18
+      - 0x1023
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      - b\ :sub:`5`
+      - b\ :sub:`4`
+      - b\ :sub:`3`
+      - b\ :sub:`2`
+      - b\ :sub:`1`
+      - b\ :sub:`0`
+      - g\ :sub:`5`
+      - g\ :sub:`4`
+      - g\ :sub:`3`
+      - g\ :sub:`2`
+      - g\ :sub:`1`
+      - g\ :sub:`0`
+      - r\ :sub:`5`
+      - r\ :sub:`4`
+      - r\ :sub:`3`
+      - r\ :sub:`2`
+      - r\ :sub:`1`
+      - r\ :sub:`0`
     * .. _MEDIA-BUS-FMT-RBG888-1X24:
 
       - MEDIA_BUS_FMT_RBG888_1X24
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 8e159e6b4d21..6ce56a984112 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -34,7 +34,7 @@
 
 #define MEDIA_BUS_FMT_FIXED			0x0001
 
-/* RGB - next is	0x1023 */
+/* RGB - next is	0x1024 */
 #define MEDIA_BUS_FMT_RGB444_1X12		0x1016
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
@@ -46,6 +46,7 @@
 #define MEDIA_BUS_FMT_RGB565_2X8_BE		0x1007
 #define MEDIA_BUS_FMT_RGB565_2X8_LE		0x1008
 #define MEDIA_BUS_FMT_RGB666_1X18		0x1009
+#define MEDIA_BUS_FMT_BGR666_1X18		0x1023
 #define MEDIA_BUS_FMT_RBG888_1X24		0x100e
 #define MEDIA_BUS_FMT_RGB666_1X24_CPADHI	0x1015
 #define MEDIA_BUS_FMT_RGB565_1X24_CPADHI	0x1022

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 1/7] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 2/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X18 Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  9:56   ` Laurent Pinchart
  2022-12-01  8:42 ` [PATCH v3 4/7] drm/vc4: dpi: Support RGB565 format Maxime Ripard
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Joerg Quinten <aBUGSworstnightmare@gmail.com>

Add the BGR666 format MEDIA_BUS_FMT_BGR666_1X24_CPADHI supported by the
RaspberryPi.

Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../userspace-api/media/v4l/subdev-formats.rst     | 37 ++++++++++++++++++++++
 include/uapi/linux/media-bus-format.h              |  3 +-
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
index 6605c056cc7c..5f2ce6eada71 100644
--- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
+++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
@@ -1060,6 +1060,43 @@ The following tables list existing packed RGB formats.
       - b\ :sub:`2`
       - b\ :sub:`1`
       - b\ :sub:`0`
+    * .. _MEDIA-BUS-FMT-BGR666-1X24_CPADHI:
+
+      - MEDIA_BUS_FMT_BGR666_1X24_CPADHI
+      - 0x1024
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      -
+      - 0
+      - 0
+      - b\ :sub:`5`
+      - b\ :sub:`4`
+      - b\ :sub:`3`
+      - b\ :sub:`2`
+      - b\ :sub:`1`
+      - b\ :sub:`0`
+      - 0
+      - 0
+      - g\ :sub:`5`
+      - g\ :sub:`4`
+      - g\ :sub:`3`
+      - g\ :sub:`2`
+      - g\ :sub:`1`
+      - g\ :sub:`0`
+      - 0
+      - 0
+      - r\ :sub:`5`
+      - r\ :sub:`4`
+      - r\ :sub:`3`
+      - r\ :sub:`2`
+      - r\ :sub:`1`
+      - r\ :sub:`0`
     * .. _MEDIA-BUS-FMT-RGB565-1X24_CPADHI:
 
       - MEDIA_BUS_FMT_RGB565_1X24_CPADHI
diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 6ce56a984112..f3b0b8091a2c 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -34,7 +34,7 @@
 
 #define MEDIA_BUS_FMT_FIXED			0x0001
 
-/* RGB - next is	0x1024 */
+/* RGB - next is	0x1025 */
 #define MEDIA_BUS_FMT_RGB444_1X12		0x1016
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
 #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
@@ -49,6 +49,7 @@
 #define MEDIA_BUS_FMT_BGR666_1X18		0x1023
 #define MEDIA_BUS_FMT_RBG888_1X24		0x100e
 #define MEDIA_BUS_FMT_RGB666_1X24_CPADHI	0x1015
+#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI	0x1024
 #define MEDIA_BUS_FMT_RGB565_1X24_CPADHI	0x1022
 #define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG		0x1010
 #define MEDIA_BUS_FMT_BGR888_1X24		0x1013

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 4/7] drm/vc4: dpi: Support RGB565 format
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
                   ` (2 preceding siblings ...)
  2022-12-01  8:42 ` [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 5/7] drm/vc4: dpi: Support BGR666 formats Maxime Ripard
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Chris Morgan <macromorgan@hotmail.com>

The RGB565 format with padding over 24 bits
(MEDIA_BUS_FMT_RGB565_1X24_CPADHI) is supported by the vc4 DPI
controller. This is what the Geekworm MZP280 DPI display uses, so let's
add support for it in the DPI controller driver.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_dpi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 1f8f44b7b5a5..7da3dd1db50e 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -182,6 +182,10 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3,
 						       DPI_FORMAT);
 				break;
+			case MEDIA_BUS_FMT_RGB565_1X24_CPADHI:
+				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_2,
+						       DPI_FORMAT);
+				break;
 			default:
 				DRM_ERROR("Unknown media bus format %d\n",
 					  bus_format);

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 5/7] drm/vc4: dpi: Support BGR666 formats
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
                   ` (3 preceding siblings ...)
  2022-12-01  8:42 ` [PATCH v3 4/7] drm/vc4: dpi: Support RGB565 format Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 6/7] drm/vc4: dpi: Change the default DPI format to being 18bpp, not 24 Maxime Ripard
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Joerg Quinten <aBUGSworstnightmare@gmail.com>

The VC4 DPI output can support multiple BGR666 variants, but they were
never added to the driver. Let's add the the support for those formats.

Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_dpi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 7da3dd1db50e..ecbe4cd87036 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -170,10 +170,16 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 				dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR,
 						       DPI_ORDER);
 				break;
+			case MEDIA_BUS_FMT_BGR666_1X24_CPADHI:
+				dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
+				fallthrough;
 			case MEDIA_BUS_FMT_RGB666_1X24_CPADHI:
 				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2,
 						       DPI_FORMAT);
 				break;
+			case MEDIA_BUS_FMT_BGR666_1X18:
+				dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
+				fallthrough;
 			case MEDIA_BUS_FMT_RGB666_1X18:
 				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
 						       DPI_FORMAT);

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 6/7] drm/vc4: dpi: Change the default DPI format to being 18bpp, not 24.
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
                   ` (4 preceding siblings ...)
  2022-12-01  8:42 ` [PATCH v3 5/7] drm/vc4: dpi: Support BGR666 formats Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01  8:42 ` [PATCH v3 7/7] drm/vc4: dpi: Fix format mapping for RGB565 Maxime Ripard
  2022-12-01 10:18 ` [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Dave Stevenson <dave.stevenson@raspberrypi.com>

DPI hasn't really been used up until now, so the default has
been meaningless.
In theory we should be able to pass the desired format for the
adjacent bridge chip through, but framework seems to be missing
for that.

As the main device to use DPI is the VGA666 or Adafruit Kippah,
both of which use RGB666, change the default to being RGB666 instead
of RGB888.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_dpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index ecbe4cd87036..fdae02760b6d 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -150,8 +150,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 	}
 	drm_connector_list_iter_end(&conn_iter);
 
-	/* Default to 24bit if no connector or format found. */
-	dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT);
+	/* Default to 18bit if no connector or format found. */
+	dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, DPI_FORMAT);
 
 	if (connector) {
 		if (connector->display_info.num_bus_formats) {

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 7/7] drm/vc4: dpi: Fix format mapping for RGB565
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
                   ` (5 preceding siblings ...)
  2022-12-01  8:42 ` [PATCH v3 6/7] drm/vc4: dpi: Change the default DPI format to being 18bpp, not 24 Maxime Ripard
@ 2022-12-01  8:42 ` Maxime Ripard
  2022-12-01 10:18 ` [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01  8:42 UTC (permalink / raw)
  To: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt
  Cc: Dave Stevenson, Maxime Ripard, dri-devel, Laurent Pinchart,
	Chris Morgan, Laurent Pinchart, Joerg Quinten, linux-kernel

From: Dave Stevenson <dave.stevenson@raspberrypi.com>

The mapping is incorrect for RGB565_1X16 as it should be
DPI_FORMAT_18BIT_666_RGB_1 instead of DPI_FORMAT_18BIT_666_RGB_3.

Fixes: 08302c35b59d ("drm/vc4: Add DPI driver")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_dpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index fdae02760b6d..a7bebfa5d5b0 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -185,7 +185,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 						       DPI_FORMAT);
 				break;
 			case MEDIA_BUS_FMT_RGB565_1X16:
-				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3,
+				dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1,
 						       DPI_FORMAT);
 				break;
 			case MEDIA_BUS_FMT_RGB565_1X24_CPADHI:

-- 
b4 0.10.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI
  2022-12-01  8:42 ` [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI Maxime Ripard
@ 2022-12-01  9:56   ` Laurent Pinchart
  0 siblings, 0 replies; 10+ messages in thread
From: Laurent Pinchart @ 2022-12-01  9:56 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maxime Ripard, Daniel Vetter, Rob Herring, David Airlie,
	Emma Anholt, Eric Anholt, Dave Stevenson, dri-devel,
	Chris Morgan, Joerg Quinten, linux-kernel

Hi Maxime,

Thank you for the patch.

On Thu, Dec 01, 2022 at 09:42:48AM +0100, Maxime Ripard wrote:
> From: Joerg Quinten <aBUGSworstnightmare@gmail.com>
> 
> Add the BGR666 format MEDIA_BUS_FMT_BGR666_1X24_CPADHI supported by the
> RaspberryPi.
> 
> Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  .../userspace-api/media/v4l/subdev-formats.rst     | 37 ++++++++++++++++++++++
>  include/uapi/linux/media-bus-format.h              |  3 +-
>  2 files changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> index 6605c056cc7c..5f2ce6eada71 100644
> --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
> +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> @@ -1060,6 +1060,43 @@ The following tables list existing packed RGB formats.
>        - b\ :sub:`2`
>        - b\ :sub:`1`
>        - b\ :sub:`0`
> +    * .. _MEDIA-BUS-FMT-BGR666-1X24_CPADHI:
> +
> +      - MEDIA_BUS_FMT_BGR666_1X24_CPADHI
> +      - 0x1024
> +      -
> +      -
> +      -
> +      -
> +      -
> +      -
> +      -
> +      -
> +      -
> +      - 0
> +      - 0
> +      - b\ :sub:`5`
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - 0
> +      - 0
> +      - g\ :sub:`5`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      - g\ :sub:`2`
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - 0
> +      - 0
> +      - r\ :sub:`5`
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
>      * .. _MEDIA-BUS-FMT-RGB565-1X24_CPADHI:
>  
>        - MEDIA_BUS_FMT_RGB565_1X24_CPADHI
> diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
> index 6ce56a984112..f3b0b8091a2c 100644
> --- a/include/uapi/linux/media-bus-format.h
> +++ b/include/uapi/linux/media-bus-format.h
> @@ -34,7 +34,7 @@
>  
>  #define MEDIA_BUS_FMT_FIXED			0x0001
>  
> -/* RGB - next is	0x1024 */
> +/* RGB - next is	0x1025 */
>  #define MEDIA_BUS_FMT_RGB444_1X12		0x1016
>  #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
>  #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
> @@ -49,6 +49,7 @@
>  #define MEDIA_BUS_FMT_BGR666_1X18		0x1023
>  #define MEDIA_BUS_FMT_RBG888_1X24		0x100e
>  #define MEDIA_BUS_FMT_RGB666_1X24_CPADHI	0x1015
> +#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI	0x1024
>  #define MEDIA_BUS_FMT_RGB565_1X24_CPADHI	0x1022
>  #define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG		0x1010
>  #define MEDIA_BUS_FMT_BGR888_1X24		0x1013
> 

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] drm/vc4: dpi: Various improvements
  2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
                   ` (6 preceding siblings ...)
  2022-12-01  8:42 ` [PATCH v3 7/7] drm/vc4: dpi: Fix format mapping for RGB565 Maxime Ripard
@ 2022-12-01 10:18 ` Maxime Ripard
  7 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-12-01 10:18 UTC (permalink / raw)
  To: David Airlie, Maxime Ripard, Maxime Ripard, Emma Anholt,
	Eric Anholt, Daniel Vetter, Rob Herring
  Cc: linux-kernel, Laurent Pinchart, Joerg Quinten, dri-devel,
	Chris Morgan, Laurent Pinchart, Dave Stevenson

On Thu, 01 Dec 2022 09:42:45 +0100, Maxime Ripard wrote:
> Those patches have been in the downstream RaspberryPi tree for a while and help
> to support more DPI displays.
> 
> Let me know what you think,
> Maxime
> 
> 
> [...]

Applied to drm/drm-misc (drm-misc-next).

Thanks!
Maxime

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-01 10:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01  8:42 [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 1/7] media: uapi: add MEDIA_BUS_FMT_RGB565_1X24_CPADHI Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 2/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X18 Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 3/7] media: uapi: add MEDIA_BUS_FMT_BGR666_1X24_CPADHI Maxime Ripard
2022-12-01  9:56   ` Laurent Pinchart
2022-12-01  8:42 ` [PATCH v3 4/7] drm/vc4: dpi: Support RGB565 format Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 5/7] drm/vc4: dpi: Support BGR666 formats Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 6/7] drm/vc4: dpi: Change the default DPI format to being 18bpp, not 24 Maxime Ripard
2022-12-01  8:42 ` [PATCH v3 7/7] drm/vc4: dpi: Fix format mapping for RGB565 Maxime Ripard
2022-12-01 10:18 ` [PATCH v3 0/7] drm/vc4: dpi: Various improvements Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).