Skip to contentSkip to conversation

drm: move a bunch of legacy dma/buf tracking to legacy header

PATCH In review Dave Airlie 2 participants 2 messages Sep 10, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm: move a bunch of legacy dma/buf tracking to legacy header

From: Dave Airlie <[email protected]>

This moves the drm_dma and drm_bufs stuff out of drmP.h as much as possible and hides it in drm_legacy.h.

It built.

Signed-off-by-: Dave Airlie <[email protected]>

---
 drivers/gpu/drm/drm_bufs.c            |  2 +-
 drivers/gpu/drm/drm_dma.c             | 10 ++---
 drivers/gpu/drm/drm_fops.c            |  2 +-
 drivers/gpu/drm/drm_info.c            |  1 +
 drivers/gpu/drm/drm_legacy.h          | 73 +++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i810/i810_dma.c       |  1 +
 drivers/gpu/drm/mga/mga_dma.c         |  1 +
 drivers/gpu/drm/mga/mga_state.c       |  1 +
 drivers/gpu/drm/r128/r128_cce.c       |  1 +
 drivers/gpu/drm/r128/r128_state.c     |  1 +
 drivers/gpu/drm/savage/savage_bci.c   |  1 +
 drivers/gpu/drm/savage/savage_state.c |  1 +
 include/drm/drmP.h                    | 73 +----------------------------------
 13 files changed, 88 insertions(+), 80 deletions(-)
drivers/gpu/drm/drm_bufs.c +1 -1
index 9e04d6a..70ba89f 100644
@@ -1338,7 +1338,7 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data,
 				  task_pid_nr(current));
 			return -EINVAL;
 		}
-		drm_free_buffer(dev, buf);
+		drm_legacy_free_buffer(dev, buf);
 	}
 
 	return 0;
drivers/gpu/drm/drm_dma.c +4 -6
index 8a140a9..c3c22b8 100644
@@ -35,7 +35,7 @@
 
 #include <linux/export.h>
 #include <drm/drmP.h>
-
+#include "drm_legacy.h"
 /**
  * Initialize the DMA data.
  *
@@ -124,7 +124,7 @@ void drm_legacy_dma_takedown(struct drm_device *dev)
  *
  * Resets the fields of \p buf.
  */
-void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf)
+void drm_legacy_free_buffer(struct drm_device *dev, struct drm_buf * buf)
 {
 	if (!buf)
 		return;
@@ -142,7 +142,7 @@ void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf)
  *
  * Frees each buffer associated with \p file_priv not already on the hardware.
  */
-void drm_core_reclaim_buffers(struct drm_device *dev,
+void drm_legacy_core_reclaim_buffers(struct drm_device *dev,
 			      struct drm_file *file_priv)
 {
 	struct drm_device_dma *dma = dev->dma;
@@ -154,7 +154,7 @@ void drm_core_reclaim_buffers(struct drm_device *dev,
 		if (dma->buflist[i]->file_priv == file_priv) {
 			switch (dma->buflist[i]->list) {
 			case DRM_LIST_NONE:
-				drm_free_buffer(dev, dma->buflist[i]);
+				drm_legacy_free_buffer(dev, dma->buflist[i]);
 				break;
 			case DRM_LIST_WAIT:
 				dma->buflist[i]->list = DRM_LIST_RECLAIM;
@@ -166,5 +166,3 @@ void drm_core_reclaim_buffers(struct drm_device *dev,
 		}
 	}
 }
-
-EXPORT_SYMBOL(drm_core_reclaim_buffers);
drivers/gpu/drm/drm_fops.c +1 -1
index b419990..6a8c937 100644
@@ -404,7 +404,7 @@ int drm_release(struct inode *inode, struct file *filp)
 		drm_master_release(dev, filp);
 
 	if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
-		drm_core_reclaim_buffers(dev, file_priv);
+		drm_legacy_core_reclaim_buffers(dev, file_priv);
 
 	drm_events_release(file_priv);
 
drivers/gpu/drm/drm_info.c +1 -0
index 3c99f6f..7a8e5a9 100644
@@ -35,6 +35,7 @@
 
 #include <linux/seq_file.h>
 #include <drm/drmP.h>
+#include "drm_legacy.h"
 
 /**
  * Called when "/proc/dri/.../name" is read.
drivers/gpu/drm/drm_legacy.h +73 -0

77 lines not on this page · raw message

drivers/gpu/drm/i810/i810_dma.c +1 -0
index c97e2ff..e286faf 100644
@@ -31,6 +31,7 @@
  */
 
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/i810_drm.h>
 #include "i810_drv.h"
 #include <linux/interrupt.h>	/* For task queue support */
drivers/gpu/drm/mga/mga_dma.c +1 -0
index 37d80c1..96b29a7 100644
@@ -36,6 +36,7 @@
  */
 
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/mga_drm.h>
 #include "mga_drv.h"
 
drivers/gpu/drm/mga/mga_state.c +1 -0
index 792f924..dee33b1 100644
@@ -33,6 +33,7 @@
  */
 
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/mga_drm.h>
 #include "mga_drv.h"
 
drivers/gpu/drm/r128/r128_cce.c +1 -0
index 1fae2f7..299c8b9 100644
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/r128_drm.h>
 #include "r128_drv.h"
 
drivers/gpu/drm/r128/r128_state.c +1 -0
index 575e986..b3b55c1 100644
@@ -29,6 +29,7 @@
  */
 
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/r128_drm.h>
 #include "r128_drv.h"
 
drivers/gpu/drm/savage/savage_bci.c +1 -0
index 9288d30..264f1f1 100644
@@ -23,6 +23,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/savage_drm.h>
 #include "savage_drv.h"
 
drivers/gpu/drm/savage/savage_state.c +1 -0
index c01ad0a..cb0dba2 100644
@@ -23,6 +23,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <drm/drmP.h>
+#include "../drm_legacy.h"
 #include <drm/savage_drm.h>
 #include "savage_drv.h"
 
include/drm/drmP.h +1 -72

97 lines not on this page · raw message

Signature · 1 line
1.9.3
#1 lore raw

Hi

Quoted 6 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This moves the drm_dma and drm_bufs stuff out of drmP.h as much as possible and hides it in drm_legacy.h.

It built.

I guess this is now obsolete with Daniel's series? I prefer his way (using a global drm_legacy.h and a drm-core drm_legacy.h header). Then headers in drivers/gpu/drm are local to drm.ko, headers in include/drm/ are global with interfaces exported to drivers from drm.ko.

Thanks
David