Commit Graph

17073 Commits

Author SHA1 Message Date
Jon Turney
7c266cafed Fix old-style definition warning for xf86OSInputThreadInit()
../hw/xfree86/os-support/stub/stub_init.c: In function ‘xf86OSInputThreadInit’:
../hw/xfree86/os-support/stub/stub_init.c:29:1: warning: old-style function definition [-Wold-style-definition]
2019-04-17 13:57:20 +01:00
Adam Jackson
6975807945 dix: Remove WindowRec::backStorage
This is only being set, never read.
2019-04-12 21:53:03 +00:00
Adam Jackson
0f477cc68b dix, composite: Optimize setting window backing store state
We hide CWBackingStore from the screen hook if nothing's actually
changing, which means compChangeWindowAttributes no longer needs to
compare the requested state with the present one.
2019-04-12 21:53:03 +00:00
Adam Jackson
4e101e7e3b mi: Simplify a conditional in miHandleExposures
miHandleExposures does two things: computes the region for which to
generate expose events, and (if the destination is a window) paints the
exposed regions with the background. The bit of this conditional we're
deleting here asserts that the source is either a pixmap or a window
without backing store. The only other possibility is a window _with_
backing store. In the old backing store implementation, this was where
you would recover bits from backing store. Since our "backing store" is
the redirected window pixmap, we know we've already copied all we could,
because CopyArea had already seen the entire window pixmap. So now in
that third case, we are still drawing to a pixmap (so there's no
background to paint) and we are still not generating events, so we can
exit early.

The comment above the function about recovering bits from backing store
is clearly misleading, so delete that too.
2019-04-12 21:53:03 +00:00
Aaron Plattner
147ed28bbf xfree86: Export xf86GPUScreens and xf86NumGPUScreens
Drivers may need to loop over the allocated screens during PreInit, for example
to consolidate xorg.conf options that apply to a GPU device as a whole.
Currently, this works for protocol screens becuase x86Screens is exported, but
does not work for GPU screens.

Export xf86GPUScreens and xf86NumGPUScreens for consistency with xf86Screens and
xf86NumScreens.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2019-04-12 21:45:19 +00:00
Eric Anholt
0a005c4fe4 test: Fix meson build with xvfb disabled.
Fixes #678

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-04-04 16:26:40 -07:00
Dave Airlie
8ab80fd505 xf86: set status to connected for monitors enabled in conf
If the user sets Option "Enable" "TRUE" for a monitor, the X
server will connect the connector a crtc but tell the user it
is disconnected.

However the user in this case is mutter, when it gets it's view
of the output configuration it sees the output is disconnected
and never sets it up again, which seems like the right thing to do.

If we let the user enable a monitor, lets just set it as always
connected.

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2019-04-02 19:20:07 +00:00
Jon Turney
f1790339d0 tests: Always separate rendercheck -f and -o options with a space 2019-04-02 13:12:42 +01:00
Michel Dänzer
fee147d75e gitlab-ci: Retry jobs after runner system failures
Up to twice, for a total of 3 attempts maximum.

This will hopefully avoid spurious CI pipeline failures due to
intermittent GitLab/docker infrastructure issues.

Inspired by
6140ed3d2c

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-04-01 16:38:04 +02:00
Michel Dänzer
b5ef99f26a gitlab-ci: Simplify autotools job script
Drop the verbose test log output, matching the meson job script.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-04-01 16:37:27 +02:00
Michel Dänzer
35561d4d1e gitlab-ci: Simplify meson job script
This way, the second ninja command line will be visible again as well in
the job output.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-04-01 16:36:51 +02:00
Roman Gilg
4adda1f635 present: Call present_vblank_scrap in screen mode
This cleans up some code duplication. No functional change.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2019-03-29 10:55:31 +01:00
Peter Hutterer
d7b1753d44 dix: leave last.valuators alone on slave switch
Terms:
dev->last.valuator[] is the last value given to us by the driver
dev->valuator.axisVal[] is the last value sent to the client
dev->last.scroll[] is the abs value of the scroll axis as given by the driver,
        used for button emulation calculation (and the remainder)

This function updates the device's last.valuator state based on the current
master axis state. This way, relative motion continues fluidly when switching
between devices. Before mouse 2 comes into effect, it's valuator state is
updated to wherever the pointer currently is so the relative event applies on
top of that.

This can only work for x/y axes, all other axes aren't guaranteed to have the
same meaning and/or may not be present:
- xtest device: no valuator 2
- mouse: valuator 2 is horizontal scroll axis
- tablet: valuator 2 is pressure

Scaling the current value from the pressure range into the range for
horizontal scrolling makes no sense. And it causes scroll jumps:

- scroll down, last.valuator == axisVal == 20
- xdotool click 1, the XTest device doesn't have that valuator
- scroll up
  - updateSlaveDeviceCoords reset last.valuator to 0 (axisVal == 20)
  - DeviceClassesChangedEvent includes value 20 for the axis
  - event is processed, last.value changes from 0 to -1
  - axisVal is updated to -1, causing a jump of -21

The same applies when we switch from tablet to mouse wheel if the pressure
value is 0 on proximity out (basically guaranteed). So let's drop this code
altogether and only leave the scaling for the relative x/y motion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-29 03:44:29 +00:00
Eric Anholt
3b26b90cb7 glamor: Fix a compiler warning since the recent OOM fixes.
Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
a63d796ce0 gitlab-ci: Build and test glamor using Xephyr.
I keep wanting this when reviewing people's glamor patches.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
ce5242fa2e gitlab-ci: Build and install a current version of rendercheck.
For really testing glamor, we want it installed.  Use master instead
of whatever version is in repos, because we'll want to update when new
tests are added.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
2a2f0ac3a9 gitlab-ci: Make shallow clones of git trees we'll be nuking at the end.
We only check out master, and delete .git when we're done, so save the
bandwidth.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
0dc271690b gitlab-ci: Don't bother building piglit.
We don't use any of piglit's tests, just the framework.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
8c1dac5f83 gitlab-ci: Install Mesa so we can test glamor.
We need the DRI swrast driver (for GLX in vfb), and also libgl (for
libepoxy in glamor)

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
3f3c489e51 test: Trim the Render ops that we test the composite paths on.
We cover all Render ops under the "blend" group, so when we're doing
the cross products of some formats for the masking operation, skip
most of the ops (covering just zero, one, and src/dst alpha blend
factors along with a definitely non-glamor-accelerated one) .

All the tests now complete in <20s of runtime on my skylake.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:22 -07:00
Eric Anholt
58c168ad93 test: Execute rendercheck tests without using piglit.
This gets us parallelism between rendercheck tests at the cost of
spinning up more Xvfbs, and nicer logging of the tests that are run.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-28 13:55:19 -07:00
Eric Anholt
82aab62295 docker: Stop dumping long-summary and meson test logs in the CI logs.
I've found that it's hard to find the original error in a dump full of
xserver debug spam for the passing cases, and when I needed to look at
this I end up using a proper editor on the file from the artifacts
view anyway.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:57:53 -07:00
Eric Anholt
05ded049ac test: Skip a few tests on glamor that are known to fail on llvmpipe.
Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:57:53 -07:00
Eric Anholt
30369c6345 gitlab-ci: Add a note about where to manage your containers.
Michel noted that I could do this instead of bumping the tag as I
developed, so leave that note for the next person.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:50:19 -07:00
Eric Anholt
164a37eac2 simple-xinit: Introduce an escaped "--" argument.
For testing xephyr-glamor on top of Xvfb in CI better, I want to be
able to make one command line describing the nested server invocation,
but that means I need to get two simple-xinits to split client/server
on different "--" arguments.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:50:19 -07:00
Eric Anholt
29aed56ec7 simple-xinit: Avoid hanging if the server fails to set up the display fd.
Early fatal errors may leave us with nothing in the displayfd pipe,
and we'd block forever.

Signed-off-by: Eric Anholt <eric@anholt.net>
2019-03-27 09:50:19 -07:00
Benjamin Tissoires
f706972309 CI: use wayland-ci-templates to manage the images
There shouldn't be a difference for users, but this way we do manage
all of our containers from freedesktop.org

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2019-03-27 17:06:53 +01:00
Michael Biebl
5a549c957a Revert "systemd-logind: Monitor systemd-logind going away"
systemd-logind since version 234 (released 2017-07-12) supports being
restarted without losing state [1]. From the systemd NEWS file [2]:

 * systemd-logind may now be restarted without losing state. It stores
   the file descriptors for devices it manages in the system manager
   using the FDSTORE= mechanism. Please note that further changes in
   other components may be required to make use of this (for example
   Xorg has code to listen for stops of systemd-logind and terminate
   itself when logind is stopped or restarted, in order to avoid using
   stale file descriptors for graphical devices, which is now
   counterproductive and must be reverted in order for restarts of
   systemd-logind to be safe. See
   https://cgit.freedesktop.org/xorg/xserver/commit/?id=dc48bd653c7e101.)

This reverts commit dc48bd653c.

Closes: #531

[1] https://github.com/systemd/systemd/pull/5600
[2] 9f09a95a7e
2019-03-21 00:09:22 +01:00
Jon Turney
f3567600cf meson: handle missing xkbcomp.pc better
Applying get_pkgconfig_variable() to a not-found dependency was always
documented as an error, but meson 0.49 now actually raises an error[1]:

  meson.build:110:4: ERROR:  'xkbcomp' is not a pkgconfig dependency

Check xkbcomp_dep is a suitable dependency type before applying
get_pkgconfig_variable() to it.

[1] but this is more by accident than design (see the discusssion at [2]
et seq.), so who knows where things will come to rest...

[2] https://github.com/mesonbuild/meson/pull/4444#issuecomment-442443301
2019-03-20 22:30:25 +00:00
Michel Dänzer
ef91da2757 present/scmd: Check that the flip and screen pixmap pitches match
If they don't, flipping will result in corrupted display.

Test case:

* Run Xorg at 1920x1080 with no window manager
* glxgears -geometry 2048x1080
2019-03-15 15:06:08 +00:00
Jon Turney
9114c4341c meson: Drop a meson version check
Drop some code conditional on meson version, which is not needed
since 7e046b94 bumped the minimum meson version
2019-03-14 21:23:23 +00:00
Jon Turney
c020769dbf
Add xf86OSInputThreadInit to stub os-support as well
stub os support also needs to provide xf86OSInputThreadInit, omitted in
ea1527a8
2019-03-13 16:07:36 +00:00
Michel Dänzer
2e18eec6f0 xwayland/present: Destroy sync_callback in xwl_present_cleanup
xwl_present_cleanup frees the struct xwl_present_window memory,
so if there's a pending callback, we have to destroy it to prevent
use-after-free in xwl_present_sync_callback.

Should fix issue #645.

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-03-13 10:36:11 +01:00
Adam Jackson
f665a9c9e6 mi: Shortcut miDoCopy/miCopyArea based on clipList
This is maybe one more comparison, but it catches FullyObscured windows
slightly earlier, so it's kind of a wash. The important thing is this
allows for paintable but unmapped windows, which will have non-empty
clipList.
2019-03-11 17:02:28 +00:00
Adam Jackson
3904216b01 dix: Outdent Unmap{Window,Subwindows} a bit
No functional change, just folding some conditionals together.
2019-03-11 17:02:28 +00:00
Olivier Fourdan
74479a99ec glamor: pixmap FBO may not be allocated
If `_glamor_create_tex()` fails to allocate the FBO because of
GL_OUT_OF_MEMORY error, the `pixmap_priv->fbo` is NULL.

However, `glamor_get_pixmap_texture()` doesn't actually check whether
the `pixmap_priv->fbo` is NULL and will segfault with a NULL pointer
dereference trying to access the `pixmap_priv->fbo->tex`.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/647
2019-03-11 16:18:26 +00:00
Paul Kocialkowski
8c4e8d9eff glamor: Fallback to system memory for RW PBO buffer allocation
We currently support two modes of operation for RW PBO buffers: one
that allocates a pack buffer with GL memory and one that uses system
memory when the former is not supported.

Since allocation with system memory is less likely to fail, add a
fallback to system memory when GL memory failed instead of bailing
out.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
de6b3fac1f glamor: Propagate glamor_prepare_access failures in copy helpers
glamor_prepare_access can fail for a few reasons, especially when
failing to allocate a PBO buffer. Take this in account and bail in
the copy helpers that call the helper when a failure happens.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
bc2e12239f glamor: Error out on out-of-memory when allocating PBO for FBO access
Packed buffer allocation (which happens at glBufferData time with the
buffer bound) can fail when there is no GL memory left.

Pick up the error when it happens, print a proper error message, do
some cleanup and bail.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Paul Kocialkowski
c98c7709c6 glamor: Propagate FBO allocation failure for picture to texture upload
When uploading a picture to a texture, glamor_upload_picture_to_texture
calls glamor_pixmap_ensure_fbo to ensure that there is backing FBO.
The FBO will be allocated if the picture's drawable pixmap does not have
one already, which can fail when there is no GL memory left.

glamor_upload_picture_to_texture checks that the call succeeded and will
enter the failure path if it did not. However, unlike many other
functions in glamor, this one has ret set to TRUE initially, so it needs
to be set to FALSE when a failure happens.

Otherwise, the error is not propagated and the failure path return TRUE.
This leads to a fault when trying to access the FBO pointer later on.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-03-08 14:29:40 +01:00
Andy Ritger
e51ebc18a7 xfree86/modes: Add "NoOutputInitialSize" option
Normally, the X server infers the initial screen size based on any
connected outputs.  However, if no outputs are connected, the X server
picks a default screen size of 1024 x 768.  This option overrides the
default screen size to use when no outputs are connected.  In contrast
to the "Virtual" Display SubSection entry, which applies unconditionally,
"NoOutputInitialSize" is only used if no outputs are detected when the
X server starts.

Parse this option in the new exported helper function
xf86AssignNoOutputInitialSize(), so that other XFree86 loadable drivers
can use it, even if they don't use xf86InitialConfiguration().

Signed-off-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2019-03-06 11:33:29 -05:00
Adam Jackson
7e046b9467 meson: Bump required meson version to 0.46
We were being naughty:

WARNING: Project specifies a minimum meson_version '>= 0.42.0' but uses features which were added in newer versions:
 * 0.46.0: {'compiler.has_multi_link_argument', 'compiler.has_link_argument'}
2019-03-05 11:34:21 -05:00
Michel Dänzer
0ec9a13c2a Revert "gitlab-ci: Only run docker-image stage if relevant source files change"
This reverts commit 8694395fcf.

Some scenarios have come to light where this failed to ensure the docker
image exists:

* If the master branch of a forked repository is used for an MR which
  doesn't modify .gitlab-ci.yml, the docker-image job may not run.
* If the docker-image job of the first pipeline in a forked repository
  is cancelled or fails for any reason, and .gitlab-ci.yml isn't
  modified for the next pipeline run.
2019-02-27 15:59:01 +00:00
Alan Coopersmith
12769c516d os-support/solaris: Set IOPL for input thread too
Since the Solaris kernel tracks IOPL per thread, and doesn't inherit
raised IOPL levels when creating a new thread, we need to turn it on
in the input thread for input drivers like vmmouse that need register
access to work correctly.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
ea1527a8a6 Add xf86OSInputThreadInit call from common layer into os-support layer
Allows os backends to run additional code as necessary to set up the
input thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
4ad21c3247 Add ddxInputThread call from os layer into ddx layer
Allows ddx's to run additional code as necessary to set up the
input thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Alan Coopersmith
7533fa9bd5 os-support/solaris: Drop ExtendedEnabled global variable
Keeping track of kernel state in user space doesn't buy us anything,
and introduces bugs, as we were keeping global state but the Solaris
kernel tracks IOPL per thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Michel Dänzer
432fad04e7 gitlab-ci: Run make distcheck in autotools build & test job
We don't set the PIGLIT_DIR and XTS_DIR environment variables for make
distcheck for now, otherwise it complains about files left behind by
piglit.
2019-02-22 10:22:49 +01:00
Michel Dänzer
f9bbc9d5ea glx,xquartz: Fix make distcheck
Guard BUILT_SOURCES and CLEANFILES by XWIN_GLX_WINDOWS/XQUARTZ.
2019-02-22 10:21:27 +01:00
Michel Dänzer
2f12c80175 gitlab-ci: Add autotools build & test job 2019-02-20 11:06:18 +01:00