aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_uapi.c
diff options
context:
space:
mode:
authorSimon Ser <[email protected]>2020-11-11 09:07:39 +0000
committerSimon Ser <[email protected]>2020-11-14 13:40:44 +0000
commit50f3d4129e7217bc89d2af9a685e4f52a76c588e (patch)
treef8b3cf4a35f9485c6fb43bc0d2bd70d6386d7495 /drivers/gpu/drm/drm_atomic_uapi.c
parentdrm: convert drm_atomic_uapi.c to new debug helpers (diff)
downloadkernel-50f3d4129e7217bc89d2af9a685e4f52a76c588e.tar.gz
kernel-50f3d4129e7217bc89d2af9a685e4f52a76c588e.zip
drm: add debug logs for drm_mode_atomic_ioctl errors
Be nice to user-space and log what happened when returning EINVAL in drm_mode_atomic_ioctl. v2: - Migrate to drm_dbg_atomic (Sam) - Add debug log for arg->reserved (Ville) - Drop redundant "atomic" word in log messages (Ville) Signed-off-by: Simon Ser <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Ville Syrjala <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_uapi.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_uapi.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index efab3d518891..9df7f2a170e3 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1330,22 +1330,35 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
* though this may be a bit overkill, since legacy userspace
* wouldn't know how to call this ioctl)
*/
- if (!file_priv->atomic)
+ if (!file_priv->atomic) {
+ drm_dbg_atomic(dev,
+ "commit failed: atomic cap not enabled\n");
return -EINVAL;
+ }
- if (arg->flags & ~DRM_MODE_ATOMIC_FLAGS)
+ if (arg->flags & ~DRM_MODE_ATOMIC_FLAGS) {
+ drm_dbg_atomic(dev, "commit failed: invalid flag\n");
return -EINVAL;
+ }
- if (arg->reserved)
+ if (arg->reserved) {
+ drm_dbg_atomic(dev, "commit failed: reserved field set\n");
return -EINVAL;
+ }
- if (arg->flags & DRM_MODE_PAGE_FLIP_ASYNC)
+ if (arg->flags & DRM_MODE_PAGE_FLIP_ASYNC) {
+ drm_dbg_atomic(dev,
+ "commit failed: invalid flag DRM_MODE_PAGE_FLIP_ASYNC\n");
return -EINVAL;
+ }
/* can't test and expect an event at the same time. */
if ((arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) &&
- (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
+ (arg->flags & DRM_MODE_PAGE_FLIP_EVENT)) {
+ drm_dbg_atomic(dev,
+ "commit failed: page-flip event requested with test-only commit\n");
return -EINVAL;
+ }
state = drm_atomic_state_alloc(dev);
if (!state)