diff mbox series

[2/6] drm/i915/display: conversions to with_intel_display_rpm()

Message ID 5560a939f4baa6eb539687c44e72327de825d13d.1741694400.git.jani.nikula@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/display: add display specific runtime PM interface | expand

Commit Message

Jani Nikula March 11, 2025, 12:05 p.m. UTC
Convert all with_intel_runtime_pm() uses to with_intel_display_rpm().

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_backlight.c | 5 ++---
 drivers/gpu/drm/i915/display/intel_bios.c      | 6 +++---
 drivers/gpu/drm/i915/display/intel_hdcp.c      | 5 ++---
 drivers/gpu/drm/i915/display/skl_watermark.c   | 9 +++++----
 4 files changed, 12 insertions(+), 13 deletions(-)

Comments

Rodrigo Vivi March 11, 2025, 8:36 p.m. UTC | #1
On Tue, Mar 11, 2025 at 02:05:36PM +0200, Jani Nikula wrote:
> Convert all with_intel_runtime_pm() uses to with_intel_display_rpm().
> 

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_backlight.c | 5 ++---
>  drivers/gpu/drm/i915/display/intel_bios.c      | 6 +++---
>  drivers/gpu/drm/i915/display/intel_hdcp.c      | 5 ++---
>  drivers/gpu/drm/i915/display/skl_watermark.c   | 9 +++++----
>  4 files changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
> index 178dc6c8de80..4f3fa966c537 100644
> --- a/drivers/gpu/drm/i915/display/intel_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_backlight.c
> @@ -16,6 +16,7 @@
>  #include "intel_backlight_regs.h"
>  #include "intel_connector.h"
>  #include "intel_de.h"
> +#include "intel_display_rpm.h"
>  #include "intel_display_types.h"
>  #include "intel_dp_aux_backlight.h"
>  #include "intel_dsi_dcs_backlight.h"
> @@ -901,11 +902,9 @@ static int intel_backlight_device_get_brightness(struct backlight_device *bd)
>  {
>  	struct intel_connector *connector = bl_get_data(bd);
>  	struct intel_display *display = to_intel_display(connector);
> -	struct drm_i915_private *i915 = to_i915(connector->base.dev);
> -	intel_wakeref_t wakeref;
>  	int ret = 0;
>  
> -	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
> +	with_intel_display_rpm(display) {
>  		u32 hw_level;
>  
>  		drm_modeset_lock(&display->drm->mode_config.connection_mutex, NULL);
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index a8d08d7d82b3..fabfcf2caa69 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -37,6 +37,7 @@
>  
>  #include "i915_drv.h"
>  #include "intel_display.h"
> +#include "intel_display_rpm.h"
>  #include "intel_display_types.h"
>  #include "intel_gmbus.h"
>  
> @@ -3115,7 +3116,6 @@ static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
>  {
>  	struct drm_i915_private *i915 = to_i915(display->drm);
>  	const struct vbt_header *vbt = NULL;
> -	intel_wakeref_t wakeref;
>  
>  	vbt = firmware_get_vbt(display, sizep);
>  
> @@ -3127,11 +3127,11 @@ static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
>  	 * through MMIO or PCI mapping
>  	 */
>  	if (!vbt && IS_DGFX(i915))
> -		with_intel_runtime_pm(&i915->runtime_pm, wakeref)
> +		with_intel_display_rpm(display)
>  			vbt = oprom_get_vbt(display, intel_rom_spi(i915), sizep, "SPI flash");
>  
>  	if (!vbt)
> -		with_intel_runtime_pm(&i915->runtime_pm, wakeref)
> +		with_intel_display_rpm(display)
>  			vbt = oprom_get_vbt(display, intel_rom_pci(i915), sizep, "PCI ROM");
>  
>  	return vbt;
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 1bf424a822f3..72a43ef6e4d2 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -22,6 +22,7 @@
>  #include "intel_de.h"
>  #include "intel_display_power.h"
>  #include "intel_display_power_well.h"
> +#include "intel_display_rpm.h"
>  #include "intel_display_types.h"
>  #include "intel_hdcp.h"
>  #include "intel_hdcp_gsc.h"
> @@ -334,9 +335,7 @@ static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
>  
>  static bool hdcp_key_loadable(struct intel_display *display)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	enum i915_power_well_id id;
> -	intel_wakeref_t wakeref;
>  	bool enabled = false;
>  
>  	/*
> @@ -349,7 +348,7 @@ static bool hdcp_key_loadable(struct intel_display *display)
>  		id = SKL_DISP_PW_1;
>  
>  	/* PG1 (power well #1) needs to be enabled */
> -	with_intel_runtime_pm(&i915->runtime_pm, wakeref)
> +	with_intel_display_rpm(display)
>  		enabled = intel_display_power_well_is_enabled(display, id);
>  
>  	/*
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 2d0de1c63308..2730396a775e 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -19,6 +19,7 @@
>  #include "intel_de.h"
>  #include "intel_display.h"
>  #include "intel_display_power.h"
> +#include "intel_display_rpm.h"
>  #include "intel_display_types.h"
>  #include "intel_fb.h"
>  #include "intel_fixed.h"
> @@ -4052,7 +4053,7 @@ static ssize_t skl_watermark_ipc_status_write(struct file *file,
>  {
>  	struct seq_file *m = file->private_data;
>  	struct drm_i915_private *i915 = m->private;
> -	intel_wakeref_t wakeref;
> +	struct intel_display *display = &i915->display;
>  	bool enable;
>  	int ret;
>  
> @@ -4060,11 +4061,11 @@ static ssize_t skl_watermark_ipc_status_write(struct file *file,
>  	if (ret < 0)
>  		return ret;
>  
> -	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
> +	with_intel_display_rpm(display) {
>  		if (!skl_watermark_ipc_enabled(i915) && enable)
> -			drm_info(&i915->drm,
> +			drm_info(display->drm,
>  				 "Enabling IPC: WM will be proper only after next commit\n");
> -		i915->display.wm.ipc_enabled = enable;
> +		display->wm.ipc_enabled = enable;
>  		skl_watermark_ipc_update(i915);
>  	}
>  
> -- 
> 2.39.5
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
index 178dc6c8de80..4f3fa966c537 100644
--- a/drivers/gpu/drm/i915/display/intel_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_backlight.c
@@ -16,6 +16,7 @@ 
 #include "intel_backlight_regs.h"
 #include "intel_connector.h"
 #include "intel_de.h"
+#include "intel_display_rpm.h"
 #include "intel_display_types.h"
 #include "intel_dp_aux_backlight.h"
 #include "intel_dsi_dcs_backlight.h"
@@ -901,11 +902,9 @@  static int intel_backlight_device_get_brightness(struct backlight_device *bd)
 {
 	struct intel_connector *connector = bl_get_data(bd);
 	struct intel_display *display = to_intel_display(connector);
-	struct drm_i915_private *i915 = to_i915(connector->base.dev);
-	intel_wakeref_t wakeref;
 	int ret = 0;
 
-	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
+	with_intel_display_rpm(display) {
 		u32 hw_level;
 
 		drm_modeset_lock(&display->drm->mode_config.connection_mutex, NULL);
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index a8d08d7d82b3..fabfcf2caa69 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -37,6 +37,7 @@ 
 
 #include "i915_drv.h"
 #include "intel_display.h"
+#include "intel_display_rpm.h"
 #include "intel_display_types.h"
 #include "intel_gmbus.h"
 
@@ -3115,7 +3116,6 @@  static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
 {
 	struct drm_i915_private *i915 = to_i915(display->drm);
 	const struct vbt_header *vbt = NULL;
-	intel_wakeref_t wakeref;
 
 	vbt = firmware_get_vbt(display, sizep);
 
@@ -3127,11 +3127,11 @@  static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
 	 * through MMIO or PCI mapping
 	 */
 	if (!vbt && IS_DGFX(i915))
-		with_intel_runtime_pm(&i915->runtime_pm, wakeref)
+		with_intel_display_rpm(display)
 			vbt = oprom_get_vbt(display, intel_rom_spi(i915), sizep, "SPI flash");
 
 	if (!vbt)
-		with_intel_runtime_pm(&i915->runtime_pm, wakeref)
+		with_intel_display_rpm(display)
 			vbt = oprom_get_vbt(display, intel_rom_pci(i915), sizep, "PCI ROM");
 
 	return vbt;
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index 1bf424a822f3..72a43ef6e4d2 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -22,6 +22,7 @@ 
 #include "intel_de.h"
 #include "intel_display_power.h"
 #include "intel_display_power_well.h"
+#include "intel_display_rpm.h"
 #include "intel_display_types.h"
 #include "intel_hdcp.h"
 #include "intel_hdcp_gsc.h"
@@ -334,9 +335,7 @@  static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
 
 static bool hdcp_key_loadable(struct intel_display *display)
 {
-	struct drm_i915_private *i915 = to_i915(display->drm);
 	enum i915_power_well_id id;
-	intel_wakeref_t wakeref;
 	bool enabled = false;
 
 	/*
@@ -349,7 +348,7 @@  static bool hdcp_key_loadable(struct intel_display *display)
 		id = SKL_DISP_PW_1;
 
 	/* PG1 (power well #1) needs to be enabled */
-	with_intel_runtime_pm(&i915->runtime_pm, wakeref)
+	with_intel_display_rpm(display)
 		enabled = intel_display_power_well_is_enabled(display, id);
 
 	/*
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index 2d0de1c63308..2730396a775e 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -19,6 +19,7 @@ 
 #include "intel_de.h"
 #include "intel_display.h"
 #include "intel_display_power.h"
+#include "intel_display_rpm.h"
 #include "intel_display_types.h"
 #include "intel_fb.h"
 #include "intel_fixed.h"
@@ -4052,7 +4053,7 @@  static ssize_t skl_watermark_ipc_status_write(struct file *file,
 {
 	struct seq_file *m = file->private_data;
 	struct drm_i915_private *i915 = m->private;
-	intel_wakeref_t wakeref;
+	struct intel_display *display = &i915->display;
 	bool enable;
 	int ret;
 
@@ -4060,11 +4061,11 @@  static ssize_t skl_watermark_ipc_status_write(struct file *file,
 	if (ret < 0)
 		return ret;
 
-	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
+	with_intel_display_rpm(display) {
 		if (!skl_watermark_ipc_enabled(i915) && enable)
-			drm_info(&i915->drm,
+			drm_info(display->drm,
 				 "Enabling IPC: WM will be proper only after next commit\n");
-		i915->display.wm.ipc_enabled = enable;
+		display->wm.ipc_enabled = enable;
 		skl_watermark_ipc_update(i915);
 	}