aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Kconfig51
-rw-r--r--drivers/video/Makefile5
-rw-r--r--drivers/video/imx/Kconfig2
-rw-r--r--drivers/video/imx/ipu_disp.c12
-rw-r--r--drivers/video/imx/mxc_ipuv3_fb.c99
-rw-r--r--drivers/video/vidconsole-uclass.c2
-rw-r--r--drivers/video/video-uclass.c1
7 files changed, 71 insertions, 101 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3812354..52f5bc6 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -14,9 +14,17 @@ config DM_VIDEO
option compiles in the video uclass and routes all LCD/video access
through this.
+config BACKLIGHT
+ bool "Enable panel backlight uclass support"
+ depends on DM_VIDEO
+ default y
+ help
+ This provides backlight uclass driver that enables basic panel
+ backlight support.
+
config BACKLIGHT_PWM
bool "Generic PWM based Backlight Driver"
- depends on DM_VIDEO && DM_PWM
+ depends on BACKLIGHT && DM_PWM
default y
help
If you have a LCD backlight adjustable by PWM, say Y to enable
@@ -27,7 +35,7 @@ config BACKLIGHT_PWM
config BACKLIGHT_GPIO
bool "Generic GPIO based Backlight Driver"
- depends on DM_VIDEO
+ depends on BACKLIGHT
help
If you have a LCD backlight adjustable by GPIO, say Y to enable
this driver.
@@ -35,6 +43,14 @@ config BACKLIGHT_GPIO
it understands the standard device tree
(leds/backlight/gpio-backlight.txt)
+config CMD_VIDCONSOLE
+ bool "Enable vidconsole commands lcdputs and setcurs"
+ depends on DM_VIDEO
+ default y
+ help
+ Enabling this will provide 'setcurs' and 'lcdputs' commands which
+ support cursor positioning and drawing strings on video framebuffer.
+
config VIDEO_BPP8
bool "Support 8-bit-per-pixel displays"
depends on DM_VIDEO
@@ -143,17 +159,34 @@ config NO_FB_CLEAR
loads takes over the screen. This, for example, can be used to
keep splash image on screen until grub graphical boot menu starts.
+config PANEL
+ bool "Enable panel uclass support"
+ depends on DM_VIDEO
+ default y
+ help
+ This provides panel uclass driver that enables basic panel support.
+
+config SIMPLE_PANEL
+ bool "Enable simple panel support"
+ depends on PANEL
+ default y
+ help
+ This turns on a simple panel driver that enables a compatible
+ video panel.
+
source "drivers/video/fonts/Kconfig"
config VIDCONSOLE_AS_LCD
- bool "Use 'vidconsole' when 'lcd' is seen in stdout"
+ string "Use 'vidconsole' when string defined here is seen in stdout"
depends on DM_VIDEO
+ default "lcd" if LCD || TEGRA_COMMON
+ default "vga" if !LCD
help
- This is a work-around for boards which have 'lcd' in their stdout
- environment variable, but have moved to use driver model for video.
- In this case the console will no-longer work. While it is possible
- to update the environment, the breakage may be confusing for users.
- This option will be removed around the end of 2016.
+ This is a work-around for boards which have 'lcd' or 'vga' in their
+ stdout environment variable, but have moved to use driver model for
+ video. In this case the console will no-longer work. While it is
+ possible to update the environment, the breakage may be confusing for
+ users. This option will be removed around the end of 2020.
config VIDEO_COREBOOT
bool "Enable coreboot framebuffer driver support"
@@ -469,13 +502,11 @@ config NXP_TDA19988
config ATMEL_HLCD
bool "Enable ATMEL video support using HLCDC"
- depends on DM_VIDEO
help
HLCDC supports video output to an attached LCD panel.
config AM335X_LCD
bool "Enable AM335x video support"
- depends on DM_VIDEO
help
Supports video output to an attached LCD panel.
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index df7119d..1dbd09a 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -4,17 +4,18 @@
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
ifdef CONFIG_DM
+obj-$(CONFIG_BACKLIGHT) += backlight-uclass.o
obj-$(CONFIG_BACKLIGHT_GPIO) += backlight_gpio.o
obj-$(CONFIG_BACKLIGHT_PWM) += pwm_backlight.o
obj-$(CONFIG_CONSOLE_NORMAL) += console_normal.o
obj-$(CONFIG_CONSOLE_ROTATION) += console_rotate.o
obj-$(CONFIG_CONSOLE_TRUETYPE) += console_truetype.o fonts/
obj-$(CONFIG_DISPLAY) += display-uclass.o
-obj-$(CONFIG_DM_VIDEO) += backlight-uclass.o
obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi-host-uclass.o
-obj-$(CONFIG_DM_VIDEO) += panel-uclass.o simple_panel.o
obj-$(CONFIG_DM_VIDEO) += video-uclass.o vidconsole-uclass.o
obj-$(CONFIG_DM_VIDEO) += video_bmp.o
+obj-$(CONFIG_PANEL) += panel-uclass.o
+obj-$(CONFIG_SIMPLE_PANEL) += simple_panel.o
endif
obj-${CONFIG_EXYNOS_FB} += exynos/
diff --git a/drivers/video/imx/Kconfig b/drivers/video/imx/Kconfig
index c33620e..78eb0f2 100644
--- a/drivers/video/imx/Kconfig
+++ b/drivers/video/imx/Kconfig
@@ -1,7 +1,7 @@
config VIDEO_IPUV3
bool "i.MX IPUv3 Core video support"
- depends on (VIDEO || DM_VIDEO) && (MX5 || MX6)
+ depends on DM_VIDEO && (MX5 || MX6)
help
This enables framebuffer driver for i.MX processors working
on the IPUv3(Image Processing Unit) internal graphic processor.
diff --git a/drivers/video/imx/ipu_disp.c b/drivers/video/imx/ipu_disp.c
index c2f00bf..4506989 100644
--- a/drivers/video/imx/ipu_disp.c
+++ b/drivers/video/imx/ipu_disp.c
@@ -1191,9 +1191,6 @@ int32_t ipu_disp_set_global_alpha(ipu_channel_t channel, unsigned char enable,
else
bg_chan = 0;
- if (!g_ipu_clk_enabled)
- clk_enable(g_ipu_clk);
-
if (bg_chan) {
reg = __raw_readl(DP_COM_CONF());
__raw_writel(reg & ~DP_COM_CONF_GWSEL, DP_COM_CONF());
@@ -1217,9 +1214,6 @@ int32_t ipu_disp_set_global_alpha(ipu_channel_t channel, unsigned char enable,
reg = __raw_readl(IPU_SRM_PRI2) | 0x8;
__raw_writel(reg, IPU_SRM_PRI2);
- if (!g_ipu_clk_enabled)
- clk_disable(g_ipu_clk);
-
return 0;
}
@@ -1246,9 +1240,6 @@ int32_t ipu_disp_set_color_key(ipu_channel_t channel, unsigned char enable,
(channel == MEM_BG_ASYNC1 || channel == MEM_FG_ASYNC1)))
return -EINVAL;
- if (!g_ipu_clk_enabled)
- clk_enable(g_ipu_clk);
-
color_key_4rgb = 1;
/* Transform color key from rgb to yuv if CSC is enabled */
if (((fg_csc_type == RGB2YUV) && (bg_csc_type == YUV2YUV)) ||
@@ -1286,8 +1277,5 @@ int32_t ipu_disp_set_color_key(ipu_channel_t channel, unsigned char enable,
reg = __raw_readl(IPU_SRM_PRI2) | 0x8;
__raw_writel(reg, IPU_SRM_PRI2);
- if (!g_ipu_clk_enabled)
- clk_disable(g_ipu_clk);
-
return 0;
}
diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 4044473..587d62f 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -38,8 +38,6 @@ DECLARE_GLOBAL_DATA_PTR;
static int mxcfb_map_video_memory(struct fb_info *fbi);
static int mxcfb_unmap_video_memory(struct fb_info *fbi);
-/* graphics setup */
-static GraphicDevice panel;
static struct fb_videomode const *gmode;
static uint8_t gdisp;
static uint32_t gpixfmt;
@@ -120,27 +118,6 @@ static uint32_t bpp_to_pixfmt(struct fb_info *fbi)
return pixfmt;
}
-/*
- * Set fixed framebuffer parameters based on variable settings.
- *
- * @param info framebuffer information pointer
- */
-static int mxcfb_set_fix(struct fb_info *info)
-{
- struct fb_fix_screeninfo *fix = &info->fix;
- struct fb_var_screeninfo *var = &info->var;
-
- fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
-
- fix->type = FB_TYPE_PACKED_PIXELS;
- fix->accel = FB_ACCEL_NONE;
- fix->visual = FB_VISUAL_TRUECOLOR;
- fix->xpanstep = 1;
- fix->ypanstep = 1;
-
- return 0;
-}
-
static int setup_disp_channel1(struct fb_info *fbi)
{
ipu_channel_params_t params;
@@ -226,7 +203,6 @@ static int mxcfb_set_par(struct fb_info *fbi)
ipu_disable_channel(mxc_fbi->ipu_ch);
ipu_uninit_channel(mxc_fbi->ipu_ch);
- mxcfb_set_fix(fbi);
mem_len = fbi->var.yres_virtual * fbi->fix.line_length;
if (!fbi->fix.smem_start || (mem_len > fbi->fix.smem_len)) {
@@ -411,12 +387,7 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
}
fbi->fix.smem_len = roundup(fbi->fix.smem_len, ARCH_DMA_MINALIGN);
-#if CONFIG_IS_ENABLED(DM_VIDEO)
fbi->screen_base = (char *)gd->video_bottom;
-#else
- fbi->screen_base = (char *)memalign(ARCH_DMA_MINALIGN,
- fbi->fix.smem_len);
-#endif
fbi->fix.smem_start = (unsigned long)fbi->screen_base;
if (fbi->screen_base == 0) {
@@ -430,10 +401,7 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
(uint32_t) fbi->fix.smem_start, fbi->fix.smem_len);
fbi->screen_size = fbi->fix.smem_len;
-
-#if CONFIG_IS_ENABLED(VIDEO)
gd->fb_base = fbi->fix.smem_start;
-#endif
/* Clear the screen */
memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
@@ -499,6 +467,8 @@ static struct fb_info *mxcfb_init_fbinfo(void)
return fbi;
}
+extern struct clk *g_ipu_clk;
+
/*
* Probe routine for the framebuffer driver. It is called during the
* driver binding process. The following functions are performed in
@@ -512,16 +482,14 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
{
struct fb_info *fbi;
struct mxcfb_info *mxcfbi;
- int ret = 0;
/*
* Initialize FB structures
*/
fbi = mxcfb_init_fbinfo();
- if (!fbi) {
- ret = -ENOMEM;
- goto err0;
- }
+ if (!fbi)
+ return -ENOMEM;
+
mxcfbi = (struct mxcfb_info *)fbi->par;
if (!g_dp_in_use) {
@@ -534,9 +502,11 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
mxcfbi->ipu_di = disp;
+ if (!ipu_clk_enabled())
+ clk_enable(g_ipu_clk);
+
ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80);
ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0);
- strcpy(fbi->fix.id, "DISP3 BG");
g_dp_in_use = 1;
@@ -547,7 +517,8 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
mxcfbi->ipu_di_pix_fmt = interface_pix_fmt;
fb_videomode_to_var(&fbi->var, mode);
fbi->var.bits_per_pixel = 16;
- fbi->fix.line_length = fbi->var.xres * (fbi->var.bits_per_pixel / 8);
+ fbi->fix.line_length = fbi->var.xres_virtual *
+ (fbi->var.bits_per_pixel / 8);
fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length;
mxcfb_check_var(&fbi->var, fbi);
@@ -555,31 +526,17 @@ static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
/* Default Y virtual size is 2x panel size */
fbi->var.yres_virtual = fbi->var.yres * 2;
- mxcfb_set_fix(fbi);
-
/* allocate fb first */
if (mxcfb_map_video_memory(fbi) < 0)
return -ENOMEM;
mxcfb_set_par(fbi);
- panel.winSizeX = mode->xres;
- panel.winSizeY = mode->yres;
- panel.plnSizeX = mode->xres;
- panel.plnSizeY = mode->yres;
-
- panel.frameAdrs = (u32)fbi->screen_base;
- panel.memSize = fbi->screen_size;
-
- panel.gdfBytesPP = 2;
- panel.gdfIndex = GDF_16BIT_565RGB;
-
+#ifdef DEBUG
ipu_dump_registers();
+#endif
return 0;
-
-err0:
- return ret;
}
void ipuv3_fb_shutdown(void)
@@ -604,21 +561,6 @@ void ipuv3_fb_shutdown(void)
}
}
-void *video_hw_init(void)
-{
- int ret;
-
- ret = ipu_probe();
- if (ret)
- puts("Error initializing IPU\n");
-
- ret = mxcfb_probe(gpixfmt, gdisp, gmode);
- debug("Framebuffer at 0x%x\n", (unsigned int)panel.frameAdrs);
- gd->fb_base = panel.frameAdrs;
-
- return (void *)&panel;
-}
-
int ipuv3_fb_init(struct fb_videomode const *mode,
uint8_t disp,
uint32_t pixfmt)
@@ -630,7 +572,6 @@ int ipuv3_fb_init(struct fb_videomode const *mode,
return 0;
}
-#if CONFIG_IS_ENABLED(DM_VIDEO)
enum {
/* Maximum display size we support */
LCD_MAX_WIDTH = 1920,
@@ -645,7 +586,6 @@ static int ipuv3_video_probe(struct udevice *dev)
#if defined(CONFIG_DISPLAY)
struct udevice *disp_dev;
#endif
- struct udevice *panel_dev;
u32 fb_start, fb_end;
int ret;
@@ -672,9 +612,13 @@ static int ipuv3_video_probe(struct udevice *dev)
return ret;
}
#endif
- ret = uclass_get_device(UCLASS_PANEL, 0, &panel_dev);
- if (panel_dev)
- panel_enable_backlight(panel_dev);
+ if (CONFIG_IS_ENABLED(PANEL)) {
+ struct udevice *panel_dev;
+
+ ret = uclass_get_device(UCLASS_PANEL, 0, &panel_dev);
+ if (panel_dev)
+ panel_enable_backlight(panel_dev);
+ }
uc_priv->xsize = gmode->xres;
uc_priv->ysize = gmode->yres;
@@ -707,8 +651,12 @@ static int ipuv3_video_bind(struct udevice *dev)
}
static const struct udevice_id ipuv3_video_ids[] = {
+#ifdef CONFIG_ARCH_MX6
{ .compatible = "fsl,imx6q-ipu" },
+#endif
+#ifdef CONFIG_ARCH_MX5
{ .compatible = "fsl,imx53-ipu" },
+#endif
{ }
};
@@ -721,4 +669,3 @@ U_BOOT_DRIVER(ipuv3_video) = {
.priv_auto_alloc_size = sizeof(struct ipuv3_video_priv),
.flags = DM_FLAG_PRE_RELOC,
};
-#endif /* CONFIG_DM_VIDEO */
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 9b76154..3f20f70 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -613,6 +613,7 @@ UCLASS_DRIVER(vidconsole) = {
.per_device_auto_alloc_size = sizeof(struct vidconsole_priv),
};
+#if CONFIG_IS_ENABLED(CMD_VIDCONSOLE)
void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
{
struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
@@ -674,3 +675,4 @@ U_BOOT_CMD(
"print string on video framebuffer",
" <string>"
);
+#endif /* CONFIG_IS_ENABLED(CMD_VIDCONSOLE) */
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index bf396d1..1f28745 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -84,6 +84,7 @@ int video_reserve(ulong *addrp)
__func__, size, *addrp, dev->name);
}
gd->video_bottom = *addrp;
+ gd->fb_base = *addrp;
debug("Video frame buffers from %lx to %lx\n", gd->video_bottom,
gd->video_top);