From de68a3339b9f19630e29a17773cad060b1f65300 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 22 Sep 2004 17:20:56 +0000 Subject: [PATCH] Allow overriding DPMS defaults (timeouts & default for on/off) from #defines/-D options. programs/Xserver/hw/xfree86/common/xf86DPMS.c Use defaultDPMSEnabled global for the default state of DPMS if not set in any config files. programs/Xserver/hw/xfree86/os-support/sunos/solaris-sparcv8plus.S Add support for required assembly inline functions for Sun compilers on Solaris/sparc. Add support for Solaris/sparc libraries. --- dix/globals.c | 19 ++- hw/xfree86/common/xf86DPMS.c | 3 +- .../os-support/solaris/solaris-sparcv8plus.S | 144 ++++++++++++++++++ 3 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 hw/xfree86/os-support/solaris/solaris-sparcv8plus.S diff --git a/dix/globals.c b/dix/globals.c index 0682ed7c7..23fbd1039 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/dix/globals.c,v 1.13 2003/12/03 17:11:29 tsi Exp $ */ +/* $XdotOrg: xc/programs/Xserver/dix/globals.c,v 1.2 2004/04/23 19:04:44 eich Exp $ */ /* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.12tsi Exp $ */ /************************************************************ @@ -94,14 +94,23 @@ int ScreenSaverBlanking; int ScreenSaverAllowExposures; #ifdef DPMSExtension -#define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2 -#define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3 -#define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4 +# ifndef DEFAULT_STANDBY_TIME +# define DEFAULT_STANDBY_TIME DEFAULT_SCREEN_SAVER_TIME * 2 +# endif +# ifndef DEFAULT_SUSPEND_TIME +# define DEFAULT_SUSPEND_TIME DEFAULT_SCREEN_SAVER_TIME * 3 +# endif +# ifndef DEFAULT_OFF_TIME +# define DEFAULT_OFF_TIME DEFAULT_SCREEN_SAVER_TIME * 4 +# endif +# ifndef DEFAULT_DPMS_ENABLED +# define DEFAULT_DPMS_ENABLED FALSE +# endif CARD32 defaultDPMSStandbyTime = DEFAULT_STANDBY_TIME; CARD32 defaultDPMSSuspendTime = DEFAULT_SUSPEND_TIME; CARD32 defaultDPMSOffTime = DEFAULT_OFF_TIME; CARD16 DPMSPowerLevel = 0; -Bool defaultDPMSEnabled = FALSE; +Bool defaultDPMSEnabled = DEFAULT_DPMS_ENABLED; Bool DPMSEnabledSwitch = FALSE; /* these denote the DPMS command line */ Bool DPMSDisabledSwitch = FALSE; /* switch states */ Bool DPMSCapableFlag = FALSE; diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c index 82004b953..104e64cfc 100644 --- a/hw/xfree86/common/xf86DPMS.c +++ b/hw/xfree86/common/xf86DPMS.c @@ -1,4 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.11 2003/11/11 21:02:28 dawes Exp $ */ +/* $XdotOrg: $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -87,7 +88,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) pDPMS->Enabled = TRUE; } else { - pDPMS->Enabled = FALSE; + pDPMS->Enabled = defaultDPMSEnabled; } pDPMS->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = DPMSClose; diff --git a/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S new file mode 100644 index 000000000..fb23942ef --- /dev/null +++ b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S @@ -0,0 +1,144 @@ +/* Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons + * to whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, use + * or other dealings in this Software without prior written authorization + * of the copyright holder. + */ + +#ifdef INLINE_ASM +#define FUNCTION_START(f,n) .inline f,n +#define FUNCTION_END(f) .end +#else +#define _ASM +#include +#define FUNCTION_START(f,n) ENTRY(f) +#define FUNCTION_END(f) SET_SIZE(f) +#endif + +/* Converted from common/compiler.h gcc inline format to Sun cc inline + * format by Kenjiro Tsuji + * + * The value 0x88 means ASI_PRIMARY_LITTLE. + * The store or load to/from the address space will be done + * as little-endian. In the original xrog code, the value + * is defined as the macro ASI_PL. + * + * In the original xorg code, "membar #StoreStore|#StoreLoad" + * is directly implemented as an instruction "0x8143e00a". + * + */ + + FUNCTION_START(outb, 0) + stba %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outb) + + FUNCTION_START(outw, 0) + stha %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outw) + + FUNCTION_START(outl, 0) + sta %o1, [%o0] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(outl) + + FUNCTION_START(inb, 0) + lduba [%o0] 0x88, %o0 + FUNCTION_END(inb) + + FUNCTION_START(inw, 0) + lduha [%o0] 0x88, %o0 + FUNCTION_END(inw) + + FUNCTION_START(inl, 0) + lda [%o0] 0x88, %o0 + FUNCTION_END(inl) + + FUNCTION_START(xf86ReadMmio8, 0) + lduba [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio8) + + FUNCTION_START(xf86ReadMmio16Be, 0) + lduh [%o0 + %o1], %o0 + FUNCTION_END(xf86ReadMmio16Be) + + FUNCTION_START(xf86ReadMmio16Le, 0) + lduha [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio16Le) + + FUNCTION_START(xf86ReadMmio32Be, 0) + ld [%o0 + %o1], %o0 + FUNCTION_END(xf86ReadMmio32Be) + + FUNCTION_START(xf86ReadMmio32Le, 0) + lda [%o0 + %o1] 0x88, %o0 + FUNCTION_END(xf86ReadMmio32Le) + + FUNCTION_START(xf86WriteMmio8, 0) + stba %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio8) + + FUNCTION_START(xf86WriteMmio16Be, 0) + sth %o2, [%o0 + %o1] + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio16Be) + + FUNCTION_START(xf86WriteMmio16Le, 0) + stha %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio16Le) + + FUNCTION_START(xf86WriteMmio32Be, 0) + st %o2, [%o0 + %o1] + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio32Be) + + FUNCTION_START(xf86WriteMmio32Le, 0) + sta %o2, [%o0 + %o1] 0x88 + membar #StoreStore|#StoreLoad + FUNCTION_END(xf86WriteMmio32Le) + + FUNCTION_START(xf86WriteMmio8NB, 0) + add %o0, %o1, %o0 + stba %o2, [%o0] 0x88 + FUNCTION_END(xf86WriteMmio8NB) + + FUNCTION_START(xf86WriteMmio16BeNB, 0) + sth %o2, [%o0 + %o1] + FUNCTION_END(xf86WriteMmio16BeNB) + + FUNCTION_START(xf86WriteMmio16LeNB, 0) + stha %o2, [%o0 + %o1] 0x88 + FUNCTION_END(xf86WriteMmio16LeNB) + + FUNCTION_START(xf86WriteMmio32BeNB, 0) + st %o2, [%o0 + %o1] + FUNCTION_END(xf86WriteMmio32BeNB) + + FUNCTION_START(xf86WriteMmio32LeNB, 0) + sta %o2, [%o0 + %o1] 0x88 + FUNCTION_END(xf86WriteMmio32LeNB) +