Commit Graph

5748 Commits

Author SHA1 Message Date
Alan Coopersmith
feebf67463 Limit the number of screens Xvfb will attempt to allocate memory for
Commit f9e3a2955d removing the MAXSCREEN limit left the screen
number too unlimited, and allowed any positive int for a screen number:

Xvfb :1 -screen 2147483647 1024x1024x8

Fatal server error:
Not enough memory for screen 2147483647

Found by Parfait 0.3.7:
Error: Integer overflow (CWE 190)
   Integer parameter of memory allocation function realloc() may overflow due to multiplication with constant value 1112
        at line 293 of hw/vfb/InitOutput.c in function 'ddxProcessArgument'.

Since the X11 connection setup only has a CARD8 for number of SCREENS,
limit to 255 screens, which is also low enough to avoid overflow on the
sizeof(*vfbScreens) * (screenNum + 1) calculation for realloc.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-12-02 00:17:28 -08:00
Matt Turner
2dc5ba4a1b Remove another if (E != NULL) check around free(E)
I wonder if there are any other patterns we haven't seen yet?

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-12-01 14:24:54 +00:00
Jeremy Huddleston
b2015a2c01 dmx: Build fix for -Werror=implicit-function-declaration on linux
Fixes regression introduced by: 6e6d732bac
Found-by: Tinderbox

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
CC: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-24 21:15:32 -08:00
Paulo Zanoni
873a1ace36 parser: free val.str after xstrtokenize
After we tokenize val.str, we discard it.

This is just one example:
6 bytes in 1 blocks are definitely lost in loss record 24 of 652
   at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x4D744D: xf86getToken (scan.c:400)
   by 0x4D75F1: xf86getSubToken (scan.c:462)
   by 0x4DB060: xf86parseInputClassSection (InputClass.c:145)
   by 0x4D664C: xf86readConfigFile (read.c:184)
   by 0x490556: xf86HandleConfigFile (xf86Config.c:2360)
   by 0x49AA77: InitOutput (xf86Init.c:365)
   by 0x425A7A: main (main.c:204)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-24 17:47:37 -02:00
Paulo Zanoni
d41987d77c parser: free val.str after xf86getBoolValue
After we convert the value to a boolean, we discard the string.

This is just one example:

3 bytes in 1 blocks are definitely lost in loss record 5 of 657
   at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
   by 0x4D744D: xf86getToken (scan.c:400)
   by 0x4D75F1: xf86getSubToken (scan.c:462)
   by 0x4DB3E0: xf86parseInputClassSection (InputClass.c:189)
   by 0x4D664C: xf86readConfigFile (read.c:184)
   by 0x490556: xf86HandleConfigFile (xf86Config.c:2360)
   by 0x49AA77: InitOutput (xf86Init.c:365)
   by 0x425A7A: main (main.c:204)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-24 17:47:37 -02:00
Paulo Zanoni
d5c7338b3e parser: free scandir's list
v2: move the free()s to the function that calls scandir

80 bytes in 1 blocks are definitely lost in loss record 411 of 631
   at 0x4C2779D: malloc (vgpreload_memcheck-amd64-linux.so)
   by 0x4C27927: realloc (vgpreload_memcheck-amd64-linux.so)
   by 0x696A80D: scandir (scandir.c:108)
   by 0x4D8828: OpenConfigDir (scan.c:854)
   by 0x4D8A43: xf86openConfigDirFiles (scan.c:952)
   by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
   by 0x49A9E3: InitOutput (xf86Init.c:365)
   by 0x425A7A: main (main.c:204)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-24 17:47:37 -02:00
Paulo Zanoni
3d635fe84d Correctly free config file names
We call xf86penConfigDirFiles twice, so we overwrite the configDirPath
variable, losing the pointer. If we move the pointer management to the
upper layer (the function callers), they will be able to call these
functions as many times as they want, but they'll have to free those
returned values.

v2: don't leak inside XWin

4,097 bytes in 1 blocks are definitely lost in loss record 625 of 632
   at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so)
   by 0x4D7899: DoSubstitution (scan.c:615)
   by 0x4D87B0: OpenConfigDir (scan.c:845)
   by 0x4D8A2D: xf86openConfigDirFiles (scan.c:955)
   by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327)
   by 0x49A9BF: InitOutput (xf86Init.c:365)
   by 0x425A7A: main (main.c:204)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-24 17:47:37 -02:00
Jeremy Huddleston
f405dfffe7 dmx: Build fix for -Werror=implicit-function-declaration
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
632d205b30 Fix gcc -Wwrite-strings warnings in xf86Modes code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
09e4b78f79 Fix gcc -Wwrite-strings warnings in xf86 ddx
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
8e4556f560 FindModule: stop copying const char *dirname to char *dirpath
Not needed since 6cf844ab69 split out the allocation/manipulation
into the helper function, leaving FindModule just copying the pointer
around, and causing gcc warnings and an unreachable call to free.

Also no longer need to store the combined strlen results in dirlen.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
0bc41d5f8d Remove redundant redeclarations of functions in the same header file
Exposed by recent addition of -Wredundant-decls to default CWARNFLAGS

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:07 -08:00
Alan Coopersmith
285133a35e sun_agp: cast key to uintptr_t before casting to (int *)
Matches what linux_agp already does and prevents gcc from throwing up:

sun_agp.c: In function 'xf86DeallocateGARTMemory':
sun_agp.c:236:40: error: cast to pointer from integer of different size

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
05d8a7f7a7 Convert a bunch of sprintf to snprintf calls
This batch is the straightforward set - others are more complex and
need more analysis to determine right size to pass.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
b967bf2af2 Remove xf86FormatPciBusNumber from API, inline the one place its used
Found no calls from current driver modules

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
6450f6ca7e Move DoShowOptions to xf86Configure.c, delete xf86ShowOpts.c
Gets rid of duplicate static copy of optionTypeToString by putting
both callers of that helper function in the same source file.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
43fa127426 Remove bad code from DoShowOptions (Xorg -showopts handler)
When we want to print a string, it's okay to just print it.
We don't need to first allocate a buffer 2 bytes bigger than the
string, copy the entire string unmodified to the buffer, print the
buffer, and then leak the buffer (though we AbortDDX 8 lines later,
and then just in case we survived that, call exit as well, so the
leak is short lived, just oh so pointless).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:06 -08:00
Alan Coopersmith
03ddca6f71 Convert dmxSetDefaultFontPath to use strdup instead of malloc+strncpy
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
d9243777c7 matchDriverFromFiles: use one snprintf instead of strncpy/cat series
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
6e6d732bac Convert strncpy/strncat to strlcpy/strlcat
As long as we're carrying around a compatibility copy in os/strl*.c,
might as well use them.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
08093c25a9 Convert some malloc + strncpy pairs into strndup calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23 12:15:05 -08:00
Alan Coopersmith
0e6b88db7f Don't fallback to wsfb or fbdev on Solaris
We don't ship either one, so don't waste time and make confusing log
entries trying to load them.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-23 12:15:04 -08:00
Alan Coopersmith
7b0f53f0a5 Fix Xdmx build on Linux to work with strlcpy changes
Include strlcpy.c in the  libdmxconfig.a library with the other functions
shared among the xdmx configuration programs.

Also add a #include "os.h" to the scanner.l file that now calls strlcpy
to include the prototype from $(top_srcdir)/include/os.h.

(To be squashed into
http://cgit.freedesktop.org/~alanc/xserver/commit/?id=c19f0ff5223d428f8ad2ab3c563c974c96a521ba
before next PULL request to avoid breaking bisection.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-23 11:06:34 -08:00
Gaetan Nadon
922c1d8170 docs: spell "X Server Version" consistently in titles. Add where missing.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-21 10:34:23 -08:00
Ross Burton
58864146fb edid: Add quirk for Acer Aspire One 110
At least one revision of the AAO reports a 190x110mm maximum size but a
451x113mm mode.

X.Org Bug 41141 <https://bugs.freedesktop.org/show_bug.cgi?id=41141>

Signed-off-by: Ross Burton <ross@linux.intel.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:03 -08:00
Chris Wilson
34b0e4eee9 dri2: Register the DRI2DrawableType after server regeneration
The Resource database is reset upon regeneration and so the dri2 module
needs to re-register its RESTYPE for the drawable or else it will
clobber the next unsuspecting user of the database. Fortunately, DRI2 is
loaded late in the initialisation sequence and was last up until
xf86-video-intel started using the Resource database to track
outstanding swaps...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2011-11-18 11:26:03 -08:00
Chris Wilson
bfa1a0dd19 DRI2: Avoid a NULL pointer dereference
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=41211

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:02 -08:00
Chris Wilson
eeb21a133b VidMode: prevent crash with no modes
Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=17431

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-18 11:26:02 -08:00
Jeremy Huddleston
1f5baa924a xfree86: Deprecate the use of xf86PciInfo.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Tormod Volden <debian.tormod@gmail.com>
2011-11-18 11:26:02 -08:00
Jeremy Huddleston
eb3377ffb8 xfree86: Fix powerpc build with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
memType is a uint64_t on powerpc. Using memType only really makes
sense for *physical* addresses, which can be 64-bit for 32-bit
systems running on 64-bit hardware.

However, unmapVidMem() only deals with *virtual* addresses, which
are guaranteed to fit into an uintptr_t.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-11-18 11:26:02 -08:00
Pierre-Loup A. Griffais
a551f126cc xfree86: Fix RandR rotation across server generations
245cb8e94f fixed xf86RotateDestroy() to actually run its teardown
code, causing the Damage object to properly be re-allocated after a
server regeneration. However the block that does that still thinks the
Rotate layer BlockHandler is wrapped from the last generation, meaning
the shadow pixmap is never re-allocated and the Damage object is never
re-registered, causing a blank screen, and potentially a driver crash
on the next teardown after the server asks it to free a 0x0 Pixmap.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-14 09:14:20 -08:00
Keith Packard
bfa2a1857a Merge remote-tracking branch 'whot/for-keith' 2011-11-14 09:07:06 -08:00
Peter Hutterer
35ec24cf24 input: replace remaining GetPairedDevice() with GetMaster()
Wherever it's obvious which device we need (keyboard or pointer), use
GetMaster() instead of GetPairedDevice(). It is more reliable in actually
getting the device type we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-11-09 13:26:47 +10:00
Derek Buitenhuis
f0d50cc665 Fix vesa's VBE PanelID interpretation
xserver's VESA driver's VBE (Vesa BIOS Extensions) code
includes a PanelID probe, which can get a monitor's native
resolution. From this, using CVT formulas, it derives
horizontal sync rate and a vertical refresh rate ranges.

It however, only derives the upper bounds of the ranges, and
the lower bounds cannot de derived. By default, they are set
to hardcoded constants which represent the lowest supported
resolution: 640x480. The constants in vbe.c however, were
not actually derived from forulas, but carried over from
other code from the bad old days, and are not relevant
to flat panel displays. This caused, for example, EEEPC701's
panel, with a native resolution of 800x480, to end up with
a upper bound of the horizontal sync rate that was lower
than the hardcoded lower bound, which of course broke things.

These numbers have been rederived using both my own CVT tool
based on xf86CVTMode(), and using the provided 'cvt' tool
that comes with xserver.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-06 16:41:44 -08:00
Peter Hutterer
c643c2b7bf xfree86: duplicate name and driver from pInfo for NewInputDeviceRequest
xorg.conf devices had the name and driver set in the DDX's InputInfoPtr list
but not in the option list for those devices. That information was lost when
passing the options into NewInputDeviceRequest. NIDR then refused to start
the devices.

Introduced in xorg-server-1.11.0-250-ge4cd24e

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: James Cloos <cloos@jhcloos.com>
2011-11-04 07:46:58 +10:00
Keith Packard
548c6fe044 Merge remote-tracking branch 'jturney/master' 2011-11-02 21:35:31 -07:00
Gaetan Nadon
3881b0bf1c mi: remove deprecated miPointerAbsoluteCursor from design doc
Function was removed from the code by commit f5409aa026

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-02 21:23:14 -07:00
Keith Packard
d91aa0e660 Merge remote-tracking branch 'whot/two-screen-coordinates' 2011-11-02 21:20:07 -07:00
Keith Packard
8df3a9ca5a Merge remote-tracking branch 'koba/reviewed' 2011-11-02 21:18:16 -07:00
Colin Harrison
ffe8ec86db hw/xwin: Fix a typo in ddraw.h
Fix a (fortunately benign) typo in ddraw.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02 14:10:41 +00:00
Yaakov Selkowitz
48fda3c52b hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"
This commit wreaks havoc with other programs which manage the clipboard,
such as MS Office Clipboard or Win32 VNC viewers:

http://sourceware.org/bugzilla/show_bug.cgi?id=9910

This reverts commit 70ddd0f39d.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:08:34 +00:00
Jon TURNEY
3ead1d810b hw/xwin: Stop pretending we work on NT4
We already link directly to some functions not available in NT4, so stop
pretending we will work on NT4 and link directly to EnumDisplayMonitors()
and SHGetFolderPath()

Also remove mentions of NT4 & Win95 from error messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:08:06 +00:00
Jon TURNEY
ee19853867 hw/xwin: Link directly to TrackMouseEvent()
TrackMouseEvent has existed in user32 since at least NT4, so
don't bother with jumping through all the ancient compatibility hoops
of finding if _TrackMouseEvent() exists in comctl32 so it can check
if TrackMouseEvent() exists in user32 to see if it needs to emulate
it...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:05:34 +00:00
Jon TURNEY
e2e6fab1ef Cygwin/X: Make default DPI match native DPI
Make the default DPI match the current Windows DPI setting. If that
setting can't be retrieved, change the fallback DPI value from 75 dpi
to 96 dpi.

Mark the application as dpiAware in the manifest, which prevents
dpi virtualization for high (>96) dpi values on Vista and later.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 13:56:22 +00:00
Keith Packard
132545ff57 Merge remote-tracking branch 'whot/for-keith' 2011-10-30 16:57:58 -07:00
Servaas Vandenberghe
820d9040f5 xfree86: fix potential buffer overflow
The patch below fixes a potential buffer overflow in xf86addComment().
This occurs if  curlen > 0 && eol_seen == 0 && iscomment == 0 , as
follows from the code:

char *xf86addComment(char *cur, char *add)

<...>

        len = strlen(add);
        endnewline = add[len - 1] == '\n';
        len +=  1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;

        if ((str = realloc(cur, len + curlen)) == NULL)
                return cur;

        cur = str;

        if (eol_seen || (curlen && !hasnewline))
                cur[curlen++] = '\n';
        if (!iscomment)
                cur[curlen++] = '#';
        strcpy(cur + curlen, add);
        if (!endnewline)
                strcat(cur, "\n");

Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

[whot: added buffer overflow test case]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-31 09:39:04 +10:00
Peter Hutterer
63e87b8639 xfree86: reduce calls to input_option_get_key/value
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-31 09:39:04 +10:00
Anssi Hannula
d0c6732a99 xfree86: add nouveau as the first automatic driver for NVIDIA hardware
Add nouveau as the first driver on linux for NVIDIA hardware when
driver autoconfiguration is done, as it is more capable than nv.

nv is also kept in the list as it is more widely supported and because
some old cards are not supported by nouveau.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-29 17:19:46 -07:00
Alexandr Shadchin
ef895484c8 bsd: alpha_video: Remove unused variables
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
fea7c7a8c0 bsd: alpha_video: Simplify #include
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
93a3a28f2c bsd: alpha_video: Function sethae() need only for FreeBSD
Return value sethae() is becoming void because no caller used it. Also old
msb_set static checked by each caller is replaced by the p.hae static checked
in sethae() when it's called.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:28 +06:00
Alexandr Shadchin
05b41e2dc6 Move check definition MAP_FAILED in xf86_OSlib.h
Also remove odd definition MAP_FAILED.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
af56e502f5 Remove odd definition DEV_MEM
DEV_MEM defined in xf86_OSlib.h

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
0481e9d3d1 Remove BSDi support
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
8838a86fd3 Remove unused VT_SYSREQ_DEFAULT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29 02:13:27 +06:00
Alexandr Shadchin
219bcec73d bsd: Remove odd message about -sharevts
This is missing in commit 'xfree86: move -novtswitch & -sharevts argument
handling up to common layer'

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-28 13:09:50 -07:00
Jeremy Huddleston
286fa9bf9b XWin: windowswm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-10-26 10:41:51 -07:00
Jeremy Huddleston
dc054fefc5 XQuartz: appledri: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-26 00:42:19 -07:00
Jeremy Huddleston
d5fee2b638 XQuartz: applewm: Correct byte swapping in event notifications
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-26 00:42:04 -07:00
Keith Packard
5701ab4a44 Merge remote-tracking branch 'whot/for-keith' 2011-10-24 22:09:00 -07:00
Peter Hutterer
a41214bc9a kdrive: check for null memory, fix OOB
If key/value allocation failed, don't bother adding another InputOption. And
make sure the memory allocated is large enough for the trailing \0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-25 14:06:41 +10:00
Peter Hutterer
6f33593dc0 xfree86 doc: replace driver "keyboard" with "kbd"
We've deprecated keyboard a long time ago

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-25 14:06:41 +10:00
Peter Hutterer
e4cd24e717 xfree86: use NewInputDeviceRequest for xorg.conf devices too
Only use one init path for input devices - through NIDR.

This requires that inp_driver and inp_identifier from the
XF86ConfInputRec are copied over into the options for NIDR to see them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:41 +10:00
Peter Hutterer
f9067c1dd8 xfree86: Fix a comment, the old function doesn't exist anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:40 +10:00
Peter Hutterer
aeab26e9e1 xfree86: use xf86AddNewOption instead of xf86addNewOption
The former strdups for us. If the strdup fails we miss out on the
CorePointer option (default on anyway) and we're likely to fall over soon
anyway, so let's pretend this is the same behaviour.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:40 +10:00
Peter Hutterer
c39c8d3428 input: switch InputOption to use XF86OptionRec storage.
Use the same struct for both InputOption and XF86OptionRec so we don't need
to convert to and fro the two in the config backends.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-25 14:06:39 +10:00
Peter Hutterer
16ac78a53c kdrive: switch to new InputOption API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-10-25 14:02:06 +10:00
Christopher Yeleighton
7d50211ab5 Bug 38420: Xvfb crashes in miInitVisuals() when started with depth=2
https://bugs.freedesktop.org/show_bug.cgi?id=38420

Exit with fatal error message, not segfault.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-24 18:59:56 -07:00
Keith Packard
d9d3a01ffc Merge remote-tracking branch 'jeremyhu/master' 2011-10-24 18:12:23 -07:00
Dave Airlie
17416e88dc xf86Crtc: handle no outputs with no modes harder.
If you started an X server with no connected outputs, we pick a default
1024x768 mode, however if you then ran an xvidmode using app against that
server it would segfault the server due to not finding any valid modes.

This was due to the no output mode set code, only adding the modes to the
scrn->modes once, when something called randr 1.2 xf86SetScrnInfoModes would
get called and remove all the modes and we'd end up with 0.

This change fixes xf86SetScrnInfoModes to always report a scrn mode of at
least 1024x768, and pushes the initial configuration to just call it instead
of setting up the mode itself.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=746926

I've seen other bugs like this on other distros so it might also actually fix them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-24 18:09:35 -07:00
Jeremy Huddleston
fb55f8f790 XQuartz: Fix the filename of our log file
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 16:45:36 -07:00
Jeremy Huddleston
1c8bda798b XQuartz: appledri: Allow byte swapped requests
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 10:34:36 -07:00
Jeremy Huddleston
14205ade0c XQuartz: appledri: Fix byte swapping in replies
Even though it's only valid when local, it is possible for a local
client and the server to not match endianness, such as when running
a ppc application under Rosetta.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
2ba0ac202a XQuartz: appledri: Set the correct reply length for XAppleDRICreatePixmap
http://xquartz.macosforge.org/trac/ticket/508

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
e4f257748b XQuartz: appledri: Change whitespace in appledristr.h to match mesa
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:56 -07:00
Jeremy Huddleston
83fef4235d Xnest: Match the host's keymap
This was a regression.

Introduced by: 08363c5830 and
               32db27a7f8
Masked by: 1e69fd4a60

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-21 10:29:51 -07:00
Jeremy Huddleston
8db554d2d8 Xnest: Fix DestroyNotify handler
This partially reverts the unwanted changes that crept into
c13a48e74e

Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2011-10-21 00:32:03 -07:00
Keith Packard
af3f64fb77 Merge remote-tracking branch 'hramrach/pull' 2011-10-19 17:33:07 -07:00
Keith Packard
15bbdc103b Merge remote-tracking branch 'whot/for-keith' 2011-10-19 17:26:50 -07:00
Gaetan Nadon
e4787ec20b XWinrc.man: fix warning: tab character in unquoted macro argument #35054
Spaces or tabs do not affect the text output layout.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:22:26 -07:00
Gaetan Nadon
321873f804 xorg.conf.man: fix 382: warning: missing )' (got R') #35054
http://www.gnu.org/software/groff/manual/html_node/Man-usage.html

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:22:18 -07:00
Jesse Barnes
3e145d3d67 crtc: match full preferred modes if possible when choosing an initial config
It's fairly common to have multiple, identical monitors plugged in.  In
that case, it's preferable to run the monitor's preferred mode on each
output, rather than just matching the width & height and end up with
different timings or refresh rates.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-19 17:19:44 -07:00
Michal Suchanek
df0dd36dee Do not uselessly reload modules in DuplicateModule
The function does not initialize the module so it has no business
loading it. If some user of DuplicateModule expects a module actually
loaded they should use LoadModule.

Signed-off-by: Michal Suchanek <hramrach@centrum.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 14:21:32 +02:00
Michal Suchanek
24d435163e Use UnloadModuleOrDriver for UnloadSubModule.
Signed-off-by: Michal Suchanek <hramrach@centrum.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 13:18:33 +02:00
Michal Suchanek
0d4bb5442c Unload submodules.
Signed-off-by: Michal Suchanek <hramrach@centrum.cz>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 12:49:29 +02:00
Tomáš Trnka
323869f329 Fix drain_console unregistration
Bug introduced by 9dca441670
xfree86: add a hook to replace the new console handler.

console_handler was not being set, making the server eat up CPU spinning
in WaitForSomething selecting consoleFd over and over again, every time
trying to unregister drain_console without success due to
console_handler being NULL.

Let's just fix the unregistration in xf86SetConsoleHandler() and use that.

But wait, there could be a catch: If some driver replaced the handler using
xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
that one. I don't understand Xorg well enough to know whether this poses a
problem (could mess up driver deinit somehow or something like that). As it is,
xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
handler is currently registered).

I had been using it for two days on my machine that previously hit 100% CPU
several times a day. That has now gone away without any new problems appearing.

Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 09:15:54 +10:00
Jeremy Huddleston
679c84bce9 Bump ABI_VIDEODRV_VERSION to 12
The ABI changed in the previous series of changes, so bump the ABI version for
the next release.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:48 -07:00
Jeremy Huddleston
a89cdcee4e xfree86: Deprecate xf86MapVidMem and friends
Drivers should transition over to using libpciaccess's instead.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:48 -07:00
Jeremy Huddleston
43d730c0e4 xfree86: Link modules with -module
This makes a difference on darwin (and apparently nowhere else)

https://www.gnu.org/s/libtool/manual/libtool.html#Modules-for-libltdl

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
f7edc00a2a xfree86: fbdevhw: Remove unused include of pciaccess.h
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:47 -07:00
Tiago Vignatti
6817050f31 configure: wrap PCI code with macro and set it at build time
--disable-pciaccess, used together with --disable-module-int10, can be used to
disable all pci code inside the server.

Note that XSERVER_LIBPCIACCESS was previously used only in the driver side and
now it defines also whether the library is used inside the server. Also,
XORG_BUS_PCI automake variable is introduced to track PCI code needs.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-15 21:18:47 -07:00
Tiago Vignatti
a319e9e697 configure: change PCI function checking by a meaningful version of the library
People that don't want VGA arbiter active can go to the library and enable the
stubs there.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
b3ca84430d xfree86: Work around issue where ar may be told to make an archive with no contents
Automake:

 "Be careful when selecting library components conditionally. Because building
 an empty library is not portable, you should ensure that any library
 always contains at least one object."

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Jeremy Huddleston
e8bafb9d8c xfree86: Add stubs for os-support to help adding new architecture support
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-10-15 21:18:47 -07:00
Adam Jackson
342f3eac84 int10: Port internal users off xf86MapVidMem
This API is apparently semi-deprecated even by XFree86 standards, and
there are only four drivers left using it.  Let's start chopping it off.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-15 21:18:46 -07:00
Adam Jackson
7757b80924 pci: Remove xf86MapDomainMemory
This is slightly draconian, but that API is just awful.  In all but
one case in the callers it's used to get a map of some legacy VGA
memory, and it would be cleaner for the caller to just call
pci_device_map_legacy.

The sole exception is in the vesa driver, which uses it to avoid having
to look up which device the BAR belongs to.  That's similarly trivial to
fix.

Having done that, Linux's PCI layer is now very small indeed.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-15 21:18:46 -07:00
Adam Jackson
6f5041d0b8 int10: Use pciaccess rom fetch for !PC machines
... instead of rolling our own, badly.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
492ed3e53b pci: Deprecate the PCITAG type
It is kept around to help drivers through the API transition and will be
removed at some point in the future.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
a248fa3a33 xfree86: Remove unused bios_devmem.c
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
aa0bfb0f13 linux: Remove ia64 domain I/O support code
pciaccess handles this now.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
95b6935637 linux: Remove pre-2.6 PCI interface support
If you haven't ported 2.6 to your architecture in the intervening seven
years, you can keep running older servers.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
769f583783 bus: remove some dead struct fields
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
dd72b3c1f1 linux: Use pci_device_get_parent_bridge instead of open-coding it
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
858fbbb40d pci: Port xf86MapLegacyIO to pciaccess
Per-domain I/O is now something drivers must manually request, and must
keep track of within their own state rather than in the ScrnInfoRec.
It's not really possible to split that into two steps without an
additional intermediate ABI break, so don't even try.  Drivers that want
source compatibility should ifdef on the presence of xf86UnmapLegacyIO.

As a fringe benefit, domain-aware I/O is now OS-independent, relying
only on support in pciaccess.  Simplify OS PCI setup to reflect this.

The IOADDRESS type is kept around to help drivers through the API
transition and will be removed at some point in the future.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:46 -07:00
Adam Jackson
6d9efdce0d vgahw: Port to pciaccess IO space routines
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
4bd6579188 vgahw: Don't default to standard (port space) access routines
In fact, don't default to anything; drivers must explicitly say which
kind they want, and they are strongly encouraged to do MMIO if possible.
This is an ABI change in that drivers that don't will crash, but drivers
that are explicit will work with both old and new servers.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
30fb334d21 vgahw: Remove IO domain setup
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
51a5558beb int10: Port to pciaccess' legacy IO API
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Adam Jackson
c0b63ff88a xfree86: Move xf86GetClocks to vgahw
This is really a vga-specific hack anyway.  The only modern driver that
uses it is trident, but it's already loaded vgahw by the time it would
call xf86GetClocks.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-10-15 21:18:45 -07:00
Peter Hutterer
8bebb4b489 Store desktop dimensions in screenInfo.
For Zaphod mode screen crossing handling we need to know the size of all
screens together (i.e. the whole desktop size). Store that in the screenInfo to
have it readily available in events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-13 11:26:09 +10:00
Peter Hutterer
9cbfa4739a xfree86: remove xf86XInputSetScreen
Keeping track of which screen the pointer within the input driver is
obsolete now. To bind to a screen, use the transformation matrix instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-10-13 11:07:50 +10:00
Jeremy Huddleston
09dbfcb0ad os: Remove Error()
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-11 21:23:46 -07:00
Jeremy Huddleston
db30615bcb Xephyr: Remove socket and its lock file on exit
https://bugs.freedesktop.org/show_bug.cgi?id=11484

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2011-10-10 20:40:44 -07:00
Jeremy Huddleston
c13a48e74e Xnest: Remove socket and its lock file on exit
https://bugs.freedesktop.org/show_bug.cgi?id=11484

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2011-10-10 20:40:44 -07:00
Jeremy Huddleston
8b29addc30 loader: when creating sdksyms.c only include shmint.h if MITSHM is enabled #29109
https://bugs.freedesktop.org/show_bug.cgi?id=29109

When configured with --disable-mitshm the symbols declared in shmint.h
do not exist. By guarding the include with '#ifdef MITSHM' these
symbols are skipped when generating sdksyms.c with --disable-mitshm.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-09 17:11:56 -07:00
Julien Cristau
eabd5532fb xfree86: fix build with xv disabled
https://bugs.freedesktop.org/show_bug.cgi?id=29111

Signed-off-by: Julien Cristau <jcristau@debian.org>
Tested-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2011-10-09 17:08:34 -07:00
Ville Skyttä
c53380be80 Man page syntax and spelling fixes.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-06 09:53:23 -07:00
Jeremy Huddleston
fae7ed62ad XQuartz: pbproxy: Add missing AM_OBJCFLAGS
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 21:40:41 -07:00
vdb@picaros.org
e4cddf509e Fix a rare memory leak
Signed-off-by: Servaas Vandenberghe <vdb@picaros.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 20:18:17 -07:00
Keith Packard
6378d0233d Merge remote-tracking branch 'herrb/master' 2011-10-03 13:56:06 -07:00
Keith Packard
6e965d8a18 Merge remote-tracking branch 'koba/reviewed' 2011-10-03 13:47:49 -07:00
Gaetan Nadon
ee3e26079e ddxDesign: drop the url in the coporate authors list
It was such an eyesore once rendered in html.
Now it looks like other authors.

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:37 -07:00
Gaetan Nadon
0ed71b48c0 ddxDesign: remove server version from the document title
Such version information is already written in the appropriate location

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:35 -07:00
Gaetan Nadon
83ec3bf1aa ddx-Design: add X Version and Release information
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 12:18:31 -07:00
Jamey Sharp
77743f877d kdrive: Fix build for opaque InputOption structure.
Commit 05284a03f9 missed fixing up
kdrive's use of the old non-opaque structure.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:51:00 -07:00
Keith Packard
cf11ca360c Merge remote-tracking branch 'jeremyhu/for-keith' 2011-10-03 11:44:59 -07:00
Pauli Nieminen
463dd87062 xf86/modes: Fix shadow rotation crashing when screen pixmap changes
Driver may change screen pixmaps after page flipping that would then
make damage lose track of the root pixmap.

Using root window for shadow damages fixes the problem because
SetWindowPixmap is implemented in shadow code.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-03 11:41:22 -07:00
Keith Packard
f5d50b46dd Merge remote-tracking branch 'whot/next' 2011-10-03 11:36:28 -07:00
Aaron Plattner
57cd32e934 xfree86/modes: Make cursor position transform a helper function
When the driver can handle the crtc transform in hardware, it sets
crtc->driverIsPerformingTransform, which turns off both the shadow
layer and the cursor's position-transforming code.  However, some
drivers actually do require the cursor position to still be
transformed in these cases.  Move the cursor position transform into a
helper function that can be called by such drivers.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:04 -07:00
Aaron Plattner
245cb8e94f xfree86/modes: Let the driver handle the transform
If a driver can use hardware to handle the crtc transform, then
there's no need for the server's shadow layer to do it.  Add a crtc
flag that lets the driver indicate that it is handling the transform.
If it's set, consider the transformed size of the screen but don't
actually enable the shadow layer.  Also stop adjusting the cursor
image and position.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2011-10-03 11:30:00 -07:00
Matthieu Herrb
98b230669f sdksyms.sh may not be executable.
Use $(SHELL) to run it. Someone may want to build out of a source tree
in a filesystem with the noexec mount flag set.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-01 17:35:19 +02:00
Matthieu Herrb
f54852edc3 Add a 'wscons' autoconf mechanism to configure input devices on BSD.
This does not really handle hotplug (it's handled inside the kernel,
by the 'mux' devices), but uses the wscons console driver
configuration to figure out the keyboard layout and the list of
pointing devices found by the kernel.

Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-30 10:10:32 +02:00
Alexandr Shadchin
ac5881d6d0 Remove unused vtSysreq
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
0be1640dbb bsd: ioctl KDENABIO/KDDISABIO do not matter for OpenBSD
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
91042b98af bsd: OpenBSD and NetBSD not need extra headers in PCVT_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
86eaa9bbe4 bsd: Some clean up
OpenBSD and NetBSD does not support syscons

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
dc864770d4 bsd: Remove dead code
Since OsInit closes stdin before the xfree86 DDX opens the
console, fstat on stdin will always fail, so it's safe to delete
code that attempts it.

Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
cbb842666f bsd: Variable devConsoleFd need only if defined PCCONS_SUPPORT
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
38bd1e123d bsd: Replacement screenFd on consoleFd because they are equivalent
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Alexandr Shadchin
f015351c73 bsd: Remove unused macros KBD_FD
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
2011-09-29 23:05:35 +06:00
Peter Hutterer
8d1a414cca input: switch InitValuatorAxisStruct to return Bool
Return errors instead of silently ignoring them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:26:43 +10:00
Daniel Stone
2b8f1d07bd Input: Widen pointer acceleration types to double
This widens almost all of the float-using code in ptrveloc.[ch] to
doubles, other than values coming from properties which are specified to
be floats by the property API.

Bumps input API to v14 as this changes the AccelScheme signature, as
used by xf86-input-synaptics.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:24:33 +10:00
Jeremy Huddleston
38e9e28ba2 XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-28 13:31:48 -07:00
Keith Packard
afb1fe695d Merge remote-tracking branch 'whot/next' 2011-09-26 20:24:15 -07:00
vdb@picaros.org
c7163fdd30 xfree86: .BI style: monitor section in xorg.conf man page
The xorg.conf manual uses the following convention in most of its
sections:

bold = text to be copied literally to the config file,
italic = a symbolic name to be substituted by a true value.

Some configuration keywords seem to have been changed into generic
options.  Prepending Option to the manual entry swapped the
bold-italic logic.  This patch restores the convention in the monitor
section and consists of

-.BI "Option " "\*qPreferredMode\*q  " \*qstring\*q
+.BI "Option \*qPreferredMode\*q \*q" name \*q

modifications.

Plus a few minor changes (Modes → Mode) and a typo fix.

Signed-off-by: Servaas Vandenberghe
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:28 +10:00
Peter Hutterer
4b4caecb7d xfree86: expose Option "TransformationMatrix"
Recent changes to the server change the default absolute input device
behaviour on zaphods to span the whole desktop too. Since these setups
usually use an xorg.conf, allow the transformation matrix to be specified in
the config as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-09-27 11:57:25 +10:00
Peter Hutterer
cf51424a34 xfree86: use subheader for Pointer Acceleration parts in xorg.conf(5)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:23 +10:00
Peter Hutterer
9125952b40 xfree86: fix comment typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-27 11:57:20 +10:00
Peter Hutterer
24823f1ab0 xfree86: switch options from pointer to XF86OptionPtr
In all cases, the pointer was simply type-cast anyway. Let's get some
compile-time type safety going, how about that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>

Squashed in:
xfree86: Move definition of xf86OptionPtr into separate header file

The pile of spaghettis that is the xfree86 include dependencies make it
rather hard to have a single typedef somewhere that's not interfering with
everything else or drags in a whole bunch of other includes.

Move the xf86OptionRec and GenericListRec declarations into a separate
header.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-27 11:43:36 +10:00
Keith Packard
7fb4bef039 Merge remote-tracking branch 'mattst88/for-keith' 2011-09-21 14:34:27 -07:00