From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: add debug logs for drm_mode_atomic_ioctl errors
Date: Tue, 10 Nov 2020 18:04:05 +0200 [thread overview]
Message-ID: <20201110160405.GS6112@intel.com> (raw)
In-Reply-To: <2sJwtJZS8GpTVmDedCE6b5WNkmnmUARXGt0mugjU2BA@cp3-web-033.plabs.ch>
On Tue, Nov 10, 2020 at 03:58:01PM +0000, Simon Ser wrote:
> Be nice to user-space and log what happened when returning EINVAL in
> drm_mode_atomic_ioctl.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/drm_atomic_uapi.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index 25c269bc4681..68d767420082 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1303,22 +1303,30 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> * though this may be a bit overkill, since legacy userspace
> * wouldn't know how to call this ioctl)
> */
> - if (!file_priv->atomic)
> + if (!file_priv->atomic) {
> + DRM_DEBUG_ATOMIC("atomic commit failed: atomic cap not enabled\n");
The "atomic commit failed:" bit seems a bit redundant.
> return -EINVAL;
> + }
>
> - if (arg->flags & ~DRM_MODE_ATOMIC_FLAGS)
> + if (arg->flags & ~DRM_MODE_ATOMIC_FLAGS) {
> + DRM_DEBUG_ATOMIC("atomic commit failed: invalid flag\n");
> return -EINVAL;
> + }
>
> if (arg->reserved)
> return -EINVAL;
You don't want one for this? I wonder why this "reserved" field
even exists...
>
> - if (arg->flags & DRM_MODE_PAGE_FLIP_ASYNC)
> + if (arg->flags & DRM_MODE_PAGE_FLIP_ASYNC) {
> + DRM_DEBUG_ATOMIC("atomic commit failed: invalid flag DRM_MODE_PAGE_FLIP_ASYNC\n");
> return -EINVAL;
> + }
>
> /* can't test and expect an event at the same time. */
> if ((arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) &&
> - (arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
> + (arg->flags & DRM_MODE_PAGE_FLIP_EVENT)) {
> + DRM_DEBUG_ATOMIC("atomic commit failed: page-flip event requested with test-only commit\n");
> return -EINVAL;
> + }
>
> state = drm_atomic_state_alloc(dev);
> if (!state)
> --
> 2.29.2
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-10 16:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 15:58 [PATCH] drm: add debug logs for drm_mode_atomic_ioctl errors Simon Ser
2020-11-10 16:04 ` Ville Syrjälä [this message]
2020-11-10 16:09 ` Simon Ser
[not found] ` <20201110173922.GA2808051@ravnborg.org>
2020-11-11 9:08 ` Simon Ser
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=20201110160405.GS6112@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=contact@emersion.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=tzimmermann@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.