Commit a0c1af46 authored by Daniel Vetter's avatar Daniel Vetter

drm/lease: debug output for lease creation

I spent a bit of time scratching heads and figuring out why the igts
don't work. Probably useful to keep this work.

Cc: Keith Packard <keithp@keithp.com>
Cc: Dave Airlie <airlied@gmail.com>
Acked-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181102132543.16486-1-daniel.vetter@ffwll.ch
parent aecbde63
...@@ -415,14 +415,17 @@ static int fill_object_idr(struct drm_device *dev, ...@@ -415,14 +415,17 @@ static int fill_object_idr(struct drm_device *dev,
} }
if (!drm_mode_object_lease_required(objects[o]->type)) { if (!drm_mode_object_lease_required(objects[o]->type)) {
DRM_DEBUG_KMS("invalid object for lease\n");
ret = -EINVAL; ret = -EINVAL;
goto out_free_objects; goto out_free_objects;
} }
} }
ret = validate_lease(dev, lessor_priv, object_count, objects); ret = validate_lease(dev, lessor_priv, object_count, objects);
if (ret) if (ret) {
DRM_DEBUG_LEASE("lease validation failed\n");
goto out_free_objects; goto out_free_objects;
}
/* add their IDs to the lease request - taking into account /* add their IDs to the lease request - taking into account
universal planes */ universal planes */
...@@ -505,15 +508,21 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, ...@@ -505,15 +508,21 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Do not allow sub-leases */ /* Do not allow sub-leases */
if (lessor->lessor) if (lessor->lessor) {
DRM_DEBUG_LEASE("recursive leasing not allowed\n");
return -EINVAL; return -EINVAL;
}
/* need some objects */ /* need some objects */
if (cl->object_count == 0) if (cl->object_count == 0) {
DRM_DEBUG_LEASE("no objects in lease\n");
return -EINVAL; return -EINVAL;
}
if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
DRM_DEBUG_LEASE("invalid flags\n");
return -EINVAL; return -EINVAL;
}
object_count = cl->object_count; object_count = cl->object_count;
...@@ -528,6 +537,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, ...@@ -528,6 +537,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
object_count, object_ids); object_count, object_ids);
kfree(object_ids); kfree(object_ids);
if (ret) { if (ret) {
DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret);
idr_destroy(&leases); idr_destroy(&leases);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment