Module Name: src
Committed By: bouyer
Date: Sat Mar 17 19:11:19 UTC 2012
Modified Files:
src/external/mit/xorg/server/drivers/xf86-video-r128 [netbsd-5]:
Makefile
xsrc/external/mit/xf86-video-r128/dist/src [netbsd-5]: r128.h
r128_driver.c
Log Message:
Pull up following revision(s) (requested by phx in ticket #1740):
xsrc/external/mit/xf86-video-r128/dist/src/r128.h: revision 1.2
xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c: revision 1.2
external/mit/xorg/server/drivers/xf86-video-r128/Makefile: revision 1.4
don't build fbdev support on powerpc and sparc64
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.4.1 -r1.1.4.2 \
src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.2.1 \
xsrc/external/mit/xf86-video-r128/dist/src/r128.h
cvs rdiff -u -r1.1.1.1.2.1 -r1.1.1.1.2.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: src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.1.4.1 src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.1.4.2
--- src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile:1.1.4.1 Thu Apr 23 02:26:10 2009
+++ src/external/mit/xorg/server/drivers/xf86-video-r128/Makefile Sat Mar 17 19:11:19 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.4.1 2009/04/23 02:26:10 snj Exp $
+# $NetBSD: Makefile,v 1.1.4.2 2012/03/17 19:11:19 bouyer Exp $
DRIVER= xf86-video-r128
DRIVER_NAME= r128_drv
@@ -8,6 +8,10 @@ SRCS= r128_accel.c r128_cursor.c r128_dg
MAN= r128.4
+.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE} == "sparc64"
+CPPFLAGS+= -DAVOID_FBDEV
+.endif
+
# Enable VGA support (esp. hw state save/restore) on i386 / amd64 platforms
.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
CPPFLAGS+= -DWITH_VGAHW
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.1.1.1.2.1
--- 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 Sat Mar 17 19:11:19 2012
@@ -230,7 +230,9 @@ typedef struct {
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.1.2.1 xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.1.1.1.2.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c:1.1.1.1.2.1 Thu Sep 17 03:34:10 2009
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_driver.c Sat Mar 17 19:11:19 2012
@@ -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 @@ typedef enum {
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 @@ static const OptionInfoRec R128Options[]
{ 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 @@ static Bool R128MapMMIO(ScrnInfoPtr pScr
{
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 @@ static Bool R128UnmapMMIO(ScrnInfoPtr pS
{
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 @@ static Bool R128MapFB(ScrnInfoPtr pScrn)
{
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 @@ static Bool R128UnmapFB(ScrnInfoPtr pScr
{
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 @@ static Bool R128PreInitConfig(ScrnInfoPt
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 @@ static Bool R128PreInitConfig(ScrnInfoPt
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 @@ static Bool R128PreInitModes(ScrnInfoPtr
pScrn->display->virtualY,
info->FbMapSize,
LOOKUP_BEST_REFRESH);
-
+#ifndef AVOID_FBDEV
if (modesFound < 1 && info->FBDev) {
fbdevHWUseBuildinMode(pScrn);
- pScrn->displayWidth = fbdevHWGetLineLength(pScrn)/(pScrn->bitsPerPixel/8);
+ pScrn->displayWidth = fbdevHWGetLineLength(pScrn) /
+ (pScrn->bitsPerPixel / 8);
modesFound = 1;
}
+#endif
if (modesFound == -1) return FALSE;
xf86PruneDriverModes(pScrn);
@@ -2044,6 +2070,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n");
}
+#ifndef AVOID_FBDEV
#ifdef __powerpc__
if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, TRUE))
#else
@@ -2065,6 +2092,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int
}
if (!info->FBDev)
+#endif /* !AVOID_FBDEV */
if (!R128PreInitInt10(pScrn, &pInt10)) goto fail;
if (!R128PreInitConfig(pScrn)) goto fail;
@@ -2234,11 +2262,12 @@ Bool R128ScreenInit(int scrnIndex, Scree
info->PaletteSavedOnVT = FALSE;
R128Save(pScrn);
+#ifndef AVOID_FBDEV
if (info->FBDev) {
if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE;
- } else {
+ } else
+#endif
if (!R128ModeInit(pScrn, pScrn->currentMode)) return FALSE;
- }
R128SaveScreen(pScreen, SCREEN_SAVER_ON);
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
@@ -2604,7 +2633,10 @@ Bool R128ScreenInit(int scrnIndex, Scree
/* Colormap setup */
if (!miCreateDefColormap(pScreen)) return FALSE;
if (!xf86HandleColormaps(pScreen, 256, info->dac6bits ? 6 : 8,
- (info->FBDev ? fbdevHWLoadPaletteWeak() :
+ (
+#ifndef AVOID_FBDEV
+ info->FBDev ? fbdevHWLoadPaletteWeak() :
+#endif
R128LoadPalette), NULL,
CMAP_PALETTED_TRUECOLOR
| CMAP_RELOAD_ON_MODE_SWITCH
@@ -2614,10 +2646,13 @@ Bool R128ScreenInit(int scrnIndex, Scree
)) return FALSE;
/* DPMS setup - FIXME: also for mirror mode in non-fbdev case? - Michel */
+#ifndef AVOID_FBDEV
if (info->FBDev)
xf86DPMSInit(pScreen, fbdevHWDPMSSetWeak(), 0);
- else {
+ else
+#endif
+ {
if (info->DisplayType == MT_LCD)
xf86DPMSInit(pScreen, R128DisplayPowerManagementSetLCD, 0);
else
@@ -3256,10 +3291,12 @@ static void R128Save(ScrnInfoPtr pScrn)
R128SavePtr save = &info->SavedReg;
R128TRACE(("R128Save\n"));
+#ifndef AVOID_FBDEV
if (info->FBDev) {
fbdevHWSave(pScrn);
return;
}
+#endif
if (!info->IsSecondary) {
#ifdef WITH_VGAHW
@@ -3301,11 +3338,12 @@ static void R128Restore(ScrnInfoPtr pScr
R128SavePtr restore = &info->SavedReg;
R128TRACE(("R128Restore\n"));
+#ifndef AVOID_FBDEV
if (info->FBDev) {
fbdevHWRestore(pScrn);
return;
}
-
+#endif
R128Blank(pScrn);
if (!info->IsSecondary) {
@@ -4243,9 +4281,11 @@ Bool R128EnterVT(int scrnIndex, int flag
R128InfoPtr info = R128PTR(pScrn);
R128TRACE(("R128EnterVT\n"));
+#ifndef AVOID_FBDEV
if (info->FBDev) {
if (!fbdevHWEnterVT(scrnIndex,flags)) return FALSE;
} else
+#endif
if (!R128ModeInit(pScrn, pScrn->currentMode)) return FALSE;
if (info->accelOn)
R128EngineInit(pScrn);
@@ -4285,9 +4325,11 @@ void R128LeaveVT(int scrnIndex, int flag
#endif
R128SavePalette(pScrn, save);
info->PaletteSavedOnVT = TRUE;
+#ifndef AVOID_FBDEV
if (info->FBDev)
fbdevHWLeaveVT(scrnIndex,flags);
else
+#endif
R128Restore(pScrn);
}
@@ -4431,7 +4473,6 @@ static void R128DisplayPowerManagementSe
/* Fall through */
case DPMSModeSuspend:
/* Fall through */
- break;
case DPMSModeOff:
/* Screen: Off; HSync: Off, VSync: Off */
OUTREGP(R128_LVDS_GEN_CNTL, mask, ~mask);