summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-05-06modesetting: fix build with glamor disabled.Dave Airlie1-0/+4
Fix build without --enable-glamor. Caught by the arm tinderbox. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-04xfree86: drop unneeded strdup for modulepath/logfileEmil Velikov1-12/+2
The destination variable is never freed, thus we even plug some memory leaks. v2: Rebase against updated xf86CheckPrivs() helper. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04xfree86: use the xf86CheckPrivs() helper for modulepath/logfileEmil Velikov1-27/+23
v2: Rebase against updated xf86CheckPrivs() helper. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04xfree86: factor out the check priviliges and print a big warningEmil Velikov1-14/+12
Current message was quite off "file specified must be a relative path" and alike. Just factor it out and use "path/file" as needed. v2: Rework error message, drop "Using default", print actual arg value. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-04modesetting: set capabilities up after glamor and enable offload caps.Dave Airlie1-12/+16
This moves the capabilites setting to after glamor is initialised, and enables the offload caps in cases where they work. This enables DRI2 PRIME support with modesetting. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04xf86Crtc: don't set the root window property on slave GPUs.Dave Airlie1-1/+2
Slave GPUs don't have a root window to set this on, so don't. This fixes some crashes I saw just playing around. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04modesetting: set driverPrivate to NULL after closing fd.Dave Airlie1-1/+1
Otherwise ms_ent_priv will return NULL and things will fall apart. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-04modesetting: Consistent whitespace in driver.cAlex Goins1-18/+18
For some reason a couple of the dirty functions in driver.c used 8 spaces per tab instead of 4 like the rest of the file. Fix this to make it more consistent and give me more room to work in ms_dirty_update in subsequent commits. v1: N/A v2: N/A v3: N/A v4: Initial commit Signed-off-by: Alex Goins <agoins@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-04XQuartz: Update copyright yearsJeremy Huddleston Sequoia1-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-04XQuartz: Add --with-bundle-version and --with-bundle-version-string ↵Jeremy Huddleston Sequoia2-3/+5
configure options Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03XQuartz: Add --with-sparkle-feed-url configure optionJeremy Huddleston Sequoia2-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03XQuartz: Update release feed URL to use new https URLJeremy Huddleston Sequoia1-14/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-05-03xfree86: add support for MatchIsTabletPadPeter Hutterer5-0/+19
The tablet pads have been separate kernel devices for a while now and libwacom has labelled them with the udev ID_INPUT_TABLET_PAD for over a year now. Add a new MatchIsTabletPad directive to apply configuration options specifically to the Pad part of a tablet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-02modesetting: port clean start code from amdgpu. (v2)Dave Airlie3-12/+36
Both radeon and amdgpu don't set the mode until the first blockhandler, this means everything should be rendered on the screen correctly by then. This ports this code, it also removes the tail call of EnterVT from ScreenInit, it really isn't necessary and causes us to set a dirty mode with -modesetting always anyways. v2: reorder set desired modes vs block handler as done for amdgpu. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-02modesetting: add support for background none.Dave Airlie4-26/+106
This adds support using glamor for background None. loosely based off the amdgpu code. relies on the glamor_finish code. Acked-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-29kdrive: Nuke a bunch of dead codeAdam Jackson1-441/+0
gcc6 says: keyboard.c:46:21: warning: ‘linux_to_x’ defined but not used Only referenced by a bunch of long if-0'd code, so chuck it all out. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29dix: Squash some new gcc6 warningsAdam Jackson1-1/+1
-Wlogical-op now tells us: devices.c:1685:23: warning: logical ‘and’ of equal expressions Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-29x86emu: Change include order to avoid conflict with system headerAndreas Schwab2-9/+1
R_SP is also defined in <sys/ucontext.h> on m68k. Also remove duplicate definitions. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Andreas Schwab <schwab@suse.de>
2016-04-25xwayland-shm: fortify fallocate against EINTRMarek Chalupa1-2/+8
If posix_fallocate or ftruncate is interrupted by signal while working, we return -1 as fd and the allocation process returns BadAlloc error. That causes xwayland clients to abort with 'BadAlloc (insufficient resources for operation)' even when there's a lot of resources available. Fix it by trying again when we get EINTR. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-18xfree86/parser: simplify #ifdef ladderEmil Velikov1-22/+9
Rather than 'hacking' around symbol names and providing macros such as 'Local' just fold things and make the code more readable. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-04-18xfree86/parser: reuse StringToToken() in xf86getToken()Emil Velikov1-8/+2
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18xfree86/parser: move StringToToken() definition further upEmil Velikov1-14/+12
... so that we can use it without the forward declaration. Plus we're doing to reuse it in the next commit ;-) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18xfree86/parser: annotate xf86ConfigSymTabRec as constant dataEmil Velikov18-37/+33
Add the const notation to all the static storage as well as the functions that use it - xf86getToken(), xf86getSubTokenWithTab(), StringToToken() and xf86getStringToken(). Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18xfree86: Remove xf86RegisterRootWindowPropertyAdam Jackson6-146/+1
All consumers have been ported to the root window callback, so this can all be nuked. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Create EDID atom from the root window callback (v2)Adam Jackson1-22/+9
v2: Fix swapped callback args Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Remove a never-hit diagnostic messageAdam Jackson1-11/+4
Practically speaking, the EDID major version is never not 1. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Make xf86SetDDCproperties work more than once (v2)Adam Jackson1-6/+29
We can call this more than once via xf86OutputSetEDID since hotplug is actually a thing in RANDR 1.2, but xf86RegisterRootWindowProperty merely adds the data to a list to be applied to the root at CreateWindow time, so calls past the first (for a given screen) would have no effect until server regen. Once we've initialised pScrn->pScreen is filled in, so we can just set the property directly. v2: Removed pointless version check, deobfuscate math (Walter Harms) Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Remove some leftovers from DisplayID supportAdam Jackson2-9/+2
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Unexport xf86Initialising, remove xf86ServerIsInitialisingAdam Jackson4-21/+1
Neither of these are used from outside the server. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Create VT atoms from the root window callback (v2)Adam Jackson1-42/+25
v2: Fix swapped callback args Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18xfree86: Create seat atom from the root window callback (v2)Adam Jackson1-20/+19
v2: Fix swapped callback args Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-15xwayland: Fix compiler warning in GLAMOR XvOlivier Fourdan1-1/+1
XvWindowMask is defined as 0x00020000 and cannot fit in the XvAdaptor type which is defined as an unsigned char, thus causing a compiler warning: xwayland-glamor-xv.c: In function ‘xwl_glamor_xv_add_adaptors’: xwayland-glamor-xv.c:339:16: warning: large integer implicitly truncated to unsigned type [-Woverflow] This XvWindowMask value is actually not used for XvAdaptor itself but by the server in its xf86xv implementation, so we don't even need that mask in our xwayland-glamor-xv implementation. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-04-07hw/xwin: xcbify internal window managerJon Turney3-563/+588
Convert the code for the multiwindow mode internal window manager to xcb xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type sizing issues v2: Various fixes v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND v4: Fix indentation, add some error handling. Fix a bug with ConfigureNotify handling v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07hw/xwin: In multiwindow mode, do window minimization entirely in the WMJon Turney3-43/+20
Remove winMinimizeWindow(), implement as UpdateState() in the WM instead, which uses getHwnd() to map a Window XID to a HWND (like everything else in the WM), rather than peering into the servers internal data structures. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07hw/xwin: xcbify code for converting X11 icon to Win32 iconJon Turney6-65/+98
Convert the code for converting an X11 icon to Win32 icon from Xlib to xcb. v2: some warning fixes in winXIconToHICON() v3: declaration-after-statement warning fixes v4: printf format fixes v5: convert in place rather than in a library This also avoids the xlib/xserver namespace collision issues, so winmultiwindowicons.h can be included everywhere it should be, which fixes compilation with -Werror=implicit-function-declaration Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-30xwin/glx: Build fix for warnings about missing WGL extensioonsJon Turney1-3/+3
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-03-30glx: Implement GLX_EXT_libglvnd (v2)Adam Jackson1-0/+6
For the dri2 backend, we depend on xfree86 already, so we can walk the options for the screen looking for a vendor string from xorg.conf. For the swrast backend we don't have that luxury, so just say mesa. This extension isn't really meaningful on Windows or OSX yet (since libglvnd isn't really functional there yet), so on those platforms we don't say anything and return BadValue for the token from QueryServerString. v2: Use xnf* allocators when parsing options (Eric and Emil) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Compute the GLX extension string from __glXScreenInitAdam Jackson2-25/+0
Now that the enable bits are in the screen base class we can compute this in one place, rather than making every backend do it. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Move glx_enable_bits up to the GLX screen base classAdam Jackson2-17/+11
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30xquartz/glx: Remove unused fields from the glx screen subclassAdam Jackson1-3/+0
dmt:~/git/xserver% git grep -E '\<(index|num_vis)\>' hw/xquartz/GL hw/xquartz/GL/indirect.c: int index; hw/xquartz/GL/indirect.c: int num_vis; Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Enable GLX 1.4 unconditionallyAdam Jackson2-23/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hackAdam Jackson1-10/+0
This doesn't seem very useful, and we're about to implement 1.4 across the board, so some WGL extensions will become required. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Use __glXInitExtensionEnableBits in all backends (v2)Adam Jackson2-31/+10
On xquartz this enables SGI_make_current_read, which is a mostly harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which is fine because no pbuffer-enabled configs are created. On xwin this enables SGIX_pbuffer and ARB_multisample in all cases. Again this is harmless if the backend doesn't support the features, since no fbconfigs will be created to expose them. It also adds SGIX_visual_select_group to both xquartz and xwin. Amusingly, both were filling in the appropriate field in the fbconfig already. v2: Warn about missing WGL extensions (Emil) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2)Adam Jackson1-10/+14
This seems to be fairly universal these days, and if it doesn't exist the only thing you break is separate drawable and readable, which is a rare feature to use. So pretend it's always there and just throw an error on MakeCurrent if it isn't, and don't consider it when computing the GLX version number. v2: Fix type-o for glxWinScreen (Jon Turney) Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30xquartz/glx: Error out for MakeContextCurrent(draw != read)Adam Jackson1-0/+3
CGL doesn't have a way to express this directly, unlike EGL WGL and GLX. It might be implementable, but it's never actually worked, and it's a fairly niche feature so we're better off throwing an error if someone attempts it. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Remove server-side mention of GLX_MESA_swap_controlAdam Jackson1-4/+1
This extension is direct-only and has no GLX protocol. We don't even track an enable bit for it, trying to turn it on is pointless. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30glx: Remove default server glx extension stringAdam Jackson2-4/+0
This existed only to be strdup'd and then immediately freed. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-28xwayland: Pretend we support viewport in vidmodeOlivier Fourdan1-4/+15
Some games (namely openttd) will raise an XError and fail with a BadValue if their request to XF86VidModeSetViewPort fails. Support only the default zoom and viewport, fail for everything else. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-03-28xwayland: do not include frequency in mode nameOlivier Fourdan1-2/+2
Some applications (e.g. using lwjgl) try to parse the output of the xrandr command and get confused with the mode name returned by Xwayland, because it contains "@[frequency]" (e.g. "1024x640@60.0Hz"). Remove the @[frequency] part of the mode name to match what is found in usual mode names on regular X servers to please those applications. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94589 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-03-28xfree86/modes: Make sure the HW cursor is hidden when it should beMichel Dänzer1-0/+6
When the HW cursor is hidden (e.g. because xf86CursorResetCursor triggers a switch from HW cursor to SW cursor), the driver isn't notified of this for disabled CRTCs. If the HW cursor was shown when the CRTC was disabled, it may still be displayed when the CRTC is enabled again. Prevent this by explicitly hiding the HW cursor again after setting a mode if it's currently supposed to be hidden. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94560 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>