[08/12] drm/legacy: move legacy dev reinit into an inline

Submitted by Dave Airlie on April 23, 2019, 2 a.m.

Details

Message ID 20190423020041.32702-9-airlied@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Dave Airlie April 23, 2019, 2 a.m.
From: Dave Airlie <airlied@redhat.com>

This moves the legacy dev reinit into a legacy inline,
also removes some unneeded inlines now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_file.c   | 24 ------------------------
 drivers/gpu/drm/drm_legacy.h | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 24 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 9701469a6e93..263fbef73fe5 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -425,30 +425,6 @@  static int drm_open_helper(struct file *filp, struct drm_minor *minor)
 	return 0;
 }
 
-static void drm_legacy_dev_reinit(struct drm_device *dev)
-{
-	if (dev->irq_enabled)
-		drm_irq_uninstall(dev);
-
-	mutex_lock(&dev->struct_mutex);
-
-	drm_legacy_agp_clear(dev);
-
-	drm_legacy_sg_cleanup(dev);
-	drm_legacy_vma_flush(dev);
-	drm_legacy_dma_takedown(dev);
-
-	mutex_unlock(&dev->struct_mutex);
-
-	dev->sigdata.lock = NULL;
-
-	dev->context_flag = 0;
-	dev->last_context = 0;
-	dev->if_version = 0;
-
-	DRM_DEBUG("lastclose completed\n");
-}
-
 void drm_lastclose(struct drm_device * dev)
 {
 	DRM_DEBUG("\n");
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index 20c4befc476b..8ee2de06f999 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -150,5 +150,29 @@  static inline void drm_legacy_destroy_members(struct drm_device *dev)
 	mutex_destroy(&dev->ctxlist_mutex);
 }
 
+static inline void drm_legacy_dev_reinit(struct drm_device *dev)
+{
+	if (dev->irq_enabled)
+		drm_irq_uninstall(dev);
+
+	mutex_lock(&dev->struct_mutex);
+
+	drm_legacy_agp_clear(dev);
+
+	drm_legacy_sg_cleanup(dev);
+	drm_legacy_vma_flush(dev);
+	drm_legacy_dma_takedown(dev);
+
+	mutex_unlock(&dev->struct_mutex);
+
+	dev->sigdata.lock = NULL;
+
+	dev->context_flag = 0;
+	dev->last_context = 0;
+	dev->if_version = 0;
+
+	DRM_DEBUG("lastclose completed\n");
+}
+
 void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *master);
 #endif /* __DRM_LEGACY_H__ */

Comments

On Tue, Apr 23, 2019 at 12:00:37PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> This moves the legacy dev reinit into a legacy inline,
> also removes some unneeded inlines now.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/drm_file.c   | 24 ------------------------
>  drivers/gpu/drm/drm_legacy.h | 24 ++++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
> index 9701469a6e93..263fbef73fe5 100644
> --- a/drivers/gpu/drm/drm_file.c
> +++ b/drivers/gpu/drm/drm_file.c
> @@ -425,30 +425,6 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
>  	return 0;
>  }
>  
> -static void drm_legacy_dev_reinit(struct drm_device *dev)
> -{
> -	if (dev->irq_enabled)
> -		drm_irq_uninstall(dev);
> -
> -	mutex_lock(&dev->struct_mutex);
> -
> -	drm_legacy_agp_clear(dev);
> -
> -	drm_legacy_sg_cleanup(dev);
> -	drm_legacy_vma_flush(dev);
> -	drm_legacy_dma_takedown(dev);
> -
> -	mutex_unlock(&dev->struct_mutex);
> -
> -	dev->sigdata.lock = NULL;
> -
> -	dev->context_flag = 0;
> -	dev->last_context = 0;
> -	dev->if_version = 0;
> -
> -	DRM_DEBUG("lastclose completed\n");
> -}
> -
>  void drm_lastclose(struct drm_device * dev)
>  {
>  	DRM_DEBUG("\n");
> diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
> index 20c4befc476b..8ee2de06f999 100644
> --- a/drivers/gpu/drm/drm_legacy.h
> +++ b/drivers/gpu/drm/drm_legacy.h
> @@ -150,5 +150,29 @@ static inline void drm_legacy_destroy_members(struct drm_device *dev)
>  	mutex_destroy(&dev->ctxlist_mutex);
>  }
>  
> +static inline void drm_legacy_dev_reinit(struct drm_device *dev)

Like previous patch, stuff it into drm_legacy_misc.c or something like
that. With that:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> +{
> +	if (dev->irq_enabled)
> +		drm_irq_uninstall(dev);
> +
> +	mutex_lock(&dev->struct_mutex);
> +
> +	drm_legacy_agp_clear(dev);
> +
> +	drm_legacy_sg_cleanup(dev);
> +	drm_legacy_vma_flush(dev);
> +	drm_legacy_dma_takedown(dev);
> +
> +	mutex_unlock(&dev->struct_mutex);
> +
> +	dev->sigdata.lock = NULL;
> +
> +	dev->context_flag = 0;
> +	dev->last_context = 0;
> +	dev->if_version = 0;
> +
> +	DRM_DEBUG("lastclose completed\n");
> +}
> +
>  void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *master);
>  #endif /* __DRM_LEGACY_H__ */
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Dave.

On Tue, Apr 23, 2019 at 12:00:37PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> This moves the legacy dev reinit into a legacy inline,


> also removes some unneeded inlines now.
This comment looks like it belogns to an older iteration
of the patch.

	Sam