svn commit: r334372 - head/sys/dev/vt/hw/ofwfb

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed May 30 04:15:34 UTC 2018


Author: nwhitehorn
Date: Wed May 30 04:15:33 2018
New Revision: 334372
URL: https://svnweb.freebsd.org/changeset/base/334372

Log:
  If linebytes property is missing from the graphics device, assume no
  overscan and synthesize it from the display depth and screen width.
  This may not be right, but it sometimes right and is better than
  returning CN_DEAD.

Modified:
  head/sys/dev/vt/hw/ofwfb/ofwfb.c

Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c
==============================================================================
--- head/sys/dev/vt/hw/ofwfb/ofwfb.c	Wed May 30 04:12:51 2018	(r334371)
+++ head/sys/dev/vt/hw/ofwfb/ofwfb.c	Wed May 30 04:15:33 2018	(r334372)
@@ -394,8 +394,7 @@ ofwfb_init(struct vt_device *vd)
 	/* Make sure we have needed properties */
 	if (OF_getproplen(node, "height") != sizeof(height) ||
 	    OF_getproplen(node, "width") != sizeof(width) ||
-	    OF_getproplen(node, "depth") != sizeof(depth) ||
-	    OF_getproplen(node, "linebytes") != sizeof(sc->fb.fb_stride))
+	    OF_getproplen(node, "depth") != sizeof(depth))
 		return (CN_DEAD);
 
 	/* Only support 8 and 32-bit framebuffers */
@@ -406,7 +405,9 @@ ofwfb_init(struct vt_device *vd)
 
 	OF_getprop(node, "height", &height, sizeof(height));
 	OF_getprop(node, "width", &width, sizeof(width));
-	OF_getprop(node, "linebytes", &stride, sizeof(stride));
+	if (OF_getprop(node, "linebytes", &stride, sizeof(stride)) !=
+	    sizeof(stride))
+		stride = width*depth/8;
 
 	sc->fb.fb_height = height;
 	sc->fb.fb_width = width;


More information about the svn-src-all mailing list