aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-16 13:46:01 +0000
committermarha <marha@users.sourceforge.net>2009-11-16 13:46:01 +0000
commit578938f1cdd5a06dd6fa28167d575ec980322a5d (patch)
treee31cf77fab7cc6e005b0e726e7951d7eef79550f /xorg-server/hw/xfree86/common
parent0032f9b66d63a4b1c5222edb8603fb60da379fb0 (diff)
downloadvcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.tar.gz
vcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.tar.bz2
vcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.zip
Update to git master branch of xserver.
Diffstat (limited to 'xorg-server/hw/xfree86/common')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Configure.c56
-rw-r--r--xorg-server/hw/xfree86/common/xf86Events.c5
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c32
-rw-r--r--xorg-server/hw/xfree86/common/xf86Mode.c29
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c16
-rw-r--r--xorg-server/hw/xfree86/common/xf86cmap.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86str.h1
7 files changed, 82 insertions, 59 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Configure.c b/xorg-server/hw/xfree86/common/xf86Configure.c
index 3b7828a3f..2df6b4ec3 100644
--- a/xorg-server/hw/xfree86/common/xf86Configure.c
+++ b/xorg-server/hw/xfree86/common/xf86Configure.c
@@ -544,6 +544,36 @@ configureMonitorSection (int screennum)
return ptr;
}
+/* Initialize Configure Monitor from Detailed Timing Block */
+static void handle_detailed_input(struct detailed_monitor_section *det_mon,
+ void *data)
+{
+ XF86ConfMonitorPtr ptr = (XF86ConfMonitorPtr) data;
+
+ switch (det_mon->type) {
+ case DS_NAME:
+ ptr->mon_modelname = realloc(ptr->mon_modelname,
+ strlen((char*)(det_mon->section.name)) +
+ 1);
+ strcpy(ptr->mon_modelname,
+ (char*)(det_mon->section.name));
+ break;
+ case DS_RANGES:
+ ptr->mon_hsync[ptr->mon_n_hsync].lo =
+ det_mon->section.ranges.min_h;
+ ptr->mon_hsync[ptr->mon_n_hsync].hi =
+ det_mon->section.ranges.max_h;
+ ptr->mon_n_vrefresh = 1;
+ ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
+ det_mon->section.ranges.min_v;
+ ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
+ det_mon->section.ranges.max_v;
+ ptr->mon_n_hsync++;
+ default:
+ break;
+ }
+}
+
static XF86ConfMonitorPtr
configureDDCMonitorSection (int screennum)
{
@@ -590,30 +620,8 @@ configureDDCMonitorSection (int screennum)
}
#endif /* def CONFIGURE_DISPLAYSIZE */
- for (i=0;i<4;i++) {
- switch (ConfiguredMonitor->det_mon[i].type) {
- case DS_NAME:
- ptr->mon_modelname = realloc(ptr->mon_modelname,
- strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
- + 1);
- strcpy(ptr->mon_modelname,
- (char*)(ConfiguredMonitor->det_mon[i].section.name));
- break;
- case DS_RANGES:
- ptr->mon_hsync[ptr->mon_n_hsync].lo =
- ConfiguredMonitor->det_mon[i].section.ranges.min_h;
- ptr->mon_hsync[ptr->mon_n_hsync].hi =
- ConfiguredMonitor->det_mon[i].section.ranges.max_h;
- ptr->mon_n_vrefresh = 1;
- ptr->mon_vrefresh[ptr->mon_n_hsync].lo =
- ConfiguredMonitor->det_mon[i].section.ranges.min_v;
- ptr->mon_vrefresh[ptr->mon_n_hsync].hi =
- ConfiguredMonitor->det_mon[i].section.ranges.max_v;
- ptr->mon_n_hsync++;
- default:
- break;
- }
- }
+ xf86ForEachDetailedBlock(ConfiguredMonitor, handle_detailed_input,
+ ptr);
if (ConfiguredMonitor->features.dpms) {
ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c
index 9487fe7b2..8cd765a1c 100644
--- a/xorg-server/hw/xfree86/common/xf86Events.c
+++ b/xorg-server/hw/xfree86/common/xf86Events.c
@@ -263,13 +263,14 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
int sigstate = xf86BlockSIGIO();
- pInfo->read_input(pInfo);
- xf86UnblockSIGIO(sigstate);
/*
* Remove the descriptior from the set because more than one
* device may share the same file descriptor.
*/
FD_CLR(pInfo->fd, &devicesWithInput);
+
+ pInfo->read_input(pInfo);
+ xf86UnblockSIGIO(sigstate);
}
pInfo = pInfo->next;
}
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index c9baff3ef..2d682aaa9 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -97,6 +97,7 @@ static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
#ifdef XF86PM
void (*xf86OSPMClose)(void) = NULL;
#endif
+static Bool xorgHWOpenConsole = FALSE;
/* Common pixmap formats */
@@ -601,8 +602,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86DoShowOptions)
DoShowOptions();
- xf86OpenConsole();
-
/* Do a general bus probe. This will be a PCI probe for x86 platforms */
xf86BusProbe();
@@ -676,20 +675,29 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
*/
for (i = 0; i < xf86NumDrivers; i++) {
- xorgHWFlags flags;
-
if (xf86DriverList[i]->Identify != NULL)
xf86DriverList[i]->Identify(0);
- if (!xorgHWAccess
- && (!xf86DriverList[i]->driverFunc
+ if (!xorgHWAccess || !xorgHWOpenConsole) {
+ xorgHWFlags flags;
+ if(!xf86DriverList[i]->driverFunc
|| !xf86DriverList[i]->driverFunc(NULL,
GET_REQUIRED_HW_INTERFACES,
- &flags)
- || NEED_IO_ENABLED(flags)))
- xorgHWAccess = TRUE;
+ &flags))
+ flags = HW_IO;
+
+ if(NEED_IO_ENABLED(flags))
+ xorgHWAccess = TRUE;
+ if(!(flags & HW_SKIP_CONSOLE))
+ xorgHWOpenConsole = TRUE;
+ }
}
+ if (xorgHWOpenConsole)
+ xf86OpenConsole();
+ else
+ xf86Info.dontVTSwitch = TRUE;
+
/* Enable full I/O access */
if (xorgHWAccess)
xorgHWAccess = xf86EnableIO();
@@ -966,7 +974,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/*
* serverGeneration != 1; some OSs have to do things here, too.
*/
- xf86OpenConsole();
+ if (xorgHWOpenConsole)
+ xf86OpenConsole();
#ifdef XF86PM
/*
@@ -1203,7 +1212,8 @@ ddxGiveUp(void)
DGAShutdown();
#endif
- xf86CloseConsole();
+ if (xorgHWOpenConsole)
+ xf86CloseConsole();
xf86CloseLog();
diff --git a/xorg-server/hw/xfree86/common/xf86Mode.c b/xorg-server/hw/xfree86/common/xf86Mode.c
index 0e43946c5..4a948d752 100644
--- a/xorg-server/hw/xfree86/common/xf86Mode.c
+++ b/xorg-server/hw/xfree86/common/xf86Mode.c
@@ -249,6 +249,15 @@ xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges)
}
}
+static Bool
+modeInClockRange(ClockRangePtr cp, DisplayModePtr p)
+{
+ return ((p->Clock >= cp->minClock) &&
+ (p->Clock <= cp->maxClock) &&
+ (cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
+ (cp->doubleScanAllowed ||
+ ((p->VScan <= 1) && !(p->Flags & V_DBLSCAN))));
+}
/*
* xf86FindClockRangeForMode() [... like the name says ...]
@@ -259,12 +268,7 @@ xf86FindClockRangeForMode(ClockRangePtr clockRanges, DisplayModePtr p)
ClockRangePtr cp;
for (cp = clockRanges; ; cp = cp->next)
- if (!cp ||
- ((p->Clock >= cp->minClock) &&
- (p->Clock <= cp->maxClock) &&
- (cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((p->VScan <= 1) && !(p->Flags & V_DBLSCAN)))))
+ if (!cp || modeInClockRange(cp, p))
return cp;
}
@@ -979,11 +983,7 @@ xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
if (scrp->progClock) {
/* Check clock is in range */
for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
- if ((cp->minClock <= mode->Clock) &&
- (cp->maxClock >= mode->Clock) &&
- (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1))))
+ if (modeInClockRange(cp, mode))
break;
}
if (cp == NULL) {
@@ -999,12 +999,7 @@ xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
status = MODE_CLOCK_RANGE;
/* Check clock is in range */
for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
- if ((cp->minClock <= mode->Clock) &&
- (cp->maxClock >= mode->Clock) &&
- (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
- (cp->doubleScanAllowed ||
- ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1)))) {
-
+ if (modeInClockRange(cp, mode)) {
/*
* Clock is in range, so if it is not a programmable clock,
* find a matching clock.
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index fd07c2a06..f637cfe19 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -113,7 +113,7 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, char* devname, pointer list,
return;
/* common settings (available via device properties) */
- tempf = xf86SetIntOption(list, "ConstantDeceleration", 1);
+ tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0);
if(tempf > 1.0){
xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n",
devname, tempf);
@@ -122,7 +122,7 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, char* devname, pointer list,
PropModeReplace, 1, &tempf, FALSE);
}
- tempf = xf86SetIntOption(list, "AdaptiveDeceleration", 1);
+ tempf = xf86SetRealOption(list, "AdaptiveDeceleration", 1.0);
if(tempf > 1.0){
xf86Msg(X_CONFIG, "%s: (accel) adaptive deceleration by %.1f\n",
devname, tempf);
@@ -726,12 +726,15 @@ xf86PostMotionEventP(DeviceIntPtr device,
int *valuators)
{
int i = 0, nevents = 0;
- int dx = 0, dy = 0;
Bool drag = xf86SendDragEvents(device);
DeviceEvent *event;
- int index;
int flags = 0;
+#if XFreeXDGA
+ int index;
+ int dx = 0, dy = 0;
+#endif
+
XI_VERIFY_VALUATORS(num_valuators);
if (is_absolute)
@@ -856,9 +859,12 @@ xf86PostButtonEventP(DeviceIntPtr device,
int *valuators)
{
int i = 0, nevents = 0;
- int index;
int flags = 0;
+#if XFreeXDGA
+ int index;
+#endif
+
XI_VERIFY_VALUATORS(num_valuators);
if (is_absolute)
diff --git a/xorg-server/hw/xfree86/common/xf86cmap.c b/xorg-server/hw/xfree86/common/xf86cmap.c
index 36e6f96de..08f557ccd 100644
--- a/xorg-server/hw/xfree86/common/xf86cmap.c
+++ b/xorg-server/hw/xfree86/common/xf86cmap.c
@@ -115,7 +115,9 @@ static void CMapDestroyColormap (ColormapPtr);
static Bool CMapEnterVT(int, int);
static Bool CMapSwitchMode(int, DisplayModePtr, int);
+#ifdef XFreeXDGA
static int CMapSetDGAMode(int, int, DGADevicePtr);
+#endif
static int CMapChangeGamma(int, Gamma);
static void ComputeGamma(CMapScreenPtr);
diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h
index b9a2e06de..7b0b758d4 100644
--- a/xorg-server/hw/xfree86/common/xf86str.h
+++ b/xorg-server/hw/xfree86/common/xf86str.h
@@ -299,6 +299,7 @@ typedef struct {
/* GET_REQUIRED_HW_INTERFACES */
#define HW_IO 1
#define HW_MMIO 2
+#define HW_SKIP_CONSOLE 4
#define NEED_IO_ENABLED(x) (x & HW_IO)
typedef CARD32 xorgHWFlags;