All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Binns <frank.binns@imgtec.com>
To: dri-devel@lists.freedesktop.org
Cc: Thierry Reding <treding@nvidia.com>, rufus.hamade@imgtec.com
Subject: [PATCH v2 5/6] drm: Introduce DRIVER_LEGACY feature
Date: Fri, 24 Jun 2016 18:15:19 +0100	[thread overview]
Message-ID: <1466788520-21325-6-git-send-email-frank.binns@imgtec.com> (raw)
In-Reply-To: <1466788520-21325-1-git-send-email-frank.binns@imgtec.com>

From: Thierry Reding <treding@nvidia.com>

Currently drivers that set the DRIVER_MODESET feature are considered to
be non-legacy drivers. At the same time DRIVER_MODESET implies that the
mode-setting IOCTLs are available. It is therefore not possible to
distinguish between a non-legacy driver with full mode-setting support
and a non-legacy driver without mode-setting functionality.

To separate the meaning of "legacy" and "modeset", a new driver feature
is introduced: DRIVER_LEGACY. The meaning of DRIVER_MODESET can then be
changed to apply to the mode-setting functionality only, irrespective
of whether it is legacy or not.

Mark all legacy drivers appropriately.

Signed-off-by: Thierry Reding <treding@nvidia.com>

v2:
- Rebase
- Add legacy flag to r128
- Don't add legacy flag to radeon
- Build fix for tdfx (use the correct field name)
- Add documentation to drm-internals

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
---
I wasn't totally sure what to do with regards to authorship and sign-off
as I'd like to give credit where it's due. Feel free to tell me if I got
it wrong :)

 Documentation/gpu/drm-internals.rst | 9 ++++++---
 drivers/gpu/drm/i810/i810_drv.c     | 3 ++-
 drivers/gpu/drm/mga/mga_drv.c       | 3 ++-
 drivers/gpu/drm/r128/r128_drv.c     | 3 ++-
 drivers/gpu/drm/savage/savage_drv.c | 2 +-
 drivers/gpu/drm/sis/sis_drv.c       | 2 +-
 drivers/gpu/drm/tdfx/tdfx_drv.c     | 1 +
 drivers/gpu/drm/via/via_drv.c       | 2 +-
 include/drm/drmP.h                  | 1 +
 9 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Documentation/gpu/drm-internals.rst b/Documentation/gpu/drm-internals.rst
index 4f71765..97b458e 100644
--- a/Documentation/gpu/drm-internals.rst
+++ b/Documentation/gpu/drm-internals.rst
@@ -95,6 +95,9 @@ DRIVER_ATOMIC
     implement appropriate obj->atomic_get_property() vfuncs for any
     modeset objects with driver specific properties.
 
+DRIVER_LEGACY
+    Driver supports user mode setting interfaces (UMS). Deprecated.
+
 Major, Minor and Patchlevel
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -337,9 +340,9 @@ how the ioctl is allowed to be called.
    device
 
 -  DRM_UNLOCKED - The ioctl handler will be called without locking the
-   DRM global mutex. This is the enforced default for kms drivers (i.e.
-   using the DRIVER_MODESET flag) and hence shouldn't be used any more
-   for new drivers.
+   DRM global mutex. This is the enforced default for drivers that don't
+   support UMS (i.e. using the DRIVER_LEGACY flag) and hence shouldn't
+   be used any more for new drivers.
 
 .. kernel-doc:: drivers/gpu/drm/drm_ioctl.c
    :export:
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 44f4a13..8c3c04a 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -58,7 +58,8 @@ static const struct file_operations i810_driver_fops = {
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP |
-	    DRIVER_HAVE_DMA,
+	    DRIVER_HAVE_DMA |
+	    DRIVER_LEGACY,
 	.dev_priv_size = sizeof(drm_i810_buf_priv_t),
 	.load = i810_driver_load,
 	.lastclose = i810_driver_lastclose,
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 5e2f131..06aafdc 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -59,7 +59,8 @@ static const struct file_operations mga_driver_fops = {
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_PCI_DMA |
-	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
+	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
+	    DRIVER_LEGACY,
 	.dev_priv_size = sizeof(drm_mga_buf_priv_t),
 	.load = mga_driver_load,
 	.unload = mga_driver_unload,
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
index c57b4de..5a63425 100644
--- a/drivers/gpu/drm/r128/r128_drv.c
+++ b/drivers/gpu/drm/r128/r128_drv.c
@@ -57,7 +57,8 @@ static const struct file_operations r128_driver_fops = {
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
-	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
+	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
+	    DRIVER_LEGACY,
 	.dev_priv_size = sizeof(drm_r128_buf_priv_t),
 	.load = r128_driver_load,
 	.preclose = r128_driver_preclose,
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 21aed1f..3b80713 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -50,7 +50,7 @@ static const struct file_operations savage_driver_fops = {
 
 static struct drm_driver driver = {
 	.driver_features =
-	    DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA,
+	    DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA | DRIVER_LEGACY,
 	.dev_priv_size = sizeof(drm_savage_buf_priv_t),
 	.load = savage_driver_load,
 	.firstopen = savage_driver_firstopen,
diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
index 79bce76..ae98398 100644
--- a/drivers/gpu/drm/sis/sis_drv.c
+++ b/drivers/gpu/drm/sis/sis_drv.c
@@ -102,7 +102,7 @@ static void sis_driver_postclose(struct drm_device *dev, struct drm_file *file)
 }
 
 static struct drm_driver driver = {
-	.driver_features = DRIVER_USE_AGP,
+	.driver_features = DRIVER_USE_AGP | DRIVER_LEGACY,
 	.load = sis_driver_load,
 	.unload = sis_driver_unload,
 	.open = sis_driver_open,
diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
index fab5ebc..f418892 100644
--- a/drivers/gpu/drm/tdfx/tdfx_drv.c
+++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
@@ -56,6 +56,7 @@ static const struct file_operations tdfx_driver_fops = {
 };
 
 static struct drm_driver driver = {
+	.driver_features = DRIVER_LEGACY,
 	.set_busid = drm_pci_set_busid,
 	.fops = &tdfx_driver_fops,
 	.name = DRIVER_NAME,
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index ed8aa8f..de54424 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -73,7 +73,7 @@ static const struct file_operations via_driver_fops = {
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_HAVE_IRQ |
-	    DRIVER_IRQ_SHARED,
+	    DRIVER_IRQ_SHARED | DRIVER_LEGACY,
 	.load = via_driver_load,
 	.unload = via_driver_unload,
 	.open = via_driver_open,
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1d39988..b6e21f3 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -157,6 +157,7 @@ void drm_err(const char *format, ...);
 #define DRIVER_RENDER			0x8000
 #define DRIVER_ATOMIC			0x10000
 #define DRIVER_KMS_LEGACY_CONTEXT	0x20000
+#define DRIVER_LEGACY			0x40000
 
 /***********************************************************************/
 /** \name Macros to make printk easier */
-- 
2.7.4

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

  parent reply	other threads:[~2016-06-24 17:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 17:15 [PATCH v2 0/6] Support render only drivers Frank Binns
2016-06-24 17:15 ` [PATCH 1/6] drm/vmwgfx: Stop checking minor type directly Frank Binns
2016-06-24 22:46   ` Sinclair Yeh
2016-07-12 11:08     ` Daniel Vetter
2016-06-24 17:15 ` [PATCH 2/6] drm: Rename DRM_MINOR_LEGACY to DRM_MINOR_PRIMARY Frank Binns
2016-07-12 11:09   ` Daniel Vetter
2016-06-24 17:15 ` [PATCH 3/6] drm/amd/amdgpu: Set DRIVER_MODESET feature flag at build time Frank Binns
2016-06-24 22:08   ` Alex Deucher
2016-06-27  9:37     ` Frank Binns
2016-06-27 15:51       ` Alex Deucher
2016-06-24 17:15 ` [PATCH 4/6] drm/qxl: Remove dead code Frank Binns
2016-07-12 11:09   ` Daniel Vetter
2016-06-24 17:15 ` Frank Binns [this message]
2016-06-24 17:15 ` [PATCH v2 6/6] drm: Separate DRIVER_MODESET and DRIVER_LEGACY Frank Binns
2016-07-12 11:06   ` 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=1466788520-21325-6-git-send-email-frank.binns@imgtec.com \
    --to=frank.binns@imgtec.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rufus.hamade@imgtec.com \
    --cc=treding@nvidia.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 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.