summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNikhil M Jain <n-jain1@ti.com>2023-06-09 14:29:47 +0530
committerUdit Kumar <u-kumar1@ti.com>2023-06-12 09:49:41 +0530
commit9dea99a57e6841777069f8193e6a816b2a191dee (patch)
tree5d6056633ecac2c35ed7396f8afdad5d0ec3fa5d /drivers
parent0544ea2c33ab7072b582fcd1307a54646a37e32d (diff)
drivers: video: Enable necessary video functions at SPL
To support video driver at SPL use CONFIG_IS_ENABLED and CONFIG_VAL, which checks for stage specific configs and thus enables video support at respective stage. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console_normal.c12
-rw-r--r--drivers/video/vidconsole-uclass.c2
-rw-r--r--drivers/video/video-uclass.c16
-rw-r--r--drivers/video/video_bmp.c8
4 files changed, 19 insertions, 19 deletions
diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c
index 04f022491e..f69b32c10c 100644
--- a/drivers/video/console_normal.c
+++ b/drivers/video/console_normal.c
@@ -24,7 +24,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr)
line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length;
switch (vid_priv->bpix) {
case VIDEO_BPP8:
- if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP8)) {
uint8_t *dst = line;
for (i = 0; i < pixels; i++)
@@ -33,7 +33,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr)
break;
}
case VIDEO_BPP16:
- if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
uint16_t *dst = line;
for (i = 0; i < pixels; i++)
@@ -42,7 +42,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr)
break;
}
case VIDEO_BPP32:
- if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
uint32_t *dst = line;
for (i = 0; i < pixels; i++)
@@ -103,7 +103,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
switch (vid_priv->bpix) {
case VIDEO_BPP8:
- if (IS_ENABLED(CONFIG_VIDEO_BPP8)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP8)) {
uint8_t *dst = line;
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
@@ -115,7 +115,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
break;
}
case VIDEO_BPP16:
- if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
uint16_t *dst = line;
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
@@ -127,7 +127,7 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y,
break;
}
case VIDEO_BPP32:
- if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
uint32_t *dst = line;
for (i = 0; i < VIDEO_FONT_WIDTH; i++) {
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 72a13d3052..ca6139a050 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -86,7 +86,7 @@ static void vidconsole_newline(struct udevice *dev)
struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
struct udevice *vid_dev = dev->parent;
struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
- const int rows = CONFIG_CONSOLE_SCROLL_LINES;
+ const int rows = CONFIG_VAL(CONSOLE_SCROLL_LINES);
int i, ret;
priv->xcur_frac = priv->xstart_frac;
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index ab482f11e5..c63343b015 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -116,7 +116,7 @@ int video_reserve(ulong *addrp)
/* Allocate space for PCI video devices in case there were not bound */
if (*addrp == gd->video_top)
- *addrp -= CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE;
+ *addrp -= CONFIG_VAL(VIDEO_PCI_DEFAULT_FB_SIZE);
gd->video_bottom = *addrp;
gd->fb_base = *addrp;
@@ -133,7 +133,7 @@ int video_fill(struct udevice *dev, u32 colour)
switch (priv->bpix) {
case VIDEO_BPP16:
- if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
u16 *ppix = priv->fb;
u16 *end = priv->fb + priv->fb_size;
@@ -142,7 +142,7 @@ int video_fill(struct udevice *dev, u32 colour)
break;
}
case VIDEO_BPP32:
- if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
u32 *ppix = priv->fb;
u32 *end = priv->fb + priv->fb_size;
@@ -196,14 +196,14 @@ u32 video_index_to_colour(struct video_priv *priv, unsigned int idx)
{
switch (priv->bpix) {
case VIDEO_BPP16:
- if (IS_ENABLED(CONFIG_VIDEO_BPP16)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP16)) {
return ((colours[idx].r >> 3) << 11) |
((colours[idx].g >> 2) << 5) |
((colours[idx].b >> 3) << 0);
}
break;
case VIDEO_BPP32:
- if (IS_ENABLED(CONFIG_VIDEO_BPP32)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BPP32)) {
if (priv->format == VIDEO_X2R10G10B10)
return (colours[idx].r << 22) |
(colours[idx].g << 12) |
@@ -449,7 +449,7 @@ static int video_post_probe(struct udevice *dev)
priv->fb_size = priv->line_length * priv->ysize;
- if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->copy_base)
+ if (CONFIG_IS_ENABLED(VIDEO_COPY) && plat->copy_base)
priv->copy_fb = map_sysmem(plat->copy_base, plat->size);
/* Set up colors */
@@ -497,8 +497,8 @@ static int video_post_probe(struct udevice *dev)
return ret;
}
- if (IS_ENABLED(CONFIG_VIDEO_LOGO) &&
- !IS_ENABLED(CONFIG_SPLASH_SCREEN) && !plat->hide_logo) {
+ if (CONFIG_IS_ENABLED(VIDEO_LOGO) &&
+ !CONFIG_IS_ENABLED(SPLASH_SCREEN) && !plat->hide_logo) {
ret = show_splash(dev);
if (ret) {
log_debug("Cannot show splash screen\n");
diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c
index 6188a13e44..47e52c4f69 100644
--- a/drivers/video/video_bmp.c
+++ b/drivers/video/video_bmp.c
@@ -320,7 +320,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
switch (bmp_bpix) {
case 1:
case 8:
- if (IS_ENABLED(CONFIG_VIDEO_BMP_RLE8)) {
+ if (CONFIG_IS_ENABLED(VIDEO_BMP_RLE8)) {
u32 compression = get_unaligned_le32(
&bmp->header.compression);
debug("compressed %d %d\n", compression, BMP_BI_RLE8);
@@ -348,7 +348,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
}
break;
case 16:
- if (IS_ENABLED(CONFIG_BMP_16BPP)) {
+ if (CONFIG_IS_ENABLED(BMP_16BPP)) {
for (i = 0; i < height; ++i) {
schedule();
for (j = 0; j < width; j++) {
@@ -361,7 +361,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
}
break;
case 24:
- if (IS_ENABLED(CONFIG_BMP_24BPP)) {
+ if (CONFIG_IS_ENABLED(BMP_24BPP)) {
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
if (bpix == 16) {
@@ -395,7 +395,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y,
}
break;
case 32:
- if (IS_ENABLED(CONFIG_BMP_32BPP)) {
+ if (CONFIG_IS_ENABLED(BMP_32BPP)) {
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
if (eformat == VIDEO_X2R10G10B10) {