Skip to content
Snippets Groups Projects

Draft: wayland: drm-lease: add new vout window module for exclusive access

4 unresolved threads

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

Members who can merge are allowed to add commits.

Merge request pipeline #170236 failed

Merge request pipeline failed for 414277ce

Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
397 399 char *x11; /**< X11 display string (NULL = use default) */
398 400 struct wl_display *wl; /**< Wayland display (client pointer) */
399 401 void* dcomp_device; /**< DirectComposition device */
402 int drm_fd; /** KMS DRM device */
  • 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;
  • Rémi Denis-Courmont
  • 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)."
  • @Courmisch beware, you've been reviewing the change from !893 (merged) again. :/

  • Alexandre Janniaux mentioned in merge request !893 (merged)

    mentioned in merge request !893 (merged)

  • Ok, the fact that planes are not visible in the underlying KMS drm display is just that I never enable DRM_CLIENT_CAP_UNIVERSAL_PLANES from the display module.

  • 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:

    image

    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).

  • Please register or sign in to reply
    Loading