summaryrefslogtreecommitdiff
path: root/hw/xfree86
AgeCommit message (Collapse)AuthorFilesLines
2011-11-23Fix gcc -Wwrite-strings warnings in xf86Modes codeAlan Coopersmith4-8/+8
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Fix gcc -Wwrite-strings warnings in xf86 ddxAlan Coopersmith22-53/+54
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23FindModule: stop copying const char *dirname to char *dirpathAlan Coopersmith1-8/+3
Not needed since 6cf844ab69926b 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-23Remove redundant redeclarations of functions in the same header fileAlan Coopersmith1-5/+0
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-23sun_agp: cast key to uintptr_t before casting to (int *)Alan Coopersmith1-1/+1
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-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith7-20/+20
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-23Remove xf86FormatPciBusNumber from API, inline the one place its usedAlan Coopersmith2-12/+6
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-23Move DoShowOptions to xf86Configure.c, delete xf86ShowOpts.cAlan Coopersmith3-123/+52
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-23Remove bad code from DoShowOptions (Xorg -showopts handler)Alan Coopersmith1-10/+2
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-23matchDriverFromFiles: use one snprintf instead of strncpy/cat seriesAlan Coopersmith1-3/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Convert strncpy/strncat to strlcpy/strlcatAlan Coopersmith4-11/+9
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-23Don't fallback to wsfb or fbdev on SolarisAlan Coopersmith1-0/+2
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-21docs: spell "X Server Version" consistently in titles. Add where missing.Gaetan Nadon1-1/+1
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-18edid: Add quirk for Acer Aspire One 110Ross Burton1-0/+5
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-18dri2: Register the DRI2DrawableType after server regenerationChris Wilson2-2/+15
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-18DRI2: Avoid a NULL pointer dereferenceChris Wilson1-1/+2
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-18VidMode: prevent crash with no modesChris Wilson1-0/+3
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-18xfree86: Deprecate the use of xf86PciInfo.hJeremy Huddleston6-10/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Tormod Volden <debian.tormod@gmail.com>
2011-11-18xfree86: Fix powerpc build with -Werror=int-to-pointer-cast ↵Jeremy Huddleston1-4/+4
-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-14xfree86: Fix RandR rotation across server generationsPierre-Loup A. Griffais1-0/+3
245cb8e94fd1599 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-14Merge remote-tracking branch 'whot/for-keith'Keith Packard3-2/+4
2011-11-09input: replace remaining GetPairedDevice() with GetMaster()Peter Hutterer2-2/+2
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-06Fix vesa's VBE PanelID interpretationDerek Buitenhuis1-1/+4
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-04xfree86: duplicate name and driver from pInfo for NewInputDeviceRequestPeter Hutterer1-0/+2
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-02Merge remote-tracking branch 'whot/two-screen-coordinates'Keith Packard5-20/+7
2011-11-02Merge remote-tracking branch 'koba/reviewed'Keith Packard8-102/+23
2011-10-30Merge remote-tracking branch 'whot/for-keith'Keith Packard2-13/+25
2011-10-31xfree86: fix potential buffer overflowServaas Vandenberghe1-4/+13
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-31xfree86: reduce calls to input_option_get_key/valuePeter Hutterer1-9/+12
No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-29xfree86: add nouveau as the first automatic driver for NVIDIA hardwareAnssi Hannula1-1/+9
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-29bsd: alpha_video: Remove unused variablesAlexandr Shadchin1-3/+0
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29bsd: alpha_video: Simplify #includeAlexandr Shadchin1-6/+4
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29bsd: alpha_video: Function sethae() need only for FreeBSDAlexandr Shadchin1-37/+14
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-29Move check definition MAP_FAILED in xf86_OSlib.hAlexandr Shadchin8-30/+4
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-29Remove odd definition DEV_MEMAlexandr Shadchin4-7/+1
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-29Remove BSDi supportAlexandr Shadchin1-17/+2
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-29Remove unused VT_SYSREQ_DEFAULTAlexandr Shadchin1-4/+0
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-28bsd: Remove odd message about -sharevtsAlexandr Shadchin1-1/+0
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-24Merge remote-tracking branch 'whot/for-keith'Keith Packard8-51/+26
2011-10-25xfree86 doc: replace driver "keyboard" with "kbd"Peter Hutterer1-2/+2
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-25xfree86: use NewInputDeviceRequest for xorg.conf devices tooPeter Hutterer2-28/+9
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-25xfree86: Fix a comment, the old function doesn't exist anymorePeter Hutterer1-1/+1
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-25xfree86: use xf86AddNewOption instead of xf86addNewOptionPeter Hutterer1-4/+4
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-25input: switch InputOption to use XF86OptionRec storage.Peter Hutterer5-16/+10
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-24xf86Crtc: handle no outputs with no modes harder.Dave Airlie1-22/+19
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-19Merge remote-tracking branch 'hramrach/pull'Keith Packard2-32/+15
2011-10-19Merge remote-tracking branch 'whot/for-keith'Keith Packard2-13/+10
2011-10-19xorg.conf.man: fix 382: warning: missing `)' (got `R') #35054Gaetan Nadon1-1/+3
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-19crtc: match full preferred modes if possible when choosing an initial configJesse Barnes1-5/+20
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-18Do not uselessly reload modules in DuplicateModuleMichal Suchanek1-9/+9
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>