1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
From fdd0972a24818dc336b2235ce93000ee7b88240e Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Thu, 1 Sep 2022 14:04:50 +0200
Subject: [PATCH 2/4] Revert "drm/panel-simple: drop use of data-mapping
property"
This reverts commit d021d751c14752a0266865700f6f212fab40a18c.
Re-enable the data-mapping property which was already used in the
5.4-2.3.0 downstream kernel.
In addition to the revert set bpc from the data-mapping value
as a WARN_ON is printed if missing.
In addition to the revert have mapping pointing to the empty string to
prevent a kernel panic if data-mapping can not be read from the dt and
then an uninitialized pointer is used in strcmp.
Upstream-Status: Denied [Alternative solution being discused]
https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
drivers/gpu/drm/panel/panel-simple.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 95959dcc6e0e..4518eb5d7acb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -464,6 +464,7 @@ static int panel_dpi_probe(struct device *dev,
struct panel_desc *desc;
unsigned int bus_flags;
struct videomode vm;
+ const char *mapping = "";
int ret;
np = dev->of_node;
@@ -488,6 +489,21 @@ 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);
+ of_property_read_string(np, "data-mapping", &mapping);
+ if (!strcmp(mapping, "rgb24")) {
+ desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+ desc->bpc = 8;
+ } else if (!strcmp(mapping, "rgb565")) {
+ desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
+ desc->bpc = 6;
+ } else if (!strcmp(mapping, "bgr666")) {
+ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
+ desc->bpc = 6;
+ } else if (!strcmp(mapping, "lvds666")) {
+ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
+ desc->bpc = 6;
+ }
+
/* Extract bus_flags from display_timing */
bus_flags = 0;
vm.flags = timing->flags;
--
2.35.3
|