diff options
author | Anatolij Gustschin <agust@denx.de> | 2019-12-04 18:18:39 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2019-12-06 18:37:45 +0300 |
commit | ca5655d8006cfbaa4ff8ff450e4a5931e57fe050 (patch) | |
tree | 81d782c87b7fba2052b9e300c62cf0f34070c17c /drivers/video/vidconsole-uclass.c | |
parent | ca2c6945b9e158716138b9d138c72676e719bd8e (diff) | |
download | u-boot-ca5655d8006cfbaa4ff8ff450e4a5931e57fe050.tar.xz |
video: add guards around 16bpp/32bbp code
Many boards use only single depth configuration, for such boards
there is some unused code in video and console uclass routines.
Add guards to avoid dead code.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Eugen Hristev <eugen.hristev@microchip.com>
Tested-by: Patrice Chotard <patrice.chotard@st.com>
Tested-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index af88588904..c690eceeaa 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -116,6 +116,7 @@ static void vidconsole_newline(struct udevice *dev) video_sync(dev->parent, false); } +#if CONFIG_IS_ENABLED(VIDEO_BPP16) || CONFIG_IS_ENABLED(VIDEO_BPP32) static const struct vid_rgb colors[VID_COLOR_COUNT] = { { 0x00, 0x00, 0x00 }, /* black */ { 0xc0, 0x00, 0x00 }, /* red */ @@ -134,18 +135,23 @@ static const struct vid_rgb colors[VID_COLOR_COUNT] = { { 0x00, 0xff, 0xff }, /* bright cyan */ { 0xff, 0xff, 0xff }, /* white */ }; +#endif u32 vid_console_color(struct video_priv *priv, unsigned int idx) { switch (priv->bpix) { +#if CONFIG_IS_ENABLED(VIDEO_BPP16) case VIDEO_BPP16: return ((colors[idx].r >> 3) << 11) | ((colors[idx].g >> 2) << 5) | ((colors[idx].b >> 3) << 0); +#endif +#if CONFIG_IS_ENABLED(VIDEO_BPP32) case VIDEO_BPP32: return (colors[idx].r << 16) | (colors[idx].g << 8) | (colors[idx].b << 0); +#endif default: /* * For unknown bit arrangements just support |