]> git.baikalelectronics.ru Git - kernel.git/commit
drm/cma-helper: Return ENOENT for "no such gem obj"
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 18 Apr 2017 12:11:20 +0000 (14:11 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 18 Apr 2017 15:57:37 +0000 (17:57 +0200)
commit003c3a0db24110a3e611d4ceccbe4165f6420647
tree1e2ebfff4b5c3b10c8f1ca5f3ed928bd3e76d38a
parent6f7af28b8b4859aeb9b61b7dff83580a03f438a8
drm/cma-helper: Return ENOENT for "no such gem obj"

All the error codes we (ab)use are strictly not the right ones (since
they're all for the vfs, and the only thing we're allowed to do from
an ioctl is EINVAL). But ENOENT is the common error code for failed to
look up an object throughout drm, so let's use it in the cma helpers,
too.

Note that this does change uabi for some drivers, but that shouldn't
ba a problem:
- other drivers (e.g. i915) already return ENOENT for invalid gem bo
- userspace tends to only check for errors, not specific ones (except
  when ioctl restarting is needed)
- if the gem bo isn't there a previous step (either creating or
  importing it) failed already, this situation should always be a
  userspace bug.

Changing it does help with debugging userspace bugs though, by making
error reporting more consistent.

Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170418121120.31862-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_fb_cma_helper.c