]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: video: Enable necessary video functions at SPL
authorNikhil M Jain <n-jain1@ti.com>
Thu, 20 Apr 2023 12:11:08 +0000 (17:41 +0530)
committerAnatolij Gustschin <agust@denx.de>
Mon, 24 Apr 2023 19:37:45 +0000 (21:37 +0200)
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>
drivers/video/console_core.c
drivers/video/vidconsole-uclass.c
drivers/video/video-uclass.c
drivers/video/video_bmp.c

index d4f79c656a9b1490d3a43922dab345f765477585..1f93b1b85fa5e6b5952823226edfc1b4d50d6bb9 100644 (file)
@@ -46,11 +46,11 @@ static int console_set_font(struct udevice *dev, struct video_fontdata *fontdata
 
 int check_bpix_support(int bpix)
 {
-       if (bpix == VIDEO_BPP8 && IS_ENABLED(CONFIG_VIDEO_BPP8))
+       if (bpix == VIDEO_BPP8 && CONFIG_IS_ENABLED(VIDEO_BPP8))
                return 0;
-       else if (bpix == VIDEO_BPP16 && IS_ENABLED(CONFIG_VIDEO_BPP16))
+       else if (bpix == VIDEO_BPP16 && CONFIG_IS_ENABLED(VIDEO_BPP16))
                return 0;
-       else if (bpix == VIDEO_BPP32 && IS_ENABLED(CONFIG_VIDEO_BPP32))
+       else if (bpix == VIDEO_BPP32 && CONFIG_IS_ENABLED(VIDEO_BPP32))
                return 0;
        else
                return -ENOSYS;
index 1225de2333255ceb66a89a22e71722ba4bacac69..a21fde0e1d46e859fb578fdea18ed6024fef5c96 100644 (file)
@@ -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;
index da89f431441ac371030b616df01bf6a4569c41d4..8396bdfb11e13562bf5006a1bbe4b08ccb0b7cc4 100644 (file)
@@ -132,7 +132,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;
@@ -149,7 +149,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;
 
@@ -158,7 +158,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;
 
@@ -212,14 +212,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) |
@@ -513,8 +513,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");
index 6188a13e44e472d0c8149e0dcbd3a5ffe9a0ce30..47e52c4f69c98b91f059961db212068da163efce 100644 (file)
@@ -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) {