summaryrefslogtreecommitdiff
path: root/hw/xfree86
AgeCommit message (Collapse)AuthorFilesLines
2016-03-02modesetting: avoid double free if AddResource failsJulien Cristau1-3/+1
ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone already free the resource. Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02dri1: Fix unchecked AddResourceAdam Jackson1-3/+5
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-01config/udev: distinguish between real keyboards and other key devicesLaércio de Sousa1-1/+1
This patch introduces a new flag ATTR_KEY for hotplugged input devices, so we can better distinguish between real keyboards (i.e. devices with udev property ID_INPUT_KEYBOARD="1") and other key input devices like lid switches, power buttons, etc. All supported hotplug backends (udev, hal, and wscons) will set both flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input devices (hal and wscons will set both flags in any case). With this distinction, kdrive input hotplugging mechanism will be allowed to only grab real keyboards, as other key input devices are currently not supported. In order to don't break current behaviour, this patch will replace all ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c. [ajax: Just add ATTR_KEY, don't re-number the other attributes] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-02-29vidmode: remove redundant DIX functionOlivier Fourdan1-7/+1
The API signature of the DIX xf86VidModeGetGammaRampSize() is now identical to the xf86cmap's xf86GetGammaRampSize() and all it does is actually call xf86GetGammaRampSize() so we can save one vfunc. Remove uneeded xf86VidModeGetGammaRampSize() function. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove redundant checkOlivier Fourdan1-67/+5
The DIX already checks for VidModePrivateKey to get the vfunc, so checking for this again in the DDX is redundant. Remove the redundant function xf86VidModeAvailable() from the DDX. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: move to a separate library of its ownOlivier Fourdan8-2239/+88
XVidMode extension might be useful to non hardware servers as well (e.g. Xwayand) so that applications that rely on it (e.g. lot of older games) can at least have read access to XVidMode. But the implementation is very XFree86 centric, so the idea is to add a bunch of vfunc that other non-XFree86 servers can hook up into to provide a similar functionality. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: rename DDX functionsOlivier Fourdan3-233/+234
To avoid confusion as to what belongs on the DDX and what not. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: move display mode definitionsOlivier Fourdan1-91/+1
To be able to reuse the VidMode extension in a non-hardware server, the display mode definitions need to be accessible from DIX. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove mode access from public APIOlivier Fourdan3-111/+108
The mode access functions (namely VidModeCreateMode(), VidModeCopyMode(), VidModeGetModeValue() and VidModeSetModeValue()) are used only in xf86VidMode code and do not need to be available anywhere else. Remove these functions from the public VidMode API and move them as static where they are used. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use appropriate DisplayModePtr typeOlivier Fourdan3-70/+70
The API uses an untyped pointer (void *) where a DisplayModePtr is expected. Clean up the API to use the appropriate type, as DisplayModePtr is really all that will be passed there. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove VidModeGetMonitor()Olivier Fourdan3-41/+30
VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to get a untyped monitor pointer that is passed back straight again to VidModeGetMonitorValue(). This is actually useless as VidModeGetMonitorValue() could as well get the monitor from the ScreenPtr just like VidModeGetMonitor() does. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use ScreenPtr instead of screen indexOlivier Fourdan3-168/+181
New code passes ScreenPtr instead of the screen index. Change the VidMode functions to take a ScreenPtr. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: get rid of the CloseScreen wrapperOlivier Fourdan2-18/+0
As we rely on dixRegisterPrivateKey() to allocate the memory for us that will be free automatically, we do not need the CloseScreen wrapper anymore. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use appropriate APIOlivier Fourdan1-21/+4
dixRegisterPrivateKey() can allocate memory that will be freed when the screen is teared down. No need to calloc() and free the memory ourself using a broken ref counting method. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29dri2: Allow many blocked clients per-drawableChris Wilson1-59/+71
This patch was motivated by the need to fix the use-after-free in dri2ClientWake, but in doing so removes an arbitrary restriction that limits DRI2 to only blocking the first client on each drawable. In order to fix the use-after-free, we need to avoid touching our privates in the ClientSleep callback and so we want to only use that external list as our means of controlling sleeps and wakeups. We thus have a list of sleeping clients at our disposal and can manage multiple events and sources. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-22dri2: add virtio-gpu pci idsMarc-Andre Lureau3-0/+10
Add virtio-gpu legacy + 1.0 pci ids, allowing them to use modesetting + glamor with dri2. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-02-22dix: Add hybrid full-size/empty-clip mode to SetRootClipDaniel Stone2-4/+4
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug handler when running rootless (e.g. as a part of Weston/Mutter), since the root window has no storage, so generating exposures will result in writes to invalid memory. Unfortunately, preventing the segfault also breaks sprite confinement. SetRootClip updates winSize and borderSize for the root window, which when combined with RRScreenSizeChanged calling ScreenRestructured, generates a new sprite-confinment area to update it to the whole screen. Removing this call results in the window geometry being reported correctly, but winSize/borderSize never changing from their values at startup, i.e. out of sync with the root window geometry / screen information in the connection info / XRandR. This patch introduces a hybrid mode, where we update winSize and borderSize for the root window, enabling sprite confinement to work correctly, but keep the clip emptied so exposures are never generated. Signed-off-by: Daniel Stone <daniels@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-11dri2: Use the work queue to manage client sleepsAdam Jackson1-12/+16
In commit e43abdce964f5ed9689cf908af8c305b39a5dd36 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Feb 3 09:54:46 2016 +0000 dri2: Unblock Clients on Drawable release we try to wake up any blocked clients at drawable destruction. But by the time we get there, CloseDownConnection has already torn down state that AttendClient wants to modify. Using ClientSleep instead of IgnoreClient puts a wakeup function on a workqueue, and the queue will be cleared for us in CloseDownClient before (non-neverretain) resource teardown. Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-02-08dri2: Unblock Clients on Drawable releaseChris Wilson1-0/+3
If the Window is destroyed by another client, such as the window manager, the original client may be blocked by DRI2 awaiting a vblank event. When this happens, DRI2DrawableGone forgets to unblock that client and so the wait never completes. Note Present/xshmfence is also suspectible to this race. Testcase: dri2-race/manager Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-02-08dri2: Only invalidate the immediate Window upon SetWindowPixmapChris Wilson1-3/+2
All callers of SetWindowPixmap will themselves be traversing the Window heirarchy updating the backing Pixmap of each child and so we can forgo doing the identical traversal inside the DRI2SetWindowPixmap handler. Reported-by: Loïc Yhuel <loic.yhuel@gmail.com> Link: http://lists.x.org/archives/xorg-devel/2015-February/045638.html Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-28xfree86: Build parser for DRI config file subsection unconditionallyAdam Jackson1-8/+0
This applies regardless of which DRI you're asking for. Worse, leaving it out means breaking the config file syntax in a pointless way, since non-DRI servers can safely just parse it and ignore it. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-28xfree86: Remove ancient DRI build instructionsAdam Jackson2-552/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-01-27dri2: Sync i915_pci_ids.h and i965_pci_ids.h from mesaTimo Aaltonen2-6/+54
Adds Skylake, Kabylake and Broxton allowing them to use modesetting + glamor with dri2. Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com> Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2016-01-06Fix build when XSERVER_PLATFORM_BUS is not defined.Thomas Klausner1-0/+4
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2016-01-05modesetting should not reference gbm when it's not definedAlan Coopersmith1-0/+6
Fixes build errors of: present.c: In function 'ms_do_pageflip': present.c:410:17: error: 'drmmode_bo' has no member named 'gbm' new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front); ^ present.c:412:22: error: 'drmmode_bo' has no member named 'gbm' if (!new_front_bo.gbm) { ^ present.c: In function 'ms_present_check_flip': present.c:536:36: error: 'drmmode_bo' has no member named 'gbm' if (drmmode_crtc->rotate_bo.gbm) ^ Introduced by commit 13c7d53d Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-21xfree86: move check for driver->PreInit upPeter Hutterer1-11/+11
No real change, but if the driver is broken and doesn't provide a PreInit function, then we don't need to worry about logind. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-12-18xfree86: add NoMatchFoo directives for InputClass sectionsPeter Hutterer5-18/+103
InputClass sections use various MatchFoo directives to decide which device to apply to. This usually works fine for specific snippets but has drawbacks for snippets that apply more generally to a multitude of devices. This patch adds a NoMatchFoo directive to negate a match, thus allowing snippets that only apply if a given condition is not set. Specifically, this allows for more flexible fallback driver matching, it is now possible to use a snippet that says "assign driver foo, but only if driver bar wasn't already assigned to it". For example: Section "InputClass" Identifier "libinput for tablets" MatchIsTablet "true" NoMatchDriver "wacom" Driver "libinput" EndSection The above only assigns libinput to tablet devices if wacom isn't already assigned to this device, making it possible to select a specific driver by installing/uninstalling it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-12-18xfree86: whitespace fixPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-08systemd-logind.c: don't parse VT settings for non-seat0 X serversLaércio de Sousa1-1/+2
Since non-seat0 X servers no longer touch VTs, I believe these settings are unnecessary. Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-12-07x86emu: Squash a warningAdam Jackson1-1/+1
Apologies, should have caught this one when applying the previous x86emu patch. Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-07x86emu: Correctly handle 0x66 prefix for some instructionsJulian Pidancet1-50/+142
(Sorry for double posting) I repost this patch because I havn't got any replies from maintainers since I posted the initial patch back in March. Some instructions are not emulated correctly by x86emu when they are prefixed by the 0x66 opcode. I've identified problems in the emulation of these intructions: ret, enter, leave, iret and some forms of call. Most of the time, the problem is that these instructions should push or pop 32-bit values to/from the stack, instead of 16bit, when they are prefixed by the 0x66 special opcode. The SeaBIOS project aims to produce a complete legacy BIOS implementation as well as a VGA option ROM, entirely written in C and using the GCC compiler. In 16bit code produced by the GCC compiler, the 0x66 prefix is used almost everywhere. This patch is necessary to allow the SeaBIOS VGA option ROM to function with Xorg when using the vesa driver. SeaBIOS currently use postprocessing on the ROM assembly output to replace the affected instruction with alternative unaffected instructions. This is obviously not very elegant, and this fix in x86emu would be more appropriate. v2: - Decrement BP instead of EBP in accordance with the Intel Manual - Assign EIP instead of IP when poping the return address from the stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret - When poping EFLAGS from the stack in iret in 32-bit operand size mode, apply some mask to preserve Read-only flags. v3: - Rebase Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2015-12-07modesetting: create entities for pci and old probe. (v2)Dave Airlie1-23/+26
This moves the code from the platform case into a common function, and calls that from the other two. v2: Emil convinced me we don't need to lookup pEnt here, so let's not bother. Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-07modesetting: drop platform_dev pointer.Dave Airlie2-10/+1
This isn't used anywhere, so no point storing it until we need it. Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-03Xorg.wrap: activate libdrm based detection for KMS driversArkadiusz Miśkiewicz1-0/+1
Xorg.wrap includes code guarded with WITH_LIBDRM for detecting KMS drivers. Unfortunately it is never activated since code missed to include file which defines WITH_LIBDRM. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92894 Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-12-02Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups"Adam Jackson1-26/+41
Reported to break libinput: http://lists.freedesktop.org/archives/xorg-devel/2015-December/048091.html This reverts commit 1df07dc36ca145c59f51176d9ab2651112506d75.
2015-12-01hw/xfree86: Use NotifyFd for device and other input fd wakeupsKeith Packard1-41/+26
Remove code in xf86Wakeup for dealing with device and other input and switch to using the new NotifyFd interface. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01modesetting: Use NotifyFd for drm event monitoringKeith Packard1-11/+5
Replace the block/wakeup handlers with a NotifyFd callback. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01xf86: Bump ABI version to 21agoins1-1/+1
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alex Goins <agoins@nvidia.com>
2015-11-30Replace 'sun' with '__sun'Richard PALO7-22/+22
Globally replace #ifdef and #if defined usage of 'sun' with '__sun' such that strict ISO compiler modes such as -ansi or -std=c99 can be used. Signed-off-by: Richard PALO <richard@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-11-30dix: Remove redundant ChangeWindowPropertyAdam Jackson1-3/+4
Use dixChangeWindowProperty(serverClient, ...) instead. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2015-11-24xfree86: fix minor memory leakPeter Hutterer1-1/+4
xf86*StrOption returns a strdup Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18modesetting: No need to free the EGLImage just before freeing the pixmap.Eric Anholt1-6/+0
DestroyPixmap handles that just fine. This also lets us drop our use of the manual image destruction function (Note that the radeon driver still uses it in a similar fashion, though). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-11-10Also dump passive grabs on XF86LogGrabInfoMichael Stapelberg1-0/+2
Signed-off-by: Michael Stapelberg <stapelberg@google.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-10-30modesetting: Remove XF86_CRTC_VERSION checksDaniel Martin1-6/+1
The ifdef checks for XF86_CRTC_VERSION >= 3/5 are remnants from the out-of-tree driver. Within the tree, we can rely on: xf86Crtc.h:#define XF86_CRTC_VERSION 6 Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30modesetting: Free output_ids in drmmode_set_mode_major()Daniel Martin1-1/+3
We calloc() output_ids. Let's free() it, too. Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30modesetting: Handle failures in setting a CRTC to a DRM mode properlyDaniel Martin1-5/+6
This fixes a bug where running the card out of PPLL's when hotplugging another monitor would result in all of the displays going blank and failing to work properly until X was restarted or the user switched to another VT. [Michel Dänzer: Pass errno instead of -ret to strerror()] [Daniel Martin: Add \n to log message] Picked from xf86-video-ati 7186a87 Handle failures in setting a CRTC to a DRM mode properly Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-30vidmode: Drop the unused event codeAdam Jackson1-216/+6
As the code says, this is "far from complete". So far, in fact, that it's been basically untouched for twenty years (XFree86 3.1!). As far as I can tell it was never enabled in any XFree86 build, and certainly has never been enabled since Xorg 7.0. Also, K&R. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-28Xorg.man: update to reflect -nolisten tcp becoming defaultAlan Coopersmith1-2/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-28Xorg.man: move XLOCAL details to X(7) man page insteadAlan Coopersmith1-53/+2
These settings affect clients, not server, so belong there, next to the information about how to set $DISPLAY. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-10-27build: Remove stale miext/cw include pathsAdam Jackson3-4/+3
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>