Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162340571
D14397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14397.diff
View Options
Index: head/sys/dev/vt/hw/vga/vt_vga.c
===================================================================
--- head/sys/dev/vt/hw/vga/vt_vga.c
+++ head/sys/dev/vt/hw/vga/vt_vga.c
@@ -30,6 +30,8 @@
* SUCH DAMAGE.
*/
+#include "opt_acpi.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -46,6 +48,10 @@
#include <machine/bus.h>
+#if ((defined(__amd64__) || defined(__i386__)) && defined(DEV_ACPI))
+#include <contrib/dev/acpica/include/acpi.h>
+#endif
+
struct vga_softc {
bus_space_tag_t vga_fb_tag;
bus_space_handle_t vga_fb_handle;
@@ -1196,11 +1202,39 @@
return (0);
}
+static bool
+vga_acpi_disabled(void)
+{
+#if ((defined(__amd64__) || defined(__i386__)) && defined(DEV_ACPI))
+ ACPI_TABLE_FADT *fadt;
+ vm_paddr_t physaddr;
+ uint16_t flags;
+
+ physaddr = acpi_find_table(ACPI_SIG_FADT);
+ if (physaddr == 0)
+ return (false);
+
+ fadt = acpi_map_table(physaddr, ACPI_SIG_FADT);
+ if (fadt == NULL) {
+ printf("vt_vga: unable to map FADT ACPI table\n");
+ return (false);
+ }
+
+ flags = fadt->BootFlags;
+ acpi_unmap_table(fadt);
+
+ if (flags & ACPI_FADT_NO_VGA)
+ return (true);
+#endif
+
+ return (false);
+}
+
static int
vga_probe(struct vt_device *vd)
{
- return (CN_INTERNAL);
+ return (vga_acpi_disabled() ? CN_DEAD : CN_INTERNAL);
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 13, 5:53 AM (4 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35026510
Default Alt Text
D14397.diff (1 KB)
Attached To
Mode
D14397: vt_vga: check if VGA is available from ACPI FADT table
Attached
Detach File
Event Timeline
Log In to Comment