aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/modes/xf86Modes.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
commit2553bdd7c359cd87525d367761c86932cec5adff (patch)
treeae71245933c98474a699d3e392de5820879b2018 /xorg-server/hw/xfree86/modes/xf86Modes.c
parente2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff)
parent4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff)
downloadvcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/modes/xf86Modes.c')
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Modes.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/xorg-server/hw/xfree86/modes/xf86Modes.c b/xorg-server/hw/xfree86/modes/xf86Modes.c
index ea398ad81..1522fa731 100644
--- a/xorg-server/hw/xfree86/modes/xf86Modes.c
+++ b/xorg-server/hw/xfree86/modes/xf86Modes.c
@@ -52,7 +52,7 @@ extern XF86ConfigPtr xf86configptr;
* Exact copy of xf86Mode.c's.
*/
_X_EXPORT double
-xf86ModeHSync(DisplayModePtr mode)
+xf86ModeHSync(const DisplayModeRec *mode)
{
double hsync = 0.0;
@@ -70,7 +70,7 @@ xf86ModeHSync(DisplayModePtr mode)
* Exact copy of xf86Mode.c's.
*/
_X_EXPORT double
-xf86ModeVRefresh(DisplayModePtr mode)
+xf86ModeVRefresh(const DisplayModeRec *mode)
{
double refresh = 0.0;
@@ -89,7 +89,7 @@ xf86ModeVRefresh(DisplayModePtr mode)
}
_X_EXPORT int
-xf86ModeWidth (DisplayModePtr mode, Rotation rotation)
+xf86ModeWidth (const DisplayModeRec *mode, Rotation rotation)
{
switch (rotation & 0xf) {
case RR_Rotate_0:
@@ -104,7 +104,7 @@ xf86ModeWidth (DisplayModePtr mode, Rotation rotation)
}
_X_EXPORT int
-xf86ModeHeight (DisplayModePtr mode, Rotation rotation)
+xf86ModeHeight (const DisplayModeRec *mode, Rotation rotation)
{
switch (rotation & 0xf) {
case RR_Rotate_0:
@@ -206,7 +206,7 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
* Allocates and returns a copy of pMode, including pointers within pMode.
*/
_X_EXPORT DisplayModePtr
-xf86DuplicateMode(DisplayModePtr pMode)
+xf86DuplicateMode(const DisplayModeRec *pMode)
{
DisplayModePtr pNew;
@@ -264,7 +264,7 @@ xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList)
* This isn't in xf86Modes.c, but it might deserve to be there.
*/
_X_EXPORT Bool
-xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2)
+xf86ModesEqual(const DisplayModeRec *pMode1, const DisplayModeRec *pMode2)
{
if (pMode1->Clock == pMode2->Clock &&
pMode1->HDisplay == pMode2->HDisplay &&
@@ -509,10 +509,27 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
for (mode = modeList; mode != NULL; mode = mode->next) {
if (xf86ModeBandwidth(mode, depth) > bandwidth)
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
mode->status = MODE_BANDWIDTH;
+#else
+ /* MODE_BANDWIDTH didn't exist in xserver 1.2 */
+ mode->status = MODE_BAD;
+#endif
}
}
+Bool
+xf86ModeIsReduced(const DisplayModeRec *mode)
+{
+ if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) &&
+ ((mode->HTotal - mode->HDisplay) == 160) &&
+ ((mode->HSyncEnd - mode->HDisplay) == 80) &&
+ ((mode->HSyncEnd - mode->HSyncStart) == 32) &&
+ ((mode->VSyncStart - mode->VDisplay) == 3))
+ return TRUE;
+ return FALSE;
+}
+
/**
* Marks as bad any reduced-blanking modes.
*
@@ -521,7 +538,6 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
_X_EXPORT void
xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList)
{
- Bool mode_is_reduced = FALSE;
DisplayModePtr mode;
for (mode = modeList; mode != NULL; mode = mode->next) {
@@ -677,12 +693,12 @@ xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor)
_X_EXPORT DisplayModePtr
xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed)
{
- DisplayModePtr head = NULL, prev = NULL, mode;
+ DisplayModePtr head = NULL, mode;
int i;
for (i = 0; i < xf86NumDefaultModes; i++)
{
- DisplayModePtr defMode = &xf86DefaultModes[i];
+ const DisplayModeRec *defMode = &xf86DefaultModes[i];
if (!interlaceAllowed && (defMode->Flags & V_INTERLACE))
continue;