diff mbox

[01/35] drm: Give drm_agp_clear drm_legacy_ prefix

Message ID 1461691808-12414-2-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter April 26, 2016, 5:29 p.m. UTC
It has a  DRIVER_MODESET check to sure make it's not creating havoc
for drm drivers. Make that clear in the name too.

v2: Move misplaced hunk, spotted by 0day and Thierry.

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_agpsupport.c | 4 ++--
 drivers/gpu/drm/drm_fops.c       | 2 +-
 drivers/gpu/drm/drm_pci.c        | 2 +-
 include/drm/drm_agpsupport.h     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

Comments

Chris Wilson April 26, 2016, 9:09 p.m. UTC | #1
On Tue, Apr 26, 2016 at 07:29:34PM +0200, Daniel Vetter wrote:
> It has a  DRIVER_MODESET check to sure make it's not creating havoc
> for drm drivers. Make that clear in the name too.

The pattern is that any extern that starts

	if (drm_core_check_feature(MODESET)) return

becomes drm_legacy_ ? With the apparent caveat of KMS_LEGACY_CONTEXT.
 
> v2: Move misplaced hunk, spotted by 0day and Thierry.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter April 27, 2016, 6:41 a.m. UTC | #2
On Tue, Apr 26, 2016 at 10:09:16PM +0100, Chris Wilson wrote:
> On Tue, Apr 26, 2016 at 07:29:34PM +0200, Daniel Vetter wrote:
> > It has a  DRIVER_MODESET check to sure make it's not creating havoc
> > for drm drivers. Make that clear in the name too.
> 
> The pattern is that any extern that starts
> 
> 	if (drm_core_check_feature(MODESET)) return
> 
> becomes drm_legacy_ ? With the apparent caveat of KMS_LEGACY_CONTEXT.

Yeah that's what I'm aiming for. Gives you a clear signal that as soon as
you spot drm_legacy_* you don't have to bother jumping into the function
at all. We've done the same with headers, splitting things into legacy
internal headers.

> > v2: Move misplaced hunk, spotted by 0day and Thierry.
> > 
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks for the review, will apply.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index a10ea6aec629..605bd243fb36 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -423,7 +423,7 @@  struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 }
 
 /**
- * drm_agp_clear - Clear AGP resource list
+ * drm_legacy_agp_clear - Clear AGP resource list
  * @dev: DRM device
  *
  * Iterate over all AGP resources and remove them. But keep the AGP head
@@ -434,7 +434,7 @@  struct drm_agp_head *drm_agp_init(struct drm_device *dev)
  * resources from getting destroyed. Drivers are responsible of cleaning them up
  * during device shutdown.
  */
-void drm_agp_clear(struct drm_device *dev)
+void drm_legacy_agp_clear(struct drm_device *dev)
 {
 	struct drm_agp_mem *entry, *tempe;
 
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index aeef58ed359b..7b5a13cda7a6 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -413,7 +413,7 @@  int drm_lastclose(struct drm_device * dev)
 
 	mutex_lock(&dev->struct_mutex);
 
-	drm_agp_clear(dev);
+	drm_legacy_agp_clear(dev);
 
 	drm_legacy_sg_cleanup(dev);
 	drm_legacy_vma_flush(dev);
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index a1fff1179a97..29d5a548d07a 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -250,7 +250,7 @@  void drm_pci_agp_destroy(struct drm_device *dev)
 {
 	if (dev->agp) {
 		arch_phys_wc_del(dev->agp->agp_mtrr);
-		drm_agp_clear(dev);
+		drm_legacy_agp_clear(dev);
 		kfree(dev->agp);
 		dev->agp = NULL;
 	}
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
index 193ef19dfc5c..b2d912670a7f 100644
--- a/include/drm/drm_agpsupport.h
+++ b/include/drm/drm_agpsupport.h
@@ -37,7 +37,7 @@  struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
 				uint32_t type);
 
 struct drm_agp_head *drm_agp_init(struct drm_device *dev);
-void drm_agp_clear(struct drm_device *dev);
+void drm_legacy_agp_clear(struct drm_device *dev);
 int drm_agp_acquire(struct drm_device *dev);
 int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
 			  struct drm_file *file_priv);
@@ -93,7 +93,7 @@  static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 	return NULL;
 }
 
-static inline void drm_agp_clear(struct drm_device *dev)
+static inline void drm_legacy_agp_clear(struct drm_device *dev)
 {
 }