diff mbox

[06/27] drm/radeon: use pm_runtime_last_busy_and_autosuspend helper

Message ID 1411575342-31048-7-git-send-email-vinod.koul@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vinod Koul Sept. 24, 2014, 4:14 p.m. UTC
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c |   15 +++++----------
 drivers/gpu/drm/radeon/radeon_drv.c        |    5 ++---
 drivers/gpu/drm/radeon/radeon_kms.c        |    6 ++----
 3 files changed, 9 insertions(+), 17 deletions(-)

Comments

Alex Deucher Sept. 24, 2014, 8:37 p.m. UTC | #1
On Wed, Sep 24, 2014 at 12:14 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>

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

I don't care which tree this goes through.

> ---
>  drivers/gpu/drm/radeon/radeon_connectors.c |   15 +++++----------
>  drivers/gpu/drm/radeon/radeon_drv.c        |    5 ++---
>  drivers/gpu/drm/radeon/radeon_kms.c        |    6 ++----
>  3 files changed, 9 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 300c4b3..b48cf9d 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -852,8 +852,7 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
>         /* check acpi lid status ??? */
>
>         radeon_connector_update_scratch_regs(connector, ret);
> -       pm_runtime_mark_last_busy(connector->dev->dev);
> -       pm_runtime_put_autosuspend(connector->dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>         return ret;
>  }
>
> @@ -1025,8 +1024,7 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
>         radeon_connector_update_scratch_regs(connector, ret);
>
>  out:
> -       pm_runtime_mark_last_busy(connector->dev->dev);
> -       pm_runtime_put_autosuspend(connector->dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
>         return ret;
>  }
> @@ -1103,8 +1101,7 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
>         if (ret == connector_status_connected)
>                 ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
>         radeon_connector_update_scratch_regs(connector, ret);
> -       pm_runtime_mark_last_busy(connector->dev->dev);
> -       pm_runtime_put_autosuspend(connector->dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>         return ret;
>  }
>
> @@ -1321,8 +1318,7 @@ out:
>         radeon_connector_update_scratch_regs(connector, ret);
>
>  exit:
> -       pm_runtime_mark_last_busy(connector->dev->dev);
> -       pm_runtime_put_autosuspend(connector->dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
>         return ret;
>  }
> @@ -1638,8 +1634,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
>
>         radeon_connector_update_scratch_regs(connector, ret);
>  out:
> -       pm_runtime_mark_last_busy(connector->dev->dev);
> -       pm_runtime_put_autosuspend(connector->dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
>         return ret;
>  }
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index 092d067..548d129 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -503,9 +503,8 @@ long radeon_drm_ioctl(struct file *filp,
>                 return ret;
>
>         ret = drm_ioctl(filp, cmd, arg);
> -
> -       pm_runtime_mark_last_busy(dev->dev);
> -       pm_runtime_put_autosuspend(dev->dev);
> +
> +       pm_runtime_last_busy_and_autosuspend(dev->dev);
>         return ret;
>  }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index eb7164d..80f061d 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -147,8 +147,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
>                 pm_runtime_set_autosuspend_delay(dev->dev, 5000);
>                 pm_runtime_set_active(dev->dev);
>                 pm_runtime_allow(dev->dev);
> -               pm_runtime_mark_last_busy(dev->dev);
> -               pm_runtime_put_autosuspend(dev->dev);
> +               pm_runtime_last_busy_and_autosuspend(dev->dev);
>         }
>
>  out:
> @@ -632,8 +631,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
>                 file_priv->driver_priv = fpriv;
>         }
>
> -       pm_runtime_mark_last_busy(dev->dev);
> -       pm_runtime_put_autosuspend(dev->dev);
> +       pm_runtime_last_busy_and_autosuspend(dev->dev);
>         return 0;
>  }
>
> --
> 1.7.0.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 300c4b3..b48cf9d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -852,8 +852,7 @@  radeon_lvds_detect(struct drm_connector *connector, bool force)
 	/* check acpi lid status ??? */
 
 	radeon_connector_update_scratch_regs(connector, ret);
-	pm_runtime_mark_last_busy(connector->dev->dev);
-	pm_runtime_put_autosuspend(connector->dev->dev);
+	pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
 	return ret;
 }
 
@@ -1025,8 +1024,7 @@  radeon_vga_detect(struct drm_connector *connector, bool force)
 	radeon_connector_update_scratch_regs(connector, ret);
 
 out:
-	pm_runtime_mark_last_busy(connector->dev->dev);
-	pm_runtime_put_autosuspend(connector->dev->dev);
+	pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
 
 	return ret;
 }
@@ -1103,8 +1101,7 @@  radeon_tv_detect(struct drm_connector *connector, bool force)
 	if (ret == connector_status_connected)
 		ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
 	radeon_connector_update_scratch_regs(connector, ret);
-	pm_runtime_mark_last_busy(connector->dev->dev);
-	pm_runtime_put_autosuspend(connector->dev->dev);
+	pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
 	return ret;
 }
 
@@ -1321,8 +1318,7 @@  out:
 	radeon_connector_update_scratch_regs(connector, ret);
 
 exit:
-	pm_runtime_mark_last_busy(connector->dev->dev);
-	pm_runtime_put_autosuspend(connector->dev->dev);
+	pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
 
 	return ret;
 }
@@ -1638,8 +1634,7 @@  radeon_dp_detect(struct drm_connector *connector, bool force)
 
 	radeon_connector_update_scratch_regs(connector, ret);
 out:
-	pm_runtime_mark_last_busy(connector->dev->dev);
-	pm_runtime_put_autosuspend(connector->dev->dev);
+	pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
 
 	return ret;
 }
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 092d067..548d129 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -503,9 +503,8 @@  long radeon_drm_ioctl(struct file *filp,
 		return ret;
 
 	ret = drm_ioctl(filp, cmd, arg);
-	
-	pm_runtime_mark_last_busy(dev->dev);
-	pm_runtime_put_autosuspend(dev->dev);
+
+	pm_runtime_last_busy_and_autosuspend(dev->dev);
 	return ret;
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index eb7164d..80f061d 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -147,8 +147,7 @@  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 		pm_runtime_set_autosuspend_delay(dev->dev, 5000);
 		pm_runtime_set_active(dev->dev);
 		pm_runtime_allow(dev->dev);
-		pm_runtime_mark_last_busy(dev->dev);
-		pm_runtime_put_autosuspend(dev->dev);
+		pm_runtime_last_busy_and_autosuspend(dev->dev);
 	}
 
 out:
@@ -632,8 +631,7 @@  int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 		file_priv->driver_priv = fpriv;
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
-	pm_runtime_put_autosuspend(dev->dev);
+	pm_runtime_last_busy_and_autosuspend(dev->dev);
 	return 0;
 }