Lines Matching refs:lessee
69 #define drm_for_each_lessee(lessee, lessor) \ argument
70 list_for_each_entry((lessee), &(lessor)->lessees, lessee_list)
99 struct drm_master *lessee; in _drm_has_leased() local
102 drm_for_each_lessee(lessee, master) in _drm_has_leased()
103 if (_drm_lease_held_master(lessee, id)) in _drm_has_leased()
211 struct drm_master *lessee; in drm_lease_create() local
218 lessee = drm_master_create(lessor->dev); in drm_lease_create()
219 if (!lessee) { in drm_lease_create()
240 id = idr_alloc(&(drm_lease_owner(lessor)->lessee_idr), lessee, 1, 0, GFP_KERNEL); in drm_lease_create()
246 lessee->lessee_id = id; in drm_lease_create()
247 lessee->lessor = drm_master_get(lessor); in drm_lease_create()
248 list_add_tail(&lessee->lessee_list, &lessor->lessees); in drm_lease_create()
251 lessee->leases = *leases; in drm_lease_create()
252 …DRM_DEBUG_LEASE("new lessee %d %p, lessor %d %p\n", lessee->lessee_id, lessee, lessor->lessee_id, … in drm_lease_create()
255 return lessee; in drm_lease_create()
260 drm_master_put(&lessee); in drm_lease_create()
481 struct drm_master *lessee = NULL; in drm_mode_create_lease_ioctl() local
539 lessee = drm_lease_create(lessor, &leases); in drm_mode_create_lease_ioctl()
541 if (IS_ERR(lessee)) { in drm_mode_create_lease_ioctl()
542 ret = PTR_ERR(lessee); in drm_mode_create_lease_ioctl()
558 lessee_priv->master = lessee; in drm_mode_create_lease_ioctl()
563 DRM_DEBUG_LEASE("Returning fd %d id %d\n", fd, lessee->lessee_id); in drm_mode_create_lease_ioctl()
565 cl->lessee_id = lessee->lessee_id; in drm_mode_create_lease_ioctl()
575 drm_master_put(&lessee); in drm_mode_create_lease_ioctl()
592 struct drm_master *lessor, *lessee; in drm_mode_list_lessees_ioctl() local
609 drm_for_each_lessee(lessee, lessor) { in drm_mode_list_lessees_ioctl()
611 if (!idr_is_empty(&lessee->leases)) { in drm_mode_list_lessees_ioctl()
613 DRM_DEBUG_LEASE("Add lessee %d\n", lessee->lessee_id); in drm_mode_list_lessees_ioctl()
614 ret = put_user(lessee->lessee_id, lessee_ids + count); in drm_mode_list_lessees_ioctl()
639 struct drm_master *lessee; in drm_mode_get_lease_ioctl() local
653 lessee = drm_file_get_master(lessee_priv); in drm_mode_get_lease_ioctl()
654 DRM_DEBUG_LEASE("get lease for %d\n", lessee->lessee_id); in drm_mode_get_lease_ioctl()
658 if (lessee->lessor == NULL) in drm_mode_get_lease_ioctl()
660 object_idr = &lessee->dev->mode_config.object_idr; in drm_mode_get_lease_ioctl()
663 object_idr = &lessee->leases; in drm_mode_get_lease_ioctl()
681 drm_master_put(&lessee); in drm_mode_get_lease_ioctl()
696 struct drm_master *lessee; in drm_mode_revoke_lease_ioctl() local
708 lessee = _drm_find_lessee(lessor, arg->lessee_id); in drm_mode_revoke_lease_ioctl()
711 if (!lessee) { in drm_mode_revoke_lease_ioctl()
717 if (lessee->lessor != lessor) { in drm_mode_revoke_lease_ioctl()
722 _drm_lease_revoke(lessee); in drm_mode_revoke_lease_ioctl()