summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2017-09-05modesetting: Create scanout buffers using supported modifierslfrb-modifiers-v2Louis-Francis Ratté-Boulianne1-0/+56
Use most optimal buffer format (e.g. tiled/compressed) available for scanout. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05modesetting: Get supported formats/modifiers for scanoutLouis-Francis Ratté-Boulianne2-4/+119
Retrieve IN_FORMATS property from the plane. It gives the allowed formats and modifiers for BO allocation. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05modesetting: Use atomic modesetting to configure output/CRTCsLouis-Francis Ratté-Boulianne3-104/+316
To make sure we also use the same primary plane and to avoid mixing uses of two APIs, it is better to always use the atomic modesetting API when possible. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05modesetting: Add support for multi-plane pixmaps when page-flippingLouis-Francis Ratté-Boulianne3-7/+59
This allows the uses of CCS compressed or tiled pixmaps as BOs when page-flipping. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05modesetting: Use atomic modesetting API for pageflip if availableLouis-Francis Ratté-Boulianne5-4/+429
In order to flip between compressed and uncompressed buffers - something drmModePageFlip explicitly bans us from doing - we need to port use the atomic modesetting API. It's only 'fake' atomic though given we still commit for each CRTC separately and CRTC and connector properties are not set with the atomic API. The helper functions to retrieve DRM properties have been borrowed from Weston. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocationLouis-Francis Ratté-Boulianne1-3/+19
Using modifier might allow the driver to use a more optimal format (e.g. tiled/compressed). Let's try to use those if possible. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05glamor: Implement GetSupportedModifiersLouis-Francis Ratté-Boulianne2-14/+124
Implement function added in DRI3 v1.1. A newest version of libepoxy (>= 1.4.4) is required as earlier versions use a problematic version of Khronos EXT_image_dma_buf_import_modifiers spec. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-09-05glamor: Implement PixmapFromBuffers and BuffersFromPixmapLouis-Francis Ratté-Boulianne5-49/+171
It relies on GBM >= 17.1.0 where we can import BO with multiple planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER). Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2017-08-02meson: Fix xwayland build since xwayland-keyboard-grab.Eric Anholt1-0/+3
The version detect was erroring out with 1.9 protos installed, and we weren't building the new code. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-01xwayland: Add grab protocol supportOlivier Fourdan4-3/+112
The keyboard grabbing protocol for Xwayland is included in wayland-protocol 1.9. Update the wayland-protocol required version in both configure and meson builds and add support for this new protocol in Xwayland. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-31xfree86: Fix X -configure driver sort yet againAdam Jackson1-6/+5
There were two bugs here: The comparison function was not stable when one or more of the drivers being compared is a fallback, and the last driver in the list would never be moved. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-07-31modesetting: Fix PCI initialization on non-zero domainsAdam Jackson1-6/+4
libdrm's busid matching for the legacy three-integer bus string format simply ignores the domain number, rather than what we were doing here of packing the domain into the bus number. Whatever, just use the existing code to build a busid string, since that gets the domain right. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-07-20XQuartz: Hack around an issue that can occur on macOS due to background apps ↵Jeremy Huddleston Sequoia1-5/+24
incorrectly stealing focus Works around <rdar://problem/7150340>. Tested-by: Martin Otte <martinjotte@gmail.com> Tested-by: Tom Lane <tgl@sss.pgh.pa.us> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2017-07-06dri2: Sync i965_pci_ids.h from Mesa.Rodrigo Vivi1-0/+23
Copied from Mesa with no modifications. Gives us Coffee Lake and Cannon Lake PCI IDs. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-05wayland: Sync drm.xml with MesaAdam Jackson1-16/+19
... where it is named src/egl/wayland/wayland-drm/wayland-drm.xml and has its requests sorted by protocol version number, avoiding a warning from wayland-scanner. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-07-04modesetting: handle NULL cursor in drmmode_set_cursor.Dave Airlie1-0/+3
We had a bug reported with a touchscreen where we could end up in here with a NULL cursor, so let's not crash the X server. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-and-Tested-by: Daniel Martin <consume.noise@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-04xfree86: link to libinput(4) from the xorg.conf man pagePeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-06-27meson: Use --export-all-symbols when building PE/COFF objectsJon TURNEY1-2/+8
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27meson: Shuffle around subdirs so we build Xorg loadable modules after XorgJon TURNEY1-24/+26
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-27Move statically linked xorgxkb files from dixmods to a separate directoryJon TURNEY9-22/+27
[ajax: Fixed test/Makefile.am as well] Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-06-22xfree86: Move DRICreatePCIBusID to xf86Pci.hAdam Jackson2-2/+1
xf86str.h is parsed into sdksyms unconditionally but the symbol is only defined when building with PCI support. Move the decl to a header that sdksyms only parses when building PCI support. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-06-20glx: Remove some indirection around EXT_texture_from_pixmapAdam Jackson1-6/+2
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20dmx: Remove some not-very-interesting debug printsAdam Jackson1-63/+0
gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it might, and we also don't care. Just delete all this. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20dmx: Silence an unused-result warningAdam Jackson1-1/+2
Modern glibc is very insistent that you care about whether write() succeeds: ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(priv->fd, &event, sizeof(event)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20xfree86: Move DRICreatePCIBusID to the PCI codeAdam Jackson4-14/+14
This symbol is used by some DRI2+ drivers and there's nothing DRI1-specific about it. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20xfree86: Remove unused xf86EnableVTSwitchAdam Jackson2-42/+3
Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20dix: Remove extension aliasesAdam Jackson1-6/+0
This appears to be essentially unused. The only known client-side library for the SELinux extension is xcb, which does not look for the name "Flask". The "SGI-GLX" alias for GLX appears to be a bit of superstition at this point, NVIDIA's driver does not expose it and Mesa does not check for it. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2017-06-20xfree86: Document BusID PCI domain format in ddxDesign.xmlMichel Dänzer1-1/+2
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20xfree86: Document BusID PCI domain format in xorg.conf manpageMichel Dänzer1-4/+4
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20xfree86: Fix printing of PCI domain/bus in xf86MatchPciInstancesMichel Dänzer1-1/+1
It was attempting to use the <bus>@<domain> format accepted by the BusID stanza, but the two values were swapped. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20xfree86: Print BusID stanza compatible bus IDs for found devicesMichel Dänzer1-2/+2
The PCI domain has to be specified like this: "PCI:<bus>@<domain>:<device>:<function>" Example before: (--) PCI:*(0:0:1:0) 1002:130f:1043:85cb [...] (--) PCI: (0:1:0:0) 1002:6939:1458:229d [...] after: (--) PCI:*(0@0:1:0) 1002:130f:1043:85cb [...] (--) PCI: (1@0:0:0) 1002:6939:1458:229d [...] Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2017-06-20meson: Restore stub ossupportJon Turney1-1/+16
Don't build BSD ossupport when there is no specific support, build stubs Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-20xfree86/modes: Use RRTransformEqual in xf86RandR12CrtcSetMichel Dänzer1-2/+1
The memcmp didn't catch when e.g. only the filter changed. Tested by alternately running xrandr --output DVI-I-0 --scale-from 3840x2160 --filter bilinear xrandr --output DVI-I-0 --scale-from 3840x2160 --filter nearest Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2017-06-13meson: Fix test for whether we've built glamor-EGL.Eric Anholt1-1/+1
This matches the test we use for going into the glamor_egl subdir in ../../meson.build.
2017-06-13dmx: Remove includes of glxtokens.hEric Anholt2-2/+0
Our top-level glx.h include already provides all of the tokens we use, and fixes redefinition warnings in the meson build. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2017-06-13modesetting: Validate the atom for enum propertiesAdam Jackson1-1/+2
The client could have said anything here, and if what they said doesn't actually name an atom NameForAtom() will return NULL, and strcmp() will be unhappy about that. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-12xwayland: Implement tablet_tool_wheel for scrollingJason Gerecke2-0/+26
The 'tablet_tool_wheel' function for tablet scrolling was added back in 8a1defcc634 but left unimplemented. This commit fills in the necessary details, using the "clicks" count as the number of discrete scroll up/down events to send. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-12xwayland: Correct off-by-one error in tablet button numberingJason Gerecke1-2/+2
The 'tablet_tool_frame' function treats the button masks as though they are zero-indexed, but 'tablet_tool_button_state' treats them as one- indexed. The result is that an e.g. middle click event recieved from Wayland will be sent from the X server as a right-click instead. Fixes: 773b04748d0 ("xwayland: handle button events after motion events") Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Remove two unused proc pointers.Carlos Garnacho1-2/+0
Xwayland doesn't override these, so we don't need defining those in the xwl_screen struct. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Lock the pointer if it is confined and has no cursorCarlos Garnacho1-1/+28
In the typical pattern in games of "hide cursor, grab with a confineTo, warp constantly the pointer to the middle of the window" the last warping step is actually rather optional. Some games may choose to just set up a grab with confineTo argument, and trust that they'll get correct relative X/Y axis values despite the hidden cursor hitting the confinement window edge. To cater for these cases, lock the pointer whenever there is a pointer confinement and the cursor is hidden. This ensures the pointer position is in sync with the compositor's when it's next shown again, and more importantly resorts to the relative pointer for event delivery. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Update root window size when desktop size changesCarlos Garnacho2-1/+6
This fixes grabs on InputOnly windows whose parent is the root window failing with GrabNotViewable. This is due to window->borderSize/windowSize being computed as clipped by its parent, resulting in a null region. Setting up the right size on the root window makes the InputOnly size correct too, so the GrabNotViewable paths aren't hit anymore. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: "Accept" confineTo on InputOnly windowsCarlos Garnacho1-0/+9
Of sorts, actually make it confine to the pointer focus, as the InputOnly window is entirely invisible to xwayland accounting, we don't have a xwl_window for it. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-07xwayland: Allow pointer warp on root/None windowCarlos Garnacho1-0/+20
Of sorts, as we can't honor pointer warping across the whole root window coordinates, peek the pointer focus in these cases. Signed-off-by: Carlos Garnacho <carlosg@gnome.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-05xfree86: Add Option "PreferCloneMode"Michel Dänzer2-0/+9
When the default behaviour was changed from clone mode to horizontal extended layout, a boolean ScrnInfoRec member preferClone was introduced to choose the old default behaviour. Option "PreferCloneMode" allows setting this preferClone member. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-06-02glamor: Drop glamor_set_screen_pixmap().Eric Anholt2-7/+0
All that was left here was updating the FBO's size. However, the FBO size was always set correctly already through glamor_set_pixmap_texture() from whoever had attached a new BO to the pixmap. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-02Add meson.build for XWin server (v2)Jon Turney5-0/+319
This needs a meson with PRs #1784, #1792 and #1794 Future work: remove conditionals which are always on, and simplify redundant CYGDEBUG conditionals Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-02hw/xwin: Remove pretense of Xv supportJon Turney2-201/+2
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-02hw/xwin: Don't unconditionally include rootless.hJon Turney2-2/+4
Don't unconditionally include rootless.h, and so we don't need to add rootless to the include path unless building MWEXTWM. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-31xwayland: Don't load extension list more than onceLyude1-2/+3
When running an Xwayland server from the command line, we end up resetting the server every time all of the clients connected to the server leave. This would be fine, except that xwayland makes the mistake of unconditionally calling LoadExtensionList(). This causes us to setup the glxExtension twice in a row which means that when we lose our last client on the second server generation, we end up trying to call the glx destructors twice in a row resulting in a segfault: (EE) (EE) Backtrace: (EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9] (EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x70845bf] (EE) 2: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x32897d) [0x1196e5bd] (EE) 3: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x328a45) [0x1196e745] (EE) 4: /usr/lib64/dri/swrast_dri.so (__driDriverGetExtensions_virtio_gpu+0x32665f) [0x11969f7f] (EE) 5: Xwayland (__glXDRIscreenDestroy+0x30) [0x54686e] (EE) 6: Xwayland (glxCloseScreen+0x3f) [0x5473db] (EE) 7: Xwayland (glxCloseScreen+0x53) [0x5473ef] (EE) 8: Xwayland (dix_main+0x7b6) [0x44c8c9] (EE) 9: Xwayland (main+0x28) [0x61c503] (EE) 10: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x72b1401] (EE) 11: Xwayland (_start+0x2a) [0x4208fa] (EE) 12: ? (?+0x2a) [0x2a] (EE) (EE) Segmentation fault at address 0x18 (EE) Fatal server error: (EE) Caught signal 11 (Segmentation fault). Server aborting (EE) Easy reproduction recipe: - Start an Xwayland session with the default settings - Open a window - Close that window - Open another window - Close that window - Total annihilation occurs Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-29xfree86: Fix interpretation of xf86WaitForInput timeoutJason Gerecke1-0/+3
Commit aa6717ce2 switched xf86WaitForInput from using select(2) to using poll(2). Before this change, the timeout was interpreted as being in microseconds; afterwards it is fed directly to xorg_poll which interprets it as being in milliseconds. This results in the function potentially blocking 1000x longer than intended. This commit scales down the timeout argument before passing it to xorg_poll, being careful to ensure the result is not rounded down due to integer division. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>