diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-08-27 09:30:08 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-08-27 09:30:08 +0000 |
commit | ed712632241f41424222f310063f597b059742ff (patch) | |
tree | b8ea68126a7716457e0ec9a4c895f22d958578c4 /sys/dev/fdt | |
parent | ce8ce2048a42db1d6e11cb1b202704780e7cadcf (diff) |
Add an interface that allows drivers to claim a framebuffer and check
whether another driver has already claimed a framebuffer. Use this in
radeondrm(4) and simplefb(4) to prevent the latter from attaching if
radeondrm(4) is attached to the hardware that provides the framebuffer
set up by the firmware.
ok mlarkin@
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r-- | sys/dev/fdt/simplefb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 3be2ac6d004..6f031953a3c 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplefb.c,v 1.4 2018/07/31 17:25:55 fcambus Exp $ */ +/* $OpenBSD: simplefb.c,v 1.5 2018/08/27 09:30:07 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -110,6 +110,10 @@ simplefb_match(struct device *parent, void *match, void *aux) { struct fdt_attach_args *faa = aux; + /* Don't attach if another driver already claimed our framebuffer. */ + if (faa->fa_nreg > 0 && rasops_check_framebuffer(faa->fa_reg[0].addr)) + return 0; + return OF_is_compatible(faa->fa_node, "simple-framebuffer"); } |