Module Name: xsrc
Committed By: macallan
Date: Thu Jun 10 13:26:46 UTC 2010
Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14.h cg14_driver.c
Log Message:
Make ioctl(CG14_SET_PIXELMODE) a proper NetBSD ioctl() ( as in use _IOW ),
also fix some bogosity in colour weights and depth.
With this and the kernel changes committed earlier the cg14 in my SS20 works
with the suncg14 driver.
TODO:
- beat some sanity in the order in which the Xserver issues various ioctl()s
and opens or closes devices to reduce unnecessary flicker and make sure we
end up in the right colour mode when entering and exiting X
- add hw cursor support
- support 8 bit visuals along with 24 bit or alone for high resolutions
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h:1.1.1.1 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h:1.2
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h:1.1.1.1 Thu Feb 11 00:16:41 2010
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14.h Thu Jun 10 13:26:46 2010
@@ -68,6 +68,11 @@
* This should match corresponding definition in Solaris's
* '/usr/include/sys/cg14io.h'.
*/
+#ifdef __NetBSD__
+#include <sys/ioccom.h>
+#define CG14_SET_PIXELMODE _IOW('M', 3, int)
+#else
#define CG14_SET_PIXELMODE (('M' << 8) | 3)
+#endif
#endif /* CG14_H */
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.2 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.3
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.2 Sun Mar 14 01:14:51 2010
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c Thu Jun 10 13:26:46 2010
@@ -331,12 +331,12 @@
deal with depth
*********************/
- if (!xf86SetDepthBpp(pScrn, 32, 0, 32, Support32bppFb)) {
- return FALSE;
- } else {
- /* Check that the returned depth is one we support */
- switch (pScrn->depth) {
+ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb|Support32bppFb))
+ return FALSE;
+ /* Check that the returned depth is one we support */
+ switch (pScrn->depth) {
case 32:
+ case 24:
/* OK */
break;
default:
@@ -344,7 +344,6 @@
"Given depth (%d) is not supported by this driver\n",
pScrn->depth);
return FALSE;
- }
}
/* Collect all of the relevant option flags (fill in pScrn->options) */
@@ -360,7 +359,7 @@
* xf86SetWeight references it.
*/
if (pScrn->depth > 8) {
- rgb weight = {10, 11, 11};
+ rgb weight = {0, 0, 0};
rgb mask = {0xff, 0xff00, 0xff0000};
if (!xf86SetWeight(pScrn, weight, mask)) {
@@ -446,8 +445,11 @@
(pCg14->psdp->width * pCg14->psdp->height));
pCg14->xlut = xf86MapSbusMem (pCg14->psdp, CG14_XLUT_VOFF, 4096);
- if (! pCg14->fb || !pCg14->x32 || !pCg14->xlut)
+ if (! pCg14->fb || !pCg14->x32 || !pCg14->xlut) {
+ xf86Msg(X_ERROR, "can't mmap something: fd %08x x32 %08x xlut %08x\n",
+ (uint32_t)pCg14->fb, (uint32_t)pCg14->x32, (uint32_t)pCg14->xlut);
return FALSE;
+ }
/* Darken the screen for aesthetic reasons and set the viewport */
CG14SaveScreen(pScreen, SCREEN_SAVER_ON);
@@ -541,6 +543,7 @@
static Bool
CG14SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
+ xf86Msg(X_ERROR, "CG14SwitchMode\n");
return TRUE;
}
@@ -601,6 +604,7 @@
Cg14Ptr pCg14 = GET_CG14_FROM_SCRN(pScrn);
pScrn->vtSema = FALSE;
+ CG14ExitCplane24 (pScrn);
xf86UnmapSbusMem(pCg14->psdp, pCg14->fb,
(pCg14->psdp->width * pCg14->psdp->height * 4));
xf86UnmapSbusMem(pCg14->psdp, pCg14->x32,