Module Name:    src
Committed By:   macallan
Date:           Tue Jun  8 06:30:42 UTC 2010

Modified Files:
        src/sys/arch/sparc/dev: cgfourteen.c

Log Message:
get rid of the cg3/cg8 'emulation' kludge since we have the xf86-video-suncg14
driver now
this will probably need some work in cgfourteenmmap() to match what the
driver expects from a cg14


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sparc/dev/cgfourteen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/dev/cgfourteen.c
diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.62 src/sys/arch/sparc/dev/cgfourteen.c:1.63
--- src/sys/arch/sparc/dev/cgfourteen.c:1.62	Thu Aug 27 20:52:18 2009
+++ src/sys/arch/sparc/dev/cgfourteen.c	Tue Jun  8 06:30:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfourteen.c,v 1.62 2009/08/27 20:52:18 macallan Exp $ */
+/*	$NetBSD: cgfourteen.c,v 1.63 2010/06/08 06:30:41 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -68,13 +68,6 @@
  */
 #undef CG14_MAP_REGS
 
-/*
- * The following enables 24-bit operation: when opened, the framebuffer
- * will switch to 24-bit mode (actually 32-bit mode), and provide a
- * simple cg8 emulation.
- */
-#define CG14_CG8
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/buf.h>
@@ -250,16 +243,9 @@
 	/* Mask out invalid flags from the user. */
 	fb->fb_flags = device_cfdata(sc->sc_dev)->cf_flags & FB_USERMASK;
 
-	/*
-	 * We're emulating a cg3/8, so represent ourselves as one
-	 */
-#ifdef CG14_CG8
-	fb->fb_type.fb_type = FBTYPE_MEMCOLOR;
+	fb->fb_type.fb_type = FBTYPE_MDICOLOR;
 	fb->fb_type.fb_depth = 32;
-#else
-	fb->fb_type.fb_type = FBTYPE_SUN3COLOR;
-	fb->fb_type.fb_depth = 8;
-#endif
+
 	fb_setsize_obp(fb, sc->sc_fb.fb_type.fb_depth, 1152, 900, node);
 	ramsize = roundup(fb->fb_type.fb_height * fb->fb_linebytes, NBPG);
 
@@ -308,13 +294,9 @@
 	/*
 	 * Let the user know that we're here
 	 */
-#ifdef CG14_CG8
-	printf(": cgeight emulated at %dx%dx24bpp",
-		fb->fb_type.fb_width, fb->fb_type.fb_height);
-#else
-	printf(": cgthree emulated at %dx%dx8bpp",
+	printf(": %dx%d",
 		fb->fb_type.fb_width, fb->fb_type.fb_height);
-#endif
+
 	/*
 	 * Enable the video.
 	 */
@@ -474,9 +456,6 @@
 	case FBIOPUTCMAP:
 		/* copy to software map */
 #define p ((struct fbcmap *)data)
-#ifdef CG14_CG8
-		p->index &= 0xffffff;
-#endif
 		error = cg14_put_cmap(p, &sc->sc_cmap, CG14_CLUT_SIZE);
 		if (error)
 			return (error);
@@ -633,25 +612,11 @@
 		sc->sc_savexlut[i] = xlut[i];
 	}
 
-#ifdef CG14_CG8
-	/*
-	 * Enable the video, and put in 24 bit mode.
-	 */
-	sc->sc_ctl->ctl_mctl = CG14_MCTL_ENABLEVID | CG14_MCTL_PIXMODE_32 |
-		CG14_MCTL_POWERCTL;
-
-	/*
-	 * Zero the xlut to enable direct-color mode
-	 */
-	for (i = 0; i < CG14_CLUT_SIZE; i++)
-		sc->sc_xlut->xlut_lut[i] = 0;
-#else
 	/*
 	 * Enable the video and put it in 8 bit mode
 	 */
 	sc->sc_ctl->ctl_mctl = CG14_MCTL_ENABLEVID | CG14_MCTL_PIXMODE_8 |
 		CG14_MCTL_POWERCTL;
-#endif
 }
 
 static void
@@ -930,6 +895,7 @@
 
 	return 0;
 }
+
 static int
 cg14_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
 	struct lwp *l)

Reply via email to