aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2018-11-02 09:25:41 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-11-06 12:23:31 -0500
commita0c1af46e9d71fdae7df904b91542ce2518382a1 (patch)
tree3de463c5097b7d63cacb72e8b9f2b37c559c13a1
parentaecbde630e95c02c24182f7acead53ca1c2a60a6 (diff)
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: Keith Packard <keithp@keithp.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20181102132543.16486-1-daniel.vetter@ffwll.ch
-rw-r--r--drivers/gpu/drm/drm_lease.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index 977f069f6d90..4cfd8fe25536 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -415,14 +415,17 @@ static int fill_object_idr(struct drm_device *dev,
415 } 415 }
416 416
417 if (!drm_mode_object_lease_required(objects[o]->type)) { 417 if (!drm_mode_object_lease_required(objects[o]->type)) {
418 DRM_DEBUG_KMS("invalid object for lease\n");
418 ret = -EINVAL; 419 ret = -EINVAL;
419 goto out_free_objects; 420 goto out_free_objects;
420 } 421 }
421 } 422 }
422 423
423 ret = validate_lease(dev, lessor_priv, object_count, objects); 424 ret = validate_lease(dev, lessor_priv, object_count, objects);
424 if (ret) 425 if (ret) {
426 DRM_DEBUG_LEASE("lease validation failed\n");
425 goto out_free_objects; 427 goto out_free_objects;
428 }
426 429
427 /* add their IDs to the lease request - taking into account 430 /* add their IDs to the lease request - taking into account
428 universal planes */ 431 universal planes */
@@ -505,15 +508,21 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
505 return -EOPNOTSUPP; 508 return -EOPNOTSUPP;
506 509
507 /* Do not allow sub-leases */ 510 /* Do not allow sub-leases */
508 if (lessor->lessor) 511 if (lessor->lessor) {
512 DRM_DEBUG_LEASE("recursive leasing not allowed\n");
509 return -EINVAL; 513 return -EINVAL;
514 }
510 515
511 /* need some objects */ 516 /* need some objects */
512 if (cl->object_count == 0) 517 if (cl->object_count == 0) {
518 DRM_DEBUG_LEASE("no objects in lease\n");
513 return -EINVAL; 519 return -EINVAL;
520 }
514 521
515 if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) 522 if (cl->flags && (cl->flags & ~(O_CLOEXEC | O_NONBLOCK))) {
523 DRM_DEBUG_LEASE("invalid flags\n");
516 return -EINVAL; 524 return -EINVAL;
525 }
517 526
518 object_count = cl->object_count; 527 object_count = cl->object_count;
519 528
@@ -528,6 +537,7 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
528 object_count, object_ids); 537 object_count, object_ids);
529 kfree(object_ids); 538 kfree(object_ids);
530 if (ret) { 539 if (ret) {
540 DRM_DEBUG_LEASE("lease object lookup failed: %i\n", ret);
531 idr_destroy(&leases); 541 idr_destroy(&leases);
532 return ret; 542 return ret;
533 } 543 }