aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-19 13:23:46 -0700
committerAnatolij Gustschin <agust@denx.de>2021-12-26 23:02:19 +0100
commit250e735c692bd12ea86dcea5de2cd1cfe225a0a4 (patch)
treebd7e5b14f1706db1a7e88c2edc46d4ce16b084cd /drivers
parent0fe5e9481e8ad39393523a23ebb090a249da18b7 (diff)
downloadu-boot-250e735c692bd12ea86dcea5de2cd1cfe225a0a4.zip
u-boot-250e735c692bd12ea86dcea5de2cd1cfe225a0a4.tar.gz
u-boot-250e735c692bd12ea86dcea5de2cd1cfe225a0a4.tar.bz2
video: sandbox: Avoid duplicate display windows
When unit tests are run they currently create a new window. Update the code so that the old one is removed first. This avoids the confusion as to which one is active. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sandbox_sdl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c
index 32739de..6e430b2 100644
--- a/drivers/video/sandbox_sdl.c
+++ b/drivers/video/sandbox_sdl.c
@@ -63,6 +63,20 @@ static void set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp)
uc_plat->size *= 2;
}
+static int sandbox_sdl_remove(struct udevice *dev)
+{
+ /*
+ * Removing the display it a bit annoying when running unit tests, since
+ * they remove all devices. It is nice to be able to see what the test
+ * wrote onto the display. So this comment is just here to show how to
+ * do it, if we want to make it optional one day.
+ *
+ * sandbox_sdl_remove_display();
+ */
+
+ return 0;
+}
+
static int sandbox_sdl_bind(struct udevice *dev)
{
struct sandbox_sdl_plat *plat = dev_get_plat(dev);
@@ -90,5 +104,6 @@ U_BOOT_DRIVER(sandbox_lcd_sdl) = {
.of_match = sandbox_sdl_ids,
.bind = sandbox_sdl_bind,
.probe = sandbox_sdl_probe,
+ .remove = sandbox_sdl_remove,
.plat_auto = sizeof(struct sandbox_sdl_plat),
};