Commit Graph

14902 Commits

Author SHA1 Message Date
Eric Anholt
835067a409 glamor: Drop a redundant check.
Above, we've already checked for ->fbo && ->fbo->fb and returned.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-02 10:05:59 -07:00
Eric Anholt
47b868492c glamor: Simplify some temp pixmap extents calculations.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
bfb6a290af glamor: Drop a dead flag to glamor_create_fbo_array().
v2: Don't forget to set priv->block_w/block_h like the wrapper used
    to.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2015-07-02 10:05:59 -07:00
Eric Anholt
fe3fedf280 glamor: Drop dead GLAMOR_FBO_DOWNLOADED flag.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
4472740941 glamor: Move doxygen for private structs into the structs.
This should hopefully keep the comments more up to date with the
structure comments.  While I'm here, I've reworded a few of them to be
more accurate, and dropped a bunch of stale comments.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
33d6384b29 glamor: Drop the dead "PBO" field in an FBO cache struct.
PBOs are only used at the whole pixmap level.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
1734aa2856 glamor: Remove dead gl_tex flag in the fbo struct.
This used to be used in the old copy_area path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
82d23fc729 glamor: Propagate the fact that pbo_valid is never set.
The code to set it was deleted in keithp's big rewrite.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-02 10:05:59 -07:00
Eric Anholt
0e3f1252da glamor: Avoid using GL_QUADS on VC4.
Improves text rendering from about 284k glyphs per second to 320k
glyphs per second.  There's no GL extension for probing this, because
of the philosophy of "Don't expose whether things are really in
hardware or not."

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:36 -07:00
Eric Anholt
f47e3f5395 glamor: Use proper Bools for some boolean values.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:36 -07:00
Eric Anholt
4001a7465e glamor: Provide a fallback path for using an index buffer to do quads.
Improves x11perf -aa10text performance by 1377.59% +/- 23.8198% (n=93)
on Intel with GLES2.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:35 -07:00
Eric Anholt
e8fc929d4a glamor: Use GL_EXT_map_buffer_range if present.
We were only looking for the desktop GL version of the extension, so
GLES2 missed out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:35 -07:00
Eric Anholt
4fc4cde0ce glamor: Use the normal GL_QUADS drawing helper in the render code.
We use this for all of our other performance-sensitive rendering, too.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:35 -07:00
Eric Anholt
c5e6fffbdd glamor: Drop CloseScreen-time GL resource cleanup code.
These will all be freed when the context is freed.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:35 -07:00
Eric Anholt
3d6dcad00d glamor: Fix text rendering on GLES2.
The GL_QUADS helper takes a number of quads, not a number of vertices.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-29 21:43:08 -07:00
Peter Harris
b4061cf5f7 Fix border tile origin when background is ParentRelative
According to
http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:CreateWindow
"The border tile origin is always the same as the background tile
origin."

ChangeWindowAttributes goes to some effort to make sure it repaints
the border tile whenever the background origin may have changed, but
miPaintWindow was ignoring the background origin.

Found by xts XChangeWindowAttributes-3

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-06-29 21:07:58 -07:00
Keith Packard
8a8d51358c Merge remote-tracking branch 'airlied/for-keithp' 2015-06-29 21:04:53 -07:00
Keith Packard
b22534d8e6 Merge remote-tracking branch 'jwrdecoede/for-keith' 2015-06-29 21:04:11 -07:00
Keith Packard
0a625adeec Merge remote-tracking branch 'anholt/glamor-next' 2015-06-29 21:01:34 -07:00
Keith Packard
84128c10bb Merge remote-tracking branch 'whot/for-keith' 2015-06-29 20:59:31 -07:00
Kenneth Graunke
13c7d53df8 modesetting: Implement page flipping support for Present.
Based on code by Keith Packard, Eric Anholt, and Jason Ekstrand.

v2:
- Fix double free and flip_count underrun (caught by Mario Kleiner).
- Don't leak flip_vblank_event on the error_out path (Mario).
- Use the updated ms_flush_drm_events API (Mario, Ken).

v3: Hack around DPMS shenanigans.  If all monitors are DPMS off, then
    there is no active framebuffer; attempting to pageflip will hit the
    error_undo paths, causing us to drmModeRmFB with no framebuffer,
    which confuses the kernel into doing full modesets and generally
    breaks things.  To avoid this, make ms_present_check_flip check that
    some CRTCs are enabled and DPMS on.  This is an ugly hack that would
    get better with atomic modesetting, or some core Present work.

v4:
- Don't do pageflipping if CRTCs are rotated (caught by Jason Ekstrand).
- Make pageflipping optional (Option "PageFlip" in xorg.conf.d), but
  enabled by default.

v5: Initialize num_crtcs_on to 0 (caught by Michel Dänzer).

[airlied: took over]
v6: merge async flip support from Mario Kleiner
free sequence after failed vblank queue
handle unflip while DPMS'ed off (Michel)
move flip tracking into its own structure, and
fix up reference counting issues, and add comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-30 13:44:09 +10:00
Dave Airlie
4342369e84 modesetting: don't try and load dri2
Since we are shipped with the server and the server has it built-in,
don't bother trying to load it.

Don't remove or invert the if statement on purpose as a later
patch adds stuff in here.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 13:44:09 +10:00
Dave Airlie
edec6394a4 modesetting: drop unused struct in vblank.c
this isn't used anywhere here.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 13:44:09 +10:00
Kenneth Graunke
bf262b4300 modesetting: Implement an ms_drm_abort_seq() function.
This is a specialization of ms_drm_abort that matches based on the drm
event queue's sequence number.

Based on code by Keith Packard.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-30 13:44:09 +10:00
Jason Ekstrand
b8ccc5d36b glamor: Add a new glamor_gbm_bo_from_pixmap() function.
v2: Rebase on commit e0788a0314 (drop "base").

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2015-06-30 13:44:09 +10:00
Kenneth Graunke
f2171d0a20 modesetting: Make ms_crtc_on non-static.
I want to use this in present.c.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-30 13:44:09 +10:00
Kenneth Graunke
f6853baeba modesetting: Improve the ms_flush_drm_events() API.
Previously, ms_flush_drm_events() returned a boolean value, and it was
very easy to interpret the meaning incorrectly.  Now, we return an
integer value.

The possible outcomes of this call are:
- poll() raised an error (formerly TRUE, now -1 - poll's return value)
- poll() said there are no events (formerly TRUE, now 0).
- drmHandleEvent() raised an error (formerly FALSE, now the negative
  value returned by drmHandleEvent).
- An event was successfully handled (formerly TRUE, now 1).

The nice part is that this allows you to distinguish errors (< 0),
nothing to do (= 0), and success (1).  We no longer conflate errors
with success.

v2: Change ms_present_queue_vblank to < 0 instead of <= 0, fixing an
    unintentional behavior change.  libdrm may return EBUSY if it's
    received EINTR for more than a second straight; just keep retrying
    in that case.  Suggested by Jasper St. Pierre.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-30 13:44:09 +10:00
Dave Airlie
7328fb3f2b modesetting: reverse prime support (v1.1)
This adds support for reverse prime to the modesetting driver.

Reverse prime is where we have two GPUs in the display chain,
but the second GPU can't scanout from the shared pixmap, so needs
an extra copy to the on screen pixmap.

This allows modesetting to support this scenario while still
supporting the USB offload one.

v1.1:
fix comment + ret = bits (Eric)

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:56 +10:00
Dave Airlie
1f10ee221e glamor: egl: add function to back a pixmap with a dma-buf. (v1.1)
Rather than create the pixmap, this uses the file descriptor
to change an existing pixmaps backing store.

This is required for reverse prime slaves, where we create
the slave pixmap, then set the backing store.

v1.1: use local pScreen (Eric)

Reviewed-by: Eric Anholt <eric@annholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:56 +10:00
Dave Airlie
a79fbfd707 modesetting: add output master support
This allows a glamor enabled master device to have
slave USB devices attached.

Tested with modesetting on SNB + USB.

It relies on the previous patch to export linear
buffers from glamor.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:55 +10:00
Dave Airlie
ea0e4d752b glamor: add support for allocating linear buffers (v2)
We need this for doing USB offload scenarios using glamor
and modesetting driver.

unfortunately only gbm in mesa 10.6 has support for the
linear API.

v1.1: fix bad define
v2: update the configure.ac test as per amdgpu. (Michel)
set linear bos to external to avoid cache. (Eric)

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:55 +10:00
Dave Airlie
5c55560538 xf86: restrict when we auto add devices as gpu devices.
Michel pointed out I broke Zaphod with the initial auto add
gpu devices change,

Fix this, by only auto adding GPU devices if we are screen 0
and there are no other screens in the layout. Anyone who
wants to assign GPU devices can specify it in the xorg.conf
for this use case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2015-06-30 12:17:55 +10:00
Dave Airlie
5064ee276f xf86Rotate: remove unused macros.
These macros aren't used anywhere.

v1.1: drop comment (Aaron)

Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:55 +10:00
Dave Airlie
8218dadd30 cursor: drop ARGB_CURSOR
I doubt anyone builds with this turned off or has done for a long
time.

It helps my eyes bleed slightly less when reading the code, I've left
the define in place as some drivers use it.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-30 12:17:51 +10:00
Chris Wilson
3c859112d3 xwayland: keep temp files out of the client mask
Xwayland opens anonymous files for its sharing buffers, move these
file descriptors out of the range of the client select mask to avoid
reaching the maximum number of clients prematurely.

https://bugs.freedesktop.org/show_bug.cgi?id=91072

Tested-by: Olivier Fourdan <fourdan@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-25 14:11:35 +02:00
Laércio de Sousa
8c86dd5160 configure.ac: fix code misplacing for KDRIVE_{KBD, MOUSE, EVDEV} auto-detection
KDrive input drivers "kbd", "mouse", and "evdev" should be automatically built
for linux systems. However, due to a code misplacing in configure.ac, the
auto-detection test is being performed AFTER the corresponding AC_DEFINEs' calls,
so that the drivers are NOT being built, regardless the test result.

This bug should be affecting previous xorg-server releases. Please consider
backporting this patch to all maintained ones!

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-24 20:10:43 +10:00
David Herrmann
780a69aff0 systemd-logind: do not rely on directed signals
Right now, Xorg does not install DBus matches for "PauseDevice" /
"ResumeDevice". Therefore, it should usually not receive those DBus
signals from logind. It is just a coincidence that systemd-logind sends
those signals in a directed manner right now. Therefore, dbus-daemon
bypasses the broadcast matches.

However, this is not ABI and Xorg should not rely on this. systemd-logind
is free to send those signals as broadcasts, in which case Xorg will
freeze the VT. Fix this by always installing those matches.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Keith Packard <keithp@keithp.com>
Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 09:42:31 +02:00
Hans de Goede
d3352d0987 Xorg.wrap.man: Fix spelling mistake in Xorg.wrap.1
This commit fixes a small mistake in Xorg.wrap.1 .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-06-23 09:42:19 +02:00
Eric Anholt
790311cec3 glamor: Don't try to disable attrib divisors without the extension.
Fixes epoxy assertion failures on vc4.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-06-19 19:11:05 -07:00
Eric Anholt
9c679d0605 glamor: Skip actual FBO setup in our glyph atlas.
VC4 (and many GLES2 renderers) can't render to GL_ALPHA, so our pixmap
would end up as GLAMOR_MEMORY and our dereference of the FBO would
setfault.  Instead, tell the pixmap creation that we don't need an FBO
at all.  Our glyph upload path was already glTexImage for non-a1, and
a more general software fallback for a1 (since the glyph is also in
system memory).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-06-19 19:11:03 -07:00
Eric Anholt
077bb1bdea glamor: Clean up some declarations in glyph rendering.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-06-19 19:11:01 -07:00
Eric Anholt
bf7a3bcb00 glamor: Actually allow glyphs of dimension 65 to 128 in the cache.
The cache was trying to allow glyph_max_dim in, but since we were
putting over 64x64 into HW memory, it would end up in the
single-glyph-per-render bail_one path.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-06-19 19:10:33 -07:00
Alexander Volkov
f4c3cac010 Xi: call UpdateDeviceState() even when the client is missing
The client window can be closed in the middle of a touch sequence,
e.g. Qt 4 closes popup windows on MousePress and Qt 5.5 will do it
on TouchBegin. In this case the state of mouse buttons will not be
updated on TouchEnd because ProcessTouchEvent() calls UpdateDeviceState()
only when the event has been sent to the client. It results in a
stuck left mouse button.

This patch leads to calling UpdateDeviceState() in case the client
can't be found.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-18 07:30:39 +10:00
Jeremy Huddleston Sequoia
9003a3e5c5 XQuartz: Silence -Wformat-security for NSRunAlertPanel
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-06-09 23:42:03 -07:00
Jeremy Huddleston Sequoia
3a6fa11575 XQuartz: Silence -Wunused-function
quartzKeyboard.c:741:1: warning: unused function 'macroman2ucs' [-Wunused-function,Unused Entity Issue]
macroman2ucs(unsigned char c)
^
1 warning generated.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-06-09 23:42:03 -07:00
Jeremy Huddleston Sequoia
9fe7f5ccad XQuartz: Silence -Wunused-variable
X11Controller.m:939:9: warning: unused variable 'remain' [-Wunused-variable,Unused Entity Issue]
    int remain;
        ^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-06-09 23:42:03 -07:00
Jeremy Huddleston Sequoia
0b9c324891 XQuartz: Silence -Wpointer-bool-conversion
X11Controller.m:417:17: error: address of function 'asl_log_descriptor' will always evaluate to 'true'
      [-Werror,-Wpointer-bool-conversion,Value Conversion Issue]
            if (asl_log_descriptor) {
            ~~  ^~~~~~~~~~~~~~~~~~
X11Controller.m:417:17: note: prefix with the address-of operator to silence this warning [Semantic Issue]
            if (asl_log_descriptor) {
                ^
                &

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-06-09 23:42:02 -07:00
Jeremy Huddleston Sequoia
7761106639 XQuartz: GLX: Use __glXEnableExtension to build extensions list
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2015-06-09 23:05:22 -07:00
Andrew Eikum
990cf5b282 dix: Send KeyPress and KeyRelease events to the XACE_KEY_AVAIL hook
While it's documented in the XACE spec, the XACE_KEY_AVAIL hook is
currently never actually invoked by the xserver.

This hook was added in 13c6713c82 (25 Aug 2006), but as the keyboard
processing was moved into XKB, the hook was forgotten and silently
dropped. The code calling this hook was removed by 7af53799c (4 Jan
2009), but it was probably already unused before that.

This patch re-adds support for this hook. The "count" hook parameter is
unused.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-10 14:14:29 +10:00
Andrew Eikum
5dc2a9aae4 xace: Add XaceHookIsSet helper function
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-10 14:14:25 +10:00