[Intel-gfx] [RFC 15/22] drm/i915/slpc: Notification of Refresh Rate change

tom.orourke at intel.com tom.orourke at intel.com
Wed Jan 20 18:26:17 PST 2016


From: Sagar Arun Kamble <sagar.a.kamble at intel.com>

This patch will inform GuC SLPC about changes in the refresh rate
due to Seamless DRRS. Refresh rate changes due to Static DRRS will
be notified via commit path.

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
Acked-by: Tom O'Rourke <Tom.O'Rourke at intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c   |  2 ++
 drivers/gpu/drm/i915/intel_slpc.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_slpc.h |  1 +
 3 files changed, 25 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index e2bea710..5100e8c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5434,6 +5434,8 @@ static void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate)
 	dev_priv->drrs.refresh_rate_type = index;
 
 	DRM_DEBUG_KMS("eDP Refresh Rate set to : %dHz\n", refresh_rate);
+
+	intel_slpc_update_display_rr_info(dev, refresh_rate);
 }
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_slpc.c b/drivers/gpu/drm/i915/intel_slpc.c
index f5f7cad..c15ab19 100644
--- a/drivers/gpu/drm/i915/intel_slpc.c
+++ b/drivers/gpu/drm/i915/intel_slpc.c
@@ -317,3 +317,25 @@ int intel_slpc_update_display_mode_info(struct drm_device *dev)
 
 	return 0;
 }
+
+int intel_slpc_update_display_rr_info(struct drm_device *dev, u32 refresh_rate)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct drm_crtc *crtc;
+	struct intel_display_pipe_basic_info *per_pipe_info;
+	struct intel_slpc_display_mode_event_params *display_params;
+
+	if (!HAS_SLPC(dev))
+		return -EINVAL;
+
+	display_params = &dev_priv->guc.slpc.display_mode_params;
+	crtc = dp_to_dig_port(dev_priv->drrs.dp)->base.base.crtc;
+
+	per_pipe_info = &display_params->per_pipe_info[to_intel_crtc(crtc)->pipe];
+	per_pipe_info->refresh_rate = refresh_rate;
+	per_pipe_info->vsync_ft_usec = 1000000 / refresh_rate;
+
+	host2guc_slpc_display_mode_change(dev_priv);
+
+	return 0;
+}
diff --git a/drivers/gpu/drm/i915/intel_slpc.h b/drivers/gpu/drm/i915/intel_slpc.h
index 18e551b..bb1d12e 100644
--- a/drivers/gpu/drm/i915/intel_slpc.h
+++ b/drivers/gpu/drm/i915/intel_slpc.h
@@ -153,5 +153,6 @@ int intel_slpc_disable(struct drm_device *dev);
 int intel_slpc_enable(struct drm_device *dev);
 int intel_slpc_reset(struct drm_device *dev);
 int intel_slpc_update_display_mode_info(struct drm_device *dev);
+int intel_slpc_update_display_rr_info(struct drm_device *dev, u32 refresh_rate);
 
 #endif
-- 
1.9.1



More information about the Intel-gfx mailing list