svn commit: r332546 - head/sys/powerpc/mpc85xx

Justin Hibbits jhibbits at FreeBSD.org
Mon Apr 16 04:02:54 UTC 2018


Author: jhibbits
Date: Mon Apr 16 04:02:53 2018
New Revision: 332546
URL: https://svnweb.freebsd.org/changeset/base/332546

Log:
  Use a resource hint instead of environment variable for DIU mode
  
  This makes it more consistent with FreeBSD norms, rather than using Linux's
  norms.  Now, instead of needing an environment variable
  
    video-mode=fslfb:1280x1024 at 60
  
  Now one would use a hint:
  
    hint.fb.0.mode=1280x1024 at 60

Modified:
  head/sys/powerpc/mpc85xx/fsl_diu.c

Modified: head/sys/powerpc/mpc85xx/fsl_diu.c
==============================================================================
--- head/sys/powerpc/mpc85xx/fsl_diu.c	Mon Apr 16 03:58:08 2018	(r332545)
+++ head/sys/powerpc/mpc85xx/fsl_diu.c	Mon Apr 16 04:02:53 2018	(r332546)
@@ -363,12 +363,9 @@ diu_attach(device_t dev)
 
 	/* TODO: Eventually, allow EDID to be dynamically provided. */
 	if (OF_getprop_alloc(node, "edid", &edid_cells) <= 0) {
-		/*
-		 * u-boot uses the environment variable name 'video-mode', so
-		 * just use the same name here.  Should allow another variable
-		 * that better fits our design model, but this is fine.
-		 */
-		if ((vm_name = kern_getenv("video-mode")) == NULL) {
+		/* Get a resource hint: hint.fb.N.mode */
+		if (resource_string_value(device_get_name(dev),
+		    device_get_unit(dev), "mode", &vm_name) != 0) {
 			device_printf(dev,
 			    "No EDID data and no video-mode env set\n");
 			return (ENXIO);
@@ -383,7 +380,7 @@ diu_attach(device_t dev)
 		videomode = edid.edid_preferred_mode;
 	} else {
 		/* Parse video-mode kenv variable. */
-		if ((err = sscanf(vm_name, "fslfb:%dx%d@%d", &w, &h, &r)) != 3) {
+		if ((err = sscanf(vm_name, "%dx%d@%d", &w, &h, &r)) != 3) {
 			device_printf(dev,
 			    "Cannot parse video mode: %s\n", vm_name);
 			return (ENXIO);


More information about the svn-src-all mailing list