提交 765393db 编写于 作者: D Daniel Vetter

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: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: NSean Paul <seanpaul@chromium.org>
Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170418121120.31862-1-daniel.vetter@ffwll.ch
上级 d8f2ebaa
...@@ -189,7 +189,7 @@ struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev, ...@@ -189,7 +189,7 @@ struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device *dev,
obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]); obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[i]);
if (!obj) { if (!obj) {
dev_err(dev->dev, "Failed to lookup GEM object\n"); dev_err(dev->dev, "Failed to lookup GEM object\n");
ret = -ENXIO; ret = -ENOENT;
goto err_gem_object_put; goto err_gem_object_put;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册