diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-02-08 21:47:10 +0100 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2018-03-06 10:01:40 +0100 |
commit | d7a75d3cd7cd7ce3665442e4e566b147c4c8602b (patch) | |
tree | ee2d1d2d8a7eee6a919b79e97a9132c808a877b9 /drivers/video/video-uclass.c | |
parent | 3aeb0cbe126849bd8aaa332a18b7ab2fe0699c02 (diff) |
dm: video: correctly clean background in 16bit mode
In 16 bit mode we have to copy two bytes per pixels repeatedly and not
four. Otherwise we will see a striped pattern.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r-- | drivers/video/video-uclass.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index dcaceed42c..9a980ea3a1 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -91,14 +91,26 @@ void video_clear(struct udevice *dev) { struct video_priv *priv = dev_get_uclass_priv(dev); - if (priv->bpix == VIDEO_BPP32) { + 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; - } else { + break; + } + default: memset(priv->fb, priv->colour_bg, priv->fb_size); + break; } } |