aboutsummaryrefslogtreecommitdiff
path: root/include/backend
AgeCommit message (Collapse)Author
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-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-08-13move wlr_drm_connector_add_mode to wlr/backend/drm.hIlia Bozhinov
2018-07-14rename wlr_tablet_tool to wlr_tabletMarkus Ongyerth
The previous naming was based on the input-device capability names from libinput. With code that uses the libinput_tablet_tool and mapping into tablet-v2, this is confusing, so the name is changed to follow the names used in the protocol.
2018-07-14Use tablet_tool impl in libinput backendMarkus Ongyerth
2018-07-14backend/libinput: Manage tablet tool livetimesMarkus Ongyerth
This adds the management code to manage tablet tools lifetimes from libinput. It follows the suggestion made in the tablet-unstable-v2.xml to destroy tablet_tools once all tablets that it got into contact with were removed from the system. This is implemented via a refcount. If a tool is *not* unique, it will be destroyed on proximity out. This is libinput specific and mentioned in libinput docs that tools will not be found again, so we shouldn't keep a reference to them. Also they can't be on other tablets as well, because they cannot be tracked. The naming in this commit is a bit off (to not break things). The wlr names stay the same, tablet_tool is the libinput_device with capaiblity LIBINPUT_DEVICE_CAP_TABLET_TOOL which is more akin to "tablet" in the tablet-unstable-v2 protocol. The struct that corresponds to the tablet_tool in tablet-unstable-v2 is called tablet_tool_tool, a rename should be done at some point in the future.
2018-07-07drm: Allow to add additional modesGuido Günther
This allows to add additional modes to the list of available video modes using VESA Coordinated Video Timing information. Closes #1080
2018-05-31Merge branch 'master' into screencontentemersion
2018-05-29backend/drm: support multi-planar DMA-BUFs when exportingemersion
2018-05-29output, backend/drm: add wlr_output_export_dmabufemersion
2018-05-25backends: implement custom EGL and renderer initializationIlia Bozhinov
Compositors now have more control over how the backend creates its renderer. Currently all backends create an EGL/GLES2 renderer, so the necessary attributes for creating the context are passed to a user-provided callback function. It is responsible for initializing provided wlr_egl and to return a renderer. On fail, return 0. Fixes #987
2018-05-12Add support for discrete axis valuesemersion
2018-05-09Fix hardware cursors scale & transformemersion
2018-05-04Merge pull request #936 from emersion/full-hardware-cursorsemersion
output: always use hardware cursors if available
2018-05-03Fix typos in comments and stringsmorganamilo
2018-05-01output: always use hardware cursors if availableemersion
This changes the `wlr_output_impl.set_cursor` function to take a `wlr_texture` instead of a byte buffer. This simplifies the DRM and Wayland backends since they were creating textures from the byte buffer anyway. With this commit, performance should be improved when moving the cursor since outputs don't need to be re-rendered anymore.
2018-04-29backend/x11: add one pointer per outputemersion
2018-04-29backend/wayland: only set one pointer listeneremersion
2018-04-29backend/wayland: create one virtual pointer per outputemersion
2018-04-28backend/x11: correctly destroy input devicesemersion
2018-04-25Make sure we don't use others' prefixesemersion
2018-04-25Remove wlr_ prefix from local symbolsemersion
2018-04-15x11_handle_input_event: Remove return valueUli Schlachter
handle_x11_event() and x11_handle_input_event() react to different kinds of events, so it does not make much of a difference if x11_handle_input_event() signals if it handled an event or not. Signed-off-by: Uli Schlachter <psychon@znc.in>
2018-04-03backend/{x11,headless}: fix refresh rateemersion
2018-04-03Merge pull request #807 from swaywm/input-inhibitDrew DeVault
Input inhibit
2018-04-03Implement input inhibit in rootstonDrew DeVault
2018-04-03backend/x11: fix cursor position when receiving configure eventemersion
2018-03-31backend/x11: hide cursoremersion
2018-03-30backend/x11: fix input eventsemersion
2018-03-30backend/x11: add WLR_X11_OUTPUTS supportemersion
2018-03-30backend/x11: refactor, prepare support for multiple outputsemersion
2018-03-28Merge pull request #763 from emersion/x11-backend-kbd-modifiersDrew DeVault
backend/x11: correctly update keyboard modifiers
2018-03-28backend/x11: make xcb-xkb optional, remove global stateemersion
2018-03-24Redesign wlr_textureemersion
- Textures are now immutable (apart from those created from raw pixels), no more invalid textures - Move all wl_drm stuff in wlr_renderer - Most of wlr_texture fields are now private - Remove some duplicated DMA-BUF code in the DRM backend - Add more assertions - Stride is now always given as bytes rather than pixels - Drop wl_shm functions Fun fact: this patch has been written 10,000 meters up in the air.
2018-03-22wayland backend: fix use-after free on output destroyDominique Martinet
==12021==ERROR: AddressSanitizer: heap-use-after-free on address 0x617000015698 at pc 0x7f1a9abe1c09 bp 0x7ffe9068f6b0 sp 0x7ffe9068f6a0 WRITE of size 4 at 0x617000015698 thread T0 #0 0x7f1a9abe1c08 in pointer_handle_leave ../backend/wayland/wl_seat.c:40 #1 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d) #2 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e) #3 0x7f1a988e0d8a (/lib64/libwayland-client.so.0+0x8d8a) #4 0x7f1a988dd927 (/lib64/libwayland-client.so.0+0x5927) #5 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3) #6 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28 #7 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11) #8 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449) #9 0x418dff in main ../rootston/main.c:81 #10 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29) #11 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9) 0x617000015698 is located 664 bytes inside of 696-byte region [0x617000015400,0x6170000156b8) freed by thread T0 here: #0 0x7f1a9af754b8 in __interceptor_free (/lib64/libasan.so.4+0xde4b8) #1 0x7f1a9abe01ee in wlr_wl_output_destroy ../backend/wayland/output.c:194 #2 0x7f1a9ac12918 in wlr_output_destroy ../types/wlr_output.c:299 #3 0x7f1a9abe061b in xdg_toplevel_handle_close ../backend/wayland/output.c:255 #4 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d) #5 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e) #6 0x7f1a988e0d8a (/lib64/libwayland-client.so.0+0x8d8a) #7 0x7f1a988dd927 (/lib64/libwayland-client.so.0+0x5927) #8 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3) #9 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28 #10 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11) #11 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449) #12 0x418dff in main ../rootston/main.c:81 #13 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29) #14 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9) previously allocated by thread T0 here: #0 0x7f1a9af75a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38) #1 0x7f1a9abe0703 in wlr_wl_output_create ../backend/wayland/output.c:272 #2 0x7f1a9abdd8eb in wlr_wl_backend_start ../backend/wayland/backend.c:55 #3 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28 #4 0x7f1a9abd8ce1 in multi_backend_start ../backend/multi/backend.c:24 #5 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28 #6 0x418c32 in main ../rootston/main.c:58 #7 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29) #8 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)
2018-03-19render: split render.h into wlr_renderer.h and wlr_texture.hemersion
2018-03-15matrix: use 2D matricesemersion
2018-03-06Use xcb atoms properlyScott Anderson
2018-02-26restore dpms state on drm resumeMarkus Ongyerth
If there is no current mode, set outputs to dpms off in drm resume. Sets current mode to null on disable to ensure this can be checked.
2018-02-19Revert "ELF Visibility"Drew DeVault
2018-02-18Merge pull request #647 from ascent12/elf_visibilityDrew DeVault
ELF Visibility
2018-02-18x11 backend: set window titleGuido Günther
This makes windows identifiable in the window list
2018-02-19Remove usec_to_msec from public APIScott Anderson
2018-02-12Reformat all #include directivesemersion
2018-02-10Merge pull request #618 from VincentVanlaer/atomic-gammaDrew DeVault
Add atomic gamma control
2018-02-09Swap buffers with damageemersion
2018-02-09Add atomic gamma lut size fetchingVincent Vanlaer
Legacy gamma lut size now uses the new legacy_crtc member of wlr_drm_crtc. This was Previously doen using old_crtc in wlr_drm_connector, but since this refers to the crtc that was connected to the ouput, this could give the wrong result.
2018-02-09Add atomic gamma settingVincent Vanlaer
2018-02-02backend/drm: support updating cursor when session is pausedemersion