Change Startek panel to RGB666 mode
-Integrate changes from Mediatek team to change from RGB888 to RGB666
-Change pixel clock, HFP, HBP, VBP
-Modify porch control registers to match changes in panel struct. Note:
HBP and VBP registers are defined as struct H\V_SYNC + H\V_BP
Change-Id: I09bbb519efe541de72b9e779d34d7053ba5c771e
diff --git a/drivers/gpu/drm/panel/panel-startek-ili9488.c b/drivers/gpu/drm/panel/panel-startek-ili9488.c
index dd6b753..dec9144 100644
--- a/drivers/gpu/drm/panel/panel-startek-ili9488.c
+++ b/drivers/gpu/drm/panel/panel-startek-ili9488.c
@@ -43,15 +43,15 @@
};
static const struct drm_display_mode startek_default_timing = {
- .clock = 26000000 / 1000,
+ .clock = 17700000 / 1000,
.hdisplay = 320,
- .hsync_start = 320 + 170,
- .hsync_end = 320 + 170 + 50,
- .htotal = 320 + 170 + 50 + 50,
+ .hsync_start = 320 + 138,
+ .hsync_end = 320 + 138 + 50,
+ .htotal = 320 + 138 + 50 + 100,
.vdisplay = 480,
.vsync_start = 480 + 2,
.vsync_end = 480 + 2 + 1,
- .vtotal = 480 + 2 + 1 + 1,
+ .vtotal = 480 + 2 + 1 + 2,
.vrefresh = 60,
};
@@ -86,16 +86,16 @@
{.cmd = 0xc5, .para_size = 3, .para = {0x00, 0x1e, 0x80}},
// Interface Mode Control
- {.cmd = 0x3a, .para_size = 1, .para = {0x77}},
+ {.cmd = 0x3a, .para_size = 1, .para = {0x06}},
- // Frame rate 70HZ
- {.cmd = 0xb1, .para_size = 1, .para = {0xb0}},
+ // Frame rate 60HZ
+ {.cmd = 0xb1, .para_size = 2, .para = {0xa0, 0x11}},
// Display Inversion Control
{.cmd = 0xb4, .para_size = 1, .para = {0x02}},
// Blanking Porch Control
- {.cmd = 0xb5, .para_size = 4, .para = {0x02, 0x02, 0xaa, 0x64}},
+ {.cmd = 0xb5, .para_size = 4, .para = {0x02, 0x03, 0x8a, 0x96}},
// Set Image Function
{.cmd = 0xe9, .para_size = 1, .para = {0x01}},
@@ -156,7 +156,7 @@
static int startek_panel_get_modes(struct drm_panel *panel)
{
struct drm_display_mode *mode;
- static const u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+ static const u32 bus_format = MEDIA_BUS_FMT_RGB666_1X18;
int ret;
mode = drm_mode_duplicate(panel->drm, &startek_default_timing);
@@ -172,7 +172,7 @@
drm_mode_set_name(mode);
drm_mode_probed_add(panel->connector, mode);
- panel->connector->display_info.bpc = 8;
+ panel->connector->display_info.bpc = 6;
panel->connector->display_info.height_mm = 49;
panel->connector->display_info.width_mm = 74;
@@ -332,7 +332,7 @@
if (!startek)
return -ENOMEM;
- dsi->format = MIPI_DSI_FMT_RGB888;
+ dsi->format = MIPI_DSI_FMT_RGB666_PACKED;
dsi->mode_flags =
MIPI_DSI_MODE_VIDEO_HSE |
MIPI_DSI_MODE_VIDEO |