changeset 11046:60b7b484ea37

PSARC/2009/596 "primary-controller" frame buffer driver property 6898353 "primary-controller" property should be added to the frame buffer driver on X86
author Edward Shu <Edward.Shu@Sun.COM>
date Thu, 12 Nov 2009 09:30:58 +0800
parents 0db6e4248051
children dc0bb5e7d98b
files usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c	Wed Nov 11 16:21:10 2009 -0800
+++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_vgatext.c	Thu Nov 12 09:30:58 2009 +0800
@@ -305,6 +305,7 @@
 	off_t	mem_offset;
 	char	*cons;
 	int pci_pcie_bus = 0;
+	int value;
 
 	switch (cmd) {
 	case DDI_ATTACH:
@@ -433,6 +434,14 @@
 
 	gfxp_check_for_console(devi, softc, pci_pcie_bus);
 
+	value = GFXP_IS_CONSOLE(softc) ? 1 : 0;
+	if (ddi_prop_update_int(DDI_DEV_T_NONE, devi,
+	    "primary-controller", value) != DDI_SUCCESS) {
+		cmn_err(CE_WARN,
+		    "Can not %s primary-controller "
+		    "property for driver", value ? "set" : "clear");
+	}
+
 	/* only do this if not in graphics mode */
 	if ((vgatext_silent == 0) && (GFXP_IS_CONSOLE(softc))) {
 		vgatext_init(softc);
@@ -455,6 +464,8 @@
 {
 	struct vgatext_softc *softc = (struct vgatext_softc *)ptr;
 
+	(void) ddi_prop_remove(DDI_DEV_T_ANY, devi, "primary-controller");
+
 	switch (cmd) {
 
 	case DDI_SUSPEND: