All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] More header rework
@ 2014-09-23 13:46 Daniel Vetter
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
                   ` (9 more replies)
  0 siblings, 10 replies; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter

So the main part here is the extraction of drm_gem.h. With a bit of prep work to
ditch the legacy mmap stuff out of gem/ttm drivers. Plus a few random pieces of
leftover cleanup that I've missed in my earlier header rework or just stumbled
over while working on this.

With this drmP.h really starts to look rather sane (it's just 1kloc now),
besides maybe the uppercase P in it's name and the massive list of headers it
includes.

As usual comments and review highly welcome. I'll probably try to still throw
this at Dave for 3.18 and see whether he rejects it or not. Otherwise no harm to
postpone this until 3.19 (but David Herrrmann said he's got more work on his
todo in this area, so merging earlier might avoid conflicts).

Cheers, Daniel

Daniel Vetter (8):
  drm/<ttm-based-drivers>: Don't call drm_mmap
  drm/gem: Don't call drm_mmap from drm_gem_mmap
  drm: move drm_mmap to <drm/drm_legacy.h>
  drm: Move drm_vm_open_locked into drm_internal.h
  drm: Move leftover ioctl declarations to drm_internal.h
  drm: Move internal debugfs functions to drm_internal.h
  drm: Extract <drm/drm_gem.h>
  drm/doc: Fixup drm_irq kerneldoc includes.

 Documentation/DocBook/drm.tmpl          |   2 +-
 drivers/gpu/drm/armada/armada_gem.h     |   2 +
 drivers/gpu/drm/ast/ast_drv.h           |   2 +
 drivers/gpu/drm/ast/ast_ttm.c           |   2 +-
 drivers/gpu/drm/bochs/bochs.h           |   2 +
 drivers/gpu/drm/bochs/bochs_mm.c        |   2 +-
 drivers/gpu/drm/cirrus/cirrus_drv.h     |   2 +
 drivers/gpu/drm/cirrus/cirrus_ttm.c     |   2 +-
 drivers/gpu/drm/drm_gem.c               |   3 +-
 drivers/gpu/drm/drm_info.c              |   2 +
 drivers/gpu/drm/drm_internal.h          |  39 ++++++-
 drivers/gpu/drm/drm_prime.c             |   2 +
 drivers/gpu/drm/drm_vm.c                |   7 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.h |   2 +
 drivers/gpu/drm/gma500/gtt.h            |   1 +
 drivers/gpu/drm/i810/i810_drv.c         |   2 +-
 drivers/gpu/drm/i915/i915_drv.h         |   1 +
 drivers/gpu/drm/mga/mga_drv.c           |   2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.h   |   2 +
 drivers/gpu/drm/mgag200/mgag200_ttm.c   |   2 +-
 drivers/gpu/drm/msm/msm_drv.h           |   1 +
 drivers/gpu/drm/nouveau/nouveau_bo.h    |   2 +
 drivers/gpu/drm/nouveau/nouveau_ttm.c   |   2 +-
 drivers/gpu/drm/omapdrm/omap_drv.h      |   1 +
 drivers/gpu/drm/qxl/qxl_drv.h           |   2 +
 drivers/gpu/drm/qxl/qxl_ttm.c           |   2 +-
 drivers/gpu/drm/r128/r128_drv.c         |   2 +-
 drivers/gpu/drm/radeon/radeon.h         |   2 +
 drivers/gpu/drm/radeon/radeon_drv.c     |   4 +-
 drivers/gpu/drm/radeon/radeon_ttm.c     |   2 +-
 drivers/gpu/drm/savage/savage_drv.c     |   2 +-
 drivers/gpu/drm/sis/sis_drv.c           |   2 +-
 drivers/gpu/drm/tdfx/tdfx_drv.c         |   3 +-
 drivers/gpu/drm/tegra/gem.h             |   1 +
 drivers/gpu/drm/udl/udl_drv.h           |   1 +
 drivers/gpu/drm/via/via_drv.c           |   2 +-
 include/drm/drmP.h                      | 182 +------------------------------
 include/drm/drm_gem.h                   | 183 ++++++++++++++++++++++++++++++++
 include/drm/drm_gem_cma_helper.h        |   1 +
 include/drm/drm_legacy.h                |   1 +
 40 files changed, 276 insertions(+), 203 deletions(-)
 create mode 100644 include/drm/drm_gem.h

-- 
2.1.0

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:05   ` David Herrmann
                     ` (3 more replies)
  2014-09-23 13:46 ` [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap Daniel Vetter
                   ` (8 subsequent siblings)
  9 siblings, 4 replies; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development
  Cc: Christian Engelmayer, Daniel Vetter, Josh Triplett,
	Fabian Frederick, Rashika, Alex Deucher, Daniel Vetter,
	Christian König, Ben Skeggs

Really, the legacy buffer api should be dead, especially for all these
newfangled drivers. I suspect this is copypasta from the transitioning
days, which probably originated in radeon.

Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Herrmann <dh.herrmann@gmail.com>
Cc: Rashika <rashika.kheria@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabian Frederick <fabf@skynet.be>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/ast/ast_ttm.c         | 2 +-
 drivers/gpu/drm/bochs/bochs_mm.c      | 2 +-
 drivers/gpu/drm/cirrus/cirrus_ttm.c   | 2 +-
 drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
 drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
 drivers/gpu/drm/qxl/qxl_ttm.c         | 2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
index 5098c7dd435c..c65d432f42c4 100644
--- a/drivers/gpu/drm/ast/ast_ttm.c
+++ b/drivers/gpu/drm/ast/ast_ttm.c
@@ -427,7 +427,7 @@ int ast_mmap(struct file *filp, struct vm_area_struct *vma)
 	struct ast_private *ast;
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 
 	file_priv = filp->private_data;
 	ast = file_priv->minor->dev->dev_private;
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 2af30e7607d7..324f5a09a0a1 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -339,7 +339,7 @@ int bochs_mmap(struct file *filp, struct vm_area_struct *vma)
 	struct bochs_device *bochs;
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 
 	file_priv = filp->private_data;
 	bochs = file_priv->minor->dev->dev_private;
diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
index 3e7d758330a9..d3c615f9b183 100644
--- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
+++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
@@ -411,7 +411,7 @@ int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
 	struct cirrus_device *cirrus;
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 
 	file_priv = filp->private_data;
 	cirrus = file_priv->minor->dev->dev_private;
diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
index be883ef5a1d3..8ac70626df6c 100644
--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
 	struct mga_device *mdev;
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 
 	file_priv = filp->private_data;
 	mdev = file_priv->minor->dev->dev_private;
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index e81d086577ce..753a6def61e7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
 	struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 
 	return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index abe945a04fd4..0cbc4c987164 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
 		pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
 			__func__, vma->vm_pgoff);
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 	}
 
 	file_priv = filp->private_data;
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index eca2ce60d440..902a3e8af79b 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -956,7 +956,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
 	int r;
 
 	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 	}
 
 	file_priv = filp->private_data;
-- 
2.1.0

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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:06   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h> Daniel Vetter
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

The only user I could dig out was i915 back when ums+gem was still a
thing. But we've just very much killed that, and even when someone
screams about that we should resurrect that with a special hack
(wrapping drm_gem_mmap) in i915, not in the core code.

So good riddance to another entry point of the legacy buffer mapping
code.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index eb5dd67153e4..f9af78541505 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -888,7 +888,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
 					   vma_pages(vma));
 	if (!node) {
 		mutex_unlock(&dev->struct_mutex);
-		return drm_mmap(filp, vma);
+		return -EINVAL;
 	} else if (!drm_vma_node_is_allowed(node, filp)) {
 		mutex_unlock(&dev->struct_mutex);
 		return -EACCES;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h>
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
  2014-09-23 13:46 ` [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:12   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h Daniel Vetter
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

Now that we've removed the copypasted users in gem/ttm we can
relegate the legacy buffer mapping support to where it belongs.
Also give it the proper drm_legacy_ prefix.

While at it statify drm_mmap_locked, somehow I've missed that in my
previous header rework.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_internal.h      | 1 -
 drivers/gpu/drm/drm_vm.c            | 6 +++---
 drivers/gpu/drm/i810/i810_drv.c     | 2 +-
 drivers/gpu/drm/mga/mga_drv.c       | 2 +-
 drivers/gpu/drm/r128/r128_drv.c     | 2 +-
 drivers/gpu/drm/radeon/radeon_drv.c | 2 +-
 drivers/gpu/drm/savage/savage_drv.c | 2 +-
 drivers/gpu/drm/sis/sis_drv.c       | 2 +-
 drivers/gpu/drm/tdfx/tdfx_drv.c     | 3 ++-
 drivers/gpu/drm/via/via_drv.c       | 2 +-
 include/drm/drmP.h                  | 1 -
 include/drm/drm_legacy.h            | 1 +
 12 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 7e459bf38c26..d27faae45f1b 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -37,7 +37,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
 
 /* drm_vm.c */
 int drm_vma_info(struct seq_file *m, void *data);
-int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
 void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
 
 /* drm_prime.c */
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 06cad0323699..e36c5cb2733b 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -541,7 +541,7 @@ static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev)
  * according to the mapping type and remaps the pages. Finally sets the file
  * pointer and calls vm_open().
  */
-int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
+static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 {
 	struct drm_file *priv = filp->private_data;
 	struct drm_device *dev = priv->minor->dev;
@@ -655,7 +655,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 	return 0;
 }
 
-int drm_mmap(struct file *filp, struct vm_area_struct *vma)
+int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma)
 {
 	struct drm_file *priv = filp->private_data;
 	struct drm_device *dev = priv->minor->dev;
@@ -670,7 +670,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
 
 	return ret;
 }
-EXPORT_SYMBOL(drm_mmap);
+EXPORT_SYMBOL(drm_legacy_mmap);
 
 void drm_legacy_vma_flush(struct drm_device *dev)
 {
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 6cb08a1c6b62..44f4a131c8dd 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -47,7 +47,7 @@ static const struct file_operations i810_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = drm_compat_ioctl,
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index cb5c71f4b28e..5e2f131a6a72 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = mga_compat_ioctl,
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
index 4a59370eb580..c57b4de63caf 100644
--- a/drivers/gpu/drm/r128/r128_drv.c
+++ b/drivers/gpu/drm/r128/r128_drv.c
@@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = r128_compat_ioctl,
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index ec7e963d9bf7..dd082049fd5b 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -308,7 +308,7 @@ static const struct file_operations radeon_driver_old_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 	.read = drm_read,
 #ifdef CONFIG_COMPAT
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 1b09d2182037..21aed1febeb4 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = drm_compat_ioctl,
diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
index 54858e6fedaf..79bce76cb8f7 100644
--- a/drivers/gpu/drm/sis/sis_drv.c
+++ b/drivers/gpu/drm/sis/sis_drv.c
@@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = drm_compat_ioctl,
diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
index df533ff999a4..fab5ebcb0fef 100644
--- a/drivers/gpu/drm/tdfx/tdfx_drv.c
+++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
@@ -36,6 +36,7 @@
 #include "tdfx_drv.h"
 
 #include <drm/drm_pciids.h>
+#include <drm/drm_legacy.h>
 
 static struct pci_device_id pciidlist[] = {
 	tdfx_PCI_IDS
@@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = drm_compat_ioctl,
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index c16ffa63ded6..ed8aa8ff861a 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -62,7 +62,7 @@ static const struct file_operations via_driver_fops = {
 	.open = drm_open,
 	.release = drm_release,
 	.unlocked_ioctl = drm_ioctl,
-	.mmap = drm_mmap,
+	.mmap = drm_legacy_mmap,
 	.poll = drm_poll,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = drm_compat_ioctl,
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 5c60d384b37b..24aa38236367 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
 extern int drm_release(struct inode *inode, struct file *filp);
 
 				/* Mapping support (drm_vm.h) */
-extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
 extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
index 6486306beb0d..3e698038dc7b 100644
--- a/include/drm/drm_legacy.h
+++ b/include/drm/drm_legacy.h
@@ -157,6 +157,7 @@ int drm_legacy_addmap(struct drm_device *d, resource_size_t offset,
 int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
 int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
 struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
+int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma);
 
 int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
 int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (2 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h> Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:15   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h Daniel Vetter
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

Leftover from my previous header cleanup.

This depends upon the patch to rework exynos mmap support, otherwise
it'll break exynos.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_internal.h | 1 +
 drivers/gpu/drm/drm_vm.c       | 1 -
 include/drm/drmP.h             | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index d27faae45f1b..05624561118a 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -37,6 +37,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
 
 /* drm_vm.c */
 int drm_vma_info(struct seq_file *m, void *data);
+void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
 void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
 
 /* drm_prime.c */
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index e36c5cb2733b..ac33f7d1ee35 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -421,7 +421,6 @@ void drm_vm_open_locked(struct drm_device *dev,
 		list_add(&vma_entry->head, &dev->vmalist);
 	}
 }
-EXPORT_SYMBOL_GPL(drm_vm_open_locked);
 
 static void drm_vm_open(struct vm_area_struct *vma)
 {
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 24aa38236367..9f1abd51ded2 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
 extern int drm_release(struct inode *inode, struct file *filp);
 
 				/* Mapping support (drm_vm.h) */
-extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
 /* Misc. IOCTL support (drm_ioctl.c) */
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (3 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:16   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 6/8] drm: Move internal debugfs functions " Daniel Vetter
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter

Somehow I've missed these three, fix this up asap. Plus move
drm_master_create since while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_internal.h | 9 +++++++++
 include/drm/drmP.h             | 7 -------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 05624561118a..bc71be6f29e0 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -62,6 +62,8 @@ int drm_gem_name_info(struct seq_file *m, void *data);
 /* drm_irq.c */
 int drm_control(struct drm_device *dev, void *data,
 		struct drm_file *file_priv);
+int drm_modeset_ctl(struct drm_device *dev, void *data,
+		    struct drm_file *file_priv);
 
 /* drm_auth.c */
 int drm_getmagic(struct drm_device *dev, void *data,
@@ -93,3 +95,10 @@ int drm_gem_open_ioctl(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv);
 void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
 void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
+
+/* drm_drv.c */
+int drm_setmaster_ioctl(struct drm_device *dev, void *data,
+			struct drm_file *file_priv);
+int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
+			 struct drm_file *file_priv);
+struct drm_master *drm_master_create(struct drm_minor *minor);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9f1abd51ded2..09dd6c77f152 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1026,15 +1026,8 @@ static inline wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc
 /* Modesetting support */
 extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
 extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
-extern int drm_modeset_ctl(struct drm_device *dev, void *data,
-			   struct drm_file *file_priv);
 
 				/* Stub support (drm_stub.h) */
-extern int drm_setmaster_ioctl(struct drm_device *dev, void *data,
-			       struct drm_file *file_priv);
-extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
-				struct drm_file *file_priv);
-struct drm_master *drm_master_create(struct drm_minor *minor);
 extern struct drm_master *drm_master_get(struct drm_master *master);
 extern void drm_master_put(struct drm_master **master);
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 6/8] drm: Move internal debugfs functions to drm_internal.h
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (4 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:21   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 7/8] drm: Extract <drm/drm_gem.h> Daniel Vetter
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter

In my header cleanup I've missed the debugfs functions completely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_internal.h | 28 ++++++++++++++++++++++++++++
 include/drm/drmP.h             | 25 -------------------------
 2 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index bc71be6f29e0..7cc0a3516871 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -102,3 +102,31 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
 int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
 			 struct drm_file *file_priv);
 struct drm_master *drm_master_create(struct drm_minor *minor);
+
+/* drm_debugfs.c */
+#if defined(CONFIG_DEBUG_FS)
+int drm_debugfs_init(struct drm_minor *minor, int minor_id,
+		     struct dentry *root);
+int drm_debugfs_cleanup(struct drm_minor *minor);
+int drm_debugfs_connector_add(struct drm_connector *connector);
+void drm_debugfs_connector_remove(struct drm_connector *connector);
+#else
+static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
+				   struct dentry *root)
+{
+	return 0;
+}
+
+static inline int drm_debugfs_cleanup(struct drm_minor *minor)
+{
+	return 0;
+}
+
+static inline int drm_debugfs_connector_add(struct drm_connector *connector)
+{
+	return 0;
+}
+static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
+{
+}
+#endif
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 09dd6c77f152..9130c8bd9e09 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1037,23 +1037,12 @@ extern unsigned int drm_debug;
 
 				/* Debugfs support */
 #if defined(CONFIG_DEBUG_FS)
-extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
-			    struct dentry *root);
 extern int drm_debugfs_create_files(const struct drm_info_list *files,
 				    int count, struct dentry *root,
 				    struct drm_minor *minor);
 extern int drm_debugfs_remove_files(const struct drm_info_list *files,
 				    int count, struct drm_minor *minor);
-extern int drm_debugfs_cleanup(struct drm_minor *minor);
-extern int drm_debugfs_connector_add(struct drm_connector *connector);
-extern void drm_debugfs_connector_remove(struct drm_connector *connector);
 #else
-static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
-				   struct dentry *root)
-{
-	return 0;
-}
-
 static inline int drm_debugfs_create_files(const struct drm_info_list *files,
 					   int count, struct dentry *root,
 					   struct drm_minor *minor)
@@ -1066,20 +1055,6 @@ static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
 {
 	return 0;
 }
-
-static inline int drm_debugfs_cleanup(struct drm_minor *minor)
-{
-	return 0;
-}
-
-static inline int drm_debugfs_connector_add(struct drm_connector *connector)
-{
-	return 0;
-}
-static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
-{
-}
-
 #endif
 
 extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 7/8] drm: Extract <drm/drm_gem.h>
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (5 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 6/8] drm: Move internal debugfs functions " Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:22   ` David Herrmann
  2014-09-23 13:46 ` [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes Daniel Vetter
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

v2: Don't forget git add, noticed by David.

Cc: David Herrmann <dh.herrmann@gmail.com>

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/armada/armada_gem.h     |   2 +
 drivers/gpu/drm/ast/ast_drv.h           |   2 +
 drivers/gpu/drm/bochs/bochs.h           |   2 +
 drivers/gpu/drm/cirrus/cirrus_drv.h     |   2 +
 drivers/gpu/drm/drm_gem.c               |   1 +
 drivers/gpu/drm/drm_info.c              |   2 +
 drivers/gpu/drm/drm_prime.c             |   2 +
 drivers/gpu/drm/exynos/exynos_drm_gem.h |   2 +
 drivers/gpu/drm/gma500/gtt.h            |   1 +
 drivers/gpu/drm/i915/i915_drv.h         |   1 +
 drivers/gpu/drm/mgag200/mgag200_drv.h   |   2 +
 drivers/gpu/drm/msm/msm_drv.h           |   1 +
 drivers/gpu/drm/nouveau/nouveau_bo.h    |   2 +
 drivers/gpu/drm/omapdrm/omap_drv.h      |   1 +
 drivers/gpu/drm/qxl/qxl_drv.h           |   2 +
 drivers/gpu/drm/radeon/radeon.h         |   2 +
 drivers/gpu/drm/radeon/radeon_drv.c     |   2 +
 drivers/gpu/drm/tegra/gem.h             |   1 +
 drivers/gpu/drm/udl/udl_drv.h           |   1 +
 include/drm/drmP.h                      | 148 +-------------------------
 include/drm/drm_gem.h                   | 183 ++++++++++++++++++++++++++++++++
 include/drm/drm_gem_cma_helper.h        |   1 +
 22 files changed, 216 insertions(+), 147 deletions(-)
 create mode 100644 include/drm/drm_gem.h

diff --git a/drivers/gpu/drm/armada/armada_gem.h b/drivers/gpu/drm/armada/armada_gem.h
index 00b6cd461a03..b000ea3a829a 100644
--- a/drivers/gpu/drm/armada/armada_gem.h
+++ b/drivers/gpu/drm/armada/armada_gem.h
@@ -8,6 +8,8 @@
 #ifndef ARMADA_GEM_H
 #define ARMADA_GEM_H
 
+#include <drm/drm_gem.h>
+
 /* GEM */
 struct armada_gem_object {
 	struct drm_gem_object	obj;
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 7485ff945ca9..86205a28e56b 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -36,6 +36,8 @@
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
 
+#include <drm/drm_gem.h>
+
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index 4f6e7b3a3635..71f2687fc3cc 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -7,6 +7,8 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
 
+#include <drm/drm_gem.h>
+
 #include <ttm/ttm_bo_driver.h>
 #include <ttm/ttm_page_alloc.h>
 
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
index dd2cfc9024aa..d44e69daa239 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.h
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
@@ -21,6 +21,8 @@
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
 
+#include <drm/drm_gem.h>
+
 #define DRIVER_AUTHOR		"Matthew Garrett"
 
 #define DRIVER_NAME		"cirrus"
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index f9af78541505..cd45e45e2cce 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -38,6 +38,7 @@
 #include <linux/dma-buf.h>
 #include <drm/drmP.h>
 #include <drm/drm_vma_manager.h>
+#include <drm/drm_gem.h>
 #include "drm_internal.h"
 
 /** @file drm_gem.c
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index 0780541f7935..51efebd434f3 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -35,6 +35,8 @@
 
 #include <linux/seq_file.h>
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
+
 #include "drm_legacy.h"
 
 /**
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 2807a771f505..7826de9da276 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -29,6 +29,8 @@
 #include <linux/export.h>
 #include <linux/dma-buf.h>
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
+
 #include "drm_internal.h"
 
 /*
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
index 1592c0ba7de8..74818b15e853 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
@@ -12,6 +12,8 @@
 #ifndef _EXYNOS_DRM_GEM_H_
 #define _EXYNOS_DRM_GEM_H_
 
+#include <drm/drm_gem.h>
+
 #define to_exynos_gem_obj(x)	container_of(x,\
 			struct exynos_drm_gem_obj, base)
 
diff --git a/drivers/gpu/drm/gma500/gtt.h b/drivers/gpu/drm/gma500/gtt.h
index f5860a739bd8..cdbb350c9d5d 100644
--- a/drivers/gpu/drm/gma500/gtt.h
+++ b/drivers/gpu/drm/gma500/gtt.h
@@ -21,6 +21,7 @@
 #define _PSB_GTT_H_
 
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
 
 /* This wants cleaning up with respect to the psb_dev and un-needed stuff */
 struct psb_gtt {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 07dafa2c2d8c..e9f5765699b4 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -43,6 +43,7 @@
 #include <linux/i2c-algo-bit.h>
 #include <drm/intel-gtt.h>
 #include <drm/drm_legacy.h> /* for struct drm_dma_handle */
+#include <drm/drm_gem.h>
 #include <linux/backlight.h>
 #include <linux/hashtable.h>
 #include <linux/intel-iommu.h>
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index c03e347f3ffd..e9eea1d4e7c3 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -22,6 +22,8 @@
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
 
+#include <drm/drm_gem.h>
+
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 8a2c5fd0893e..afaafd42dee7 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -51,6 +51,7 @@ static inline struct device *msm_iommu_get_ctx(const char *ctx_name)
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/msm_drm.h>
+#include <drm/drm_gem.h>
 
 struct msm_kms;
 struct msm_gpu;
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
index ae95b2d43b36..f238def41a92 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.h
@@ -1,6 +1,8 @@
 #ifndef __NOUVEAU_BO_H__
 #define __NOUVEAU_BO_H__
 
+#include <drm/drm_gem.h>
+
 struct nouveau_channel;
 struct nouveau_fence;
 struct nouveau_vma;
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 84d73a61b34b..60e47b33c801 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -26,6 +26,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/omap_drm.h>
+#include <drm/drm_gem.h>
 #include <linux/platform_data/omap_drm.h>
 
 
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
index d75c0a9f674f..ff0772728eb0 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.h
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
@@ -43,6 +43,8 @@
 #include <ttm/ttm_placement.h>
 #include <ttm/ttm_module.h>
 
+#include <drm/drm_gem.h>
+
 /* just for ttm_validate_buffer */
 #include <ttm/ttm_execbuf_util.h>
 
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 82b0e11ade89..ef91ebb7c671 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -74,6 +74,8 @@
 #include <ttm/ttm_module.h>
 #include <ttm/ttm_execbuf_util.h>
 
+#include <drm/drm_gem.h>
+
 #include "radeon_family.h"
 #include "radeon_mode.h"
 #include "radeon_reg.h"
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index dd082049fd5b..de108427a197 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -38,6 +38,8 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
+#include <drm/drm_gem.h>
+
 #include "drm_crtc_helper.h"
 /*
  * KMS wrapper.
diff --git a/drivers/gpu/drm/tegra/gem.h b/drivers/gpu/drm/tegra/gem.h
index 43a25c853357..6538b56780c2 100644
--- a/drivers/gpu/drm/tegra/gem.h
+++ b/drivers/gpu/drm/tegra/gem.h
@@ -15,6 +15,7 @@
 
 #include <drm/drm.h>
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
 
 #define TEGRA_BO_BOTTOM_UP (1 << 0)
 
diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 51e10ee77f39..c7490a2489a7 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -15,6 +15,7 @@
 #define UDL_DRV_H
 
 #include <linux/usb.h>
+#include <drm/drm_gem.h>
 
 #define DRIVER_NAME		"udl"
 #define DRIVER_DESC		"DisplayLink"
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9130c8bd9e09..d46efbc255ed 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -82,6 +82,7 @@ struct drm_agp_head;
 struct drm_local_map;
 struct drm_device_dma;
 struct drm_dma_handle;
+struct drm_gem_object;
 
 struct device_node;
 struct videomode;
@@ -331,93 +332,6 @@ struct drm_lock_data {
 };
 
 /**
- * This structure defines the drm_mm memory object, which will be used by the
- * DRM for its buffer objects.
- */
-struct drm_gem_object {
-	/** Reference count of this object */
-	struct kref refcount;
-
-	/**
-	 * handle_count - gem file_priv handle count of this object
-	 *
-	 * Each handle also holds a reference. Note that when the handle_count
-	 * drops to 0 any global names (e.g. the id in the flink namespace) will
-	 * be cleared.
-	 *
-	 * Protected by dev->object_name_lock.
-	 * */
-	unsigned handle_count;
-
-	/** Related drm device */
-	struct drm_device *dev;
-
-	/** File representing the shmem storage */
-	struct file *filp;
-
-	/* Mapping info for this object */
-	struct drm_vma_offset_node vma_node;
-
-	/**
-	 * Size of the object, in bytes.  Immutable over the object's
-	 * lifetime.
-	 */
-	size_t size;
-
-	/**
-	 * Global name for this object, starts at 1. 0 means unnamed.
-	 * Access is covered by the object_name_lock in the related drm_device
-	 */
-	int name;
-
-	/**
-	 * Memory domains. These monitor which caches contain read/write data
-	 * related to the object. When transitioning from one set of domains
-	 * to another, the driver is called to ensure that caches are suitably
-	 * flushed and invalidated
-	 */
-	uint32_t read_domains;
-	uint32_t write_domain;
-
-	/**
-	 * While validating an exec operation, the
-	 * new read/write domain values are computed here.
-	 * They will be transferred to the above values
-	 * at the point that any cache flushing occurs
-	 */
-	uint32_t pending_read_domains;
-	uint32_t pending_write_domain;
-
-	/**
-	 * dma_buf - dma buf associated with this GEM object
-	 *
-	 * Pointer to the dma-buf associated with this gem object (either
-	 * through importing or exporting). We break the resulting reference
-	 * loop when the last gem handle for this object is released.
-	 *
-	 * Protected by obj->object_name_lock
-	 */
-	struct dma_buf *dma_buf;
-
-	/**
-	 * import_attach - dma buf attachment backing this object
-	 *
-	 * Any foreign dma_buf imported as a gem object has this set to the
-	 * attachment point for the device. This is invariant over the lifetime
-	 * of a gem object.
-	 *
-	 * The driver's ->gem_free_object callback is responsible for cleaning
-	 * up the dma_buf attachment and references acquired at import time.
-	 *
-	 * Note that the drm gem/prime core does not depend upon drivers setting
-	 * this field any more. So for drivers where this doesn't make sense
-	 * (e.g. virtual devices or a displaylink behind an usb bus) they can
-	 * simply leave it as NULL.
-	 */
-	struct dma_buf_attachment *import_attach;
-};
-
-/**
  * struct drm_master - drm master structure
  *
  * @refcount: Refcount for this master object.
@@ -1073,10 +987,6 @@ extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **
 extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages);
 extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
 
-int drm_gem_dumb_destroy(struct drm_file *file,
-			 struct drm_device *dev,
-			 uint32_t handle);
-
 
 extern struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
 					    size_t align);
@@ -1085,62 +995,6 @@ extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
 			       /* sysfs support (drm_sysfs.c) */
 extern void drm_sysfs_hotplug_event(struct drm_device *dev);
 
-/* Graphics Execution Manager library functions (drm_gem.c) */
-void drm_gem_object_release(struct drm_gem_object *obj);
-void drm_gem_object_free(struct kref *kref);
-int drm_gem_object_init(struct drm_device *dev,
-			struct drm_gem_object *obj, size_t size);
-void drm_gem_private_object_init(struct drm_device *dev,
-				 struct drm_gem_object *obj, size_t size);
-void drm_gem_vm_open(struct vm_area_struct *vma);
-void drm_gem_vm_close(struct vm_area_struct *vma);
-int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
-		     struct vm_area_struct *vma);
-int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
-
-static inline void
-drm_gem_object_reference(struct drm_gem_object *obj)
-{
-	kref_get(&obj->refcount);
-}
-
-static inline void
-drm_gem_object_unreference(struct drm_gem_object *obj)
-{
-	if (obj != NULL)
-		kref_put(&obj->refcount, drm_gem_object_free);
-}
-
-static inline void
-drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
-{
-	if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
-		struct drm_device *dev = obj->dev;
-
-		mutex_lock(&dev->struct_mutex);
-		if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
-			drm_gem_object_free(&obj->refcount);
-		mutex_unlock(&dev->struct_mutex);
-	}
-}
-
-int drm_gem_handle_create(struct drm_file *file_priv,
-			  struct drm_gem_object *obj,
-			  u32 *handlep);
-int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
-
-
-void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
-int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
-int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
-
-struct page **drm_gem_get_pages(struct drm_gem_object *obj);
-void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
-		bool dirty, bool accessed);
-
-struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
-					     struct drm_file *filp,
-					     u32 handle);
 
 struct drm_device *drm_dev_alloc(struct drm_driver *driver,
 				 struct device *parent);
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
new file mode 100644
index 000000000000..1e6ae1458f7a
--- /dev/null
+++ b/include/drm/drm_gem.h
@@ -0,0 +1,183 @@
+#ifndef __DRM_GEM_H__
+#define __DRM_GEM_H__
+
+/*
+ * GEM Graphics Execution Manager Driver Interfaces
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * Copyright (c) 2009-2010, Code Aurora Forum.
+ * All rights reserved.
+ * Copyright © 2014 Intel Corporation
+ *   Daniel Vetter <daniel.vetter@ffwll.ch>
+ *
+ * Author: Rickard E. (Rik) Faith <faith@valinux.com>
+ * Author: Gareth Hughes <gareth@valinux.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * This structure defines the drm_mm memory object, which will be used by the
+ * DRM for its buffer objects.
+ */
+struct drm_gem_object {
+	/** Reference count of this object */
+	struct kref refcount;
+
+	/**
+	 * handle_count - gem file_priv handle count of this object
+	 *
+	 * Each handle also holds a reference. Note that when the handle_count
+	 * drops to 0 any global names (e.g. the id in the flink namespace) will
+	 * be cleared.
+	 *
+	 * Protected by dev->object_name_lock.
+	 * */
+	unsigned handle_count;
+
+	/** Related drm device */
+	struct drm_device *dev;
+
+	/** File representing the shmem storage */
+	struct file *filp;
+
+	/* Mapping info for this object */
+	struct drm_vma_offset_node vma_node;
+
+	/**
+	 * Size of the object, in bytes.  Immutable over the object's
+	 * lifetime.
+	 */
+	size_t size;
+
+	/**
+	 * Global name for this object, starts at 1. 0 means unnamed.
+	 * Access is covered by the object_name_lock in the related drm_device
+	 */
+	int name;
+
+	/**
+	 * Memory domains. These monitor which caches contain read/write data
+	 * related to the object. When transitioning from one set of domains
+	 * to another, the driver is called to ensure that caches are suitably
+	 * flushed and invalidated
+	 */
+	uint32_t read_domains;
+	uint32_t write_domain;
+
+	/**
+	 * While validating an exec operation, the
+	 * new read/write domain values are computed here.
+	 * They will be transferred to the above values
+	 * at the point that any cache flushing occurs
+	 */
+	uint32_t pending_read_domains;
+	uint32_t pending_write_domain;
+
+	/**
+	 * dma_buf - dma buf associated with this GEM object
+	 *
+	 * Pointer to the dma-buf associated with this gem object (either
+	 * through importing or exporting). We break the resulting reference
+	 * loop when the last gem handle for this object is released.
+	 *
+	 * Protected by obj->object_name_lock
+	 */
+	struct dma_buf *dma_buf;
+
+	/**
+	 * import_attach - dma buf attachment backing this object
+	 *
+	 * Any foreign dma_buf imported as a gem object has this set to the
+	 * attachment point for the device. This is invariant over the lifetime
+	 * of a gem object.
+	 *
+	 * The driver's ->gem_free_object callback is responsible for cleaning
+	 * up the dma_buf attachment and references acquired at import time.
+	 *
+	 * Note that the drm gem/prime core does not depend upon drivers setting
+	 * this field any more. So for drivers where this doesn't make sense
+	 * (e.g. virtual devices or a displaylink behind an usb bus) they can
+	 * simply leave it as NULL.
+	 */
+	struct dma_buf_attachment *import_attach;
+};
+
+void drm_gem_object_release(struct drm_gem_object *obj);
+void drm_gem_object_free(struct kref *kref);
+int drm_gem_object_init(struct drm_device *dev,
+			struct drm_gem_object *obj, size_t size);
+void drm_gem_private_object_init(struct drm_device *dev,
+				 struct drm_gem_object *obj, size_t size);
+void drm_gem_vm_open(struct vm_area_struct *vma);
+void drm_gem_vm_close(struct vm_area_struct *vma);
+int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
+		     struct vm_area_struct *vma);
+int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
+
+static inline void
+drm_gem_object_reference(struct drm_gem_object *obj)
+{
+	kref_get(&obj->refcount);
+}
+
+static inline void
+drm_gem_object_unreference(struct drm_gem_object *obj)
+{
+	if (obj != NULL)
+		kref_put(&obj->refcount, drm_gem_object_free);
+}
+
+static inline void
+drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
+{
+	if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
+		struct drm_device *dev = obj->dev;
+
+		mutex_lock(&dev->struct_mutex);
+		if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
+			drm_gem_object_free(&obj->refcount);
+		mutex_unlock(&dev->struct_mutex);
+	}
+}
+
+int drm_gem_handle_create(struct drm_file *file_priv,
+			  struct drm_gem_object *obj,
+			  u32 *handlep);
+int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
+
+
+void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
+int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
+int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
+
+struct page **drm_gem_get_pages(struct drm_gem_object *obj);
+void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
+		bool dirty, bool accessed);
+
+struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
+					     struct drm_file *filp,
+					     u32 handle);
+int drm_gem_dumb_destroy(struct drm_file *file,
+			 struct drm_device *dev,
+			 uint32_t handle);
+
+#endif /* __DRM_GEM_H__ */
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 2a3cea91606d..42f11f3a8d39 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -2,6 +2,7 @@
 #define __DRM_GEM_CMA_HELPER_H__
 
 #include <drm/drmP.h>
+#include <drm/drm_gem.h>
 
 struct drm_gem_cma_object {
 	struct drm_gem_object base;
-- 
2.1.0

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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes.
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (6 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 7/8] drm: Extract <drm/drm_gem.h> Daniel Vetter
@ 2014-09-23 13:46 ` Daniel Vetter
  2014-09-23 14:22   ` David Herrmann
  2014-09-23 14:24 ` [PATCH 0/8] More header rework David Herrmann
  2014-09-23 15:11 ` Alex Deucher
  9 siblings, 1 reply; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 13:46 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

Only !P can be used together with a function list.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 Documentation/DocBook/drm.tmpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index ca44d9fe7d7d..be35bc328b77 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -3406,7 +3406,7 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis>
     <sect2>
       <title>Vertical Blanking and Interrupt Handling Functions Reference</title>
 !Edrivers/gpu/drm/drm_irq.c
-!Iinclude/drm/drmP.h drm_crtc_vblank_waitqueue
+!Finclude/drm/drmP.h drm_crtc_vblank_waitqueue
     </sect2>
   </sect1>
 
-- 
2.1.0

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

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
@ 2014-09-23 14:05   ` David Herrmann
  2014-09-23 15:30   ` Christian König
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:05 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Christian Engelmayer, Josh Triplett, DRI Development,
	Fabian Frederick, Rashika, Alex Deucher, Daniel Vetter,
	Christian König, Ben Skeggs

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Really, the legacy buffer api should be dead, especially for all these
> newfangled drivers. I suspect this is copypasta from the transitioning
> days, which probably originated in radeon.
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Rashika <rashika.kheria@gmail.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Fabian Frederick <fabf@skynet.be>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Alexandre Courbot <acourbot@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> Cc: Christian Engelmayer <cengelma@gmx.at>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Yeah, I hope no-one ever used DMA-mmap or BUFS-mmap on those drivers..
otherwise, we can still revert it in special cases (or just break this
legacy stuff..).

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> ---
>  drivers/gpu/drm/ast/ast_ttm.c         | 2 +-
>  drivers/gpu/drm/bochs/bochs_mm.c      | 2 +-
>  drivers/gpu/drm/cirrus/cirrus_ttm.c   | 2 +-
>  drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
>  drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
>  drivers/gpu/drm/qxl/qxl_ttm.c         | 2 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c   | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
> index 5098c7dd435c..c65d432f42c4 100644
> --- a/drivers/gpu/drm/ast/ast_ttm.c
> +++ b/drivers/gpu/drm/ast/ast_ttm.c
> @@ -427,7 +427,7 @@ int ast_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct ast_private *ast;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         ast = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> index 2af30e7607d7..324f5a09a0a1 100644
> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> @@ -339,7 +339,7 @@ int bochs_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct bochs_device *bochs;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         bochs = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> index 3e7d758330a9..d3c615f9b183 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> @@ -411,7 +411,7 @@ int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct cirrus_device *cirrus;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         cirrus = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> index be883ef5a1d3..8ac70626df6c 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> @@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct mga_device *mdev;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         mdev = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index e81d086577ce..753a6def61e7 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index abe945a04fd4..0cbc4c987164 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
>                 pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
>                         __func__, vma->vm_pgoff);
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>         }
>
>         file_priv = filp->private_data;
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index eca2ce60d440..902a3e8af79b 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -956,7 +956,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
>         int r;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>         }
>
>         file_priv = filp->private_data;
> --
> 2.1.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap
  2014-09-23 13:46 ` [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap Daniel Vetter
@ 2014-09-23 14:06   ` David Herrmann
  0 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:06 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> The only user I could dig out was i915 back when ums+gem was still a
> thing. But we've just very much killed that, and even when someone
> screams about that we should resurrect that with a special hack
> (wrapping drm_gem_mmap) in i915, not in the core code.

Agreed! Drivers should just add the hacks themselves if there is
user-space that needs it. Same as for patch #1:

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> So good riddance to another entry point of the legacy buffer mapping
> code.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index eb5dd67153e4..f9af78541505 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -888,7 +888,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>                                            vma_pages(vma));
>         if (!node) {
>                 mutex_unlock(&dev->struct_mutex);
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>         } else if (!drm_vma_node_is_allowed(node, filp)) {
>                 mutex_unlock(&dev->struct_mutex);
>                 return -EACCES;
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h>
  2014-09-23 13:46 ` [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h> Daniel Vetter
@ 2014-09-23 14:12   ` David Herrmann
  0 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:12 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Now that we've removed the copypasted users in gem/ttm we can
> relegate the legacy buffer mapping support to where it belongs.
> Also give it the proper drm_legacy_ prefix.
>
> While at it statify drm_mmap_locked, somehow I've missed that in my
> previous header rework.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_internal.h      | 1 -
>  drivers/gpu/drm/drm_vm.c            | 6 +++---
>  drivers/gpu/drm/i810/i810_drv.c     | 2 +-
>  drivers/gpu/drm/mga/mga_drv.c       | 2 +-
>  drivers/gpu/drm/r128/r128_drv.c     | 2 +-
>  drivers/gpu/drm/radeon/radeon_drv.c | 2 +-
>  drivers/gpu/drm/savage/savage_drv.c | 2 +-
>  drivers/gpu/drm/sis/sis_drv.c       | 2 +-
>  drivers/gpu/drm/tdfx/tdfx_drv.c     | 3 ++-
>  drivers/gpu/drm/via/via_drv.c       | 2 +-
>  include/drm/drmP.h                  | 1 -
>  include/drm/drm_legacy.h            | 1 +
>  12 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 7e459bf38c26..d27faae45f1b 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -37,7 +37,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
>
>  /* drm_vm.c */
>  int drm_vma_info(struct seq_file *m, void *data);
> -int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
>  void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
>
>  /* drm_prime.c */
> diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> index 06cad0323699..e36c5cb2733b 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -541,7 +541,7 @@ static resource_size_t drm_core_get_reg_ofs(struct drm_device *dev)
>   * according to the mapping type and remaps the pages. Finally sets the file
>   * pointer and calls vm_open().
>   */
> -int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
> +static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
>  {
>         struct drm_file *priv = filp->private_data;
>         struct drm_device *dev = priv->minor->dev;
> @@ -655,7 +655,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
>         return 0;
>  }
>
> -int drm_mmap(struct file *filp, struct vm_area_struct *vma)
> +int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma)
>  {
>         struct drm_file *priv = filp->private_data;
>         struct drm_device *dev = priv->minor->dev;
> @@ -670,7 +670,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
>
>         return ret;
>  }
> -EXPORT_SYMBOL(drm_mmap);
> +EXPORT_SYMBOL(drm_legacy_mmap);
>
>  void drm_legacy_vma_flush(struct drm_device *dev)
>  {
> diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
> index 6cb08a1c6b62..44f4a131c8dd 100644
> --- a/drivers/gpu/drm/i810/i810_drv.c
> +++ b/drivers/gpu/drm/i810/i810_drv.c
> @@ -47,7 +47,7 @@ static const struct file_operations i810_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = drm_compat_ioctl,
> diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
> index cb5c71f4b28e..5e2f131a6a72 100644
> --- a/drivers/gpu/drm/mga/mga_drv.c
> +++ b/drivers/gpu/drm/mga/mga_drv.c
> @@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = mga_compat_ioctl,
> diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
> index 4a59370eb580..c57b4de63caf 100644
> --- a/drivers/gpu/drm/r128/r128_drv.c
> +++ b/drivers/gpu/drm/r128/r128_drv.c
> @@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = r128_compat_ioctl,
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index ec7e963d9bf7..dd082049fd5b 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -308,7 +308,7 @@ static const struct file_operations radeon_driver_old_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>         .read = drm_read,
>  #ifdef CONFIG_COMPAT
> diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
> index 1b09d2182037..21aed1febeb4 100644
> --- a/drivers/gpu/drm/savage/savage_drv.c
> +++ b/drivers/gpu/drm/savage/savage_drv.c
> @@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = drm_compat_ioctl,
> diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
> index 54858e6fedaf..79bce76cb8f7 100644
> --- a/drivers/gpu/drm/sis/sis_drv.c
> +++ b/drivers/gpu/drm/sis/sis_drv.c
> @@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = drm_compat_ioctl,
> diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
> index df533ff999a4..fab5ebcb0fef 100644
> --- a/drivers/gpu/drm/tdfx/tdfx_drv.c
> +++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
> @@ -36,6 +36,7 @@
>  #include "tdfx_drv.h"
>
>  #include <drm/drm_pciids.h>
> +#include <drm/drm_legacy.h>
>
>  static struct pci_device_id pciidlist[] = {
>         tdfx_PCI_IDS
> @@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = drm_compat_ioctl,
> diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
> index c16ffa63ded6..ed8aa8ff861a 100644
> --- a/drivers/gpu/drm/via/via_drv.c
> +++ b/drivers/gpu/drm/via/via_drv.c
> @@ -62,7 +62,7 @@ static const struct file_operations via_driver_fops = {
>         .open = drm_open,
>         .release = drm_release,
>         .unlocked_ioctl = drm_ioctl,
> -       .mmap = drm_mmap,
> +       .mmap = drm_legacy_mmap,
>         .poll = drm_poll,
>  #ifdef CONFIG_COMPAT
>         .compat_ioctl = drm_compat_ioctl,
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 5c60d384b37b..24aa38236367 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
>  extern int drm_release(struct inode *inode, struct file *filp);
>
>                                 /* Mapping support (drm_vm.h) */
> -extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
>  extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
>  extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
>
> diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
> index 6486306beb0d..3e698038dc7b 100644
> --- a/include/drm/drm_legacy.h
> +++ b/include/drm/drm_legacy.h
> @@ -157,6 +157,7 @@ int drm_legacy_addmap(struct drm_device *d, resource_size_t offset,
>  int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
>  int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
>  struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
> +int drm_legacy_mmap(struct file *filp, struct vm_area_struct *vma);
>
>  int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
>  int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h
  2014-09-23 13:46 ` [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h Daniel Vetter
@ 2014-09-23 14:15   ` David Herrmann
  2014-09-23 14:21     ` Daniel Vetter
  0 siblings, 1 reply; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:15 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Leftover from my previous header cleanup.
>
> This depends upon the patch to rework exynos mmap support, otherwise
> it'll break exynos.

What patch do you mean? I cannot see any users of drm_vm_open_locked()
anywhere besides drm_gem.c and drm_vm.c, (branch drm-next).

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_internal.h | 1 +
>  drivers/gpu/drm/drm_vm.c       | 1 -
>  include/drm/drmP.h             | 1 -
>  3 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index d27faae45f1b..05624561118a 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -37,6 +37,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
>
>  /* drm_vm.c */
>  int drm_vma_info(struct seq_file *m, void *data);
> +void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
>  void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
>
>  /* drm_prime.c */
> diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> index e36c5cb2733b..ac33f7d1ee35 100644
> --- a/drivers/gpu/drm/drm_vm.c
> +++ b/drivers/gpu/drm/drm_vm.c
> @@ -421,7 +421,6 @@ void drm_vm_open_locked(struct drm_device *dev,
>                 list_add(&vma_entry->head, &dev->vmalist);
>         }
>  }
> -EXPORT_SYMBOL_GPL(drm_vm_open_locked);
>
>  static void drm_vm_open(struct vm_area_struct *vma)
>  {
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 24aa38236367..9f1abd51ded2 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
>  extern int drm_release(struct inode *inode, struct file *filp);
>
>                                 /* Mapping support (drm_vm.h) */
> -extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
>  extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
>
>  /* Misc. IOCTL support (drm_ioctl.c) */
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h
  2014-09-23 13:46 ` [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h Daniel Vetter
@ 2014-09-23 14:16   ` David Herrmann
  0 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:16 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Somehow I've missed these three, fix this up asap. Plus move
> drm_master_create since while at it.

s/since//

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_internal.h | 9 +++++++++
>  include/drm/drmP.h             | 7 -------
>  2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 05624561118a..bc71be6f29e0 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -62,6 +62,8 @@ int drm_gem_name_info(struct seq_file *m, void *data);
>  /* drm_irq.c */
>  int drm_control(struct drm_device *dev, void *data,
>                 struct drm_file *file_priv);
> +int drm_modeset_ctl(struct drm_device *dev, void *data,
> +                   struct drm_file *file_priv);
>
>  /* drm_auth.c */
>  int drm_getmagic(struct drm_device *dev, void *data,
> @@ -93,3 +95,10 @@ int drm_gem_open_ioctl(struct drm_device *dev, void *data,
>                        struct drm_file *file_priv);
>  void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
>  void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
> +
> +/* drm_drv.c */
> +int drm_setmaster_ioctl(struct drm_device *dev, void *data,
> +                       struct drm_file *file_priv);
> +int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
> +                        struct drm_file *file_priv);
> +struct drm_master *drm_master_create(struct drm_minor *minor);
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 9f1abd51ded2..09dd6c77f152 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -1026,15 +1026,8 @@ static inline wait_queue_head_t *drm_crtc_vblank_waitqueue(struct drm_crtc *crtc
>  /* Modesetting support */
>  extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
>  extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
> -extern int drm_modeset_ctl(struct drm_device *dev, void *data,
> -                          struct drm_file *file_priv);
>
>                                 /* Stub support (drm_stub.h) */
> -extern int drm_setmaster_ioctl(struct drm_device *dev, void *data,
> -                              struct drm_file *file_priv);
> -extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
> -                               struct drm_file *file_priv);
> -struct drm_master *drm_master_create(struct drm_minor *minor);
>  extern struct drm_master *drm_master_get(struct drm_master *master);
>  extern void drm_master_put(struct drm_master **master);
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 6/8] drm: Move internal debugfs functions to drm_internal.h
  2014-09-23 13:46 ` [PATCH 6/8] drm: Move internal debugfs functions " Daniel Vetter
@ 2014-09-23 14:21   ` David Herrmann
  0 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:21 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> In my header cleanup I've missed the debugfs functions completely.

I'd actually prefer a drm_debugfs.h, but I have some local patches
that refactor drm-debugfs stuff, anyway. So I can do it later myself:

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_internal.h | 28 ++++++++++++++++++++++++++++
>  include/drm/drmP.h             | 25 -------------------------
>  2 files changed, 28 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index bc71be6f29e0..7cc0a3516871 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -102,3 +102,31 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data,
>  int drm_dropmaster_ioctl(struct drm_device *dev, void *data,
>                          struct drm_file *file_priv);
>  struct drm_master *drm_master_create(struct drm_minor *minor);
> +
> +/* drm_debugfs.c */
> +#if defined(CONFIG_DEBUG_FS)
> +int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> +                    struct dentry *root);
> +int drm_debugfs_cleanup(struct drm_minor *minor);
> +int drm_debugfs_connector_add(struct drm_connector *connector);
> +void drm_debugfs_connector_remove(struct drm_connector *connector);
> +#else
> +static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> +                                  struct dentry *root)
> +{
> +       return 0;
> +}
> +
> +static inline int drm_debugfs_cleanup(struct drm_minor *minor)
> +{
> +       return 0;
> +}
> +
> +static inline int drm_debugfs_connector_add(struct drm_connector *connector)
> +{
> +       return 0;
> +}
> +static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
> +{
> +}
> +#endif
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 09dd6c77f152..9130c8bd9e09 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -1037,23 +1037,12 @@ extern unsigned int drm_debug;
>
>                                 /* Debugfs support */
>  #if defined(CONFIG_DEBUG_FS)
> -extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> -                           struct dentry *root);
>  extern int drm_debugfs_create_files(const struct drm_info_list *files,
>                                     int count, struct dentry *root,
>                                     struct drm_minor *minor);
>  extern int drm_debugfs_remove_files(const struct drm_info_list *files,
>                                     int count, struct drm_minor *minor);
> -extern int drm_debugfs_cleanup(struct drm_minor *minor);
> -extern int drm_debugfs_connector_add(struct drm_connector *connector);
> -extern void drm_debugfs_connector_remove(struct drm_connector *connector);
>  #else
> -static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
> -                                  struct dentry *root)
> -{
> -       return 0;
> -}
> -
>  static inline int drm_debugfs_create_files(const struct drm_info_list *files,
>                                            int count, struct dentry *root,
>                                            struct drm_minor *minor)
> @@ -1066,20 +1055,6 @@ static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
>  {
>         return 0;
>  }
> -
> -static inline int drm_debugfs_cleanup(struct drm_minor *minor)
> -{
> -       return 0;
> -}
> -
> -static inline int drm_debugfs_connector_add(struct drm_connector *connector)
> -{
> -       return 0;
> -}
> -static inline void drm_debugfs_connector_remove(struct drm_connector *connector)
> -{
> -}
> -
>  #endif
>
>  extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h
  2014-09-23 14:15   ` David Herrmann
@ 2014-09-23 14:21     ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 14:21 UTC (permalink / raw)
  To: David Herrmann; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

On Tue, Sep 23, 2014 at 04:15:05PM +0200, David Herrmann wrote:
> Hi
> 
> On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Leftover from my previous header cleanup.
> >
> > This depends upon the patch to rework exynos mmap support, otherwise
> > it'll break exynos.
> 
> What patch do you mean? I cannot see any users of drm_vm_open_locked()
> anywhere besides drm_gem.c and drm_vm.c, (branch drm-next).

Only since exynos-next was pulled in yesterday, which is why I've now sent
these out. I'll reword the commit message to reflect this.
-Daniel

> 
> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
> 
> Thanks
> David
> 
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/drm_internal.h | 1 +
> >  drivers/gpu/drm/drm_vm.c       | 1 -
> >  include/drm/drmP.h             | 1 -
> >  3 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> > index d27faae45f1b..05624561118a 100644
> > --- a/drivers/gpu/drm/drm_internal.h
> > +++ b/drivers/gpu/drm/drm_internal.h
> > @@ -37,6 +37,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
> >
> >  /* drm_vm.c */
> >  int drm_vma_info(struct seq_file *m, void *data);
> > +void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
> >  void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma);
> >
> >  /* drm_prime.c */
> > diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
> > index e36c5cb2733b..ac33f7d1ee35 100644
> > --- a/drivers/gpu/drm/drm_vm.c
> > +++ b/drivers/gpu/drm/drm_vm.c
> > @@ -421,7 +421,6 @@ void drm_vm_open_locked(struct drm_device *dev,
> >                 list_add(&vma_entry->head, &dev->vmalist);
> >         }
> >  }
> > -EXPORT_SYMBOL_GPL(drm_vm_open_locked);
> >
> >  static void drm_vm_open(struct vm_area_struct *vma)
> >  {
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index 24aa38236367..9f1abd51ded2 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -961,7 +961,6 @@ extern ssize_t drm_read(struct file *filp, char __user *buffer,
> >  extern int drm_release(struct inode *inode, struct file *filp);
> >
> >                                 /* Mapping support (drm_vm.h) */
> > -extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma);
> >  extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
> >
> >  /* Misc. IOCTL support (drm_ioctl.c) */
> > --
> > 2.1.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 7/8] drm: Extract <drm/drm_gem.h>
  2014-09-23 13:46 ` [PATCH 7/8] drm: Extract <drm/drm_gem.h> Daniel Vetter
@ 2014-09-23 14:22   ` David Herrmann
  0 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:22 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> v2: Don't forget git add, noticed by David.
>
> Cc: David Herrmann <dh.herrmann@gmail.com>

Acked-by: David Herrmann <dh.herrmann@gmail.com>

Thanks
David

> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/armada/armada_gem.h     |   2 +
>  drivers/gpu/drm/ast/ast_drv.h           |   2 +
>  drivers/gpu/drm/bochs/bochs.h           |   2 +
>  drivers/gpu/drm/cirrus/cirrus_drv.h     |   2 +
>  drivers/gpu/drm/drm_gem.c               |   1 +
>  drivers/gpu/drm/drm_info.c              |   2 +
>  drivers/gpu/drm/drm_prime.c             |   2 +
>  drivers/gpu/drm/exynos/exynos_drm_gem.h |   2 +
>  drivers/gpu/drm/gma500/gtt.h            |   1 +
>  drivers/gpu/drm/i915/i915_drv.h         |   1 +
>  drivers/gpu/drm/mgag200/mgag200_drv.h   |   2 +
>  drivers/gpu/drm/msm/msm_drv.h           |   1 +
>  drivers/gpu/drm/nouveau/nouveau_bo.h    |   2 +
>  drivers/gpu/drm/omapdrm/omap_drv.h      |   1 +
>  drivers/gpu/drm/qxl/qxl_drv.h           |   2 +
>  drivers/gpu/drm/radeon/radeon.h         |   2 +
>  drivers/gpu/drm/radeon/radeon_drv.c     |   2 +
>  drivers/gpu/drm/tegra/gem.h             |   1 +
>  drivers/gpu/drm/udl/udl_drv.h           |   1 +
>  include/drm/drmP.h                      | 148 +-------------------------
>  include/drm/drm_gem.h                   | 183 ++++++++++++++++++++++++++++++++
>  include/drm/drm_gem_cma_helper.h        |   1 +
>  22 files changed, 216 insertions(+), 147 deletions(-)
>  create mode 100644 include/drm/drm_gem.h
>
> diff --git a/drivers/gpu/drm/armada/armada_gem.h b/drivers/gpu/drm/armada/armada_gem.h
> index 00b6cd461a03..b000ea3a829a 100644
> --- a/drivers/gpu/drm/armada/armada_gem.h
> +++ b/drivers/gpu/drm/armada/armada_gem.h
> @@ -8,6 +8,8 @@
>  #ifndef ARMADA_GEM_H
>  #define ARMADA_GEM_H
>
> +#include <drm/drm_gem.h>
> +
>  /* GEM */
>  struct armada_gem_object {
>         struct drm_gem_object   obj;
> diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
> index 7485ff945ca9..86205a28e56b 100644
> --- a/drivers/gpu/drm/ast/ast_drv.h
> +++ b/drivers/gpu/drm/ast/ast_drv.h
> @@ -36,6 +36,8 @@
>  #include <drm/ttm/ttm_memory.h>
>  #include <drm/ttm/ttm_module.h>
>
> +#include <drm/drm_gem.h>
> +
>  #include <linux/i2c.h>
>  #include <linux/i2c-algo-bit.h>
>
> diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
> index 4f6e7b3a3635..71f2687fc3cc 100644
> --- a/drivers/gpu/drm/bochs/bochs.h
> +++ b/drivers/gpu/drm/bochs/bochs.h
> @@ -7,6 +7,8 @@
>  #include <drm/drm_crtc_helper.h>
>  #include <drm/drm_fb_helper.h>
>
> +#include <drm/drm_gem.h>
> +
>  #include <ttm/ttm_bo_driver.h>
>  #include <ttm/ttm_page_alloc.h>
>
> diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
> index dd2cfc9024aa..d44e69daa239 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_drv.h
> +++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
> @@ -21,6 +21,8 @@
>  #include <drm/ttm/ttm_memory.h>
>  #include <drm/ttm/ttm_module.h>
>
> +#include <drm/drm_gem.h>
> +
>  #define DRIVER_AUTHOR          "Matthew Garrett"
>
>  #define DRIVER_NAME            "cirrus"
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index f9af78541505..cd45e45e2cce 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -38,6 +38,7 @@
>  #include <linux/dma-buf.h>
>  #include <drm/drmP.h>
>  #include <drm/drm_vma_manager.h>
> +#include <drm/drm_gem.h>
>  #include "drm_internal.h"
>
>  /** @file drm_gem.c
> diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
> index 0780541f7935..51efebd434f3 100644
> --- a/drivers/gpu/drm/drm_info.c
> +++ b/drivers/gpu/drm/drm_info.c
> @@ -35,6 +35,8 @@
>
>  #include <linux/seq_file.h>
>  #include <drm/drmP.h>
> +#include <drm/drm_gem.h>
> +
>  #include "drm_legacy.h"
>
>  /**
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 2807a771f505..7826de9da276 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -29,6 +29,8 @@
>  #include <linux/export.h>
>  #include <linux/dma-buf.h>
>  #include <drm/drmP.h>
> +#include <drm/drm_gem.h>
> +
>  #include "drm_internal.h"
>
>  /*
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
> index 1592c0ba7de8..74818b15e853 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
> @@ -12,6 +12,8 @@
>  #ifndef _EXYNOS_DRM_GEM_H_
>  #define _EXYNOS_DRM_GEM_H_
>
> +#include <drm/drm_gem.h>
> +
>  #define to_exynos_gem_obj(x)   container_of(x,\
>                         struct exynos_drm_gem_obj, base)
>
> diff --git a/drivers/gpu/drm/gma500/gtt.h b/drivers/gpu/drm/gma500/gtt.h
> index f5860a739bd8..cdbb350c9d5d 100644
> --- a/drivers/gpu/drm/gma500/gtt.h
> +++ b/drivers/gpu/drm/gma500/gtt.h
> @@ -21,6 +21,7 @@
>  #define _PSB_GTT_H_
>
>  #include <drm/drmP.h>
> +#include <drm/drm_gem.h>
>
>  /* This wants cleaning up with respect to the psb_dev and un-needed stuff */
>  struct psb_gtt {
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 07dafa2c2d8c..e9f5765699b4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -43,6 +43,7 @@
>  #include <linux/i2c-algo-bit.h>
>  #include <drm/intel-gtt.h>
>  #include <drm/drm_legacy.h> /* for struct drm_dma_handle */
> +#include <drm/drm_gem.h>
>  #include <linux/backlight.h>
>  #include <linux/hashtable.h>
>  #include <linux/intel-iommu.h>
> diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
> index c03e347f3ffd..e9eea1d4e7c3 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_drv.h
> +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
> @@ -22,6 +22,8 @@
>  #include <drm/ttm/ttm_memory.h>
>  #include <drm/ttm/ttm_module.h>
>
> +#include <drm/drm_gem.h>
> +
>  #include <linux/i2c.h>
>  #include <linux/i2c-algo-bit.h>
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index 8a2c5fd0893e..afaafd42dee7 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -51,6 +51,7 @@ static inline struct device *msm_iommu_get_ctx(const char *ctx_name)
>  #include <drm/drm_crtc_helper.h>
>  #include <drm/drm_fb_helper.h>
>  #include <drm/msm_drm.h>
> +#include <drm/drm_gem.h>
>
>  struct msm_kms;
>  struct msm_gpu;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
> index ae95b2d43b36..f238def41a92 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.h
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.h
> @@ -1,6 +1,8 @@
>  #ifndef __NOUVEAU_BO_H__
>  #define __NOUVEAU_BO_H__
>
> +#include <drm/drm_gem.h>
> +
>  struct nouveau_channel;
>  struct nouveau_fence;
>  struct nouveau_vma;
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
> index 84d73a61b34b..60e47b33c801 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -26,6 +26,7 @@
>  #include <drm/drmP.h>
>  #include <drm/drm_crtc_helper.h>
>  #include <drm/omap_drm.h>
> +#include <drm/drm_gem.h>
>  #include <linux/platform_data/omap_drm.h>
>
>
> diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
> index d75c0a9f674f..ff0772728eb0 100644
> --- a/drivers/gpu/drm/qxl/qxl_drv.h
> +++ b/drivers/gpu/drm/qxl/qxl_drv.h
> @@ -43,6 +43,8 @@
>  #include <ttm/ttm_placement.h>
>  #include <ttm/ttm_module.h>
>
> +#include <drm/drm_gem.h>
> +
>  /* just for ttm_validate_buffer */
>  #include <ttm/ttm_execbuf_util.h>
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 82b0e11ade89..ef91ebb7c671 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -74,6 +74,8 @@
>  #include <ttm/ttm_module.h>
>  #include <ttm/ttm_execbuf_util.h>
>
> +#include <drm/drm_gem.h>
> +
>  #include "radeon_family.h"
>  #include "radeon_mode.h"
>  #include "radeon_reg.h"
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index dd082049fd5b..de108427a197 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -38,6 +38,8 @@
>  #include <linux/module.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/vga_switcheroo.h>
> +#include <drm/drm_gem.h>
> +
>  #include "drm_crtc_helper.h"
>  /*
>   * KMS wrapper.
> diff --git a/drivers/gpu/drm/tegra/gem.h b/drivers/gpu/drm/tegra/gem.h
> index 43a25c853357..6538b56780c2 100644
> --- a/drivers/gpu/drm/tegra/gem.h
> +++ b/drivers/gpu/drm/tegra/gem.h
> @@ -15,6 +15,7 @@
>
>  #include <drm/drm.h>
>  #include <drm/drmP.h>
> +#include <drm/drm_gem.h>
>
>  #define TEGRA_BO_BOTTOM_UP (1 << 0)
>
> diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
> index 51e10ee77f39..c7490a2489a7 100644
> --- a/drivers/gpu/drm/udl/udl_drv.h
> +++ b/drivers/gpu/drm/udl/udl_drv.h
> @@ -15,6 +15,7 @@
>  #define UDL_DRV_H
>
>  #include <linux/usb.h>
> +#include <drm/drm_gem.h>
>
>  #define DRIVER_NAME            "udl"
>  #define DRIVER_DESC            "DisplayLink"
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 9130c8bd9e09..d46efbc255ed 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -82,6 +82,7 @@ struct drm_agp_head;
>  struct drm_local_map;
>  struct drm_device_dma;
>  struct drm_dma_handle;
> +struct drm_gem_object;
>
>  struct device_node;
>  struct videomode;
> @@ -331,93 +332,6 @@ struct drm_lock_data {
>  };
>
>  /**
> - * This structure defines the drm_mm memory object, which will be used by the
> - * DRM for its buffer objects.
> - */
> -struct drm_gem_object {
> -       /** Reference count of this object */
> -       struct kref refcount;
> -
> -       /**
> -        * handle_count - gem file_priv handle count of this object
> -        *
> -        * Each handle also holds a reference. Note that when the handle_count
> -        * drops to 0 any global names (e.g. the id in the flink namespace) will
> -        * be cleared.
> -        *
> -        * Protected by dev->object_name_lock.
> -        * */
> -       unsigned handle_count;
> -
> -       /** Related drm device */
> -       struct drm_device *dev;
> -
> -       /** File representing the shmem storage */
> -       struct file *filp;
> -
> -       /* Mapping info for this object */
> -       struct drm_vma_offset_node vma_node;
> -
> -       /**
> -        * Size of the object, in bytes.  Immutable over the object's
> -        * lifetime.
> -        */
> -       size_t size;
> -
> -       /**
> -        * Global name for this object, starts at 1. 0 means unnamed.
> -        * Access is covered by the object_name_lock in the related drm_device
> -        */
> -       int name;
> -
> -       /**
> -        * Memory domains. These monitor which caches contain read/write data
> -        * related to the object. When transitioning from one set of domains
> -        * to another, the driver is called to ensure that caches are suitably
> -        * flushed and invalidated
> -        */
> -       uint32_t read_domains;
> -       uint32_t write_domain;
> -
> -       /**
> -        * While validating an exec operation, the
> -        * new read/write domain values are computed here.
> -        * They will be transferred to the above values
> -        * at the point that any cache flushing occurs
> -        */
> -       uint32_t pending_read_domains;
> -       uint32_t pending_write_domain;
> -
> -       /**
> -        * dma_buf - dma buf associated with this GEM object
> -        *
> -        * Pointer to the dma-buf associated with this gem object (either
> -        * through importing or exporting). We break the resulting reference
> -        * loop when the last gem handle for this object is released.
> -        *
> -        * Protected by obj->object_name_lock
> -        */
> -       struct dma_buf *dma_buf;
> -
> -       /**
> -        * import_attach - dma buf attachment backing this object
> -        *
> -        * Any foreign dma_buf imported as a gem object has this set to the
> -        * attachment point for the device. This is invariant over the lifetime
> -        * of a gem object.
> -        *
> -        * The driver's ->gem_free_object callback is responsible for cleaning
> -        * up the dma_buf attachment and references acquired at import time.
> -        *
> -        * Note that the drm gem/prime core does not depend upon drivers setting
> -        * this field any more. So for drivers where this doesn't make sense
> -        * (e.g. virtual devices or a displaylink behind an usb bus) they can
> -        * simply leave it as NULL.
> -        */
> -       struct dma_buf_attachment *import_attach;
> -};
> -
> -/**
>   * struct drm_master - drm master structure
>   *
>   * @refcount: Refcount for this master object.
> @@ -1073,10 +987,6 @@ extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **
>  extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages);
>  extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
>
> -int drm_gem_dumb_destroy(struct drm_file *file,
> -                        struct drm_device *dev,
> -                        uint32_t handle);
> -
>
>  extern struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
>                                             size_t align);
> @@ -1085,62 +995,6 @@ extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
>                                /* sysfs support (drm_sysfs.c) */
>  extern void drm_sysfs_hotplug_event(struct drm_device *dev);
>
> -/* Graphics Execution Manager library functions (drm_gem.c) */
> -void drm_gem_object_release(struct drm_gem_object *obj);
> -void drm_gem_object_free(struct kref *kref);
> -int drm_gem_object_init(struct drm_device *dev,
> -                       struct drm_gem_object *obj, size_t size);
> -void drm_gem_private_object_init(struct drm_device *dev,
> -                                struct drm_gem_object *obj, size_t size);
> -void drm_gem_vm_open(struct vm_area_struct *vma);
> -void drm_gem_vm_close(struct vm_area_struct *vma);
> -int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
> -                    struct vm_area_struct *vma);
> -int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
> -
> -static inline void
> -drm_gem_object_reference(struct drm_gem_object *obj)
> -{
> -       kref_get(&obj->refcount);
> -}
> -
> -static inline void
> -drm_gem_object_unreference(struct drm_gem_object *obj)
> -{
> -       if (obj != NULL)
> -               kref_put(&obj->refcount, drm_gem_object_free);
> -}
> -
> -static inline void
> -drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
> -{
> -       if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
> -               struct drm_device *dev = obj->dev;
> -
> -               mutex_lock(&dev->struct_mutex);
> -               if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
> -                       drm_gem_object_free(&obj->refcount);
> -               mutex_unlock(&dev->struct_mutex);
> -       }
> -}
> -
> -int drm_gem_handle_create(struct drm_file *file_priv,
> -                         struct drm_gem_object *obj,
> -                         u32 *handlep);
> -int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
> -
> -
> -void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
> -int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
> -int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
> -
> -struct page **drm_gem_get_pages(struct drm_gem_object *obj);
> -void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
> -               bool dirty, bool accessed);
> -
> -struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
> -                                            struct drm_file *filp,
> -                                            u32 handle);
>
>  struct drm_device *drm_dev_alloc(struct drm_driver *driver,
>                                  struct device *parent);
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> new file mode 100644
> index 000000000000..1e6ae1458f7a
> --- /dev/null
> +++ b/include/drm/drm_gem.h
> @@ -0,0 +1,183 @@
> +#ifndef __DRM_GEM_H__
> +#define __DRM_GEM_H__
> +
> +/*
> + * GEM Graphics Execution Manager Driver Interfaces
> + *
> + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
> + * Copyright (c) 2009-2010, Code Aurora Forum.
> + * All rights reserved.
> + * Copyright © 2014 Intel Corporation
> + *   Daniel Vetter <daniel.vetter@ffwll.ch>
> + *
> + * Author: Rickard E. (Rik) Faith <faith@valinux.com>
> + * Author: Gareth Hughes <gareth@valinux.com>
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * This structure defines the drm_mm memory object, which will be used by the
> + * DRM for its buffer objects.
> + */
> +struct drm_gem_object {
> +       /** Reference count of this object */
> +       struct kref refcount;
> +
> +       /**
> +        * handle_count - gem file_priv handle count of this object
> +        *
> +        * Each handle also holds a reference. Note that when the handle_count
> +        * drops to 0 any global names (e.g. the id in the flink namespace) will
> +        * be cleared.
> +        *
> +        * Protected by dev->object_name_lock.
> +        * */
> +       unsigned handle_count;
> +
> +       /** Related drm device */
> +       struct drm_device *dev;
> +
> +       /** File representing the shmem storage */
> +       struct file *filp;
> +
> +       /* Mapping info for this object */
> +       struct drm_vma_offset_node vma_node;
> +
> +       /**
> +        * Size of the object, in bytes.  Immutable over the object's
> +        * lifetime.
> +        */
> +       size_t size;
> +
> +       /**
> +        * Global name for this object, starts at 1. 0 means unnamed.
> +        * Access is covered by the object_name_lock in the related drm_device
> +        */
> +       int name;
> +
> +       /**
> +        * Memory domains. These monitor which caches contain read/write data
> +        * related to the object. When transitioning from one set of domains
> +        * to another, the driver is called to ensure that caches are suitably
> +        * flushed and invalidated
> +        */
> +       uint32_t read_domains;
> +       uint32_t write_domain;
> +
> +       /**
> +        * While validating an exec operation, the
> +        * new read/write domain values are computed here.
> +        * They will be transferred to the above values
> +        * at the point that any cache flushing occurs
> +        */
> +       uint32_t pending_read_domains;
> +       uint32_t pending_write_domain;
> +
> +       /**
> +        * dma_buf - dma buf associated with this GEM object
> +        *
> +        * Pointer to the dma-buf associated with this gem object (either
> +        * through importing or exporting). We break the resulting reference
> +        * loop when the last gem handle for this object is released.
> +        *
> +        * Protected by obj->object_name_lock
> +        */
> +       struct dma_buf *dma_buf;
> +
> +       /**
> +        * import_attach - dma buf attachment backing this object
> +        *
> +        * Any foreign dma_buf imported as a gem object has this set to the
> +        * attachment point for the device. This is invariant over the lifetime
> +        * of a gem object.
> +        *
> +        * The driver's ->gem_free_object callback is responsible for cleaning
> +        * up the dma_buf attachment and references acquired at import time.
> +        *
> +        * Note that the drm gem/prime core does not depend upon drivers setting
> +        * this field any more. So for drivers where this doesn't make sense
> +        * (e.g. virtual devices or a displaylink behind an usb bus) they can
> +        * simply leave it as NULL.
> +        */
> +       struct dma_buf_attachment *import_attach;
> +};
> +
> +void drm_gem_object_release(struct drm_gem_object *obj);
> +void drm_gem_object_free(struct kref *kref);
> +int drm_gem_object_init(struct drm_device *dev,
> +                       struct drm_gem_object *obj, size_t size);
> +void drm_gem_private_object_init(struct drm_device *dev,
> +                                struct drm_gem_object *obj, size_t size);
> +void drm_gem_vm_open(struct vm_area_struct *vma);
> +void drm_gem_vm_close(struct vm_area_struct *vma);
> +int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
> +                    struct vm_area_struct *vma);
> +int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
> +
> +static inline void
> +drm_gem_object_reference(struct drm_gem_object *obj)
> +{
> +       kref_get(&obj->refcount);
> +}
> +
> +static inline void
> +drm_gem_object_unreference(struct drm_gem_object *obj)
> +{
> +       if (obj != NULL)
> +               kref_put(&obj->refcount, drm_gem_object_free);
> +}
> +
> +static inline void
> +drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
> +{
> +       if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
> +               struct drm_device *dev = obj->dev;
> +
> +               mutex_lock(&dev->struct_mutex);
> +               if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
> +                       drm_gem_object_free(&obj->refcount);
> +               mutex_unlock(&dev->struct_mutex);
> +       }
> +}
> +
> +int drm_gem_handle_create(struct drm_file *file_priv,
> +                         struct drm_gem_object *obj,
> +                         u32 *handlep);
> +int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
> +
> +
> +void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
> +int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
> +int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
> +
> +struct page **drm_gem_get_pages(struct drm_gem_object *obj);
> +void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
> +               bool dirty, bool accessed);
> +
> +struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
> +                                            struct drm_file *filp,
> +                                            u32 handle);
> +int drm_gem_dumb_destroy(struct drm_file *file,
> +                        struct drm_device *dev,
> +                        uint32_t handle);
> +
> +#endif /* __DRM_GEM_H__ */
> diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
> index 2a3cea91606d..42f11f3a8d39 100644
> --- a/include/drm/drm_gem_cma_helper.h
> +++ b/include/drm/drm_gem_cma_helper.h
> @@ -2,6 +2,7 @@
>  #define __DRM_GEM_CMA_HELPER_H__
>
>  #include <drm/drmP.h>
> +#include <drm/drm_gem.h>
>
>  struct drm_gem_cma_object {
>         struct drm_gem_object base;
> --
> 2.1.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes.
  2014-09-23 13:46 ` [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes Daniel Vetter
@ 2014-09-23 14:22   ` David Herrmann
  2014-09-23 14:25     ` Daniel Vetter
  0 siblings, 1 reply; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:22 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Only !P can be used together with a function list.

You say !P, but you use !F?

Thanks
David

> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  Documentation/DocBook/drm.tmpl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
> index ca44d9fe7d7d..be35bc328b77 100644
> --- a/Documentation/DocBook/drm.tmpl
> +++ b/Documentation/DocBook/drm.tmpl
> @@ -3406,7 +3406,7 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis>
>      <sect2>
>        <title>Vertical Blanking and Interrupt Handling Functions Reference</title>
>  !Edrivers/gpu/drm/drm_irq.c
> -!Iinclude/drm/drmP.h drm_crtc_vblank_waitqueue
> +!Finclude/drm/drmP.h drm_crtc_vblank_waitqueue
>      </sect2>
>    </sect1>
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/8] More header rework
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (7 preceding siblings ...)
  2014-09-23 13:46 ` [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes Daniel Vetter
@ 2014-09-23 14:24 ` David Herrmann
  2014-09-23 15:11 ` Alex Deucher
  9 siblings, 0 replies; 26+ messages in thread
From: David Herrmann @ 2014-09-23 14:24 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: DRI Development

Hi

On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> So the main part here is the extraction of drm_gem.h. With a bit of prep work to
> ditch the legacy mmap stuff out of gem/ttm drivers. Plus a few random pieces of
> leftover cleanup that I've missed in my earlier header rework or just stumbled
> over while working on this.
>
> With this drmP.h really starts to look rather sane (it's just 1kloc now),
> besides maybe the uppercase P in it's name and the massive list of headers it
> includes.
>
> As usual comments and review highly welcome. I'll probably try to still throw
> this at Dave for 3.18 and see whether he rejects it or not. Otherwise no harm to
> postpone this until 3.19 (but David Herrrmann said he's got more work on his
> todo in this area, so merging earlier might avoid conflicts).

Assuming you ran 0day bots on the gem-header move, these look all
fine. I commented on them all.

Thanks!
David

> Cheers, Daniel
>
> Daniel Vetter (8):
>   drm/<ttm-based-drivers>: Don't call drm_mmap
>   drm/gem: Don't call drm_mmap from drm_gem_mmap
>   drm: move drm_mmap to <drm/drm_legacy.h>
>   drm: Move drm_vm_open_locked into drm_internal.h
>   drm: Move leftover ioctl declarations to drm_internal.h
>   drm: Move internal debugfs functions to drm_internal.h
>   drm: Extract <drm/drm_gem.h>
>   drm/doc: Fixup drm_irq kerneldoc includes.
>
>  Documentation/DocBook/drm.tmpl          |   2 +-
>  drivers/gpu/drm/armada/armada_gem.h     |   2 +
>  drivers/gpu/drm/ast/ast_drv.h           |   2 +
>  drivers/gpu/drm/ast/ast_ttm.c           |   2 +-
>  drivers/gpu/drm/bochs/bochs.h           |   2 +
>  drivers/gpu/drm/bochs/bochs_mm.c        |   2 +-
>  drivers/gpu/drm/cirrus/cirrus_drv.h     |   2 +
>  drivers/gpu/drm/cirrus/cirrus_ttm.c     |   2 +-
>  drivers/gpu/drm/drm_gem.c               |   3 +-
>  drivers/gpu/drm/drm_info.c              |   2 +
>  drivers/gpu/drm/drm_internal.h          |  39 ++++++-
>  drivers/gpu/drm/drm_prime.c             |   2 +
>  drivers/gpu/drm/drm_vm.c                |   7 +-
>  drivers/gpu/drm/exynos/exynos_drm_gem.h |   2 +
>  drivers/gpu/drm/gma500/gtt.h            |   1 +
>  drivers/gpu/drm/i810/i810_drv.c         |   2 +-
>  drivers/gpu/drm/i915/i915_drv.h         |   1 +
>  drivers/gpu/drm/mga/mga_drv.c           |   2 +-
>  drivers/gpu/drm/mgag200/mgag200_drv.h   |   2 +
>  drivers/gpu/drm/mgag200/mgag200_ttm.c   |   2 +-
>  drivers/gpu/drm/msm/msm_drv.h           |   1 +
>  drivers/gpu/drm/nouveau/nouveau_bo.h    |   2 +
>  drivers/gpu/drm/nouveau/nouveau_ttm.c   |   2 +-
>  drivers/gpu/drm/omapdrm/omap_drv.h      |   1 +
>  drivers/gpu/drm/qxl/qxl_drv.h           |   2 +
>  drivers/gpu/drm/qxl/qxl_ttm.c           |   2 +-
>  drivers/gpu/drm/r128/r128_drv.c         |   2 +-
>  drivers/gpu/drm/radeon/radeon.h         |   2 +
>  drivers/gpu/drm/radeon/radeon_drv.c     |   4 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c     |   2 +-
>  drivers/gpu/drm/savage/savage_drv.c     |   2 +-
>  drivers/gpu/drm/sis/sis_drv.c           |   2 +-
>  drivers/gpu/drm/tdfx/tdfx_drv.c         |   3 +-
>  drivers/gpu/drm/tegra/gem.h             |   1 +
>  drivers/gpu/drm/udl/udl_drv.h           |   1 +
>  drivers/gpu/drm/via/via_drv.c           |   2 +-
>  include/drm/drmP.h                      | 182 +------------------------------
>  include/drm/drm_gem.h                   | 183 ++++++++++++++++++++++++++++++++
>  include/drm/drm_gem_cma_helper.h        |   1 +
>  include/drm/drm_legacy.h                |   1 +
>  40 files changed, 276 insertions(+), 203 deletions(-)
>  create mode 100644 include/drm/drm_gem.h
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes.
  2014-09-23 14:22   ` David Herrmann
@ 2014-09-23 14:25     ` Daniel Vetter
  0 siblings, 0 replies; 26+ messages in thread
From: Daniel Vetter @ 2014-09-23 14:25 UTC (permalink / raw)
  To: David Herrmann; +Cc: Daniel Vetter, DRI Development, Daniel Vetter

On Tue, Sep 23, 2014 at 04:22:55PM +0200, David Herrmann wrote:
> Hi
> 
> On Tue, Sep 23, 2014 at 3:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Only !P can be used together with a function list.
> 
> You say !P, but you use !F?

Oops yeah this should read !F. !P is for including DOC: sections, dunno
why I've fumbled this.
-Daniel

> 
> Thanks
> David
> 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  Documentation/DocBook/drm.tmpl | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
> > index ca44d9fe7d7d..be35bc328b77 100644
> > --- a/Documentation/DocBook/drm.tmpl
> > +++ b/Documentation/DocBook/drm.tmpl
> > @@ -3406,7 +3406,7 @@ void (*disable_vblank) (struct drm_device *dev, int crtc);</synopsis>
> >      <sect2>
> >        <title>Vertical Blanking and Interrupt Handling Functions Reference</title>
> >  !Edrivers/gpu/drm/drm_irq.c
> > -!Iinclude/drm/drmP.h drm_crtc_vblank_waitqueue
> > +!Finclude/drm/drmP.h drm_crtc_vblank_waitqueue
> >      </sect2>
> >    </sect1>
> >
> > --
> > 2.1.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/8] More header rework
  2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
                   ` (8 preceding siblings ...)
  2014-09-23 14:24 ` [PATCH 0/8] More header rework David Herrmann
@ 2014-09-23 15:11 ` Alex Deucher
  9 siblings, 0 replies; 26+ messages in thread
From: Alex Deucher @ 2014-09-23 15:11 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: DRI Development

On Tue, Sep 23, 2014 at 9:46 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> So the main part here is the extraction of drm_gem.h. With a bit of prep work to
> ditch the legacy mmap stuff out of gem/ttm drivers. Plus a few random pieces of
> leftover cleanup that I've missed in my earlier header rework or just stumbled
> over while working on this.
>
> With this drmP.h really starts to look rather sane (it's just 1kloc now),
> besides maybe the uppercase P in it's name and the massive list of headers it
> includes.
>
> As usual comments and review highly welcome. I'll probably try to still throw
> this at Dave for 3.18 and see whether he rejects it or not. Otherwise no harm to
> postpone this until 3.19 (but David Herrrmann said he's got more work on his
> todo in this area, so merging earlier might avoid conflicts).
>
> Cheers, Daniel
>
> Daniel Vetter (8):
>   drm/<ttm-based-drivers>: Don't call drm_mmap
>   drm/gem: Don't call drm_mmap from drm_gem_mmap
>   drm: move drm_mmap to <drm/drm_legacy.h>
>   drm: Move drm_vm_open_locked into drm_internal.h
>   drm: Move leftover ioctl declarations to drm_internal.h
>   drm: Move internal debugfs functions to drm_internal.h
>   drm: Extract <drm/drm_gem.h>
>   drm/doc: Fixup drm_irq kerneldoc includes.
>

Series is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

>  Documentation/DocBook/drm.tmpl          |   2 +-
>  drivers/gpu/drm/armada/armada_gem.h     |   2 +
>  drivers/gpu/drm/ast/ast_drv.h           |   2 +
>  drivers/gpu/drm/ast/ast_ttm.c           |   2 +-
>  drivers/gpu/drm/bochs/bochs.h           |   2 +
>  drivers/gpu/drm/bochs/bochs_mm.c        |   2 +-
>  drivers/gpu/drm/cirrus/cirrus_drv.h     |   2 +
>  drivers/gpu/drm/cirrus/cirrus_ttm.c     |   2 +-
>  drivers/gpu/drm/drm_gem.c               |   3 +-
>  drivers/gpu/drm/drm_info.c              |   2 +
>  drivers/gpu/drm/drm_internal.h          |  39 ++++++-
>  drivers/gpu/drm/drm_prime.c             |   2 +
>  drivers/gpu/drm/drm_vm.c                |   7 +-
>  drivers/gpu/drm/exynos/exynos_drm_gem.h |   2 +
>  drivers/gpu/drm/gma500/gtt.h            |   1 +
>  drivers/gpu/drm/i810/i810_drv.c         |   2 +-
>  drivers/gpu/drm/i915/i915_drv.h         |   1 +
>  drivers/gpu/drm/mga/mga_drv.c           |   2 +-
>  drivers/gpu/drm/mgag200/mgag200_drv.h   |   2 +
>  drivers/gpu/drm/mgag200/mgag200_ttm.c   |   2 +-
>  drivers/gpu/drm/msm/msm_drv.h           |   1 +
>  drivers/gpu/drm/nouveau/nouveau_bo.h    |   2 +
>  drivers/gpu/drm/nouveau/nouveau_ttm.c   |   2 +-
>  drivers/gpu/drm/omapdrm/omap_drv.h      |   1 +
>  drivers/gpu/drm/qxl/qxl_drv.h           |   2 +
>  drivers/gpu/drm/qxl/qxl_ttm.c           |   2 +-
>  drivers/gpu/drm/r128/r128_drv.c         |   2 +-
>  drivers/gpu/drm/radeon/radeon.h         |   2 +
>  drivers/gpu/drm/radeon/radeon_drv.c     |   4 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c     |   2 +-
>  drivers/gpu/drm/savage/savage_drv.c     |   2 +-
>  drivers/gpu/drm/sis/sis_drv.c           |   2 +-
>  drivers/gpu/drm/tdfx/tdfx_drv.c         |   3 +-
>  drivers/gpu/drm/tegra/gem.h             |   1 +
>  drivers/gpu/drm/udl/udl_drv.h           |   1 +
>  drivers/gpu/drm/via/via_drv.c           |   2 +-
>  include/drm/drmP.h                      | 182 +------------------------------
>  include/drm/drm_gem.h                   | 183 ++++++++++++++++++++++++++++++++
>  include/drm/drm_gem_cma_helper.h        |   1 +
>  include/drm/drm_legacy.h                |   1 +
>  40 files changed, 276 insertions(+), 203 deletions(-)
>  create mode 100644 include/drm/drm_gem.h
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
  2014-09-23 14:05   ` David Herrmann
@ 2014-09-23 15:30   ` Christian König
  2014-09-23 21:38   ` Jerome Glisse
  2014-09-23 23:42   ` Ben Skeggs
  3 siblings, 0 replies; 26+ messages in thread
From: Christian König @ 2014-09-23 15:30 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Christian Engelmayer, Josh Triplett, Fabian Frederick, Rashika,
	Alex Deucher, Daniel Vetter, Ben Skeggs

Am 23.09.2014 um 15:46 schrieb Daniel Vetter:
> Really, the legacy buffer api should be dead, especially for all these
> newfangled drivers. I suspect this is copypasta from the transitioning
> days, which probably originated in radeon.
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Rashika <rashika.kheria@gmail.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Fabian Frederick <fabf@skynet.be>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Alexandre Courbot <acourbot@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> Cc: Christian Engelmayer <cengelma@gmx.at>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

To be honest I always wondered what this stuff is all about, never 
really understood it.

So patch is Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ast/ast_ttm.c         | 2 +-
>   drivers/gpu/drm/bochs/bochs_mm.c      | 2 +-
>   drivers/gpu/drm/cirrus/cirrus_ttm.c   | 2 +-
>   drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
>   drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
>   drivers/gpu/drm/qxl/qxl_ttm.c         | 2 +-
>   drivers/gpu/drm/radeon/radeon_ttm.c   | 2 +-
>   7 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
> index 5098c7dd435c..c65d432f42c4 100644
> --- a/drivers/gpu/drm/ast/ast_ttm.c
> +++ b/drivers/gpu/drm/ast/ast_ttm.c
> @@ -427,7 +427,7 @@ int ast_mmap(struct file *filp, struct vm_area_struct *vma)
>   	struct ast_private *ast;
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   
>   	file_priv = filp->private_data;
>   	ast = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> index 2af30e7607d7..324f5a09a0a1 100644
> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> @@ -339,7 +339,7 @@ int bochs_mmap(struct file *filp, struct vm_area_struct *vma)
>   	struct bochs_device *bochs;
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   
>   	file_priv = filp->private_data;
>   	bochs = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> index 3e7d758330a9..d3c615f9b183 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> @@ -411,7 +411,7 @@ int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
>   	struct cirrus_device *cirrus;
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   
>   	file_priv = filp->private_data;
>   	cirrus = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> index be883ef5a1d3..8ac70626df6c 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> @@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
>   	struct mga_device *mdev;
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   
>   	file_priv = filp->private_data;
>   	mdev = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index e81d086577ce..753a6def61e7 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
>   	struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   
>   	return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
>   }
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index abe945a04fd4..0cbc4c987164 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
>   		pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
>   			__func__, vma->vm_pgoff);
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   	}
>   
>   	file_priv = filp->private_data;
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index eca2ce60d440..902a3e8af79b 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -956,7 +956,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
>   	int r;
>   
>   	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>   	}
>   
>   	file_priv = filp->private_data;

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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
  2014-09-23 14:05   ` David Herrmann
  2014-09-23 15:30   ` Christian König
@ 2014-09-23 21:38   ` Jerome Glisse
  2014-09-23 21:53     ` David Herrmann
  2014-09-23 23:42   ` Ben Skeggs
  3 siblings, 1 reply; 26+ messages in thread
From: Jerome Glisse @ 2014-09-23 21:38 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Christian Engelmayer, Josh Triplett, DRI Development,
	Fabian Frederick, Rashika, Ben Skeggs, Alex Deucher,
	Daniel Vetter, Christian König

On Tue, Sep 23, 2014 at 03:46:47PM +0200, Daniel Vetter wrote:
> Really, the legacy buffer api should be dead, especially for all these
> newfangled drivers. I suspect this is copypasta from the transitioning
> days, which probably originated in radeon.
> 
> Cc: David Airlie <airlied@linux.ie>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Rashika <rashika.kheria@gmail.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Fabian Frederick <fabf@skynet.be>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Alexandre Courbot <acourbot@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> Cc: Christian Engelmayer <cengelma@gmx.at>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

I would say NAK as i am pretty sure this break radeon UMS code path.
Of course if we have the go ahead to nuke radeon UMS i am more than
happy.


> ---
>  drivers/gpu/drm/ast/ast_ttm.c         | 2 +-
>  drivers/gpu/drm/bochs/bochs_mm.c      | 2 +-
>  drivers/gpu/drm/cirrus/cirrus_ttm.c   | 2 +-
>  drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
>  drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
>  drivers/gpu/drm/qxl/qxl_ttm.c         | 2 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c   | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
> index 5098c7dd435c..c65d432f42c4 100644
> --- a/drivers/gpu/drm/ast/ast_ttm.c
> +++ b/drivers/gpu/drm/ast/ast_ttm.c
> @@ -427,7 +427,7 @@ int ast_mmap(struct file *filp, struct vm_area_struct *vma)
>  	struct ast_private *ast;
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  
>  	file_priv = filp->private_data;
>  	ast = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> index 2af30e7607d7..324f5a09a0a1 100644
> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> @@ -339,7 +339,7 @@ int bochs_mmap(struct file *filp, struct vm_area_struct *vma)
>  	struct bochs_device *bochs;
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  
>  	file_priv = filp->private_data;
>  	bochs = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> index 3e7d758330a9..d3c615f9b183 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> @@ -411,7 +411,7 @@ int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
>  	struct cirrus_device *cirrus;
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  
>  	file_priv = filp->private_data;
>  	cirrus = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> index be883ef5a1d3..8ac70626df6c 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> @@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
>  	struct mga_device *mdev;
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  
>  	file_priv = filp->private_data;
>  	mdev = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index e81d086577ce..753a6def61e7 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
>  	struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  
>  	return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index abe945a04fd4..0cbc4c987164 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
>  		pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
>  			__func__, vma->vm_pgoff);
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  	}
>  
>  	file_priv = filp->private_data;
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index eca2ce60d440..902a3e8af79b 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -956,7 +956,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
>  	int r;
>  
>  	if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
> -		return drm_mmap(filp, vma);
> +		return -EINVAL;
>  	}
>  
>  	file_priv = filp->private_data;
> -- 
> 2.1.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 21:38   ` Jerome Glisse
@ 2014-09-23 21:53     ` David Herrmann
  2014-09-23 21:57       ` Jerome Glisse
  0 siblings, 1 reply; 26+ messages in thread
From: David Herrmann @ 2014-09-23 21:53 UTC (permalink / raw)
  To: Jerome Glisse
  Cc: Christian Engelmayer, Daniel Vetter, Josh Triplett,
	DRI Development, Fabian Frederick, Rashika, Ben Skeggs,
	Alex Deucher, Daniel Vetter, Christian König

Hi

On Tue, Sep 23, 2014 at 11:38 PM, Jerome Glisse <j.glisse@gmail.com> wrote:
> On Tue, Sep 23, 2014 at 03:46:47PM +0200, Daniel Vetter wrote:
>> Really, the legacy buffer api should be dead, especially for all these
>> newfangled drivers. I suspect this is copypasta from the transitioning
>> days, which probably originated in radeon.
>>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: "Christian König" <christian.koenig@amd.com>
>> Cc: David Herrmann <dh.herrmann@gmail.com>
>> Cc: Rashika <rashika.kheria@gmail.com>
>> Cc: Josh Triplett <josh@joshtriplett.org>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Cc: Fabian Frederick <fabf@skynet.be>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Ben Skeggs <bskeggs@redhat.com>
>> Cc: Alexandre Courbot <acourbot@nvidia.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
>> Cc: Christian Engelmayer <cengelma@gmx.at>
>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> I would say NAK as i am pretty sure this break radeon UMS code path.
> Of course if we have the go ahead to nuke radeon UMS i am more than
> happy.

radeon_drv.c says:
        driver_old.fops.mmap == drm_mmap;

..so I don't understand why that would break UMS? Do you use KMS mixed
with UMS? radeon_mmap() is only used by radeon_driver_kms_fops, which
is only used by kms_driver. UMS (which I understand as non-KMS in
radeon case) should not be affected by this.

Thanks
David
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 21:53     ` David Herrmann
@ 2014-09-23 21:57       ` Jerome Glisse
  0 siblings, 0 replies; 26+ messages in thread
From: Jerome Glisse @ 2014-09-23 21:57 UTC (permalink / raw)
  To: David Herrmann
  Cc: Christian Engelmayer, Daniel Vetter, Josh Triplett,
	DRI Development, Fabian Frederick, Rashika, Ben Skeggs,
	Alex Deucher, Daniel Vetter, Christian König

On Tue, Sep 23, 2014 at 11:53:53PM +0200, David Herrmann wrote:
> Hi
> 
> On Tue, Sep 23, 2014 at 11:38 PM, Jerome Glisse <j.glisse@gmail.com> wrote:
> > On Tue, Sep 23, 2014 at 03:46:47PM +0200, Daniel Vetter wrote:
> >> Really, the legacy buffer api should be dead, especially for all these
> >> newfangled drivers. I suspect this is copypasta from the transitioning
> >> days, which probably originated in radeon.
> >>
> >> Cc: David Airlie <airlied@linux.ie>
> >> Cc: Alex Deucher <alexander.deucher@amd.com>
> >> Cc: "Christian König" <christian.koenig@amd.com>
> >> Cc: David Herrmann <dh.herrmann@gmail.com>
> >> Cc: Rashika <rashika.kheria@gmail.com>
> >> Cc: Josh Triplett <josh@joshtriplett.org>
> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Cc: Fabian Frederick <fabf@skynet.be>
> >> Cc: Gerd Hoffmann <kraxel@redhat.com>
> >> Cc: Ben Skeggs <bskeggs@redhat.com>
> >> Cc: Alexandre Courbot <acourbot@nvidia.com>
> >> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> >> Cc: Christian Engelmayer <cengelma@gmx.at>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >
> > I would say NAK as i am pretty sure this break radeon UMS code path.
> > Of course if we have the go ahead to nuke radeon UMS i am more than
> > happy.
> 
> radeon_drv.c says:
>         driver_old.fops.mmap == drm_mmap;
> 
> ..so I don't understand why that would break UMS? Do you use KMS mixed
> with UMS? radeon_mmap() is only used by radeon_driver_kms_fops, which
> is only used by kms_driver. UMS (which I understand as non-KMS in
> radeon case) should not be affected by this.

Oh this might be an heritage of old code in my mind when we had old user
space running on top of KMS, more as a prototype stage and maybe also at
one point the plan was to share the same mmap function so that old code
could use new code cs ioctl.

So yeah this can be nuke sorry for the noise.
> 
> Thanks
> David

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap
  2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
                     ` (2 preceding siblings ...)
  2014-09-23 21:38   ` Jerome Glisse
@ 2014-09-23 23:42   ` Ben Skeggs
  3 siblings, 0 replies; 26+ messages in thread
From: Ben Skeggs @ 2014-09-23 23:42 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Christian Engelmayer, Josh Triplett, DRI Development,
	Fabian Frederick, Rashika, Ben Skeggs, Alex Deucher,
	Daniel Vetter, Christian König

On Tue, Sep 23, 2014 at 11:46 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Really, the legacy buffer api should be dead, especially for all these
> newfangled drivers. I suspect this is copypasta from the transitioning
> days, which probably originated in radeon.
>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Herrmann <dh.herrmann@gmail.com>
> Cc: Rashika <rashika.kheria@gmail.com>
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Fabian Frederick <fabf@skynet.be>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Cc: Alexandre Courbot <acourbot@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> Cc: Christian Engelmayer <cengelma@gmx.at>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>

> ---
>  drivers/gpu/drm/ast/ast_ttm.c         | 2 +-
>  drivers/gpu/drm/bochs/bochs_mm.c      | 2 +-
>  drivers/gpu/drm/cirrus/cirrus_ttm.c   | 2 +-
>  drivers/gpu/drm/mgag200/mgag200_ttm.c | 2 +-
>  drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
>  drivers/gpu/drm/qxl/qxl_ttm.c         | 2 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c   | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
> index 5098c7dd435c..c65d432f42c4 100644
> --- a/drivers/gpu/drm/ast/ast_ttm.c
> +++ b/drivers/gpu/drm/ast/ast_ttm.c
> @@ -427,7 +427,7 @@ int ast_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct ast_private *ast;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         ast = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> index 2af30e7607d7..324f5a09a0a1 100644
> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> @@ -339,7 +339,7 @@ int bochs_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct bochs_device *bochs;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         bochs = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> index 3e7d758330a9..d3c615f9b183 100644
> --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
> +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
> @@ -411,7 +411,7 @@ int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct cirrus_device *cirrus;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         cirrus = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> index be883ef5a1d3..8ac70626df6c 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
> @@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct mga_device *mdev;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         file_priv = filp->private_data;
>         mdev = file_priv->minor->dev->dev_private;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index e81d086577ce..753a6def61e7 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
>         struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>
>         return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index abe945a04fd4..0cbc4c987164 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
>                 pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
>                         __func__, vma->vm_pgoff);
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>         }
>
>         file_priv = filp->private_data;
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index eca2ce60d440..902a3e8af79b 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -956,7 +956,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
>         int r;
>
>         if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
> -               return drm_mmap(filp, vma);
> +               return -EINVAL;
>         }
>
>         file_priv = filp->private_data;
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-09-23 23:42 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 13:46 [PATCH 0/8] More header rework Daniel Vetter
2014-09-23 13:46 ` [PATCH 1/8] drm/<ttm-based-drivers>: Don't call drm_mmap Daniel Vetter
2014-09-23 14:05   ` David Herrmann
2014-09-23 15:30   ` Christian König
2014-09-23 21:38   ` Jerome Glisse
2014-09-23 21:53     ` David Herrmann
2014-09-23 21:57       ` Jerome Glisse
2014-09-23 23:42   ` Ben Skeggs
2014-09-23 13:46 ` [PATCH 2/8] drm/gem: Don't call drm_mmap from drm_gem_mmap Daniel Vetter
2014-09-23 14:06   ` David Herrmann
2014-09-23 13:46 ` [PATCH 3/8] drm: move drm_mmap to <drm/drm_legacy.h> Daniel Vetter
2014-09-23 14:12   ` David Herrmann
2014-09-23 13:46 ` [PATCH 4/8] drm: Move drm_vm_open_locked into drm_internal.h Daniel Vetter
2014-09-23 14:15   ` David Herrmann
2014-09-23 14:21     ` Daniel Vetter
2014-09-23 13:46 ` [PATCH 5/8] drm: Move leftover ioctl declarations to drm_internal.h Daniel Vetter
2014-09-23 14:16   ` David Herrmann
2014-09-23 13:46 ` [PATCH 6/8] drm: Move internal debugfs functions " Daniel Vetter
2014-09-23 14:21   ` David Herrmann
2014-09-23 13:46 ` [PATCH 7/8] drm: Extract <drm/drm_gem.h> Daniel Vetter
2014-09-23 14:22   ` David Herrmann
2014-09-23 13:46 ` [PATCH 8/8] drm/doc: Fixup drm_irq kerneldoc includes Daniel Vetter
2014-09-23 14:22   ` David Herrmann
2014-09-23 14:25     ` Daniel Vetter
2014-09-23 14:24 ` [PATCH 0/8] More header rework David Herrmann
2014-09-23 15:11 ` Alex Deucher

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.