Commit Graph

7310 Commits

Author SHA1 Message Date
Adam Jackson
a5dd7b890f dix: Squash some new gcc6 warnings
-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-29 11:19:58 -04:00
Andreas Schwab
23dfa01729 x86emu: Change include order to avoid conflict with system header
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-29 11:05:38 -04:00
Marek Chalupa
f48b0534f1 xwayland-shm: fortify fallocate against EINTR
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-25 15:29:40 -04:00
Emil Velikov
577bebe206 xfree86/parser: simplify #ifdef ladder
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-18 11:36:46 -04:00
Emil Velikov
537276a5b8 xfree86/parser: reuse StringToToken() in xf86getToken()
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-18 11:36:43 -04:00
Emil Velikov
944ea03d5b xfree86/parser: move StringToToken() definition further up
... 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-18 11:36:41 -04:00
Emil Velikov
b93be14b7d xfree86/parser: annotate xf86ConfigSymTabRec as constant data
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-18 11:36:29 -04:00
Adam Jackson
a1b13cda61 xfree86: Remove xf86RegisterRootWindowProperty
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-18 11:23:10 -04:00
Adam Jackson
e89c7f1c2a xfree86: Create EDID atom from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:23:10 -04:00
Adam Jackson
8e3010d7d8 xfree86: Remove a never-hit diagnostic message
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-18 11:23:10 -04:00
Adam Jackson
7961377567 xfree86: Make xf86SetDDCproperties work more than once (v2)
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-18 11:23:06 -04:00
Adam Jackson
8be83fff04 xfree86: Remove some leftovers from DisplayID support
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Adam Jackson
0cd2a24b61 xfree86: Unexport xf86Initialising, remove xf86ServerIsInitialising
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-18 11:22:58 -04:00
Adam Jackson
e70ee11a39 xfree86: Create VT atoms from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Adam Jackson
da9ee1eddd xfree86: Create seat atom from the root window callback (v2)
v2: Fix swapped callback args

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-04-18 11:22:58 -04:00
Olivier Fourdan
e8e5d83996 xwayland: Fix compiler warning in GLAMOR Xv
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-15 16:22:16 -04:00
Jon Turney
a6288f0954 hw/xwin: xcbify internal window manager
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-07 10:31:39 +01:00
Jon Turney
8114b8127f hw/xwin: In multiwindow mode, do window minimization entirely in the WM
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-07 10:31:13 +01:00
Jon Turney
6a64b9d7af hw/xwin: xcbify code for converting X11 icon to Win32 icon
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-04-07 10:30:48 +01:00
Jon Turney
0a69c1e2fa xwin/glx: Build fix for warnings about missing WGL extensioons
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-03-30 13:51:19 -04:00
Adam Jackson
b08526eecf glx: Implement GLX_EXT_libglvnd (v2)
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-30 11:13:57 -04:00
Adam Jackson
2e8781ead3 glx: Compute the GLX extension string from __glXScreenInit
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-30 11:13:57 -04:00
Adam Jackson
e21de4bf3c glx: Move glx_enable_bits up to the GLX screen base class
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-30 11:13:57 -04:00
Adam Jackson
23cce73221 xquartz/glx: Remove unused fields from the glx screen subclass
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-30 11:13:57 -04:00
Adam Jackson
36bcbf76dc glx: Enable GLX 1.4 unconditionally
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-30 11:13:57 -04:00
Adam Jackson
2a72789ee8 xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hack
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-30 11:13:57 -04:00
Adam Jackson
77bdaa1313 glx: Use __glXInitExtensionEnableBits in all backends (v2)
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-30 11:13:57 -04:00
Adam Jackson
9b2fc6d986 xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2)
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-30 10:47:59 -04:00
Adam Jackson
b2ef7df476 xquartz/glx: Error out for MakeContextCurrent(draw != read)
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-30 10:47:56 -04:00
Adam Jackson
410aec8255 glx: Remove server-side mention of GLX_MESA_swap_control
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-30 10:47:52 -04:00
Adam Jackson
3a21da59e5 glx: Remove default server glx extension string
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-30 09:37:41 -04:00
Olivier Fourdan
44e1c97ca6 xwayland: Pretend we support viewport in vidmode
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-28 14:10:59 -04:00
Olivier Fourdan
6e3a6e30a6 xwayland: do not include frequency in mode name
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-28 14:09:09 -04:00
Michel Dänzer
418fe365b4 xfree86/modes: Make sure the HW cursor is hidden when it should be
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>
2016-03-28 14:03:29 -04:00
Sonny Jiang
1c90797565 DRI2: add Polaris PCI IDs
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (Polaris10)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (Polaris11)

(Ported from Mesa commit f00c840578a70e479ffb99f6b64c73dc420179fa)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-03-28 12:32:25 -04:00
Adam Jackson
8ac0e05cc6 vfb: Re-add LD_EXPORT_SYMBOLS_FLAG to LDFLAGS
Accidentally removed, breaks Xvfb on cygwin.

Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-23 14:47:24 -04:00
Evgeny M. Zubok
b78897d0a0 xfree86: Change VBE version early-out to 1.2. (#22672)
Reporter has an S3 Trio with DDC and VESA 1.2.

Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-03-14 11:44:10 -04:00
Adam Jackson
184fbf7541 xfree86: Finish removing font modules
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-14 11:37:32 -04:00
Adam Jackson
69d1528bc3 xfree86: Font modules aren't a real thing
There are no longer any loadable font modules (not that they ever did
much in the first place), so stop pretending they're a defined ABI
surface.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-14 11:23:51 -04:00
Adam Jackson
744c292ae4 vidmode: Remove stray vidmodeproc.h from EXTRA_DIST
Was removed from the tree in:

    commit f175cf45ae
    Author: Olivier Fourdan <ofourdan@redhat.com>
    Date:   Wed Feb 10 09:34:34 2016 +0100

        vidmode: move to a separate library of its own

but not removed from the Makefile, which broke 'make dist'.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-11 13:50:32 -05:00
Eric Anholt
c01094c531 ephyr: Fix redisplay with glamor on GLES.
glamor_transfer.c is still totally broken, though.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2016-03-10 11:12:43 -05:00
Olivier Fourdan
da7724d3d2 xwayland: add glamor Xv adaptor
This adds an Xv adaptor using glamor.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-03-09 14:03:03 -05:00
Jon Turney
d11fdff50c hw/xwin: Tidy-up of winmsg.h
- winVMsg() has no uses, so remove
- winMsgVerb() has only one use, with default verbosity, so remove
- winMsg() is identical to LogMessage()
- Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
- Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:54 +00:00
Jon Turney
519b98765f hw/xwin: Remove GC privates, unused since native GDI engine removal
Unused since native GDI engine removal in commit 8465ee78

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:47 +00:00
Jon Turney
9d28ff2a9b hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:41 +00:00
Jon Turney
a309085a56 hw/xwin: Remove unused FinishCreateWindowsWindow engine function
This only ever had an (unused) implementation in the DDNL engine, which was
removed in commit 57bbf6e2.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:34 +00:00
Jon Turney
fa6f9d06a3 hw/xwin: Remove unused HotKeyAltTab engine function
This was only ever used by the primaryfb engine, removed in commit c79f824b

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:28 +00:00
Jon Turney
7bd25aa843 hw/xwin: Return FALSE to indicate failure in winSetEngine()
Return FALSE to indicate failure in winSetEngine(), if it couldn't find a
drawing engine to use

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:21 +00:00
Jon Turney
52e05b9282 hw/xwin: Remove WM_WM_MAP message, which is now unused
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:16 +00:00
Jon Turney
c42217aa3d hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent
Remove fAnotherWMRunning which tracks this message (although since it was
never initialized, I doubt this worked reliably), and the only use of that,
which was to prevent winMWExtWMRestackWindows() from being used when the
internalwm is running

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:07 +00:00