dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Ezequiel Garcia <ezequiel@collabora.com>,
	Gustavo Padovan <gustavo@padovan.org>,
	Sean Paul <seanpaul@chromium.org>
Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Allow CAP_DUMB_BUFFERS on !MODESET
Date: Mon, 7 May 2018 11:36:55 +0200	[thread overview]
Message-ID: <451dc7e3-2845-fb1d-d050-c6570b85d29b@linux.intel.com> (raw)
In-Reply-To: <20180504142547.12930-1-ezequiel@collabora.com>

Op 04-05-18 om 16:25 schreef Ezequiel Garcia:
> It's perfectly possible to get dumb buffers out of drivers
> that don't support modeset. This is the case of vgem,
> which can be used to export dmabuf to run various tests.
> Therefore, move the dumb buffer capability check before
> the mode set check.
>
> Inspired by commit f3f4c4d68a28 ("drm: Allow CAP_PRIME on !MODESET").
>
> Fixes: d5264ed3823a ("drm: Return -ENOTSUPP when called for KMS cap with a non-KMS driver")
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
>  drivers/gpu/drm/drm_ioctl.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index af782911c505..deac011a0c25 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -244,6 +244,9 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>  	case DRM_CAP_SYNCOBJ:
>  		req->value = drm_core_check_feature(dev, DRIVER_SYNCOBJ);
>  		return 0;
> +	case DRM_CAP_DUMB_BUFFER:
> +		req->value |= dev->driver->dumb_create ? 1 : 0;
Why the |= ?
> +		return 0;
>  	}
>  
>  	/* Other caps only work with KMS drivers */
> @@ -251,10 +254,6 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>  		return -ENOTSUPP;
>  
>  	switch (req->capability) {
> -	case DRM_CAP_DUMB_BUFFER:
> -		if (dev->driver->dumb_create)
> -			req->value = 1;
> -		break;
>  	case DRM_CAP_VBLANK_HIGH_CRTC:
>  		req->value = 1;
>  		break;


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-07  9:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 14:25 [PATCH] drm: Allow CAP_DUMB_BUFFERS on !MODESET Ezequiel Garcia
2018-05-07  9:36 ` Maarten Lankhorst [this message]
2018-05-08  4:47   ` Ezequiel Garcia
2018-05-08  4:52 ` [PATCH v2] " Ezequiel Garcia
2018-05-08  7:55   ` Daniel Vetter
2018-05-08 23:42     ` Ezequiel Garcia
2018-05-09  8:11       ` 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=451dc7e3-2845-fb1d-d050-c6570b85d29b@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ezequiel@collabora.com \
    --cc=gustavo@padovan.org \
    --cc=kernel@collabora.com \
    --cc=seanpaul@chromium.org \
    /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