CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2019-01-11 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jan 11 22:59:52 UTC 2019

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_output.c

Log Message:
- don't try to access a nonexistant video BIOS
- don't blindly assume VGA output
- on mobility chips assume LVDS and VGA outputs if no other info is available
Now this works again on my Pismo


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_output.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-r128/dist/src/r128_output.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.7 xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.8
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.7	Sun Dec 30 06:46:48 2018
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c	Fri Jan 11 22:59:52 2019
@@ -294,7 +294,7 @@ static R128MonitorType R128DisplayDDCCon
 unsigned char *R128MMIO = info->MMIO;
 R128OutputPrivatePtr r128_output = output->driver_private;
 
-R128MonitorType MonType = MT_CRT;
+R128MonitorType MonType = MT_NONE;
 xf86MonPtr *MonInfo = >MonInfo;
 uint32_t mask1, mask2;
 
@@ -476,7 +476,14 @@ void R128GetConnectorInfoFromBIOS(ScrnIn
 
 /* non-x86 platform */
 if (!info->VBIOS) {
-otypes[0] = OUTPUT_VGA;
+	if (info->isDFP) {
+	/* XXX assume LVDS on chips that can have them */ 
+otypes[0] = OUTPUT_LVDS;
+otypes[1] = OUTPUT_VGA;
+} else {
+otypes[0] = OUTPUT_VGA;
+}
+return;
 }
 
 bios_header = R128_BIOS16(0x48);



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2018-12-29 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sun Dec 30 06:59:35 UTC 2018

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c r128_exa.c

Log Message:
fix merge botch -- at least compiles now.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.19 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.20
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.19	Sun Dec 30 06:46:48 2018
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Sun Dec 30 06:59:35 2018
@@ -1588,7 +1588,6 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int 
 
 info->useEXA = FALSE;
 #ifdef USE_EXA
-#ifndef HAVE_XAA_H
 info->useEXA = TRUE;
 #endif
 

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.4
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.3	Sun Dec 30 06:46:48 2018
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c	Sun Dec 30 06:59:35 2018
@@ -440,12 +440,10 @@ R128UploadToScreenHW(PixmapPtr pDst, int
 uint32_t	*s;
 
 if (!R128GetDatatypeBpp(bpp, )) {
-R128TRACE(("R128GetDatatypeBpp failed\n"));
 	return FALSE;
 }
 
 if (!R128GetPixmapOffsetPitch(pDst, _pitch_offset)) {
-R128TRACE(("R128GetPixmapOffsetPitch dest failed\n"));
 	return FALSE;
 }
 



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2018-07-25 Thread Kamil Rytarowski
Module Name:xsrc
Committed By:   kamil
Date:   Wed Jul 25 18:54:43 UTC 2018

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_reg.h

Log Message:
Avoid Undefined Behavior in r128_reg.h

Specify symbols without altering signed bit.

Requested by GCC when building with Undefined Behavior Sanitizer.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h

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-r128/dist/src/r128_reg.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.4
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.3	Mon Jul 20 00:55:42 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h	Wed Jul 25 18:54:43 2018
@@ -1027,8 +1027,8 @@
 #   define R128_PM4_64PIO_128INDBM (5  << 28)
 #   define R128_PM4_64BM_128INDBM  (6  << 28)
 #   define R128_PM4_64PIO_64VCBM_64INDBM   (7  << 28)
-#   define R128_PM4_64BM_64VCBM_64INDBM(8  << 28)
-#   define R128_PM4_64PIO_64VCPIO_64INDPIO (15 << 28)
+#   define R128_PM4_64BM_64VCBM_64INDBM(8U  << 28)
+#   define R128_PM4_64PIO_64VCPIO_64INDPIO (15U << 28)
 #define R128_PM4_BUFFER_WM_CNTL   0x0708
 #   define R128_WMA_SHIFT  0
 #   define R128_WMB_SHIFT  8
@@ -1037,7 +1037,7 @@
 #define R128_PM4_BUFFER_DL_RPTR_ADDR  0x070c
 #define R128_PM4_BUFFER_DL_RPTR   0x0710
 #define R128_PM4_BUFFER_DL_WPTR   0x0714
-#   define R128_PM4_BUFFER_DL_DONE(1 << 31)
+#   define R128_PM4_BUFFER_DL_DONE(1U << 31)
 #define R128_PM4_BUFFER_DL_WPTR_DELAY 0x0718
 #   define R128_PRE_WRITE_TIMER_SHIFT  0
 #   define R128_PRE_WRITE_LIMIT_SHIFT 23
@@ -1085,7 +1085,7 @@
 #define R128_PM4_STAT 0x07b8
 #   define R128_PM4_FIFOCNT_MASK  0x0fff
 #   define R128_PM4_BUSY  (1 << 16)
-#   define R128_PM4_GUI_ACTIVE(1 << 31)
+#   define R128_PM4_GUI_ACTIVE(1U << 31)
 #define R128_PM4_BUFFER_ADDR  0x07f0
 #define R128_PM4_MICRO_CNTL   0x07fc
 #   define R128_PM4_MICRO_FREERUN (1 << 30)
@@ -1150,7 +1150,7 @@
 #   define R128_COMPOSITE_SHADOW  (1  << 29)
 #   define R128_TEX_MAP_ALPHA_IN_TEXTURE  (1  << 30)
 #   define R128_TEX_CACHE_LINE_SIZE_8QW   (0  << 31)
-#   define R128_TEX_CACHE_LINE_SIZE_4QW   (1  << 31)
+#   define R128_TEX_CACHE_LINE_SIZE_4QW   (1U  << 31)
 #define R128_SCALE_3D_DATATYPE0x1a20
 
 #define R128_SETUP_CNTL   0x1bc4
@@ -1178,7 +1178,7 @@
 #   define R128_SU_POLY_LINE_NOT_LAST (1 << 18)
 #   define R128_SUB_PIX_2BITS (0 << 19)
 #   define R128_SUB_PIX_4BITS (1 << 19)
-#   define R128_SET_UP_CONTINUE   (1 << 31)
+#   define R128_SET_UP_CONTINUE   (1U << 31)
 
 #define R128_WINDOW_XY_OFFSET 0x1bcc
 #   define R128_WINDOW_Y_SHIFT4
@@ -1257,7 +1257,7 @@
 #   define R128_ANTI_ALIAS (1 << 21)
 #   define R128_TEX_CACHE_FLUSH(1 << 23)
 #   define R128_LOD_BIAS_SHIFT 24
-#   define R128_LOD_BIAS_MASK  (0xff << 24)
+#   define R128_LOD_BIAS_MASK  (0xffU << 24)
 #define R128_MISC_3D_STATE_CNTL_REG   0x1ca0
 #   define R128_REF_ALPHA_MASK  0xff
 #   define R128_MISC_SCALE_3D_NOOP  (0  <<  8)
@@ -1386,11 +1386,11 @@
 #   define R128_SEC_TEX_PITCH_MASK   (0x0f << 16)
 #   define R128_SEC_TEX_SIZE_MASK(0x0f << 20)
 #   define R128_SEC_TEX_HEIGHT_MASK  (0x0f << 24)
-#   define R128_SEC_TEX_MIN_SIZE_MASK(0x0f << 28)
+#   define R128_SEC_TEX_MIN_SIZE_MASK(0x0fU << 28)
 #   define R128_TEX_SIZE_PITCH_SHIFT  0
 #   define R128_SEC_TEX_SIZE_PITCH_SHIFT 16
 #   define R128_TEX_SIZE_PITCH_MASK  (0x <<  0)
-#   define R128_SEC_TEX_SIZE_PITCH_MASK  (0x << 16)
+#   define R128_SEC_TEX_SIZE_PITCH_MASK  (0xU << 16)
 #define R128_PRIM_TEX_0_OFFSET_C  0x1cbc
 #define R128_PRIM_TEX_1_OFFSET_C  0x1cc0
 #define R128_PRIM_TEX_2_OFFSET_C  0x1cc4
@@ -1404,8 +1404,8 @@
 #define R128_PRIM_TEX_10_OFFSET_C 0x1ce4
 #   define R128_TEX_NO_TILE   (0 << 30)
 #   define R128_TEX_TILED_BY_HOST (1 << 30)
-#   define R128_TEX_TILED_BY_STORAGE  (2 << 30)
-#   define R128_TEX_TILED_BY_STORAGE2 (3 << 30)
+#   define R128_TEX_TILED_BY_STORAGE  (2U << 30)
+#   define R128_TEX_TILED_BY_STORAGE2 (3U << 30)
 
 #define R128_SEC_TEX_CNTL_C   0x1d00
 #   define R128_SEC_SELECT_PRIM_ST(0  <<  0)



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2016-09-09 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Sep  9 22:40:01 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_exa.c

Log Message:
- implement UploadToScreen() using host blits
- implement DownloadFromScreen() with memcpy() but sync the engine first
- call exaMarkSync() when needed
- don't set EXA_OFFSCREEN_ALIGN_POT unless we actually do xrender acceleration


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.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-r128/dist/src/r128_exa.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.1.1.1 xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.1.1.1	Sun Jun  2 08:24:19 2013
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c	Fri Sep  9 22:40:01 2016
@@ -230,6 +230,7 @@ R128Solid(PixmapPtr pPixmap, int x1, int
 R128WaitForFifo(pScrn, 2);
 OUTREG(R128_DST_Y_X,  (y1 << 16) | x1);
 OUTREG(R128_DST_WIDTH_HEIGHT, ((x2-x1) << 16) | (y2-y1));
+exaMarkSync(pScreen);
 }
 
 #define R128DoneSolid R128Done
@@ -317,6 +318,7 @@ R128Copy(PixmapPtr pDstPixmap, int srcX,
 OUTREG(R128_SRC_Y_X,  (srcY << 16) | srcX);
 OUTREG(R128_DST_Y_X,  (dstY << 16) | dstX);
 OUTREG(R128_DST_HEIGHT_WIDTH, (height << 16) | width);
+exaMarkSync(pScreen);
 }
 
 #define R128DoneCopy R128Done
@@ -410,6 +412,131 @@ R128CCESync(ScreenPtr pScreen, int marke
 
 #endif
 
+/*
+ * Memcpy-based UTS.
+ */
+static Bool
+R128UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
+char *src, int src_pitch)
+{
+ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+R128InfoPtr	info  = R128PTR(pScrn);
+char	*dst= info->FB + exaGetPixmapOffset(pDst);
+int		dst_pitch  = exaGetPixmapPitch(pDst);
+int		bpp= pDst->drawable.bitsPerPixel;
+int		cpp= (bpp + 7) >> 3;
+int		wBytes = w * cpp;
+
+dst += (x * cpp) + (y * dst_pitch);
+
+R128WaitForIdle(pScrn);
+
+while (h--) {
+	memcpy(dst, src, wBytes);
+	src += src_pitch;
+	dst += dst_pitch;
+}
+
+return TRUE;
+}
+
+/*
+ * Hostblit-based UTS.
+ * this assumes 32bit pixels
+ */
+static Bool
+R128UploadToScreenHW(PixmapPtr pDst, int x, int y, int w, int h,
+char *src, int src_pitch)
+{
+ScrnInfoPtr	pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+R128InfoPtr	info  = R128PTR(pScrn);
+uint32_t	dst_pitch_offset, datatype;
+int		cnt, line, px;
+unsigned char *R128MMIO = info->MMIO;
+int		bpp = pDst->drawable.bitsPerPixel;
+uint32_t	*s;
+
+if (!R128GetDatatypeBpp(bpp, )) {
+R128TRACE(("R128GetDatatypeBpp failed\n"));
+	return FALSE;
+}
+
+if (!R128GetPixmapOffsetPitch(pDst, _pitch_offset)) {
+R128TRACE(("R128GetPixmapOffsetPitch dest failed\n"));
+	return FALSE;
+}
+
+info->state_2d.in_use = TRUE;
+info->state_2d.dp_gui_master_cntl = (R128_GMC_DST_PITCH_OFFSET_CNTL |
+	  R128_GMC_BRUSH_NONE |
+	  (datatype >> 8) |
+	  R128_GMC_SRC_DATATYPE_COLOR |
+	  R128_ROP3_S |
+	  R128_DP_SRC_SOURCE_HOST_DATA |
+	  R128_GMC_CLR_CMP_CNTL_DIS);
+info->state_2d.dp_cntl = R128_DST_X_LEFT_TO_RIGHT |
+ R128_DST_Y_TOP_TO_BOTTOM;
+info->state_2d.dp_write_mask = 0x;
+info->state_2d.dst_pitch_offset = dst_pitch_offset;
+info->state_2d.default_sc_bottom_right = R128_DEFAULT_SC_RIGHT_MAX |
+ R128_DEFAULT_SC_BOTTOM_MAX;
+Emit2DState(pScrn);
+
+R128WaitForFifo(pScrn, 3);
+OUTREG(R128_SRC_Y_X, 0);
+OUTREG(R128_DST_Y_X, (y << 16) | x);
+OUTREG(R128_DST_HEIGHT_WIDTH, (h << 16) | w);
+
+R128WaitForFifo(pScrn, 32);
+cnt = 0;
+
+for (line = 0; line < h; line++) {
+	s = (void *)src;
+	for (px = 0; px < w; px++) {
+	OUTREG(R128_HOST_DATA0, cpu_to_le32(*s));
+	s++;
+	cnt++;
+	if (cnt > 31) {
+		R128WaitForFifo(pScrn, 32);
+		cnt = 0;
+	}
+	}
+	src += src_pitch;
+}
+info->state_2d.in_use = FALSE;
+exaMarkSync(pDst->drawable.pScreen);
+return TRUE;
+}
+
+/*
+ * Memcpy-based DFS.
+ */
+static Bool
+R128DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
+char *dst, int dst_pitch)
+{
+ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+R128InfoPtr   info  = R128PTR(pScrn);
+char  *src= info->FB + exaGetPixmapOffset(pSrc);
+intsrc_pitch  = exaGetPixmapPitch(pSrc);
+
+int bpp= pSrc->drawable.bitsPerPixel;
+int cpp= (bpp + 7) >> 3;
+int wBytes = w * cpp;
+
+src += (x * cpp) + (y * src_pitch);
+
+R128WaitForIdle(pScrn);
+
+while (h--) {
+	memcpy(dst, src, wBytes);
+	src += 

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2016-08-16 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Tue Aug 16 08:09:12 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128.h r128_driver.c
r128_output.c r128_probe.h

Log Message:
include xorg-server.h which is normally included by config.h.

(as an unmaintained version, this change doubly isn't a candidate
for upstream.)

include xf86Privstr.h and switch screenFd to consoleFd.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xf86-video-r128/dist/src/r128.h
cvs rdiff -u -r1.16 -r1.17 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h

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-r128/dist/src/r128.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.7 xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.8
--- xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.7	Wed Jul 29 18:15:38 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128.h	Tue Aug 16 08:09:12 2016
@@ -38,6 +38,7 @@
 #define _R128_H_
 
 #include 
+#include "xorg-server.h"
 #include "xf86str.h"
 
 /* PCI support */

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.16 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.17
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.16	Wed Jul 29 19:27:37 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Tue Aug 16 08:09:12 2016
@@ -94,6 +94,7 @@
 #include "xf86xv.h"
 #include "vbe.h"
 #include "xf86Priv.h"
+#include "xf86Privstr.h"
 
 /* fbdevhw & vgahw */
 #ifdef WITH_VGAHW
@@ -608,7 +609,7 @@ fallback:
 	 */
 	struct wsdisplay_fbinfo fbinfo;
 	
-	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GINFO, ) == 0) {
+	if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GINFO, ) == 0) {
 	r128_output->PanelXRes = fbinfo.width;
 	r128_output->PanelYRes = fbinfo.height;
 	}
@@ -1348,7 +1349,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int 
 /* now check if this is the console */
 info->HaveWSDisplay = FALSE;
 info->HaveBacklightControl = FALSE;
-if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_BUSID, ) != -1) {
+if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GET_BUSID, ) != -1) {
 	if ((bid.bus_type == WSDISPLAYIO_BUS_PCI) &&
 	(bid.ubus.pci.bus == PCI_DEV_BUS(info->PciInfo)) &&
 	(bid.ubus.pci.device == PCI_DEV_DEV(info->PciInfo)) &&
@@ -1359,7 +1360,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int 
 
 		/* now see if we have hacklight control */
 		p.param = WSDISPLAYIO_PARAM_BACKLIGHT;
-		if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GETPARAM, ) != -1) {
+		if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ) != -1) {
 		xf86Msg(X_INFO, "... and we have backlight control\n");
 		info->HaveBacklightControl = TRUE; 	 
 		}   	

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.4 xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.5
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.4	Mon Aug 15 03:06:07 2016
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c	Tue Aug 16 08:09:12 2016
@@ -41,6 +41,7 @@
 #include "r128_probe.h"
 #include "r128_reg.h"
 #include "xf86Priv.h"
+#include "xf86Privstr.h"
 
 #ifdef __NetBSD__
 #include 
@@ -195,7 +196,7 @@ void R128DPMSSetOn(xf86OutputPtr output)
 
 	p.param = WSDISPLAYIO_PARAM_BACKLIGHT;
 	p.curval = 1;
-	ioctl(xf86Info.screenFd, WSDISPLAYIO_SETPARAM, );
+	ioctl(xf86Info.consoleFd, WSDISPLAYIO_SETPARAM, );
 	} else
 #endif
 	{
@@ -235,7 +236,7 @@ void R128DPMSSetOff(xf86OutputPtr output
 
 	p.param = WSDISPLAYIO_PARAM_BACKLIGHT;
 	p.curval = 0;
-	ioctl(xf86Info.screenFd, WSDISPLAYIO_SETPARAM, );
+	ioctl(xf86Info.consoleFd, WSDISPLAYIO_SETPARAM, );
 	} else
 #endif
 	{
@@ -278,7 +279,7 @@ static R128MonitorType R128DisplayDDCCon
 	buffer = malloc(1024);
 	ei.edid_data = buffer;
 	ei.buffer_size = 1024;
-	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_EDID, ) != -1) {
+	if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GET_EDID, ) != -1) {
 		xf86Msg(X_INFO, "got %d bytes worth of EDID from wsdisplay\n",
 		ei.data_size);
 		tmp = xf86InterpretEEDID(pScrn->scrnIndex, buffer);

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h:1.1.1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h:1.1.1.3	Mon Jul 20 00:23:09 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_probe.h	Tue Aug 16 08:09:12 2016
@@ -36,6 +36,7 @@
 

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2016-08-14 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Aug 15 03:06:07 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_output.c

Log Message:
merge xf86-video-r128 6.10.1


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_output.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-r128/dist/src/r128_output.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.4
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.3	Wed Jul 29 18:15:38 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c	Mon Aug 15 03:06:07 2016
@@ -260,10 +260,11 @@ static R128MonitorType R128DisplayDDCCon
 {
 ScrnInfoPtr pScrn = output->scrn;
 R128InfoPtr info = R128PTR(pScrn);
+R128EntPtr pR128Ent = R128EntPriv(pScrn);
 unsigned char *R128MMIO = info->MMIO;
 R128OutputPrivatePtr r128_output = output->driver_private;
 
-R128MonitorType MonType = MT_NONE;
+R128MonitorType MonType = MT_CRT;
 xf86MonPtr *MonInfo = >MonInfo;
 uint32_t mask1, mask2;
 
@@ -290,8 +291,8 @@ static R128MonitorType R128DisplayDDCCon
 #endif
 return MT_LCD;
 } else if (r128_output->type == OUTPUT_VGA) {
-mask1 = R128_GPIO_MONID_MASK_1 | (info->isPro2 ? R128_GPIO_MONID_MASK_2 : R128_GPIO_MONID_MASK_3);
-mask2 = R128_GPIO_MONID_A_1| (info->isPro2 ? R128_GPIO_MONID_A_2: R128_GPIO_MONID_A_3);
+mask1 = R128_GPIO_MONID_MASK_1 | (pR128Ent->HasCRTC2 ? R128_GPIO_MONID_MASK_3 : R128_GPIO_MONID_MASK_2);
+mask2 = R128_GPIO_MONID_A_1| (pR128Ent->HasCRTC2 ? R128_GPIO_MONID_A_3: R128_GPIO_MONID_A_2);
 } else {
 mask1 = R128_GPIO_MONID_MASK_0 | R128_GPIO_MONID_MASK_3;
 mask2 = R128_GPIO_MONID_A_0| R128_GPIO_MONID_A_3;
@@ -318,9 +319,6 @@ static R128MonitorType R128DisplayDDCCon
 else
 MonType = MT_CRT;
 	}
-} else if (xf86I2CProbeAddress(r128_output->pI2CBus, 0x0060)) {
-/* Just in case. */
-MonType = MT_CRT;
 }
 
 return MonType;
@@ -527,7 +525,7 @@ Bool R128SetupConnectors(ScrnInfoPtr pSc
 
 if (otypes[i] != OUTPUT_LVDS && info->DDC) {
 i2c.ddc_reg  = R128_GPIO_MONID;
-if (otypes[i] == OUTPUT_VGA && info->isPro2) {
+if (otypes[i] == OUTPUT_VGA && !pR128Ent->HasCRTC2) {
 i2c.put_clk_mask = R128_GPIO_MONID_EN_2;
 i2c.get_clk_mask = R128_GPIO_MONID_Y_2;
 } else {



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-29 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jul 29 19:27:37 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
restore some more registers on exit, now we actually get back to a usable
console


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.15 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.16
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.15	Wed Jul 29 18:15:38 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jul 29 19:27:37 2015
@@ -2797,15 +2797,11 @@ static void R128Restore(ScrnInfoPtr pScr
 R128RestoreFPRegisters(pScrn, restore);
 R128RestoreLVDSRegisters(pScrn, restore);
 
-#if 0
-if (!info-IsSecondary) {
-OUTREG(R128_AMCGPIO_MASK, restore-amcgpio_mask);
-OUTREG(R128_AMCGPIO_EN_REG,   restore-amcgpio_en_reg);
-OUTREG(R128_CLOCK_CNTL_INDEX, restore-clock_cntl_index);
-OUTREG(R128_GEN_RESET_CNTL,   restore-gen_reset_cntl);
-OUTREG(R128_DP_DATATYPE,  restore-dp_datatype);
-}
-#endif
+OUTREG(R128_AMCGPIO_MASK, restore-amcgpio_mask);
+OUTREG(R128_AMCGPIO_EN_REG,   restore-amcgpio_en_reg);
+OUTREG(R128_CLOCK_CNTL_INDEX, restore-clock_cntl_index);
+OUTREG(R128_GEN_RESET_CNTL,   restore-gen_reset_cntl);
+OUTREG(R128_DP_DATATYPE,  restore-dp_datatype);
 
 #ifdef WITH_VGAHW
 if (info-VGAAccess) {



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-29 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jul 29 18:15:38 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128.h r128_driver.c
r128_output.c

Log Message:
- make sure the wsdisplay we talk to is actually the one handling the chip
  we're about to use
- make sure we habe backlight control via wsdisplay before attempting to use it
- use wsdisplay backlight control for blanking if available


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xf86-video-r128/dist/src/r128.h
cvs rdiff -u -r1.14 -r1.15 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_output.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-r128/dist/src/r128.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.6 xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.7
--- xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.6	Mon Jul 20 00:55:42 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128.h	Wed Jul 29 18:15:38 2015
@@ -311,6 +311,10 @@ typedef struct {
 Bool  FBDev;
 #endif
 
+#ifdef __NetBSD__
+Bool	  HaveWSDisplay;
+Bool	  HaveBacklightControl;
+#endif
 unsigned long LinearAddr;   /* Frame buffer physical address */
 unsigned long MMIOAddr; /* MMIO region physical address  */
 unsigned long BIOSAddr; /* BIOS physical address */

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.14 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.15
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.14	Wed Jul 29 01:51:18 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jul 29 18:15:38 2015
@@ -596,7 +596,8 @@ void R128GetPanelInfoFromBIOS(xf86Output
 return;
 fallback:
 #ifdef __NetBSD__
-if (!r128_output-PanelXRes || !r128_output-PanelYRes) {
+if ((!r128_output-PanelXRes || !r128_output-PanelYRes)  
+(info-HaveWSDisplay)) {
 	/*
 	 * we may not be on x86 so check wsdisplay for panel dimensions
 	 * XXX this assumes that the r128 is the console, although that should
@@ -1313,6 +1314,9 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int 
 {
 R128InfoPtr  info;
 xf86Int10InfoPtr pInt10 = NULL;
+#ifdef __NetBSD__
+struct wsdisplayio_bus_id bid;
+#endif
 
 R128TRACE((R128PreInit\n));
 
@@ -1340,6 +1344,29 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int 
 	   PCI_DEV_DEV(info-PciInfo),
 	   PCI_DEV_FUNC(info-PciInfo));
 
+#ifdef __NetBSD__
+/* now check if this is the console */
+info-HaveWSDisplay = FALSE;
+info-HaveBacklightControl = FALSE;
+if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_BUSID, bid) != -1) {
+	if ((bid.bus_type == WSDISPLAYIO_BUS_PCI) 
+	(bid.ubus.pci.bus == PCI_DEV_BUS(info-PciInfo)) 
+	(bid.ubus.pci.device == PCI_DEV_DEV(info-PciInfo)) 
+	(bid.ubus.pci.function == PCI_DEV_FUNC(info-PciInfo))) {
+		struct wsdisplay_param p;
+		xf86Msg(X_INFO, Alright, this is the console\n);
+		info-HaveWSDisplay = TRUE;
+
+		/* now see if we have hacklight control */
+		p.param = WSDISPLAYIO_PARAM_BACKLIGHT;
+		if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GETPARAM, p) != -1) {
+		xf86Msg(X_INFO, ... and we have backlight control\n);
+		info-HaveBacklightControl = TRUE; 	 
+		}   	
+	}
+}
+#endif
+
 #ifndef XSERVER_LIBPCIACCESS
 info-PciTag= pciTag(PCI_DEV_BUS(info-PciInfo),
 PCI_DEV_DEV(info-PciInfo),

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.2 xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.3
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.2	Wed Jul 29 01:51:18 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c	Wed Jul 29 18:15:38 2015
@@ -189,9 +189,20 @@ void R128DPMSSetOn(xf86OutputPtr output)
 
 switch(MonType) {
 case MT_LCD:
-OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_BLON, ~R128_LVDS_BLON);
-usleep(r128_output-PanelPwrDly * 1000);
-OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_ON, ~R128_LVDS_ON);
+#ifdef __NetBSD__
+	if (info-HaveBacklightControl) {
+	struct wsdisplay_param p;
+
+	p.param = WSDISPLAYIO_PARAM_BACKLIGHT;
+	p.curval = 1;
+	ioctl(xf86Info.screenFd, WSDISPLAYIO_SETPARAM, p);
+	} else
+#endif
+	{
+OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_BLON, ~R128_LVDS_BLON);
+usleep(r128_output-PanelPwrDly * 1000);
+OUTREGP(R128_LVDS_GEN_CNTL, R128_LVDS_ON, ~R128_LVDS_ON);
+}
 save-lvds_gen_cntl |= (R128_LVDS_ON | R128_LVDS_BLON);
 break;
 case MT_DFP:
@@ 

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-28 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jul 29 01:51:18 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c r128_output.c

Log Message:
port static EDID support via WSDISPLAYIO_GET_EDID back, now this works again
on my pismo


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_output.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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.13 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.14
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.13	Mon Jul 20 01:33:51 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jul 29 01:51:18 2015
@@ -508,7 +508,7 @@ void R128GetPanelInfoFromBIOS(xf86Output
 xf86GetOptValInteger(info-Options, OPTION_PANEL_WIDTH,  (r128_output-PanelXRes));
 xf86GetOptValInteger(info-Options, OPTION_PANEL_HEIGHT, (r128_output-PanelYRes));
 
-if (!info-VBIOS) return;
+if (!info-VBIOS) goto fallback;
 info-FPBIOSstart = 0;
 
 /* FIXME: There should be direct access to the start of the FP info
@@ -529,7 +529,7 @@ void R128GetPanelInfoFromBIOS(xf86Output
 }
 }
 
-if (!FPHeader) return;
+if (!FPHeader) goto fallback;
 
 
 /* Assume that only one panel is attached and supported */
@@ -540,25 +540,6 @@ void R128GetPanelInfoFromBIOS(xf86Output
 }
 }
 
-#ifdef __NetBSD__
-if (!r128_output-PanelXRes || !r128_output-PanelYRes) {
-	/*
-	 * we may not be on x86 so check wsdisplay for panel dimensions
-	 * XXX this assumes that the r128 is the console, although that should
-	 * be the case in the vast majority of cases where an LCD is hooked up
-	 * directly
-	 * We should probably just check the relevant registers but I'm not
-	 * sure they're available at this point.
-	 */
-	struct wsdisplay_fbinfo fbinfo;
-	
-	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GINFO, fbinfo) == 0) {
-	r128_output-PanelXRes = fbinfo.width;
-	r128_output-PanelYRes = fbinfo.height;
-	}
-}
-#endif
-
 #ifndef AVOID_FBDEV
 if (!info-FPBIOSstart) return;
 #endif
@@ -612,6 +593,26 @@ void R128GetPanelInfoFromBIOS(xf86Output
This support is untested and may not 
function properly\n);
 }
+return;
+fallback:
+#ifdef __NetBSD__
+if (!r128_output-PanelXRes || !r128_output-PanelYRes) {
+	/*
+	 * we may not be on x86 so check wsdisplay for panel dimensions
+	 * XXX this assumes that the r128 is the console, although that should
+	 * be the case in the vast majority of cases where an LCD is hooked up
+	 * directly
+	 * We should probably just check the relevant registers but I'm not
+	 * sure they're available at this point.
+	 */
+	struct wsdisplay_fbinfo fbinfo;
+	
+	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GINFO, fbinfo) == 0) {
+	r128_output-PanelXRes = fbinfo.width;
+	r128_output-PanelYRes = fbinfo.height;
+	}
+}
+#endif
 }
 
 /* Read PLL parameters from BIOS block.  Default to typical values if there

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.1.1.1 xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c:1.1.1.1	Mon Jul 20 00:23:09 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_output.c	Wed Jul 29 01:51:18 2015
@@ -40,6 +40,14 @@
 #include r128.h
 #include r128_probe.h
 #include r128_reg.h
+#include xf86Priv.h
+
+#ifdef __NetBSD__
+#include sys/time.h
+#include sys/ioctl.h
+#include dev/wscons/wsconsio.h
+#endif
+
 
 static void R128ConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr output);
 
@@ -238,6 +246,24 @@ static R128MonitorType R128DisplayDDCCon
 uint32_t mask1, mask2;
 
 if (r128_output-type == OUTPUT_LVDS) {
+#ifdef __NetBSD__
+	struct wsdisplayio_edid_info ei;
+	char *buffer;
+	xf86MonPtr tmp;
+
+	buffer = malloc(1024);
+	ei.edid_data = buffer;
+	ei.buffer_size = 1024;
+	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_EDID, ei) != -1) {
+	xf86Msg(X_ERROR, got %d bytes worth of EDID from wsdisplay\n,
+	  ei.data_size);
+	tmp = xf86InterpretEEDID(pScrn-scrnIndex, buffer);
+	tmp-flags |= MONITOR_EDID_COMPLETE_RAWDATA;
+	*MonInfo = tmp;
+	xf86OutputSetEDID(output, tmp);
+	} else
+	free(buffer);
+#endif
 return MT_LCD;
 } else if (r128_output-type == OUTPUT_VGA) {
 mask1 = R128_GPIO_MONID_MASK_1 | (info-isPro2 ? R128_GPIO_MONID_MASK_2 : R128_GPIO_MONID_MASK_3);
@@ -297,8 +323,8 @@ DisplayModePtr R128ProbeOutputModes(xf86
 if (r128_output-pI2CBus) {
 edid_mon = xf86OutputGetEDID(output, 

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-19 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Jul 20 00:55:42 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128.h r128_driver.c
r128_reg.h
Removed Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_dga.c

Log Message:
attempt to merge r128 driver.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xf86-video-r128/dist/src/r128.h
cvs rdiff -u -r1.1.1.2 -r0 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_dga.c
cvs rdiff -u -r1.11 -r1.12 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h

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-r128/dist/src/r128.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.5 xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.6
--- xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.5	Wed Mar 19 23:56:47 2014
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128.h	Mon Jul 20 00:55:42 2015
@@ -74,6 +74,7 @@
 #endif
 
 #include fb.h
+#include xf86Crtc.h
 
 #include compat-api.h
 #include atipcirename.h
@@ -136,6 +137,14 @@
 #define R128_ALIGN(x,bytes) (((x) + ((bytes) - 1))  ~((bytes) - 1))
 #define R128PTR(pScrn) ((R128InfoPtr)(pScrn)-driverPrivate)
 
+#define R128_BIOS8(v)  ((info-VBIOS[(v)]))
+#define R128_BIOS16(v) ((info-VBIOS[(v)])   | \
+			(info-VBIOS[(v) + 1]  8))
+#define R128_BIOS32(v) ((info-VBIOS[(v)])   | \
+			(info-VBIOS[(v) + 1]  8)  | \
+			(info-VBIOS[(v) + 2]  16) | \
+			(info-VBIOS[(v) + 3]  24))
+
 typedef struct {/* All values in XCLKS*/
 int  ML;/* Memory Read Latency*/
 int  MB;/* Memory Burst Length*/
@@ -151,106 +160,106 @@ typedef struct {/* All values in
 
 typedef struct {
 /* Common registers */
-CARD32 ovr_clr;
-CARD32 ovr_wid_left_right;
-CARD32 ovr_wid_top_bottom;
-CARD32 ov0_scale_cntl;
-CARD32 mpp_tb_config;
-CARD32 mpp_gp_config;
-CARD32 subpic_cntl;
-CARD32 viph_control;
-CARD32 i2c_cntl_1;
-CARD32 gen_int_cntl;
-CARD32 cap0_trig_cntl;
-CARD32 cap1_trig_cntl;
-CARD32 bus_cntl;
-CARD32 config_cntl;
+uint32_t   ovr_clr;
+uint32_t   ovr_wid_left_right;
+uint32_t   ovr_wid_top_bottom;
+uint32_t   ov0_scale_cntl;
+uint32_t   mpp_tb_config;
+uint32_t   mpp_gp_config;
+uint32_t   subpic_cntl;
+uint32_t   viph_control;
+uint32_t   i2c_cntl_1;
+uint32_t   gen_int_cntl;
+uint32_t   cap0_trig_cntl;
+uint32_t   cap1_trig_cntl;
+uint32_t   bus_cntl;
+uint32_t   config_cntl;
 
 /* Other registers to save for VT switches */
-CARD32 dp_datatype;
-CARD32 gen_reset_cntl;
-CARD32 clock_cntl_index;
-CARD32 amcgpio_en_reg;
-CARD32 amcgpio_mask;
+uint32_t   dp_datatype;
+uint32_t   gen_reset_cntl;
+uint32_t   clock_cntl_index;
+uint32_t   amcgpio_en_reg;
+uint32_t   amcgpio_mask;
 
 /* CRTC registers */
-CARD32 crtc_gen_cntl;
-CARD32 crtc_ext_cntl;
-CARD32 dac_cntl;
-CARD32 crtc_h_total_disp;
-CARD32 crtc_h_sync_strt_wid;
-CARD32 crtc_v_total_disp;
-CARD32 crtc_v_sync_strt_wid;
-CARD32 crtc_offset;
-CARD32 crtc_offset_cntl;
-CARD32 crtc_pitch;
+uint32_t   crtc_gen_cntl;
+uint32_t   crtc_ext_cntl;
+uint32_t   dac_cntl;
+uint32_t   crtc_h_total_disp;
+uint32_t   crtc_h_sync_strt_wid;
+uint32_t   crtc_v_total_disp;
+uint32_t   crtc_v_sync_strt_wid;
+uint32_t   crtc_offset;
+uint32_t   crtc_offset_cntl;
+uint32_t   crtc_pitch;
 
 /* CRTC2 registers */
-CARD32 crtc2_gen_cntl;
-CARD32 crtc2_h_total_disp;
-CARD32 crtc2_h_sync_strt_wid;
-CARD32 crtc2_v_total_disp;
-CARD32 crtc2_v_sync_strt_wid;
-CARD32 crtc2_offset;
-CARD32 crtc2_offset_cntl;
-CARD32 crtc2_pitch;
+uint32_t   crtc2_gen_cntl;
+uint32_t   crtc2_h_total_disp;
+uint32_t   crtc2_h_sync_strt_wid;
+uint32_t   crtc2_v_total_disp;
+uint32_t   crtc2_v_sync_strt_wid;
+uint32_t   crtc2_offset;
+uint32_t   crtc2_offset_cntl;
+uint32_t   crtc2_pitch;
 
 /* Flat panel registers */
-CARD32 fp_crtc_h_total_disp;
-CARD32 fp_crtc_v_total_disp;
-CARD32 fp_gen_cntl;
-CARD32 fp_h_sync_strt_wid;
-CARD32 fp_horz_stretch;
-CARD32 fp_panel_cntl;
-CARD32 fp_v_sync_strt_wid;
-CARD32 fp_vert_stretch;
-CARD32 lvds_gen_cntl;
-CARD32 tmds_crc;
-CARD32 tmds_transmitter_cntl;
+uint32_t   fp_crtc_h_total_disp;
+uint32_t   fp_crtc_v_total_disp;
+uint32_t   fp_gen_cntl;
+uint32_t   

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-19 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Jul 20 01:33:52 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
merge this at least so it builds.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.12 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.13
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.12	Mon Jul 20 00:55:42 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Mon Jul 20 01:33:51 2015
@@ -577,9 +577,6 @@ void R128GetPanelInfoFromBIOS(xf86Output
 xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
 		   Can't determine panel dimensions, and none specified.\n
 		   \tDisabling programming of FP registers.\n);
-} else {
-	xf86DrvMsg(pScrn-scrnIndex, X_INFO, Panel size: %dx%d\n,
-		   info-PanelXRes, info-PanelYRes);
 }
 
 xf86DrvMsg(pScrn-scrnIndex, X_INFO, Panel ID: );
@@ -1716,16 +1713,6 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DEC
 info-PaletteSavedOnVT = FALSE;
 
 R128Save(pScrn);
-#ifndef AVOID_FBDEV
-if (info-FBDev) {
-	if (!fbdevHWModeInit(pScrn, pScrn-currentMode)) return FALSE;
-} else {
-#endif
-	if (!R128ModeInit(pScrn, pScrn-currentMode)) return FALSE;
-}
-
-R128SaveScreen(pScreen, SCREEN_SAVER_ON);
-pScrn-AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn-frameX0, pScrn-frameY0));
 
 /* Visual setup */
 miClearVisualTypes();
@@ -2101,11 +2088,15 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DEC
 /* xf86CrtcRotate accesses pScrn-pScreen */
 pScrn-pScreen = pScreen;
 
+#ifndef AVOID_FBDEV
 if (info-FBDev) {
 	if (!fbdevHWModeInit(pScrn, pScrn-currentMode)) return FALSE;
 } else {
+#endif
 	if (!xf86SetDesiredModes(pScrn)) return FALSE;
+#ifndef AVOID_FBDEV
 }
+#endif
 
 R128SaveScreen(pScreen, SCREEN_SAVER_ON);
 //pScrn-AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn-frameX0, pScrn-frameY0));
@@ -2149,19 +2140,10 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DEC
 if (info-FBDev)
 	xf86DPMSInit(pScreen, fbdevHWDPMSSetWeak(), 0);
 else
-xf86DPMSInit(pScreen, xf86DPMSSet, 0);
-
-else 
 #endif
-{
-	if (info-DisplayType == MT_LCD)
-	xf86DPMSInit(pScreen, R128DisplayPowerManagementSetLCD, 0);
-	else
-	xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0);
-}
+xf86DPMSInit(pScreen, xf86DPMSSet, 0);
 
-if (!info-IsSecondary)
-	R128InitVideo(pScreen);
+R128InitVideo(pScreen);
 
 /* Provide SaveScreen */
 pScreen-SaveScreen  = R128SaveScreen;
@@ -2787,6 +2769,7 @@ static void R128Restore(ScrnInfoPtr pScr
 R128RestoreFPRegisters(pScrn, restore);
 R128RestoreLVDSRegisters(pScrn, restore);
 
+#if 0
 if (!info-IsSecondary) {
 OUTREG(R128_AMCGPIO_MASK, restore-amcgpio_mask);
 OUTREG(R128_AMCGPIO_EN_REG,   restore-amcgpio_en_reg);
@@ -2794,6 +2777,7 @@ static void R128Restore(ScrnInfoPtr pScr
 OUTREG(R128_GEN_RESET_CNTL,   restore-gen_reset_cntl);
 OUTREG(R128_DP_DATATYPE,  restore-dp_datatype);
 }
+#endif
 
 #ifdef WITH_VGAHW
 if (info-VGAAccess) {
@@ -3629,14 +3613,12 @@ Bool R128EnterVT(VT_FUNC_ARGS_DECL)
 #ifndef AVOID_FBDEV
 if (info-FBDev) {
 if (!fbdevHWEnterVT(VT_FUNC_ARGS)) return FALSE;
-} else
+} else {
 #endif
-if (!R128ModeInit(pScrn, pScrn-currentMode)) return FALSE;
-else {
-if (!xf86SetDesiredModes(pScrn)) return FALSE;
+	if (!xf86SetDesiredModes(pScrn)) return FALSE;
+#ifndef AVOID_FBDEV
 }
-
-//if (!R128ModeInit(pScrn, pScrn-currentMode)) return FALSE;
+#endif
 
 if (info-accelOn)
 	R128EngineInit(pScrn);
@@ -3755,129 +3737,3 @@ void R128FreeScreen(FREE_SCREEN_ARGS_DEC
 #endif
 R128FreeRec(pScrn);
 }
-
-/* Sets VESA Display Power Management Signaling (DPMS) Mode.  */
-static void R128DisplayPowerManagementSet(ScrnInfoPtr pScrn,
-	  int PowerManagementMode, int flags)
-{
-R128InfoPtr   info  = R128PTR(pScrn);
-unsigned char *R128MMIO = info-MMIO;
-int   mask  = (R128_CRTC_DISPLAY_DIS
-			   | R128_CRTC_HSYNC_DIS
-			   | R128_CRTC_VSYNC_DIS);
-int mask2 = R128_CRTC2_DISP_DIS;
-
-switch (PowerManagementMode) {
-case DPMSModeOn:
-	/* Screen: On; HSync: On, VSync: On */
-	if (info-IsSecondary)
-		OUTREGP(R128_CRTC2_GEN_CNTL, 0, ~mask2);
-	else
-		OUTREGP(R128_CRTC_EXT_CNTL, 0, ~mask);
-	break;
-case DPMSModeStandby:
-	/* Screen: Off; HSync: Off, VSync: On */
-	if (info-IsSecondary)
-		OUTREGP(R128_CRTC2_GEN_CNTL, R128_CRTC2_DISP_DIS, ~mask2);
-	else
-		OUTREGP(R128_CRTC_EXT_CNTL,
-			R128_CRTC_DISPLAY_DIS | R128_CRTC_HSYNC_DIS, ~mask);
-	break;
-case 

CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-08 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jul  8 18:56:39 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
sprintf - snprintf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.10 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.11
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.10	Tue Jul  7 00:55:52 2015
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jul  8 18:56:39 2015
@@ -1622,8 +1622,8 @@ static int R128ValidateFPModes(ScrnInfoP
 /* If no mode specified in config, we use native resolution*/
 if(!pScrn-display-modes[0])
 {
-pScrn-display-modes[0] = xnfalloc(16);
-sprintf(pScrn-display-modes[0], %dx%d,
+pScrn-display-modes[0] = xnfalloc(32);
+snprintf(pScrn-display-modes[0], 32, %dx%d,
info-PanelXRes, info-PanelYRes);
 /* don't forget to NULL terminate */
 pScrn-display-modes[1] = NULL;



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2015-07-06 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Tue Jul  7 00:55:52 UTC 2015

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
don't forget to NULL terminate the mode list when adding a single mode from
EDID. Now this works again on my Pismo.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.9 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.10
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.9	Wed Mar 19 23:56:47 2014
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Tue Jul  7 00:55:52 2015
@@ -1625,6 +1625,8 @@ static int R128ValidateFPModes(ScrnInfoP
 pScrn-display-modes[0] = xnfalloc(16);
 sprintf(pScrn-display-modes[0], %dx%d,
info-PanelXRes, info-PanelYRes);
+/* don't forget to NULL terminate */
+pScrn-display-modes[1] = NULL;
 }
 
 for(i=0; pScrn-display-modes[i] != NULL; i++)



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2011-07-13 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jul 13 22:43:04 UTC 2011

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
Rage 128 M3 can have DFP output


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.6 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.7
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.6	Wed Jun 29 04:11:31 2011
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jul 13 22:43:04 2011
@@ -1059,7 +1059,8 @@
 	case PCI_CHIP_RAGE128LF:
 	case PCI_CHIP_RAGE128MF:
 	case PCI_CHIP_RAGE128ML: 
-			info-HasPanelRegs = TRUE;  
+			info-HasPanelRegs = TRUE; 
+			info-isDFP = TRUE; 
 			/* which chips support dualhead? */
 			info-HasCRTC2 = TRUE;  
 			break;
@@ -1421,7 +1422,7 @@
 
 MonInfo = xf86DoEDID_DDC2(pScrn-scrnIndex, info-pI2CBus);
 #ifdef __NetBSD__
-{
+if (MonInfo == NULL) {
 	struct wsdisplayio_edid_info ei;
 	char buffer[1024];
 	int i, j;



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2011-06-28 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jun 29 04:11:31 UTC 2011

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
use ioctl(WSDISPLAYIO_GET_EDID)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.5 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.6
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.5	Sun May 15 23:44:47 2011
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Jun 29 04:11:31 2011
@@ -1395,6 +1395,10 @@
 return TRUE;
 }
 
+/* XXX
+ * the following comment is bogus - the code scans the main monitor port,
+ * not R128_GPIO_MONIDB
+ */
 /* return TRUE is a DFP is indeed connected to a DVI port */
 static Bool R128GetDFPInfo(ScrnInfoPtr pScrn)
 {
@@ -1416,6 +1420,22 @@
 ~(CARD32)(R128_GPIO_MONID_A_0 | R128_GPIO_MONID_A_3));
 
 MonInfo = xf86DoEDID_DDC2(pScrn-scrnIndex, info-pI2CBus);
+#ifdef __NetBSD__
+{
+	struct wsdisplayio_edid_info ei;
+	char buffer[1024];
+	int i, j;
+
+	ei.edid_data = buffer;
+	ei.buffer_size = 1024;
+	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_EDID, ei) != -1) {
+	xf86Msg(X_INFO, got %d bytes worth of EDID from wsdisplay\n, ei.data_size);
+	MonInfo = xf86InterpretEDID(pScrn-scrnIndex, buffer);
+	} else
+	xf86Msg(X_INFO, ioctl failed %d\n, errno);
+}
+#endif
+		
 if(!MonInfo) {
 xf86DrvMsg(pScrn-scrnIndex, X_ERROR,
No DFP detected\n);



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2011-01-05 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Jan  6 00:40:50 UTC 2011

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_driver.c

Log Message:
if we can't read panel resolution from BIOS - for example if there is none -
get the display resolution from wsdisplay instead
With this we no longer need to specify PanelWidth and PanelHeight in xorg.conf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.4
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.3	Thu Dec 23 04:32:50 2010
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Thu Jan  6 00:40:50 2011
@@ -94,6 +94,7 @@
 #include xf86cmap.h
 #include xf86xv.h
 #include vbe.h
+#include xf86Priv.h
 
 /* fbdevhw  vgahw */
 #ifdef WITH_VGAHW
@@ -114,6 +115,10 @@
 #include X11/extensions/dpms.h
 #endif
 
+#ifdef __NetBSD__
+#include sys/time.h
+#include dev/wscons/wsconsio.h
+#endif
 
 #ifndef MAX
 #define MAX(a,b) ((a)(b)?(a):(b))
@@ -667,8 +672,6 @@
 	info-PanelXRes = R128_BIOS16(info-FPBIOSstart+25);
 	if (!info-PanelYRes)
 	info-PanelYRes = R128_BIOS16(info-FPBIOSstart+27);
-	xf86DrvMsg(pScrn-scrnIndex, X_INFO, Panel size: %dx%d\n,
-		   info-PanelXRes, info-PanelYRes);
 
 	info-PanelPwrDly = R128_BIOS8(info-FPBIOSstart+56);
 
@@ -702,11 +705,33 @@
 	}
 }
 
+#ifdef __NetBSD__
+if (!info-PanelXRes || !info-PanelYRes) {
+	/*
+	 * we may not be on x86 so check wsdisplay for panel dimensions
+	 * XXX this assumes that the r128 is the console, although that should
+	 * be the case in the vast majority of cases where an LCD is hooked up
+	 * directly
+	 * We should probably just check the relevant registers but I'm not
+	 * sure they're available at this point.
+	 */
+	struct wsdisplay_fbinfo fbinfo;
+	
+	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GINFO, fbinfo) == 0) {
+	info-PanelXRes = fbinfo.width;
+	info-PanelYRes = fbinfo.height;
+	}
+}
+#endif
+
 if (!info-PanelXRes || !info-PanelYRes) {
 info-HasPanelRegs = FALSE;
 xf86DrvMsg(pScrn-scrnIndex, X_WARNING,
 		   Can't determine panel dimensions, and none specified.\n
 		   \tDisabling programming of FP registers.\n);
+} else {
+	xf86DrvMsg(pScrn-scrnIndex, X_INFO, Panel size: %dx%d\n,
+		   info-PanelXRes, info-PanelYRes);
 }
 
 return TRUE;



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2010-12-22 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec 23 04:32:51 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128.h r128_driver.c
r128_reg.h

Log Message:
Make saving/restoring video modes work on my PowerBook.
The problem was, that the driver blindly assumed that everyone uses PLL3 for
everything which isn't true at least on my PowerBook, which uses PLL0. So now
we actually restore which PLL to use and save PLL0 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xf86-video-r128/dist/src/r128.h \
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h

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-r128/dist/src/r128.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.2 xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.3
--- xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.2	Wed Nov 10 04:06:20 2010
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128.h	Thu Dec 23 04:32:50 2010
@@ -71,6 +71,7 @@
 #define R128_MMIOSIZE  0x4000
 
 #define R128_VBIOS_SIZE 0x0001
+#define R128_NAME R128
 
 #if R128_DEBUG
 #define R128TRACE(x)  \
@@ -169,6 +170,7 @@
 /* PLL registers */
 CARD32 ppll_ref_div;
 CARD32 ppll_div_3;
+CARD32 ppll_div_0;
 CARD32 htotal_cntl;
 
 /* Computed values for PLL2 */
Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.2 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.3
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.2	Wed Nov 10 04:06:20 2010
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Thu Dec 23 04:32:50 2010
@@ -2871,6 +2871,15 @@
 R128PLLWriteUpdate(pScrn);
 R128PLLWaitForReadUpdateComplete(pScrn);
 
+OUTPLLP(pScrn, R128_PPLL_DIV_0,
+	restore-ppll_div_0, ~R128_PPLL_FB0_DIV_MASK);
+/*R128PLLWriteUpdate(pScrn);*/
+OUTPLLP(pScrn, R128_PPLL_DIV_0,
+	restore-ppll_div_0, ~R128_PPLL_POST0_DIV_MASK);
+
+R128PLLWriteUpdate(pScrn);
+R128PLLWaitForReadUpdateComplete(pScrn);
+
 OUTPLL(R128_HTOTAL_CNTL, restore-htotal_cntl);
 /*R128PLLWriteUpdate(pScrn);*/
 
@@ -2952,11 +2961,7 @@
 	   restore-p2pll_ref_div,
 	   restore-p2pll_div_0,
 	   restore-htotal_cntl2,
-	   INPLL(pScrn, RADEON_P2PLL_CNTL)));
-R128TRACE((Wrote: rd=%d, fd=%d, pd=%d\n,
-	   restore-p2pll_ref_div  RADEON_P2PLL_REF_DIV_MASK,
-	   restore-p2pll_div_0  RADEON_P2PLL_FB3_DIV_MASK,
-	   (restore-p2pll_div_0  RADEON_P2PLL_POST3_DIV_MASK) 16));
+	   INPLL(pScrn, R128_P2PLL_CNTL)));
 
 usleep(5000); /* Let the clock to lock */
 
@@ -3188,6 +3193,7 @@
 {
 save-ppll_ref_div = INPLL(pScrn, R128_PPLL_REF_DIV);
 save-ppll_div_3   = INPLL(pScrn, R128_PPLL_DIV_3);
+save-ppll_div_0   = INPLL(pScrn, R128_PPLL_DIV_0);
 save-htotal_cntl  = INPLL(pScrn, R128_HTOTAL_CNTL);
 
 R128TRACE((Read: 0x%08x 0x%08x 0x%08x\n,
@@ -3318,7 +3324,6 @@
 vgaHWLock(hwp);
 }
 #endif
-
 save-dp_datatype  = INREG(R128_DP_DATATYPE);
 save-gen_reset_cntl   = INREG(R128_GEN_RESET_CNTL);
 save-clock_cntl_index = INREG(R128_CLOCK_CNTL_INDEX);
@@ -3355,6 +3360,15 @@
 }
 
 R128RestoreMode(pScrn, restore);
+
+if (!info-IsSecondary) {
+OUTREG(R128_AMCGPIO_MASK, restore-amcgpio_mask);
+OUTREG(R128_AMCGPIO_EN_REG,   restore-amcgpio_en_reg);
+OUTREG(R128_CLOCK_CNTL_INDEX, restore-clock_cntl_index);
+OUTREG(R128_GEN_RESET_CNTL,   restore-gen_reset_cntl);
+OUTREG(R128_DP_DATATYPE,  restore-dp_datatype);
+}
+
 #ifdef WITH_VGAHW
 if (info-VGAAccess) {
 vgaHWPtr hwp = VGAHWPTR(pScrn);

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.1.1.1 xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h:1.1.1.1	Sun Oct 12 23:10:25 2008
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_reg.h	Thu Dec 23 04:32:50 2010
@@ -905,6 +905,8 @@
 #   define R128_PPLL_ATOMIC_UPDATE_EN (1  16)
 #   define R128_PPLL_VGA_ATOMIC_UPDATE_EN (1  17)
 #define R128_PPLL_DIV_0   0x0004 /* PLL */
+#   define R128_PPLL_FB0_DIV_MASK 0x07ff
+#   define R128_PPLL_POST0_DIV_MASK   0x0007
 #define R128_PPLL_DIV_1   0x0005 /* PLL */
 #define R128_PPLL_DIV_2   0x0006 /* PLL */
 #define R128_PPLL_DIV_3   0x0007 /* PLL */



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2010-11-09 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Nov 10 04:06:20 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128.h r128_driver.c

Log Message:
sprinkle #if(n)def to allow building the driver without any fbdev support
whatsoever
while there do what the comment suggests and fall through to turning off
the backlight in all DPMS modes except on - leaving the backlight on while
turning the DAC off is kind of useless, isn't it?


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128.h
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_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-r128/dist/src/r128.h
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.1.1.1 xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128.h:1.1.1.1	Sun Oct 12 23:10:25 2008
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128.h	Wed Nov 10 04:06:20 2010
@@ -230,7 +230,9 @@
 int   Chipset;
 Bool  Primary;
 
+#ifndef AVOID_FBDEV
 Bool  FBDev;
+#endif
 
 unsigned long LinearAddr;   /* Frame buffer physical address */
 unsigned long MMIOAddr; /* MMIO region physical address  */

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.1.1.2 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.1.1.2	Sat Aug 22 00:01:00 2009
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c	Wed Nov 10 04:06:20 2010
@@ -99,7 +99,11 @@
 #ifdef WITH_VGAHW
 #include vgaHW.h
 #endif
+
+#ifndef AVOID_FBDEV
 #include fbdevhw.h
+#endif
+
 #include dixstruct.h
 
 /* DPMS support. */
@@ -153,7 +157,9 @@
   OPTION_PANEL_WIDTH,
   OPTION_PANEL_HEIGHT,
   OPTION_PROG_FP_REGS,
+#ifndef AVOID_FBDEV
   OPTION_FBDEV,
+#endif
   OPTION_VIDEO_KEY,
   OPTION_SHOW_CACHE,
   OPTION_VGA_ACCESS
@@ -180,7 +186,9 @@
   { OPTION_PANEL_WIDTH,  PanelWidth,   OPTV_INTEGER, {0}, FALSE },
   { OPTION_PANEL_HEIGHT, PanelHeight,  OPTV_INTEGER, {0}, FALSE },
   { OPTION_PROG_FP_REGS, ProgramFPRegs,OPTV_BOOLEAN, {0}, FALSE },
+#ifndef AVOID_FBDEV
   { OPTION_FBDEV,UseFBDev, OPTV_BOOLEAN, {0}, FALSE },
+#endif
   { OPTION_VIDEO_KEY,VideoKey, OPTV_INTEGER, {0}, FALSE },
   { OPTION_SHOW_CACHE,   ShowCache,OPTV_BOOLEAN, {0}, FALSE },
   { OPTION_VGA_ACCESS,   VGAAccess,OPTV_BOOLEAN, {0}, TRUE  },
@@ -238,9 +246,12 @@
 {
 R128InfoPtr info  = R128PTR(pScrn);
 
+#ifndef AVOID_FBDEV
 if (info-FBDev) {
 	info-MMIO = fbdevHWMapMMIO(pScrn);
-} else {
+} else
+#endif
+{
 /* If the primary screen has already mapped the MMIO region,
use its pointer instead of mapping it a second time. */
 if (info-IsSecondary) {
@@ -283,9 +294,12 @@
 {
 R128InfoPtr info  = R128PTR(pScrn);
 
+#ifndef AVOID_FBDEV
 if (info-FBDev)
 	fbdevHWUnmapMMIO(pScrn);
-else {
+else 
+#endif
+{
 #ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn-scrnIndex, info-MMIO, R128_MMIOSIZE);
 #else
@@ -301,9 +315,12 @@
 {
 R128InfoPtr info  = R128PTR(pScrn);
 
+#ifndef AVOID_FBDEV
 if (info-FBDev) {
 	info-FB = fbdevHWMapVidmem(pScrn);
-} else {
+} else 
+#endif
+{
 #ifndef XSERVER_LIBPCIACCESS
 	info-FB = xf86MapPciMem(pScrn-scrnIndex,
  VIDMEM_FRAMEBUFFER,
@@ -336,9 +353,11 @@
 {
 R128InfoPtr info  = R128PTR(pScrn);
 
+#ifndef AVOID_FBDEV
 if (info-FBDev)
 	fbdevHWUnmapVidmem(pScrn);
 else
+#endif
 #ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn-scrnIndex, info-FB, info-FbMapSize);
 #else
@@ -1045,9 +1064,11 @@
 R128MapMMIO(pScrn);
 R128MMIO  = info-MMIO;
 
+#ifndef AVOID_FBDEV
 if (info-FBDev)
 	pScrn-videoRam   = fbdevHWGetVidmem(pScrn) / 1024;
 else
+#endif
 	pScrn-videoRam   = INREG(R128_CONFIG_MEMSIZE) / 1024;
 
 info-MemCntl = INREG(R128_MEM_CNTL);
@@ -1061,11 +1082,14 @@
 if (info-HasPanelRegs) {
 char *Display = xf86GetOptValString(info-Options, OPTION_DISPLAY);
 
+#ifndef AVOID_FBDEV
 	if (info-FBDev)
 	xf86DrvMsg(pScrn-scrnIndex, X_INFO,
 		 Option \Display\ ignored 
 		 (framebuffer device determines display type)\n);
-	else if (info-IsPrimary || info-IsSecondary)
+	else
+#endif
+	 if (info-IsPrimary || info-IsSecondary)
 	info-BIOSDisplay = R128_DUALHEAD;
 	else if (!Display || !xf86NameCmp(Display, FP))
 	info-BIOSDisplay = R128_BIOS_DISPLAY_FP;
@@ -1720,12 +1744,14 @@
    pScrn-display-virtualY,
    info-FbMapSize,
    LOOKUP_BEST_REFRESH);
-
+#ifndef AVOID_FBDEV
 if