Skip to content

Commit f88b9ad

Browse files
aBUGSworstnightmare-rpipelwell
authored andcommitted
Support RPi DPI interface in mode6 for 18-bit color
A matching media bus format was added and an overlay for using it, both with FB and VC4 was added as well. Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
1 parent 0ea4d9e commit f88b9ad

5 files changed

Lines changed: 124 additions & 1 deletion

File tree

‎Documentation/devicetree/bindings/display/panel/panel-simple.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ properties:
147147
- ivo,m133nwf4-r0
148148
# Innolux AT043TN24 4.3" WQVGA TFT LCD panel
149149
- innolux,at043tn24
150+
# Innolux AT056tN53V1 5.6" VGA (640x480) TFT LCD panel
151+
- innolux,at056tn53v1
150152
# Innolux AT070TN92 7.0" WQVGA TFT LCD panel
151153
- innolux,at070tn92
152154
# Innolux G070Y2-L01 7" WVGA (800x480) TFT LCD panel

‎Documentation/userspace-api/media/v4l/subdev-formats.rst‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,43 @@ The following tables list existing packed RGB formats.
908908
- g\ :sub:`5`
909909
- g\ :sub:`4`
910910
- g\ :sub:`3`
911+
* .. _MEDIA-BUS-FMT-BGR666-1X18:
912+
913+
- MEDIA_BUS_FMT_RGB666_1X18
914+
- 0x101f
915+
-
916+
-
917+
-
918+
-
919+
-
920+
-
921+
-
922+
-
923+
-
924+
-
925+
-
926+
-
927+
-
928+
-
929+
-
930+
- b\ :sub:`5`
931+
- b\ :sub:`4`
932+
- b\ :sub:`3`
933+
- b\ :sub:`2`
934+
- b\ :sub:`1`
935+
- b\ :sub:`0`
936+
- g\ :sub:`5`
937+
- g\ :sub:`4`
938+
- g\ :sub:`3`
939+
- g\ :sub:`2`
940+
- g\ :sub:`1`
941+
- g\ :sub:`0`
942+
- r\ :sub:`5`
943+
- r\ :sub:`4`
944+
- r\ :sub:`3`
945+
- r\ :sub:`2`
946+
- r\ :sub:`1`
947+
- r\ :sub:`0`
911948
* .. _MEDIA-BUS-FMT-RGB666-1X18:
912949

913950
- MEDIA_BUS_FMT_RGB666_1X18
@@ -982,6 +1019,43 @@ The following tables list existing packed RGB formats.
9821019
- g\ :sub:`2`
9831020
- g\ :sub:`1`
9841021
- g\ :sub:`0`
1022+
* .. _MEDIA-BUS-FMT-BGR666-1X24_CPADHI:
1023+
1024+
- MEDIA_BUS_FMT_BGR666_1X24_CPADHI
1025+
- 0x101e
1026+
-
1027+
-
1028+
-
1029+
-
1030+
-
1031+
-
1032+
-
1033+
-
1034+
-
1035+
- 0
1036+
- 0
1037+
- b\ :sub:`5`
1038+
- b\ :sub:`4`
1039+
- b\ :sub:`3`
1040+
- b\ :sub:`2`
1041+
- b\ :sub:`1`
1042+
- b\ :sub:`0`
1043+
- 0
1044+
- 0
1045+
- g\ :sub:`5`
1046+
- g\ :sub:`4`
1047+
- g\ :sub:`3`
1048+
- g\ :sub:`2`
1049+
- g\ :sub:`1`
1050+
- g\ :sub:`0`
1051+
- 0
1052+
- 0
1053+
- r\ :sub:`5`
1054+
- r\ :sub:`4`
1055+
- r\ :sub:`3`
1056+
- r\ :sub:`2`
1057+
- r\ :sub:`1`
1058+
- r\ :sub:`0`
9851059
* .. _MEDIA-BUS-FMT-RGB666-1X24_CPADHI:
9861060

9871061
- MEDIA_BUS_FMT_RGB666_1X24_CPADHI

‎drivers/gpu/drm/panel/panel-simple.c‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,38 @@ static const struct panel_desc innolux_at043tn24 = {
20932093
.bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
20942094
};
20952095

2096+
static const struct display_timing innolux_at056tn53v1_timing = {
2097+
.pixelclock = { 39700000, 39700000, 39700000},
2098+
.hactive = { 640, 640, 640 },
2099+
.hfront_porch = { 16, 16, 16 },
2100+
.hback_porch = { 134, 134, 134 },
2101+
.hsync_len = { 10, 10, 10},
2102+
.vactive = { 480, 480, 480 },
2103+
.vfront_porch = { 32, 32, 32},
2104+
.vback_porch = { 11, 11, 11 },
2105+
.vsync_len = { 2, 2, 2 },
2106+
.flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_PHSYNC,
2107+
};
2108+
2109+
static const struct panel_desc innolux_at056tn53v1 = {
2110+
.timings = &innolux_at056tn53v1_timing,
2111+
.num_timings = 1,
2112+
.bpc = 6,
2113+
.size = {
2114+
.width = 112,
2115+
.height = 84,
2116+
},
2117+
.delay = {
2118+
.prepare = 50,
2119+
.enable = 200,
2120+
.disable = 110,
2121+
.unprepare = 200,
2122+
},
2123+
.bus_format = MEDIA_BUS_FMT_BGR666_1X24_CPADHI,
2124+
.bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
2125+
.connector_type = DRM_MODE_CONNECTOR_DPI,
2126+
};
2127+
20962128
static const struct drm_display_mode innolux_at070tn92_mode = {
20972129
.clock = 33333,
20982130
.hdisplay = 800,
@@ -4075,6 +4107,9 @@ static const struct of_device_id platform_of_match[] = {
40754107
}, {
40764108
.compatible = "innolux,at043tn24",
40774109
.data = &innolux_at043tn24,
4110+
}, {
4111+
.compatible = "innolux,at056tn53v1",
4112+
.data = &innolux_at056tn53v1,
40784113
}, {
40794114
.compatible = "innolux,at070tn92",
40804115
.data = &innolux_at070tn92,

‎drivers/gpu/drm/vc4/vc4_dpi.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,20 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
165165
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2,
166166
DPI_FORMAT);
167167
break;
168+
case MEDIA_BUS_FMT_BGR666_1X24_CPADHI:
169+
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2,
170+
DPI_FORMAT);
171+
dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
172+
break;
168173
case MEDIA_BUS_FMT_RGB666_1X18:
169174
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
170175
DPI_FORMAT);
171176
break;
177+
case MEDIA_BUS_FMT_BGR666_1X18:
178+
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1,
179+
DPI_FORMAT);
180+
dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER);
181+
break;
172182
case MEDIA_BUS_FMT_RGB565_1X16:
173183
dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3,
174184
DPI_FORMAT);

‎include/uapi/linux/media-bus-format.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#define MEDIA_BUS_FMT_FIXED 0x0001
3636

37-
/* RGB - next is 0x101d */
37+
/* RGB - next is 0x1020 */
3838
#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
3939
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
4040
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
@@ -45,8 +45,10 @@
4545
#define MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006
4646
#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
4747
#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
48+
#define MEDIA_BUS_FMT_BGR666_1X18 0x101f
4849
#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
4950
#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
51+
#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI 0x101e
5052
#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
5153
#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
5254
#define MEDIA_BUS_FMT_BGR888_1X24 0x1013

0 commit comments

Comments
 (0)