Commit Graph

16779 Commits

Author SHA1 Message Date
Adam Jackson
03b2125005 dix: Remove LegalModifier()
This hasn't done anything besides return TRUE in a long long time.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28 16:25:17 -04:00
Adam Jackson
a23eba2a91 dix: Merge AbortDDX into ddxGiveUp
These are so close to identical that most DDXes implement one in terms
of the other. All the relevant cases can be distinguished by the error
code, so merge the functions together to make things simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28 16:25:12 -04:00
Adam Jackson
d78ac2f159 mi: Factor out miSaveScreen
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28 16:25:01 -04:00
Adam Jackson
0a9415cf79 glamor_egl: Don't initialize on llvmpipe
Mesa started supporting GL_OES_EGL_image on llvmpipe in 17.3, after this
commit:

    commit bbdeddd5fd0b797e1e281f058338b3da4d98029d
    Author: Gurchetan Singh <gurchetansingh@chromium.org>
    Date:   Tue Aug 1 14:49:33 2017 -0700

        st/dri: add drisw image extension

That's pretty cool, but it means glamor now thinks it can initialize on
llvmpipe. This is almost certainly not what anyone wants, as glamor on
llvmpipe is pretty much uniformly slower than fb.

This fixes both Xorg and Xwayland to refuse glamor in such a setup.
Xephyr is left alone, both because glamor is not the default there and
because Xephyr+glamor+llvmpipe is one of the easier ways to get xts to
exercise glamor.

The (very small) downside of this change is that you lose DRI3 support.
This wouldn't have helped you very much (since an lp glamor blit is
slower than a pixman blit), but it would eliminate the PutImage overhead
for llvmpipe's glXSwapBuffers. A future change should add DRI3 support
for the fb-only case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28 20:07:05 +00:00
Jon Turney
feca61cdb5 test: Initialize the pixmap in damage test 2018-09-28 20:02:54 +00:00
Adam Jackson
d1c00c859c xfree86: Remove -flippixels
No supported driver supports 1bpp anymore, nor has in a very long time.
This option only worked with vgahw anyway.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-27 16:50:22 +00:00
Adam Jackson
2bd631810d automake: Fix Linux build with --disable-apm --disable-acpi
Fixes: accd32a4 (xorg: Remove the XF86PM define.)
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-27 16:44:20 +00:00
Eric Anholt
89901e14d2 test: Add the start of a testsuite for damage.
Inspired by the previous bug, build something we can use to write
damage testcases, including testing for the bug.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-25 21:27:08 -07:00
Cedric Roux
bc36594e0e miext/damage: take care of the coordinate mode in damagePolyPoint
The mode (CoordModeOrigin or CoordModePrevious) was not taken into
account when computing the box. The result was a bad drawing of
points in some situations (on my hardware/software configuration,
calling XDrawString followed by XDrawPoints in the mode
CoordModePrevious).

Signed-off-by: Cedric Roux <sed@free.fr>
Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-25 21:27:08 -07:00
Olivier Fourdan
734b2d6907 xwayland: Use double for xwl_tablet_tool
So we do not lose subpixel precision in Xwayland.

Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/libinput/libinput/issues/138
2018-09-26 04:14:16 +00:00
Jon Turney
2f424df0ca hw/xwin/glx: Fix logging about WGL pxfs with overlays
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
d63f9dddeb hw/xwin/glx: Use multisample attributes with wglChoosePixelFormatARB()
Seems like this was omitted in error

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
e3398d921b hw/xwin/glx: Add GLX_ARB_framebuffer_sRGB extension
v2:
Fix a bogus warning about a missing pixelformat attribute issued for every
pixelformat when WGL_ARB_framebuffer_sRGB isn't available

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
1fc240c687 hw/xwin/glx: publish GLX create_context extensions
Future work: To properly support GLX_ARB_create_context in indirect mode, we
need to use wglCreateContextAttribsARB() rather than wglCreateContext(),
when attribs are provided, rather than just dropping attribs on the floor,
as we currently do.

That probably entails removing the deferred context creation and instead
using a temporary window, as direct WGL does.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
67b47d50df hw/xwin/glx: Add support for float format fbconfig GLX extensions
v2:
Set renderType more correctly

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
6be9681eb9 hw/xwin/glx: Make WGL -> GLX extension mapping table-driven
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
ad6b4113cd hw/xwin/glx: Fallback to ChoosePixelFormat() if wglChoosePixelFormatARB() fails
In glxWinSetPixelFormat() handle the case where wglChoosePixelFormatARB()
fails and fallback to ChoosePixelFormat()

It seems for some drivers, wglChoosePixelFormatARB() can fail when the
provided DC doesn't belong to the driver (e.g. it's a compatible DC for a
bitmap, so allow a fallback to ChoosePixelFormat() if it fails.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:09 +01:00
Jon Turney
8c0adf404a hw/xwin/glx: Don't create fbConfigs for un-accelerated pixelFormats
Exposing these pixelFormats is problematic: they are provided by the 'GDI
Generic' renderer, which doesn't support the same set of extensions as the
IGD providing the more capable pixelFormats.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:10 +01:00
Ross Burton
6a2ce6c5da compiler.h: only use inx/outx on ARM with glibc
musl only implements inx/outx on x86, so check for __GLIBC__ instead of
__linux__.

Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-09-25 14:25:56 +00:00
Ross Burton
5f65a6246f xorg-server.m4: just all cflags instead of just sdkdir
Instead of fetching just the sdkdir variable of xorg-server using pkg-config,
simply get all of the CFLAGS.  Aside from completeness, this helps builds in
sysroots as pkg-config knows what to do with --cflags but doesn't remap
arbitrary variables.

Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-09-20 20:12:24 +01:00
Eric Anholt
19f6cb570b shm: Pick the shm dir at run time, not build time.
Prodding the builder's filesystem for tmp dirs doesn't necessarily
tell you anything about what the actual host's filesystem is going to
look like, so we should just try the dirs at runtime.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 21:36:16 +00:00
Eric Anholt
804a9b4f57 shm: reindent shm_tmpfile to follow our standards.
Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 21:36:16 +00:00
Eric Anholt
b8b64cd627 xorg: Don't log "Build Operating System: Linux 4.9.0-5-amd64 x86_64 Debian"
I don't think this is useful information to have in the log, and it's
a bunch of autotools and meson logic to produce it.

Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 13:15:04 -07:00
Eric Anholt
bfa6e84641 meson: Add configure option and autodetection of HAVE_INPUTTHREAD.
Signed-off-by: Eric Anholt <eric@anholt.net>
2018-09-19 13:10:29 -07:00
Adam Jackson
a56da0ff28 include: Remove now-dead declarations
60ec8ead broke the autotools build:

    sdksyms.o:(.data+0x58): undefined reference to `InitConnectionLimits'
    sdksyms.o:(.data+0x2ec8): undefined reference to `xf86ServerName'
    collect2: error: ld returned 1 exit status
    Makefile:811: recipe for target 'Xorg' failed

Likewise 3a4d7c79 for InitConnectionLimits.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 17:23:53 -04:00
Adam Jackson
a2c1260958 xfree86: Remove vestigial lastScrnFlag
Only the mga XAA code ever set this (hence the compat macro), since XAA
is long gone this can go too.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:47:15 +00:00
Adam Jackson
c7414f4d07 xfree86: Remove NoTrapSignals
This was dangerous on UMS and largely pointless on KMS.
2018-09-12 20:47:15 +00:00
Adam Jackson
d1aeaad5c6 xfree86: Remove a fallback path we never hit
If it's really this important we should just do it and not complain. We
never do it so it must not matter.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:47:15 +00:00
Adam Jackson
771980fc02 xfree86: Remove some not-terribly-useful debugging
I'm sure printing the address of function pointers in modules you'd
loaded might have made sense back when we rolled our own dlopen, but we
got better.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:47:15 +00:00
Adam Jackson
6a094185d1 xfree86: Remove some redundant zero-fill for ScrnInfoRec
xf86AllocateScreen() callocs these for us.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:47:15 +00:00
Adam Jackson
60ec8eadc3 xfree86: Remove unused xf86GetServerName()
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:47:15 +00:00
Adam Jackson
a41ccaa085 gitlab: Skip the docker-in-docker step
No idea which cult's cargo I was looking at there. Cuts about a minute
off the build time.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 20:43:42 +00:00
Adam Jackson
3a4d7c79e7 dix: Remove MaxClients
This variable was no longer being read anywhere. MAXCLIENTS the macro is
the compile-time maximum limit, LIMITCLIENTS the macro is the default
limit, LimitClients the variable is the limit for the current server.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 19:31:07 +00:00
Adam Jackson
7d689f049c xfree86: Fix Option "MaxClients" validation
The old code would not in fact validate the option value, though it
might complain about it in the log. It also didn't let you set some
legal values that the -maxclients command line option would.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 19:31:07 +00:00
Adam Jackson
d791c8e5ab dga: Make shutdown less magical and/or terrifying
DGAShutdown() walks every screen and attempts to reset the mode.  That's
maybe a reasonable thing to do, although the explicit loop is certainly
a bad smell.

In ddxGiveUp it's called after we've torn down the vga arbiter - and in
fact most of the rest of screen state - which is... very very bad.  The
other place it's called is from the Control-Alt-BackSpace handler, where
we don't even attempt to do vga arb setup, and where in any case we're
going to escape the main loop eventually anyway.

Move all that cleanup work inside DGACloseScreen. This means it happens
earlier in server teardown than previously, but not in a way you're ever
going to be upset about.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 19:18:05 +00:00
Adam Jackson
3d06d111b2 dga: Simplify mieq handler registration
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 19:18:05 +00:00
Adam Jackson
801977e825 mi: Hush mieqSetHandler for no-op changes
If we set the handler to the thing it's already set to, that's fine.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-12 19:18:05 +00:00
Dave Airlie
ba0f5d854f devices: break after finding and removing device from lists
Coverity complains about a use after free in here after the
freeing, I can't follow the linked list so well, but whot
says the device can only be on one list once, so break should
fix it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
c4591ea171 mibltblt: free prgnSrcClip on error path.
Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
7583939512 xkb: fix what looks to be a copy-paste error with first vs firstMM
Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
cad3a1a82d posix_tty: free leak of xf86SetStrOption return value.
Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
b6c29a881e modesetting: get pEnt after error checks
This saves us having to make sure we clean it up.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
f0a5c0d1fd glamor: fix leak of fs_getcolor_source.
This is created using XNFstrdup, so it needs to be freed.

Pointed out by coverity.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
c7fa6a0a0d fboverlay: move bpp checks above malloc
Avoids having to free the malloced object.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:48 +10:00
Dave Airlie
51ae6126dc xi: free modifiers_failed on error path. (v2)
Pointed out by coverity.

v2: set modifies_failed to NULL at start (whot)

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 12:26:28 +10:00
Dave Airlie
3439929c51 shm: move shmsize verify before allocating the drawable.
Otherwise if the VERIFY_SHMSIZE macro fails we leak the drawables
we allocated earlier.

Noticed by coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-12 10:30:13 +10:00
Adam Jackson
047794e350 xselinux: warning fix
../Xext/xselinux_ext.c: In function ‘SELinuxExtensionInit’:
../Xext/xselinux_ext.c:692:21: warning: variable ‘extEntry’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-11 20:03:38 +00:00
Julien Isorce
f4115bcc8c glamor: add support for NV12 in Xv
Useful when video decoders only output NV12. Currently
glamor Xv only supports I420 and YV12.

Note that Intel's sna supports I420, YV12, YUY2, UYVY, NV12.

Test: xvinfo | grep NV12
Test: gst-launch-1.0 videotestsrc ! video/x-raw, format=NV12 ! xvimagesink

v2: Combine the two texture2Ds on u_sampler.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-09-11 15:54:57 -04:00
Julien Isorce
44f5885686 glamor: add support for GL_RG
Allow to upload the CbCr plane of an NV12 image into a GL texture.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-09-11 15:54:57 -04:00
Julien Isorce
f98ff253c7 xfree86: define FOURCC_NV12 and XVIMAGE_NV12
Useful for glamor.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-09-11 15:54:57 -04:00