X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fvideo%2Fvideo-uclass.c;h=3d658e61d7c6ccba03164ca239b6962a85478fb2;hb=b4778ae94a42a86b34166606cd88c8dfc9899897;hp=f660c5205ed3e7d3d69b7a74aaade4f0e060fc5b;hpb=a7bbaf8c1345906affb8dd6faa6a3aaedac3f451;p=oweals%2Fu-boot.git diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index f660c5205e..3d658e61d7 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -92,22 +93,24 @@ int video_clear(struct udevice *dev) struct video_priv *priv = dev_get_uclass_priv(dev); switch (priv->bpix) { - case VIDEO_BPP16: { - u16 *ppix = priv->fb; - u16 *end = priv->fb + priv->fb_size; - - while (ppix < end) - *ppix++ = priv->colour_bg; - break; - } - case VIDEO_BPP32: { - u32 *ppix = priv->fb; - u32 *end = priv->fb + priv->fb_size; - - while (ppix < end) - *ppix++ = priv->colour_bg; - break; - } + case VIDEO_BPP16: + if (IS_ENABLED(CONFIG_VIDEO_BPP16)) { + u16 *ppix = priv->fb; + u16 *end = priv->fb + priv->fb_size; + + while (ppix < end) + *ppix++ = priv->colour_bg; + break; + } + case VIDEO_BPP32: + if (IS_ENABLED(CONFIG_VIDEO_BPP32)) { + u32 *ppix = priv->fb; + u32 *end = priv->fb + priv->fb_size; + + while (ppix < end) + *ppix++ = priv->colour_bg; + break; + } default: memset(priv->fb, priv->colour_bg, priv->fb_size); break; @@ -121,14 +124,14 @@ void video_set_default_colors(struct udevice *dev, bool invert) struct video_priv *priv = dev_get_uclass_priv(dev); int fore, back; -#ifdef CONFIG_SYS_WHITE_ON_BLACK - /* White is used when switching to bold, use light gray here */ - fore = VID_LIGHT_GRAY; - back = VID_BLACK; -#else - fore = VID_BLACK; - back = VID_WHITE; -#endif + if (CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK)) { + /* White is used when switching to bold, use light gray here */ + fore = VID_LIGHT_GRAY; + back = VID_BLACK; + } else { + fore = VID_BLACK; + back = VID_WHITE; + } if (invert) { int temp;