summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06kdrive: drop screen crossing code.Dave Airlie1-6/+0
The only kdrive server we probably care about anymore is Xephyr, and this screen enable/disable code totally breaks it in multi-screen mode. When you are in one screen the other stops updating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=757457 Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-06xaa: avoid possible freed pointer reuse in epilogueDave Airlie1-0/+1
If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps avoid this by clearing the flags in to be destroyed pGCPriv. Reported by coverity. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-06fbdevhw: iterate over all modes that match a mode. (v3)Adam Jackson1-8/+10
So on RHEL5 anaconda sets an xorg.conf with a fixed 800x600 mode in it, we run radeonfb and fbdev since ati won't work in userspace due to domain issues in the older codebase. On certain pseries blades the built-in KVM can't accept an 800x600-43 mode, it requires the 800x600-60 mode, so we have to have the kernel radeonfb driver reject the 800x600-43 mode when it sees it. However then fbdev doesn't try any of the other 800x600 modes in the modelist, and we end up getting a default 640x480 mode we don't want. This patch changes the mode validation loop to continue on with the other modes that match to find one that works. v2: move code around to avoid extra loop, after comment from Jamey. v3: move loop setup back into loop as per Jeremy's review. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-01Remove another if (E != NULL) check around free(E)Matt Turner1-2/+0
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-11-24dmx: Build fix for -Werror=implicit-function-declaration on linuxJeremy Huddleston1-0/+1
Fixes regression introduced by: 6e6d732bac3c21cb85f8e998908f9b393630e5f8 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-24parser: free val.str after xstrtokenizePaulo Zanoni1-0/+9
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-24parser: free val.str after xf86getBoolValuePaulo Zanoni1-0/+6
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-24parser: free scandir's listPaulo Zanoni1-3/+3
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-24Correctly free config file namesPaulo Zanoni4-20/+20
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-23dmx: Build fix for -Werror=implicit-function-declarationJeremy Huddleston6-0/+95
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-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 Coopersmith12-30/+33
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-23Convert dmxSetDefaultFontPath to use strdup instead of malloc+strncpyAlan Coopersmith1-7/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> 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 Coopersmith8-17/+13
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-23Convert some malloc + strncpy pairs into strndup callsAlan Coopersmith1-3/+1
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-23Fix Xdmx build on Linux to work with strlcpy changesAlan Coopersmith2-0/+5
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-21docs: spell "X Server Version" consistently in titles. Add where missing.Gaetan Nadon3-1/+5
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 'jturney/master'Keith Packard11-158/+45
2011-11-02mi: remove deprecated miPointerAbsoluteCursor from design docGaetan Nadon1-8/+1
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-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-11-02hw/xwin: Fix a typo in ddraw.hColin Harrison1-1/+1
Fix a (fortunately benign) typo in ddraw.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"Yaakov Selkowitz1-46/+2
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 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec. 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-02hw/xwin: Stop pretending we work on NT4Jon TURNEY3-57/+11
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-02hw/xwin: Link directly to TrackMouseEvent()Jon TURNEY6-49/+6
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-02Cygwin/X: Make default DPI match native DPIJon TURNEY3-5/+25
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-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>