From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm: Sync errno values for property lookup errors
Date: Tue, 22 Jan 2019 10:39:38 +0100 [thread overview]
Message-ID: <20190122093938.GX3271@phenom.ffwll.local> (raw)
In-Reply-To: <20190121202430.30789-2-ville.syrjala@linux.intel.com>
On Mon, Jan 21, 2019 at 10:24:29PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@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@linux.intel.com>
Matches https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#recommended-ioctl-return-values
Reviewed-by: Daniel Vetter <daniel.vetter@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-01-22 9:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 20:24 [PATCH 1/3] drm: Add debug prints for the various object lookup errors Ville Syrjala
2019-01-21 20:24 ` [PATCH 2/3] drm: Sync errno values for property " Ville Syrjala
2019-01-22 9:39 ` Daniel Vetter [this message]
2019-01-25 21:01 ` Ville Syrjälä
2019-01-29 8:49 ` Daniel Vetter
2019-02-15 8:21 ` [LKP] [drm] ef3de4356d: piglit.igt.kms_atomic.atomic_invalid_params.fail kernel test robot
2019-01-21 20:24 ` [PATCH 3/3] drm: Add a debug print for drm_modeset_backoff() Ville Syrjala
2019-01-22 9:41 ` Daniel Vetter
2019-01-22 9:38 ` [Intel-gfx] [PATCH 1/3] drm: Add debug prints for the various object lookup errors Daniel Vetter
2019-01-25 20:58 ` Ville Syrjälä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190122093938.GX3271@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox