Draft: wayland: drm-lease: add new vout window module for exclusive access
The DRM lease wayland implementation is using the drm-lease-v1 protocol to acquire a DRM lease including a given connector, mainly for VR headset since compositor might not expose the other screens that way currently, and use it as a fully exclusive DRM output.
This is still WIP since it depends on !893 (merged) being merged for the vout_window handle/display interface, and though it's a separate issue, the display still has issues with retrieving a plane from the DRM lease, so is not able to display anything.
The priority will need tweaking, and it might also lack a vout_window_cfg_t
item to ensure this module is only enabled when exclusive access to display is requested, be it by whitelisting exclusive access in this module, blacklisting exclusive access in the others or creating a separate vout window capability for exclusive access (given that X11 and vulkan also has this).
I hope this module can comfort others in how the handle/display values for KMS are chosen.
Merge request reports
Activity
changed milestone to %Features paradize
added Component::Video: Wayland label
assigned to @alexandre-janniaux
799 sys->modeRes = drmModeGetResources(sys->drm_fd); 800 if (sys->modeRes == NULL) { 801 msg_Err(wnd, "Didn't get DRM resources"); 802 goto err_out; 803 } 804 805 wnd->ops = &window_ops; 806 wnd->type = VOUT_WINDOW_TYPE_KMS; 807 wnd->display.drm_fd = sys->drm_fd; 808 /* Note: wnd->handle.crtc will be initialized later */ 809 810 return VLC_SUCCESS; 811 err_out: 812 drmDropMaster(sys->drm_fd); 813 vlc_close(sys->drm_fd); 814 sys->drm_fd = -1; - Resolved by Rémi Denis-Courmont
- Resolved by Rémi Denis-Courmont
158 187 159 188 msg_Info(wnd, "Looping over %d resources", modeRes->count_connectors); 160 189 for (int c = 0; c < modeRes->count_connectors && sys->crtc == 0; c++) { 161 msg_Info(wnd, "connector %d", c); 162 190 163 191 drmModeConnector *conn = 164 192 drmModeGetConnector(sys->drm_fd, modeRes->connectors[c]); 165 193 if (conn == NULL) 166 194 continue; 167 195 196 msg_Info(wnd, "connector %d: %s-%d", c, 53 53 54 54 #define DEVICE_TEXT "Framebuffer device" 55 55 #define DEVICE_LONGTEXT \ 56 "Framebuffer device to use for rendering (usually /dev/dri/card0)." 56 "Framebuffer device to use for rendering (usually " DRM_DIR_NAME "/card0)." Right, I'll remove this from !893 (merged)
@Courmisch beware, you've been reviewing the change from !893 (merged) again. :/
mentioned in merge request !893 (merged)
After some changes in the modules and some changes in the compositor to avoid my lease being revoked on screen startup, this is working correctly:
There was one issue with how the lease was revoked and which couldn't be fixed though. The wl-drm-lease module will need to wait for the leased connector to be completely available (screen started), ie. without new drm-lease changes, so that it doesn't get revoked behind the back of the display, but it means that the module can be stuck in Open/Enable when there is no screen to wait anymore (eg. disconnected screen when it is being started).