diff options
author | Tom Rini | 2020-06-30 11:43:18 -0400 |
---|---|---|
committer | Tom Rini | 2020-06-30 11:43:18 -0400 |
commit | 5fdb3c0e7ee6bac6b8809ae69e52f16d22d45035 (patch) | |
tree | d04c64ec751e7adf24de995ce0fa7eabc88865bc /drivers/video | |
parent | 6b3c74428a3faca92701843c954b717e8d186b17 (diff) | |
parent | e35c2a8fdd41a34c06c409ce700c5d5591429367 (diff) |
Merge tag 'mips-pull-2020-06-29' of https://gitlab.denx.de/u-boot/custodians/u-boot-mips into next
- net: pcnet: cleanup and add DM support
- Makefile: add rule to build an endian-swapped U-Boot image
used by MIPS Malta EL variants
- CI: add Qemu tests for MIPS Malta
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/orisetech_otm8009a.c | 20 | ||||
-rw-r--r-- | drivers/video/raydium-rm68200.c | 20 | ||||
-rw-r--r-- | drivers/video/rockchip/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/rockchip/rk_edp.c | 3 | ||||
-rw-r--r-- | drivers/video/stm32/stm32_dsi.c | 13 | ||||
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 1 | ||||
-rw-r--r-- | drivers/video/video_bmp.c | 27 |
7 files changed, 47 insertions, 39 deletions
diff --git a/drivers/video/orisetech_otm8009a.c b/drivers/video/orisetech_otm8009a.c index b1f2dd403ef..362bf6a6fe4 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 9169280fb8b..353894503b9 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/rockchip/Kconfig b/drivers/video/rockchip/Kconfig index cfd774ead60..5215a71f99f 100644 --- a/drivers/video/rockchip/Kconfig +++ b/drivers/video/rockchip/Kconfig @@ -22,7 +22,7 @@ menuconfig VIDEO_ROCKCHIP config VIDEO_ROCKCHIP_MAX_XRES int "Maximum horizontal resolution (for memory allocation purposes)" depends on VIDEO_ROCKCHIP - default 3480 if ROCKCHIP_RK3399 && DISPLAY_ROCKCHIP_HDMI + default 3840 if ROCKCHIP_RK3399 && DISPLAY_ROCKCHIP_HDMI default 1920 help The maximum horizontal resolution to support for the framebuffer. diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c index 92188be9275..000bd481408 100644 --- a/drivers/video/rockchip/rk_edp.c +++ b/drivers/video/rockchip/rk_edp.c @@ -1062,7 +1062,8 @@ static int rk_edp_probe(struct udevice *dev) rk_setreg(&priv->grf->soc_con12, 1 << 4); /* select epd signal from vop0 or vop1 */ - rk_setreg(&priv->grf->soc_con6, (vop_id == 1) ? (1 << 5) : (1 << 5)); + rk_clrsetreg(&priv->grf->soc_con6, (1 << 5), + (vop_id == 1) ? (1 << 5) : (0 << 5)); rockchip_edp_wait_hpd(priv); diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c index 04796435f11..283151398bb 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 901347c4675..3f20f70e9aa 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -623,6 +623,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 eb9636541d7..7d7f37b445c 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); |