From: Daniel Vetter Date: Tue, 18 Apr 2017 12:11:20 +0000 (+0200) Subject: drm/cma-helper: Return ENOENT for "no such gem obj" X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=765393db20e34b8ad9c1c6a71a793d17d23f4aa5;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Laurent Pinchart Reviewed-by: Sean Paul Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20170418121120.31862-1-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index d2b77b02830d..53f9bdf470d7 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -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]); if (!obj) { dev_err(dev->dev, "Failed to lookup GEM object\n"); - ret = -ENXIO; + ret = -ENOENT; goto err_gem_object_put; }