Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Nov 2020 21:27:54 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367431 - head/sys/dev/vt/hw/efifb
Message-ID:  <202011062127.0A6LRsP6074621@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Fri Nov  6 21:27:54 2020
New Revision: 367431
URL: https://svnweb.freebsd.org/changeset/base/367431

Log:
  efifb: vt_generate_cons_palette() takes max color, not mask
  
  vt_generate_cons_palette() does take max values of RGB component colours, not
  mask. Also we need to set info->fb_cmsize, or vt_fb_init() will re-initialize
  the info->fb_cmap.

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

Modified: head/sys/dev/vt/hw/efifb/efifb.c
==============================================================================
--- head/sys/dev/vt/hw/efifb/efifb.c	Fri Nov  6 19:27:27 2020	(r367430)
+++ head/sys/dev/vt/hw/efifb/efifb.c	Fri Nov  6 21:27:54 2020	(r367431)
@@ -102,6 +102,7 @@ vt_efifb_init(struct vt_device *vd)
 	struct fb_info	*info;
 	struct efi_fb	*efifb;
 	caddr_t		kmdp;
+	int		roff, goff, boff;
 
 	info = vd->vd_softc;
 	if (info == NULL)
@@ -126,10 +127,14 @@ vt_efifb_init(struct vt_device *vd)
 	/* Stride in bytes, not pixels */
 	info->fb_stride = efifb->fb_stride * (info->fb_bpp / NBBY);
 
+	roff = ffs(efifb->fb_mask_red) - 1;
+	goff = ffs(efifb->fb_mask_green) - 1;
+	boff = ffs(efifb->fb_mask_blue) - 1;
 	vt_generate_cons_palette(info->fb_cmap, COLOR_FORMAT_RGB,
-	    efifb->fb_mask_red, ffs(efifb->fb_mask_red) - 1,
-	    efifb->fb_mask_green, ffs(efifb->fb_mask_green) - 1,
-	    efifb->fb_mask_blue, ffs(efifb->fb_mask_blue) - 1);
+	    efifb->fb_mask_red >> roff, roff,
+	    efifb->fb_mask_green >> goff, goff,
+	    efifb->fb_mask_blue >> boff, boff);
+	info->fb_cmsize = NCOLORS;
 
 	info->fb_size = info->fb_height * info->fb_stride;
 	info->fb_pbase = efifb->fb_addr;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011062127.0A6LRsP6074621>