From: Keith Packard <keithp@keithp.com>
To: linux-kernel@vger.kernel.org, Dave Airlie <airlied@redhat.com>
Cc: Keith Packard <keithp@keithp.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH 3/5] drm: Advertise async page flip ability through GETCAP ioctl
Date: Mon, 22 Jul 2013 18:50:00 -0700 [thread overview]
Message-ID: <1374544202-15496-4-git-send-email-keithp@keithp.com> (raw)
In-Reply-To: <1374544202-15496-1-git-send-email-keithp@keithp.com>
Let applications know whether the kernel supports asynchronous page
flipping.
Signed-off-by: Keith Packard <keithp@keithp.com>
---
drivers/gpu/drm/drm_crtc.c | 3 +++
drivers/gpu/drm/drm_ioctl.c | 3 +++
include/drm/drm_crtc.h | 3 +++
include/uapi/drm/drm.h | 1 +
4 files changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 989072c..0909af6 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3514,6 +3514,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
page_flip->reserved != 0)
return -EINVAL;
+ if ((page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC) && !dev->mode_config.async_page_flip)
+ return -EINVAL;
+
obj = drm_mode_object_find(dev, page_flip->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj)
return -EINVAL;
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index ffd7a7b..7602177 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -303,6 +303,9 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
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;
default:
return -EINVAL;
}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 0820ab6..13d215f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -845,6 +845,9 @@ struct drm_mode_config {
/* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow;
+
+ /* whether async page flip is supported or not */
+ bool async_page_flip;
};
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 238a166..2adfaa5 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -780,6 +780,7 @@ struct drm_event_vblank {
#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
#define DRM_CAP_PRIME 0x5
#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
#define DRM_PRIME_CAP_IMPORT 0x1
#define DRM_PRIME_CAP_EXPORT 0x2
--
1.8.3.2
next prev parent reply other threads:[~2013-07-23 2:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 1:49 drm: Asynchronouse page flipping interface and Intel implementation Keith Packard
2013-07-23 1:49 ` [PATCH 1/5] drm: Pass page flip ioctl flags to driver Keith Packard
2013-07-23 1:49 ` [PATCH 2/5] drm: Add DRM_MODE_PAGE_FLIP_ASYNC flag definition Keith Packard
2013-07-23 1:50 ` Keith Packard [this message]
2013-07-23 1:50 ` [PATCH 4/5] drm/i915: Add async page flip support for IVB Keith Packard
2013-07-23 5:28 ` Daniel Vetter
2013-07-24 20:26 ` Keith Packard
2013-07-24 21:23 ` Daniel Vetter
2013-07-25 1:40 ` Keith Packard
2013-07-25 7:47 ` Daniel Vetter
2013-07-25 18:13 ` Keith Packard
2013-07-25 19:18 ` Daniel Vetter
2013-07-25 22:15 ` Keith Packard
2013-07-25 22:15 ` [PATCH 1/2] " Keith Packard
2013-07-30 16:42 ` Ville Syrjälä
2013-07-25 22:15 ` [PATCH 2/2] drm/i915: Add async page flip support for SNB Keith Packard
2013-07-30 16:28 ` [Intel-gfx] " Ville Syrjälä
2013-07-23 1:50 ` [PATCH 5/5] " Keith Packard
2013-07-23 20:15 ` drm: Asynchronouse page flipping interface and Intel implementation Daniel Vetter
2013-07-23 20:33 ` Keith Packard
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=1374544202-15496-4-git-send-email-keithp@keithp.com \
--to=keithp@keithp.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).