Dynamically transfer DRM lease between clients

Fixed

Description

The Instrument Cluster use case needs to be able to change which client (application or container) drives (owns) the display controlled by a DRM lease while the system is in operation.

Basically, the display (DRM lease) "owner" must be able to be dynamically transferred from one client to another.  In practice it is probably best to revoke the previous owner's lease and generate a new one for the new owner.

The transition requirements for the Instrument Cluster use case have been defined as follows:

  • The display output must not blank during the transition

    • Assuming that the old client and new client use the same display modesetting

  • A new DRM lease client can "steal" the ownership from the current owner

    • There is no mechanism to request that the current owner give up its ownership

    • Permissions for which clients can steal DRM lease ownership is handled outside of the DRM lease manager and client

      • Client permission handling is not currently defined and out-of-scope of this task.

Environment

None

Activity

Show:

Walt Miner 
July 13, 2021 at 4:41 PM

Close for LL 12.0.0

Damian Hobson-Garcia 
March 29, 2021 at 3:16 AM

The stealing (renamed to lease transition) functionality as described above (without the configuration file settings, which depends on https://lf-automotivelinux.atlassian.net/browse/SPEC-3815#icft=SPEC-3815) has been pushed to gerrit.

Lease transition has been tested with both weston and kmscube can perform a no blank transition from weston to kmscube and kmscube to kmscube.  Transitions to weston still see a black screen on transition because weston displays a black screen as its first frame.  This is because weston starts to display frames before the desktop-shell application is launched.

There is a patch pending merge upstream to fix this, which will allow seamless transition to weston, but it is blocked because it causes failures in the weston test suite.  I looked into the problem, and it seems to be an underlying problem with wayland.
Specifically with the patch applied, the wayland display event loop does not exit as expected when running the test suite (this doesn't affect the actual weston compositor shutdown).  An issue has been opened on the wayland gitlab to look into this.

I will push the weston patch to gerrit too, since it seems likely to be merged upstream once the wayland issue is fixed.

Damian Hobson-Garcia 
March 2, 2021 at 6:06 AM

, thank you for your comments.

>> Should the stealing be prohibited (by the DRM lease manager) for other clients?

> This case can control container isolation. Which lease can use, it can control by socket binding to guest. It's my understanding.
In this case, DRM lease manager may not stealing be prohibited.

Container isolation may not be enough to prohibit stealing because any client in the container will be able to steal the lease.
The lease could also be stolen by the host.

For containers / environments that don't need the stealing feature, it might be useful to be able to disable stealing.  Then the clients don't have
to worry about it at all.

It is easy to add a global (applied to all DRM leases) enable/disable flag to the DRM lease manager. 
If the configuration file from SPEC is implemented, we can also enable/disable stealing per lease, so we can, for example, enable stealing on IC and disable it on IVI containers.

Maybe this is overkill (over spec) for the current IC use case though, what do you think?  

Naoto YAMAGUCHI 
March 1, 2021 at 11:08 AM

I agree to this point.

> this would only be used to transition away from a custom made IC specific client.

 

> Will the DRM lease transition feature only be used to switch from custom IC clients?

Exactly. This use case is limited.

> Should the stealing be prohibited (by the DRM lease manager) for other clients?

This case can control container isolation. Which lease can use, it can control by socket binding to guest. It's my understanding.
In this case, DRM lease manager may not stealing be prohibited.

Marius Vlad 
February 24, 2021 at 11:33 AM

Cool, thanks for looking into it!. I guess if this stealing process only happens with some custom clients made that are only intended to run in IC, then there shouldn't be a problem for the IVI side of things (where weston/libweston runs in) so that's why I've wanted to clarify things a bit. 

Details

Assignee

Reporter

Fix versions

Labels

Priority

Created February 22, 2021 at 8:38 AM
Updated July 13, 2021 at 4:41 PM
Resolved April 14, 2021 at 1:44 AM

Flag notifications