|
15 | 15 | #include "drm_crtc_internal.h"
|
16 | 16 | #include "drm_internal.h"
|
17 | 17 |
|
| 18 | +/** |
| 19 | + * DOC: drm leasing |
| 20 | + * |
| 21 | + * DRM leases provide information about whether a DRM master may control a DRM |
| 22 | + * mode setting object. This enables the creation of multiple DRM masters that |
| 23 | + * manage subsets of display resources. |
| 24 | + * |
| 25 | + * The original DRM master of a device 'owns' the available drm resources. It |
| 26 | + * may create additional DRM masters and 'lease' resources which it controls |
| 27 | + * to the new DRM master. This gives the new DRM master control over the |
| 28 | + * leased resources until the owner revokes the lease, or the new DRM master |
| 29 | + * is closed. Some helpful terminology: |
| 30 | + * |
| 31 | + * - An 'owner' is a &struct drm_master that is not leasing objects from |
| 32 | + * another &struct drm_master, and hence 'owns' the objects. The owner can be |
| 33 | + * identified as the &struct drm_master for which &drm_master.lessor is NULL. |
| 34 | + * |
| 35 | + * - A 'lessor' is a &struct drm_master which is leasing objects to one or more |
| 36 | + * other &struct drm_master. Currently, lessees are not allowed to |
| 37 | + * create sub-leases, hence the lessor is the same as the owner. |
| 38 | + * |
| 39 | + * - A 'lessee' is a &struct drm_master which is leasing objects from some |
| 40 | + * other &struct drm_master. Each lessee only leases resources from a single |
| 41 | + * lessor recorded in &drm_master.lessor, and holds the set of objects that |
| 42 | + * it is leasing in &drm_master.leases. |
| 43 | + * |
| 44 | + * - A 'lease' is a contract between the lessor and lessee that identifies |
| 45 | + * which resources may be controlled by the lessee. All of the resources |
| 46 | + * that are leased must be owned by or leased to the lessor, and lessors are |
| 47 | + * not permitted to lease the same object to multiple lessees. |
| 48 | + * |
| 49 | + * The set of objects any &struct drm_master 'controls' is limited to the set |
| 50 | + * of objects it leases (for lessees) or all objects (for owners). |
| 51 | + * |
| 52 | + * Objects not controlled by a &struct drm_master cannot be modified through |
| 53 | + * the various state manipulating ioctls, and any state reported back to user |
| 54 | + * space will be edited to make them appear idle and/or unusable. For |
| 55 | + * instance, connectors always report 'disconnected', while encoders |
| 56 | + * report no possible crtcs or clones. |
| 57 | + * |
| 58 | + * Since each lessee may lease objects from a single lessor, display resource |
| 59 | + * leases form a tree of &struct drm_master. As lessees are currently not |
| 60 | + * allowed to create sub-leases, the tree depth is limited to 1. All of |
| 61 | + * these get activated simultaneously when the top level device owner changes |
| 62 | + * through the SETMASTER or DROPMASTER IOCTL, so &drm_device.master points to |
| 63 | + * the owner at the top of the lease tree (i.e. the &struct drm_master for which |
| 64 | + * &drm_master.lessor is NULL). The full list of lessees that are leasing |
| 65 | + * objects from the owner can be searched via the owner's |
| 66 | + * &drm_master.lessee_idr. |
| 67 | + */ |
| 68 | + |
18 | 69 | #define drm_for_each_lessee(lessee, lessor) \
|
19 | 70 | list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
|
20 | 71 |
|
|
0 commit comments