[Intel-gfx] [PATCH 2/3] drm: Sync errno values for property lookup errors

Daniel Vetter daniel at ffwll.ch
Tue Jan 22 09:39:38 UTC 2019


On Mon, Jan 21, 2019 at 10:24:29PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Use ENOENT consistently for the case where the requested property
> isn't found, and EINVAL for the case where the object has no
> properties whatsoever. Currenrly these are handled differently
> in the atomic and legacy codepaths.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Matches https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#recommended-ioctl-return-values

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Any igts that blow up with this? We should have at least some trying to do
invalid stuff ...
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
>  drivers/gpu/drm/drm_mode_object.c | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index 06390307e5a3..2a54f826cf65 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1330,7 +1330,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
>  			DRM_DEBUG_ATOMIC("Object ID %d has no properties\n",
>  					 obj_id);
>  			drm_mode_object_put(obj);
> -			ret = -ENOENT;
> +			ret = -EINVAL;
>  			goto out;
>  		}
>  
> diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> index e8dac94d576d..31730d935842 100644
> --- a/drivers/gpu/drm/drm_mode_object.c
> +++ b/drivers/gpu/drm/drm_mode_object.c
> @@ -527,6 +527,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
>  	property = drm_mode_obj_find_prop_id(arg_obj, arg->prop_id);
>  	if (!property) {
>  		DRM_DEBUG_KMS("Unknown property ID %d\n", arg->prop_id);
> +		ret = -ENOENT;
>  		goto out_unref;
>  	}
>  
> -- 
> 2.19.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list