Commit Graph

12559 Commits

Author SHA1 Message Date
Peter Hutterer
6993f8b459 Xi: free barrier code at reset time
==29423== 16 bytes in 1 blocks are definitely lost in loss record 73 of 328
==29423==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==29423==    by 0x5987C0: XIBarrierInit (xibarriers.c:908)
==29423==    by 0x58F370: XInputExtensionInit (extinit.c:1300)
==29423==    by 0x4F33C3: InitExtensions (miinitext.c:337)
==29423==    by 0x4997DB: main (main.c:208)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:19 +10:00
Peter Hutterer
042c6d861f os: Use ErrorFSigSafe from FatalError and it's friends
Backtrace logging etc. is already sigsafe, but the actual FatalError message
in response is not yet, leading to amusing logs like this:

    (EE) Segmentation fault at address 0x0
    (EE) BUG: triggered 'if (inSignalContext)'
    (EE) BUG: log.c:499 in LogVMessageVerb()
    (EE) Warning: attempting to log data in a signal unsafe manner while in
    signal context.
    Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or
    ErrorFSigSafe().
    The offending log format message is:

    Fatal server error:

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:14 +10:00
Peter Hutterer
d9848fb4b1 os: complain about unsupported pnprintf directives
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:11 +10:00
Peter Hutterer
d903d17d7f os: support %c in pnprintf
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:09 +10:00
Peter Hutterer
58ef34ee6d os: support %% in pnprintf
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:07 +10:00
Peter Hutterer
5ea21560dd os: support pnprintf length modifiers for integers
Mainly for %ld, smaller than int is propagated anyway, and %lld isn't really
used.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:05 +10:00
Peter Hutterer
d3d4af5f9e dix: reset the registry before quitting
Heaps of these:
==2042== 15,360 bytes in 120 blocks are still reachable in loss record 94 of
97
==2042==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==2042==    by 0x4C2A657: realloc (vg_replace_malloc.c:525)
==2042==    by 0x45FB91: double_size (registry.c:65)
==2042==    by 0x45FC97: RegisterRequestName (registry.c:85)
==2042==    by 0x460095: RegisterExtensionNames (registry.c:179)
==2042==    by 0x460729: dixResetRegistry (registry.c:334)
==2042==    by 0x5AC992: main (main.c:201)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:02 +10:00
Peter Hutterer
6f44d672aa xkb: free XkbRulesUsed and XkbRulesDflt on extension cleanup
==2547== 1 bytes in 1 blocks are still reachable in loss record 1 of 111
==2547==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==2547==    by 0x64D1551: strdup (strdup.c:43)
==2547==    by 0x4802FB: Xstrdup (utils.c:1113)
==2547==    by 0x585B6C: XkbSetRulesUsed (xkbInit.c:219)
==2547==    by 0x58700F: InitKeyboardDeviceStruct (xkbInit.c:595)
==2547==    by 0x419FA3: vfbKeybdProc (InitInput.c:74)
==2547==    by 0x425A3D: ActivateDevice (devices.c:540)
==2547==    by 0x425F65: InitAndStartDevices (devices.c:713)
==2547==    by 0x5ACA57: main (main.c:259)

and a few more of the above.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:51 +10:00
Peter Hutterer
623981ddae If neither HAL nor udev backends are enabled, warn the user
If both are missing,  input device hotplugging will not work out of the box.
While we still have a DBus-API or the user may want to set AAD off all the
time, the most likely source of this is misconfiguration (i.e. lack of the
udev/hal devel packages).

Message printed last to make it more obvious to the user.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:46 +10:00
Peter Hutterer
dce40e2266 Xi: always return BadMatch for XTest devices ChangeDeviceControl requests
The only controls that still do something are DEVICE_RESOLUTION and
DEVICE_ENABLE.

XTest devices have no resolution to change, and they cannot be disabled. So
skip the lot, and prevent a crash in the DDX when it's trying to
de-reference pInfo->control_proc on device with no pInfo struct.

Likewise, don't allow setting device mode or the valuators.
XTest pointers are always relative, they don't have a mode.

Test cases:
xts5/XI/ChangeDeviceControl (1/10)
xts5/XI/SetDeviceValuators (1/6)
and a few others

Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:44 +10:00
Peter Hutterer
23d1bc69f3 dix: send the current axis value in DeviceChangedEvents (#62321)
X.Org Bug 62321 <http://bugs.freedesktop.org/show_bug.cgi?id=62321>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:42 +10:00
Peter Hutterer
27b11f5c19 Xi: fix comment - XI2 grabs aren't keysym grabs
Comment dates back to a pre-release version of XI2 that supported keysym
grabs. That never made it into a release, it was ditched before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:40:39 +10:00
Keith Packard
2746c68163 Merge remote-tracking branch 'alanc/master' 2013-05-06 10:52:40 -07:00
Keith Packard
1e6cf8ec20 Merge remote-tracking branch 'jturney/unused-but-set-variable-warning-fix' 2013-05-06 10:20:21 -07:00
Aaron Plattner
dbfeaf7062 xfree86: don't enable anything in xf86InitialConfiguration for GPU screens
There's no point in turning on outputs connected to GPU screens during initial
configuration.  Not only does this cause them to just display black, it also
confuses clients when these screens are attached to a master screen and RandR
reports that the outputs are already on.

Also, don't print the warning about no outputs being found on GPU screens,
since that's expected.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@gmail.com>
2013-05-06 09:34:27 +10:00
Jon TURNEY
5860408a19 hw/xwin: Fix unused-but-set-variable warning in ProcWindowsWMFrameGetRect()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c: In function ‘ProcWindowsWMFrameGetRect’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c:322:12: error: variable ‘ir’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:29 +01:00
Jon TURNEY
bcfd523c15 hw/xwin: Fix unused-but-set-variable warning in winMWExtWMUpdateWindowDecoration()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c: In function ‘winMWExtWMUpdateWindowDecoration’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c:189:11: error: variable ‘dwStyle’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:27 +01:00
Jon TURNEY
fbf819c24d hw/xwin: Fix unused-but-set-variable warning in winHotKeyAltTabPrimaryDD()
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c: In function ‘winHotKeyAltTabPrimaryDD’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c:518:20: error: variable ‘rcSrc’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:25 +01:00
Jon TURNEY
7dae1e59ce hw/xwin: Fix unused-but-set-variable warning in winMinimizeWindow() when built !XWIN_MULTIWINDOWEXTWM
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c: In function ‘winMinimizeWindow’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c:813:20: error: variable ‘pScreenInfo’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:23 +01:00
Jon TURNEY
b284666f09 hw/xwin: Fix unused-but-set-variable warning in winClipboardProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c: In function ‘winClipboardProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c:88:25: error: variable ‘atomClipboardManager’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:22 +01:00
Jon TURNEY
d414a09bb7 hw/xwin: Fix unused-but-set-variable warning in winWindowProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c: In function ‘winWindowProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c:65:22: error: variable ‘s_hInstance’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:20 +01:00
Jon TURNEY
7726102671 hw/xwin: Fix unused-but-set-variable warning in winCopyWindowNativeGDI()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c: In function ‘winCopyWindowNativeGDI’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c:131:15: error: variable ‘pwinRoot’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:18 +01:00
Jon TURNEY
b9a2566a6e hw/xwin: Fix unused-but-set-variable warning in winFinishScreenInitFB()
/jhbuild/checkout/xorg/xserver/hw/xwin/winscrinit.c:264:11: error: variable ‘pbits’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:16 +01:00
Jon TURNEY
c97fbd39ad hw/xwin: Fix unused-but-set-variable warning in winIsFakeCtrl_L()
/jhbuild/checkout/xorg/xserver/hw/xwin/winkeybd.c:331:17: error: variable ‘lastMessage’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:14 +01:00
Jon TURNEY
cdb74fe17d hw/xwin: Fix unused-but-set-variable warnings in windialog.c
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winChangeDepthDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:432:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winAboutDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:564:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:12 +01:00
Dave Airlie
f2fd8ec372 gpu: call CreateScreenResources for GPU screens
I didn't think we needed this before, but after doing some more
work with reverse optimus it seems like it should be called.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:51 +10:00
Dave Airlie
8fcb9d91b6 dix: allow pixmap dirty helper to be used for non-shared pixmaps
this allows the pixmap dirty helper to be used for reverse optimus,
where the GPU wants to copy from the shared pixmap to its VRAM copy.

[airlied: slave_dst is wrong name now but pointless ABI churn at this point]
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:31 +10:00
Dave Airlie
16077b81c5 xf86crtc: don't use scrn->display for gpu screens
scrn->display is a property of the main screen really, and we don't
want to have the GPU screens use it for anything when picking modes
or a front buffer size.

This fixes a bug where when you plugged a display link device, it
would try and allocate a screen the same size as the current running
one (3360x1050 in this case), which was too big for the device. Avoid
doing this and just pick sizes based on whats plugged into this device.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:23 +10:00
Dave Airlie
f0d0d75bfe dix/gpu: remove asserts for output/offload from same slave
We should have no problem allowing output/offload from the same slave,
I asserted here, but in order to implement reverse optimus this makes
perfect sense. (reverse optimus is intel outputting to nvidia).

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:10:14 +10:00
Dave Airlie
9d26e8eaf5 randr: report changes when we disconnect a GPU slave
When we disconnect an output/offload slave set the changed bits,
so a later TellChanged can do something.

Then when we remove a GPU slave device, sent change notification
to the protocol screen.

This allows hot unplugged USB devices to disappear in clients.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Dave Airlie
b724324252 randr: only respected changed on the protocol screen
We don't want to know about changes on the non-protocol screen,
we will fix up setchanged to make sure non-protocol screens update
the protocol screens when they have a change.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Dave Airlie
b3f70f38ed randr: make SetChanged modify the main protocol screen not the gpu screen
When SetChanged is called we now modify the main protocol screen,
not the the gpu screen. Since changed stuff should work at the protocol level.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Dave Airlie
f9c8248b83 randr: don't directly set changed bits in randr screen
Introduce a wrapper interface so we can fix things up for multi-gpu
situations later.

This just introduces the API for now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-04-30 10:08:43 +10:00
Chris Wilson
451ba4bd41 hw/xfree86: Only report SetDesiredModes() failed if at least one modeset fails
commit 6703a7c7cf
Author: Keith Packard <keithp@keithp.com>
Date:   Tue Jan 8 20:24:32 2013 -0800

    hw/xfree86: Require only one working CRTC to start the server.

changed the logic to try to set the mode on all connected outputs rather
than abort upon the first failure. The return error code was then
tweaked such that it reported success if it set a mode on any crtc.
However, this confuses the headless case where we never enable any crtcs
and also, importantly, never fail to set a crtc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59190

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Also-written-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-29 09:10:06 -07:00
Alan Coopersmith
9878e097a7 Only call xf86platformVTProbe() when it's defined
Fixes build on non-udev systems, since XSERVER_PLATFORM_BUS is only
defined in configure.ac if $CONFIG_UDEV_KMS is true.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2013-04-25 21:44:09 -07:00
Keith Packard
e779402d53 shadow: Define c2p_unsupported
Just make this call BUG_WARN(1) to indicate that something unexpected
happened

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-25 09:02:31 -07:00
Alan Coopersmith
2b361fbda5 sparcPromPathname2Node: free name when returning error, instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24 14:22:36 -07:00
Alan Coopersmith
174ccd8493 xf86SbusCmapLoadPalette: Delay malloc until needed, avoiding leak on error
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

V2: check for malloc failure

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-24 14:22:36 -07:00
Alan Coopersmith
6bca0184d1 dmxVDLRead: if we opened a file, close it instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24 14:22:36 -07:00
Alan Coopersmith
8c5ff2e93f __glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

V2: goto existing error handler, instead of replicating more of it here

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24 14:22:33 -07:00
Alan Coopersmith
9567fa9a72 __glXDRIscreenCreateContext: free context on failure, instead of leaking it
Reported with other leaks found by cppcheck in bugzilla #50281
https://bugs.freedesktop.org/show_bug.cgi?id=50281

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-04-24 14:22:19 -07:00
Keith Packard
7ab98bafc9 Merge remote-tracking branch 'geertu/master' 2013-04-24 14:14:45 -07:00
Keith Packard
53da26afb7 Merge remote-tracking branch 'whot/for-keith' 2013-04-24 10:27:19 -07:00
Keith Packard
5ece86e921 Merge remote-tracking branch 'airlied/for-keithp-gpu-vt-owner' 2013-04-24 10:23:51 -07:00
Jeremy White
ef0a726bc8 Eliminate the use of xf86Rename.h
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-24 10:22:20 -07:00
Keith Packard
2b539239e4 Bump to 1.14.99.1
Snapshot with fix for CVE-2013-1940.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-04-24 10:11:03 -07:00
Andreas Müller
d8d3c78b6e dixstruct.h: fix segfaults - char is unsigned for ARM and PowerPC architectures
see ARM related bug reports [1-3]

[1] https://github.com/archlinuxarm/PKGBUILDs/issues/446I
[2] http://www.raspberrypi.org/phpBB3/viewtopic.php?t=38568&p=321673
[3] http://lists.linuxtogo.org/pipermail/openembedded-core/2013-April/037805.html

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-23 17:43:31 +10:00
Peter Hutterer
7d722796c6 dix: plug memory leak in freeing TouchClass
==15562== 1,800 bytes in 1 blocks are definitely lost in loss record 298 of 330
==15562==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==15562==    by 0x4312C7: InitTouchClassDeviceStruct (devices.c:1644)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-23 17:33:24 +10:00
Geert Uytterhoeven
5ab260317a Xfbdev: Wire up Amiga afb4 and afb8 support
Add support for Amiga-style bitplanes, with 4 or 8 bits per pixel.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00
Geert Uytterhoeven
672bc5bb38 Xfbdev: Wire up Atari iplan2p4 and iplan2p8 support
Add support for Atari-style interleaved bitplanes, with 2 bytes interleave
and 4 or 8 bits per pixel.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-18 13:10:26 +02:00