aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2018-10-05output: don't trigger a frame immediately in schedule_frameemersion
This desynchronizes our rendering loop with the vblank cycle. In case a compositor doesn't swap buffers but schedules a frame, emitting a frame event immediately enters a busy-loop. Instead, ask the backend to send a frame when appropriate. On Wayland we can just register a frame callback on our surface. On DRM we can do a no-op pageflip. Fixes #617 Fixes swaywm/sway#2748
2018-10-04output: add presentation refresh predictionemersion
2018-10-04Rename get_present_clock to get_presentation clock, use itemersion
2018-10-04backend: add get_present_clockemersion
2018-10-04output: send present event from all backendsemersion
2018-10-04output: add present eventemersion
2018-10-04Merge pull request #1262 from nyorain/session_fixDrew DeVault
Improve session handling
2018-10-04Use sd_bus_get_property_trivial & remove numberingnyorain
2018-10-04backend/drm: update EDID manufacturers databaseemersion
2018-10-03backend/drm: reset gamma table on VT switchemersion
2018-10-03output: make gamma size a size_t and gamma table constemersion
2018-09-28backend/drm: don't free connector immediatelyemersion
When a pageflip is pending, we'll get a DRM event for the connector in the future. We don't want to free the connector immediately otherwise we'll use-after-free in the pageflip handler. This commit adds a new state, "DISAPPEARED". This asks the pageflip handler to destroy the output after it's done pageflipping.
2018-09-24Rework session handlingnyorain
Sessions can now be retrieved from a backend in a more general manner. Multi-backend gets back its `session` field that contains the session if one was created, removing the interfacing from multi backend with the drm backend directly. This adds the possibility to use sessions even without the drm backend. It additionally fixes the bug that 2 session objects got created when WLR_BACKENDS were set to "libinput,drm". To allow vt switching without drm backend (and drm fd) on logind, start listening to PropertiesChanged signals from dbus and parse the session "Active" property when no master fd was created (this does not change current drm backend behaviour in any way).
2018-09-21Apply multiseat fixes to FreeBSD direct backendsghctoma
This commit applies the multiseat fixes that are part of PR #1063 ( commits 964e0a50 and 47895d2) to the FreeBSD direct backend.
2018-09-19Introduce wlr_multi_for_each_backendRyan Dwyer
2018-09-18backend/drm: add assertionsemersion
2018-09-18backend/x11: add assertionsemersion
2018-09-18backend/wayland: add assertionsemersion
2018-09-18backend/session: add assertionsemersion
2018-09-18backend/multi: add assertionsemersion
2018-09-18backend/libinput: add assertionsemersion
2018-09-18backend/headless: add assertionsemersion
2018-09-18Add support for WLR_SESSION env variablerandom human
Valid values are "logind"/"systemd" and "direct". If WLR_SESSION is set, only its value is potentially tried; it will not try any other option.
2018-09-15backend/drm: steal CRTCs from disabled outputsemersion
This commit allows outputs that need a CRTC to steal it from user-disabled outputs. Note that in the case there are enough CRTCs, disabled outputs don't loose it (so there's no modeset and plane initialization needed after DPMS). CRTC allocation still prefers to keep the old configuration, even if that means allocating an extra CRTC to a disabled output. CRTC reallocation now happen when enabling/disabling an output as well as when trying to modeset. When enabling an output without a CRTC, we realloc to try to steal a CRTC from a disabled output (that doesn't really need the CRTC). When disabling an output, we try to give our CRTC to an output that needs one. Modesetting is similar to enabling. A new DRM connector field has been added: `desired_enabled`. Outputs without CRTCs get automatically disabled. This field keeps track of the state desired by the user, allowing to automatically re-enable outputs when a CRTC becomes free. This required some changes to the allocation algorithm. Previously, the algorithm tried to keep the previous configuration even if a new configuration with a better score was possible (it only changed configuration when the old one didn't work anymore). This is now changed and the old configuration (still preferred) is only retained without considering new possibilities when it's perfect (all outputs have CRTCs). User-disabled outputs now have `possible_crtcs` set to 0, meaning they can only retain a previous CRTC (not acquire a new one). The allocation algorithm has been updated to do not bump the score when assigning a CRTC to a disabled output.
2018-09-14output: make wlr_output_enable return a boolemersion
2018-09-10Merge pull request #1235 from emersion/dealloc-unused-crtcsDrew DeVault
backend/drm: de-allocate unused CRTCs
2018-09-10Merge pull request #1205 from sghctoma/fix-freebsd-direct-sessionDrew DeVault
Add drmSetMaster and drmDropMaster calls to FreeBSD direct session
2018-09-10backend/drm: de-allocate unused CRTCsemersion
They can be re-used by another output after a subsequent hotplug.
2018-09-10fix cursor loss w/ legacy drm and software cursor (tested on etnaviv)mntmn
2018-09-07Fix build failure on non-FreeBSD systemssghctoma
Accidentally included the FreeBSD-specific dev/evdev/input.h file on other systems too. This commit fixes that.
2018-09-07Implement device type discovery using ioctl callssghctoma
This commit implements device type discovery by calling two ioctls (DRM_IOCTL_VERSION and EVIOCGVERSION) on the device. These iocts are specific to drm and input devices respectively, therefore we can determine the device type based on which one returns an error.
2018-09-07Merge remote-tracking branch 'upstream/master' into fix-freebsd-direct-sessionsghctoma
2018-09-04backend/drm: damage outputs when switching CRTCsemersion
2018-09-04backend/drm: cosmetic enhancementsemersion
2018-09-04backend/drm: consider continue not using resourcesemersion
Fixes #1230
2018-09-04backend/drm: prevent use of uninitialized dataemersion
2018-09-04backend/drm: remove unused ifemersion
2018-09-04backend/drm: log when de-allocating CRTCemersion
2018-09-04backend/drm: better hotplug handlingemersion
This commit handles better situations in which the number of connected outputs is greater than the number of available CRTCs. It'll enable as many outputs as possible, and transfer CRTCs to outputs that need one on unplug. This changes CRTC and plane reallocation to happen after scanning DRM connectors instead of on modeset. This cleanups CRTCs and planes on unplug to allow them to be re-used for other outputs. On modeset, if an output doesn't have a CRTC, the desired mode is saved and used later when the output gains a CRTC. Future work includes giving priority to enabled outputs over disabled ones for CRTC allocation. This requires the compositor to know about all outputs (even outputs without CRTCs) to properly modeset outputs enabled in the compositor config file and disable outputs disabled in the config file.
2018-09-02Activate last active VT after compositor exitsghctoma
The VT the compositor was started from was not activated after exiting the compositor, which resulted in arriving on a blank VT. This commit fixes that by introducing a new field in direct_session struct that stores the last active VT so that it can be activated in direct_session_destroy.
2018-09-02Merge remote-tracking branch 'upstream/master' into fix-freebsd-direct-sessionsghctoma
2018-09-02Free unused pointer in x11/backend.crandom human
2018-09-02backend/drm: fix invalid VLA size in scan_drm_connectorsemersion
I failed to see this issue with Valgrind because of the +1.
2018-09-02backend/drm: emit new_output after scanning connectorsemersion
This prevents receiving modesetting requests from the compositor while we don't have the whole picture (ie. while we haven't yet scanned all connectors). This also makes connectors without CRTCs disabled (they can't be enabled yet even if some CRTCs are free'd -- this is future work).
2018-09-01backend/drm: allow disabling outputs in NEEDS_MODESET stateemersion
This correctly frees CRTCs when disabling outputs without setting a mode.
2018-08-31Fix bugs listed by clang's static analyzerrandom human
A few pedantic changes and unused variables (1-4), and genuine bugs (5, 6). The reports with the corresponding files and lines numbers are as follows. 1. backend/libinput/tablet_pad.c@31,44,57 "Allocator sizeof operand mismatch" "Result of 'calloc' is converted to a pointer of type 'unsigned int', which is incompatible with sizeof operand type 'int'" 2. types/tablet_v2/wlr_tablet_v2_pad.c@371 "Allocator sizeof operand mismatch" "Result of 'calloc' is converted to a pointer of type 'uint32_t', which is incompatible with sizeof operand type 'int'" 3. types/wlr_cursor.c@335 "Dead initialization" "Value stored to 'dx'/'dy' during its initialization is never read" 4. rootston/xdg_shell.c@510 "Dead initialization" "Value stored to 'desktop' during its initialization is never read" 5. types/tablet_v2/wlr_tablet_v2_pad.c@475 "Dereference of null pointer" "Access to field 'strips' results in a dereference of a null pointer (loaded from field 'current_client')" The boolean logic was incorrect (c.f. the check in the following function). 6. examples/idle.c@163,174,182 "Uninitialized argument value" "1st function call argument is an uninitialized value" If close_timeout != 0, but simulate_activity_timeout >= close_timeout, the program would segfault at pthread_cancel(t1).
2018-08-30Fix that major(st_rdev) have no meaning on FreeBSDsghctoma
The major device number does not indicate the device type on FreeBSD, and AFAIK the only way to differentiate between DRM, input, and other devices is checking the fd path. This commit implements that. The drmDropmaster and drmSetmaster calls are necessary, because the implicit drop (that should occur when the DRM fd is closed) seems not to be working in some scenarios (e.g. if you have a tmux session running - maybe the fd is retained somehow by tmux?). This is a problem, because once you exit the compositor, you can't start it (or any other program that wants to be DRM master) again until you close all your tmux sessions.
2018-08-29Use legacy modesetting for gamma controlDrew DeVault
It doesn't look like there's any motion on a fix from the AMDGPU side, and using the legacy interface for this isn't so bad.
2018-08-27Init the new destroy signals added by #1200Alexander Bakker
2018-08-26Add destroy signals to types that are destroyed by wl_display_destroyAlexander Bakker