summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-06-28 10:12:25 -0400
committerTom Rini <trini@konsulko.com>2020-06-28 10:12:25 -0400
commit19a7e5814b77b288472aa96b6d94fb2591cc9184 (patch)
tree63d44b846dca34b1fd237eae392f748a1212fb65
parent5f99ba1e24693eb881c2eb673f78ee241056f825 (diff)
parentbccb385a83a5f9ee603a30de1d39b03fd6f45b23 (diff)
downloadu-boot-WIP/28Jun2020.tar.gz
Merge tag 'fixes-for-v2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-videoWIP/28Jun2020
- fix logo on mx6ul_14x14_evk with DM_VIDEO enabled - fix banner string overwriting the logo on small displays - fix splash warning when building for ARM64 - fix STM32 DSI driver to probe only on supported hardware - fix memory corruption with DSI panel drivers
-rw-r--r--common/splash.c2
-rw-r--r--drivers/video/orisetech_otm8009a.c20
-rw-r--r--drivers/video/raydium-rm68200.c20
-rw-r--r--drivers/video/stm32/stm32_dsi.c13
-rw-r--r--drivers/video/vidconsole-uclass.c1
-rw-r--r--drivers/video/video_bmp.c27
-rw-r--r--include/mipi_dsi.h6
7 files changed, 51 insertions, 38 deletions
diff --git a/common/splash.c b/common/splash.c
index e7d847726d..2b9313e03f 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -59,7 +59,7 @@ static struct splash_location default_splash_locations[] = {
static int splash_video_logo_load(void)
{
char *splashimage;
- u32 bmp_load_addr;
+ ulong bmp_load_addr;
splashimage = env_get("splashimage");
if (!splashimage)
diff --git a/drivers/video/orisetech_otm8009a.c b/drivers/video/orisetech_otm8009a.c
index b1f2dd403e..362bf6a6fe 100644
--- a/drivers/video/orisetech_otm8009a.c
+++ b/drivers/video/orisetech_otm8009a.c
@@ -62,9 +62,6 @@
struct otm8009a_panel_priv {
struct udevice *reg;
struct gpio_desc reset;
- unsigned int lanes;
- enum mipi_dsi_pixel_format format;
- unsigned long mode_flags;
};
static const struct display_timing default_timing = {
@@ -293,17 +290,8 @@ static int otm8009a_panel_enable_backlight(struct udevice *dev)
static int otm8009a_panel_get_display_timing(struct udevice *dev,
struct display_timing *timings)
{
- struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
- struct mipi_dsi_device *device = plat->device;
- struct otm8009a_panel_priv *priv = dev_get_priv(dev);
-
memcpy(timings, &default_timing, sizeof(*timings));
- /* fill characteristics of DSI data link */
- device->lanes = priv->lanes;
- device->format = priv->format;
- device->mode_flags = priv->mode_flags;
-
return 0;
}
@@ -335,6 +323,7 @@ static int otm8009a_panel_ofdata_to_platdata(struct udevice *dev)
static int otm8009a_panel_probe(struct udevice *dev)
{
struct otm8009a_panel_priv *priv = dev_get_priv(dev);
+ struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
int ret;
if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) {
@@ -350,9 +339,10 @@ static int otm8009a_panel_probe(struct udevice *dev)
dm_gpio_set_value(&priv->reset, false);
mdelay(10); /* >5ms */
- priv->lanes = 2;
- priv->format = MIPI_DSI_FMT_RGB888;
- priv->mode_flags = MIPI_DSI_MODE_VIDEO |
+ /* fill characteristics of DSI data link */
+ plat->lanes = 2;
+ plat->format = MIPI_DSI_FMT_RGB888;
+ plat->mode_flags = MIPI_DSI_MODE_VIDEO |
MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM;
diff --git a/drivers/video/raydium-rm68200.c b/drivers/video/raydium-rm68200.c
index 9169280fb8..353894503b 100644
--- a/drivers/video/raydium-rm68200.c
+++ b/drivers/video/raydium-rm68200.c
@@ -75,9 +75,6 @@ struct rm68200_panel_priv {
struct udevice *reg;
struct udevice *backlight;
struct gpio_desc reset;
- unsigned int lanes;
- enum mipi_dsi_pixel_format format;
- unsigned long mode_flags;
};
static const struct display_timing default_timing = {
@@ -259,17 +256,8 @@ static int rm68200_panel_enable_backlight(struct udevice *dev)
static int rm68200_panel_get_display_timing(struct udevice *dev,
struct display_timing *timings)
{
- struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
- struct mipi_dsi_device *device = plat->device;
- struct rm68200_panel_priv *priv = dev_get_priv(dev);
-
memcpy(timings, &default_timing, sizeof(*timings));
- /* fill characteristics of DSI data link */
- device->lanes = priv->lanes;
- device->format = priv->format;
- device->mode_flags = priv->mode_flags;
-
return 0;
}
@@ -308,6 +296,7 @@ static int rm68200_panel_ofdata_to_platdata(struct udevice *dev)
static int rm68200_panel_probe(struct udevice *dev)
{
struct rm68200_panel_priv *priv = dev_get_priv(dev);
+ struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
int ret;
if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) {
@@ -322,9 +311,10 @@ static int rm68200_panel_probe(struct udevice *dev)
dm_gpio_set_value(&priv->reset, false);
mdelay(10);
- priv->lanes = 2;
- priv->format = MIPI_DSI_FMT_RGB888;
- priv->mode_flags = MIPI_DSI_MODE_VIDEO |
+ /* fill characteristics of DSI data link */
+ plat->lanes = 2;
+ plat->format = MIPI_DSI_FMT_RGB888;
+ plat->mode_flags = MIPI_DSI_MODE_VIDEO |
MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM;
diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c
index 04796435f1..283151398b 100644
--- a/drivers/video/stm32/stm32_dsi.c
+++ b/drivers/video/stm32/stm32_dsi.c
@@ -271,7 +271,6 @@ static int dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,
u32 val;
/* Update lane capabilities according to hw version */
- dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
dsi->lane_min_kbps = LANE_MIN_KBPS;
dsi->lane_max_kbps = LANE_MAX_KBPS;
if (dsi->hw_version == HWVER_131) {
@@ -354,6 +353,9 @@ static int stm32_dsi_attach(struct udevice *dev)
mplat = dev_get_platdata(priv->panel);
mplat->device = &priv->device;
+ device->lanes = mplat->lanes;
+ device->format = mplat->format;
+ device->mode_flags = mplat->mode_flags;
ret = panel_get_display_timing(priv->panel, &timings);
if (ret) {
@@ -475,6 +477,15 @@ static int stm32_dsi_probe(struct udevice *dev)
/* Reset */
reset_deassert(&rst);
+ /* check hardware version */
+ priv->hw_version = dsi_read(priv, DSI_VERSION) & VERSION;
+ if (priv->hw_version != HWVER_130 &&
+ priv->hw_version != HWVER_131) {
+ dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
+ ret = -ENODEV;
+ goto err_clk;
+ }
+
return 0;
err_clk:
clk_disable(&clk);
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index d30e6db6f6..9b76154721 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -622,6 +622,7 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
col *= priv->x_charsize;
row *= priv->y_charsize;
priv->xcur_frac = VID_TO_POS(min_t(short, col, vid_priv->xsize - 1));
+ priv->xstart_frac = priv->xcur_frac;
priv->ycur = min_t(short, row, vid_priv->ysize - 1);
}
diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index eb9636541d..7d7f37b445 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -233,6 +233,8 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
*/
if (bpix != bmp_bpix &&
!(bmp_bpix == 8 && bpix == 16) &&
+ !(bmp_bpix == 8 && bpix == 24) &&
+ !(bmp_bpix == 8 && bpix == 32) &&
!(bmp_bpix == 24 && bpix == 16) &&
!(bmp_bpix == 24 && bpix == 32)) {
printf("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
@@ -265,6 +267,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
switch (bmp_bpix) {
case 1:
case 8: {
+ struct bmp_color_table_entry *cte;
cmap_base = priv->cmap;
#ifdef CONFIG_VIDEO_BMP_RLE8
u32 compression = get_unaligned_le32(&bmp->header.compression);
@@ -280,21 +283,33 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
break;
}
#endif
-
- if (bpix != 16)
+ byte_width = width * (bpix / 8);
+ if (!byte_width)
byte_width = width;
- else
- byte_width = width * 2;
for (i = 0; i < height; ++i) {
WATCHDOG_RESET();
for (j = 0; j < width; j++) {
- if (bpix != 16) {
+ if (bpix == 8) {
fb_put_byte(&fb, &bmap);
- } else {
+ } else if (bpix == 16) {
*(uint16_t *)fb = cmap_base[*bmap];
bmap++;
fb += sizeof(uint16_t) / sizeof(*fb);
+ } else {
+ /* Only support big endian */
+ cte = &palette[*bmap];
+ bmap++;
+ if (bpix == 24) {
+ *(fb++) = cte->red;
+ *(fb++) = cte->green;
+ *(fb++) = cte->blue;
+ } else {
+ *(fb++) = cte->blue;
+ *(fb++) = cte->green;
+ *(fb++) = cte->red;
+ *(fb++) = 0;
+ }
}
}
bmap += (padded_width - width);
diff --git a/include/mipi_dsi.h b/include/mipi_dsi.h
index 83c5163cf8..c8a7d3daef 100644
--- a/include/mipi_dsi.h
+++ b/include/mipi_dsi.h
@@ -221,9 +221,15 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
/**
* struct mipi_dsi_panel_plat - DSI panel platform data
* @device: DSI peripheral device
+ * @lanes: number of active data lanes
+ * @format: pixel format for video mode
+ * @mode_flags: DSI operation mode related flags
*/
struct mipi_dsi_panel_plat {
struct mipi_dsi_device *device;
+ unsigned int lanes;
+ enum mipi_dsi_pixel_format format;
+ unsigned long mode_flags;
};
/**