aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/sandbox_sdl.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-02-11 10:58:41 -0500
committerTom Rini <trini@konsulko.com>2020-02-11 10:58:41 -0500
commit9a8942b53d57149754e0dfc975e0d92d1afd4087 (patch)
treede55e5352f3a8a79c413c0b8cb533428e5476841 /drivers/video/sandbox_sdl.c
parentae347120eed8204b1fdf018ddf79131964e57016 (diff)
parent21d651fb29cf268b1a5f64d080e3d352ee32c87f (diff)
downloadu-boot-9a8942b53d57149754e0dfc975e0d92d1afd4087.zip
u-boot-9a8942b53d57149754e0dfc975e0d92d1afd4087.tar.gz
u-boot-9a8942b53d57149754e0dfc975e0d92d1afd4087.tar.bz2
Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
Diffstat (limited to 'drivers/video/sandbox_sdl.c')
-rw-r--r--drivers/video/sandbox_sdl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c
index 913651c..1196e6c 100644
--- a/drivers/video/sandbox_sdl.c
+++ b/drivers/video/sandbox_sdl.c
@@ -8,6 +8,7 @@
#include <fdtdec.h>
#include <video.h>
#include <asm/sdl.h>
+#include <asm/state.h>
#include <asm/u-boot-sandbox.h>
#include <dm/test.h>
@@ -23,9 +24,11 @@ static int sandbox_sdl_probe(struct udevice *dev)
{
struct sandbox_sdl_plat *plat = dev_get_platdata(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+ struct sandbox_state *state = state_get_current();
int ret;
- ret = sandbox_sdl_init_display(plat->xres, plat->yres, plat->bpix);
+ ret = sandbox_sdl_init_display(plat->xres, plat->yres, plat->bpix,
+ state->double_lcd);
if (ret) {
puts("LCD init failed\n");
return ret;
@@ -44,13 +47,11 @@ static int sandbox_sdl_bind(struct udevice *dev)
{
struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev);
struct sandbox_sdl_plat *plat = dev_get_platdata(dev);
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(dev);
int ret = 0;
- plat->xres = fdtdec_get_int(blob, node, "xres", LCD_MAX_WIDTH);
- plat->yres = fdtdec_get_int(blob, node, "yres", LCD_MAX_HEIGHT);
- plat->bpix = VIDEO_BPP16;
+ plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH);
+ plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT);
+ plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16);
uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8;
debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);