dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH v2] drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver
Date: Thu, 1 Dec 2016 10:21:28 -0500	[thread overview]
Message-ID: <CAOw6vbJVAVupGqBUh0RCQVFRjVmX4RByGRbkYEUJZWDHT415Tg@mail.gmail.com> (raw)
In-Reply-To: <20161201073731.5716-1-michel@daenzer.net>

On Thu, Dec 1, 2016 at 2:37 AM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> This is an attempt to make the previous fix a bit more robust going
> forward.

It takes a bit of work to locate the "previous fix" now that it's gone
through drm-misc-fixes. Can you update with a proper reference to the
first patch?

Additionally, it's probably easiest if we hold off on merging this
until your first patch finds its way into drm-misc-next.

Thanks,

Sean


>
> v2:
> * Only allow DRM_CAP_TIMESTAMP_MONOTONIC with UMS drivers (Daniel
>   Vetter, Alex Deucher)
> * Different logic to keep DRM_CAP_TIMESTAMP_MONOTONIC separate from
>   the other caps (Daniel Vetter)
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> ---
>  drivers/gpu/drm/drm_ioctl.c | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index 71c3473..706d5aa 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -229,6 +229,17 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>         struct drm_crtc *crtc;
>
>         req->value = 0;
> +
> +       /* Only one cap makes sense with a UMS driver: */
> +       if (req->capability == DRM_CAP_TIMESTAMP_MONOTONIC) {
> +               req->value = drm_timestamp_monotonic;
> +               return 0;
> +       }
> +
> +       /* Other caps only work with KMS drivers */
> +       if (!drm_core_check_feature(dev, DRIVER_MODESET))
> +               return -ENOTSUPP;
> +
>         switch (req->capability) {
>         case DRM_CAP_DUMB_BUFFER:
>                 if (dev->driver->dumb_create)
> @@ -247,19 +258,14 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>                 req->value |= dev->driver->prime_fd_to_handle ? DRM_PRIME_CAP_IMPORT : 0;
>                 req->value |= dev->driver->prime_handle_to_fd ? DRM_PRIME_CAP_EXPORT : 0;
>                 break;
> -       case DRM_CAP_TIMESTAMP_MONOTONIC:
> -               req->value = drm_timestamp_monotonic;
> -               break;
>         case DRM_CAP_ASYNC_PAGE_FLIP:
>                 req->value = dev->mode_config.async_page_flip;
>                 break;
>         case DRM_CAP_PAGE_FLIP_TARGET:
> -               if (drm_core_check_feature(dev, DRIVER_MODESET)) {
> -                       req->value = 1;
> -                       drm_for_each_crtc(crtc, dev) {
> -                               if (!crtc->funcs->page_flip_target)
> -                                       req->value = 0;
> -                       }
> +               req->value = 1;
> +               drm_for_each_crtc(crtc, dev) {
> +                       if (!crtc->funcs->page_flip_target)
> +                               req->value = 0;
>                 }
>                 break;
>         case DRM_CAP_CURSOR_WIDTH:
> --
> 2.10.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-12-01 15:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 11:56 drm: GPF in drm_getcap Dmitry Vyukov
2016-11-26 17:17 ` Dmitry Vyukov
2016-11-26 17:35   ` David Herrmann
2016-11-26 17:50     ` Dmitry Vyukov
2016-11-26 18:02       ` David Herrmann
2016-11-26 18:07         ` Dmitry Vyukov
2016-11-26 18:22           ` David Herrmann
2016-11-28  6:55             ` Daniel Vetter
2016-11-28  7:14               ` Michel Dänzer
2016-11-28  8:41                 ` Dmitry Vyukov
2016-11-30  8:30                   ` [PATCH 1/2] drm: Don't call drm_for_each_crtc with a non-KMS driver Michel Dänzer
2016-11-30  8:30                     ` [PATCH 2/2] drm: Return -ENOTSUPP when called for KMS cap " Michel Dänzer
2016-11-30  9:07                       ` Daniel Vetter
2016-11-30 17:21                         ` Alex Deucher
2016-12-01  7:35                         ` Michel Dänzer
2016-12-01  7:37                         ` [PATCH v2] " Michel Dänzer
2016-12-01 14:46                           ` Alex Deucher
2016-12-05  8:05                             ` Daniel Vetter
2016-12-01 15:21                           ` Sean Paul [this message]
2016-12-01 15:23                             ` Daniel Vetter
2016-11-30  9:13                     ` [PATCH 1/2] drm: Don't call drm_for_each_crtc " Daniel Vetter

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=CAOw6vbJVAVupGqBUh0RCQVFRjVmX4RByGRbkYEUJZWDHT415Tg@mail.gmail.com \
    --to=seanpaul@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dvyukov@google.com \
    --cc=michel@daenzer.net \
    /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;
as well as URLs for NNTP newsgroup(s).