All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Enable PSR on Haswell.
@ 2013-07-11 21:44 Rodrigo Vivi
  2013-07-11 21:44 ` [PATCH 01/11] drm: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
                   ` (11 more replies)
  0 siblings, 12 replies; 50+ messages in thread
From: Rodrigo Vivi @ 2013-07-11 21:44 UTC (permalink / raw)
  To: intel-gfx

I'm resending full series again because after accepting most of suggestions
and rebasing again on drm-intel-nightly most of patches got some kind of
conflict so the full series is here again.

First 3 patches on this series are already reviewed and I'd be glad if they
were merged asap to avoid future conflicts. This patches at least allows
people to know if they have psr panel or not.

For the rest I accepted most of suggestions and explained on previous emails
the ones I didn't accepted and why. However even the ones I didn't accepted
I tested and verified that they caused some kind of issue.

This version is working very fine for a long time in my machine. I'd appreciate if you could merge everything since now psr is disabled by default by kernel flag. So I'm 100% sure that this series won't cause any kind of regression for any user.

I understand that it would be good to deliver psr enabled by default however I'm changing this default behaviour because I'm sure that PSR will cause regression without userspace (DDX) help when using kde and xdm.

Thanks in advance,
Rodrigo.

Rodrigo Vivi (9):
  drm/i915: split aux_clock_divider logic in a separated function for
    reuse.
  drm/i915: Enable/Disable PSR
  drm/i915: Added debugfs support for PSR Status
  drm/i915: Match all PSR mode entry conditions before enabling it.
  drm/i915: add update function to disable/enable-back PSR
  drm/intel: add enable_psr module option and disable psr by default
  drm/i915: Adding global I915_PARAM for PSR ENABLED.
  drm/i915: Add functions to force psr exit
  drm/i915: Hook PSR functionality

Shobhit Kumar (2):
  drm: Added SDP and VSC structures for handling PSR for eDP
  drm/i915: Read the EDP DPCD and PSR Capability

 drivers/gpu/drm/i915/i915_debugfs.c  | 128 ++++++++++++
 drivers/gpu/drm/i915/i915_dma.c      |   3 +
 drivers/gpu/drm/i915/i915_drv.c      |   4 +
 drivers/gpu/drm/i915/i915_drv.h      |  15 ++
 drivers/gpu/drm/i915/i915_gem.c      |   2 +
 drivers/gpu/drm/i915/i915_reg.h      |  74 +++++++
 drivers/gpu/drm/i915/intel_ddi.c     |   2 +
 drivers/gpu/drm/i915/intel_display.c |   1 +
 drivers/gpu/drm/i915/intel_dp.c      | 373 ++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/i915/intel_drv.h     |  10 +
 include/drm/drm_dp_helper.h          |  31 ++-
 include/uapi/drm/i915_drm.h          |   1 +
 12 files changed, 618 insertions(+), 26 deletions(-)

-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 50+ messages in thread
* [PATCH 10/11] drm/i915: Add functions to force psr exit
@ 2013-06-26 21:55 Rodrigo Vivi
  2013-06-27 13:03 ` [PATCH] " Rodrigo Vivi
  0 siblings, 1 reply; 50+ messages in thread
From: Rodrigo Vivi @ 2013-06-26 21:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

PSR tracking engine in HSW doesn't detect automagically some directly copy area
operations through scanout so we will have to kick it manually and
reschedule it to come back to normal operation as soon as possible.

v2: Before PSR Hook. Don't force it when busy yet.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/i915_reg.h  |  1 +
 drivers/gpu/drm/i915/intel_dp.c  | 59 ++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h |  4 +++
 3 files changed, 64 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index ab5d597..cea646b 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1838,6 +1838,7 @@
 #define   EDP_PSR_PERF_CNT_MASK		0xffffff
 
 #define EDP_PSR_DEBUG_CTL		0x64860
+#define   EDP_PSR_DEBUG_FORCE_EXIT	(3<<30)
 #define   EDP_PSR_DEBUG_MASK_LPSP	(1<<27)
 #define   EDP_PSR_DEBUG_MASK_MEMUP	(1<<26)
 #define   EDP_PSR_DEBUG_MASK_HPD	(1<<25)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 91d3bd6..9986484 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1366,6 +1366,48 @@ static bool intel_edp_is_psr_enabled(struct drm_device *dev)
 	return I915_READ(EDP_PSR_CTL) & EDP_PSR_ENABLE;
 }
 
+static void intel_edp_psr_delayed_normal_work(struct work_struct *__work)
+{
+	struct intel_dp *intel_dp = container_of(to_delayed_work(__work),
+						 struct intel_dp,
+						 edp_psr_delayed_normal_work);
+	struct drm_device *dev = intel_dp_to_dev(intel_dp);
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	mutex_lock(&intel_dp->psr_exit_mutex);
+	I915_WRITE(EDP_PSR_DEBUG_CTL, I915_READ(EDP_PSR_DEBUG_CTL) &
+		   ~EDP_PSR_DEBUG_FORCE_EXIT);
+	mutex_unlock(&intel_dp->psr_exit_mutex);
+}
+
+void intel_edp_psr_force_exit(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_encoder *encoder;
+	struct intel_dp *intel_dp = NULL;
+
+	if (!intel_edp_is_psr_enabled(dev))
+		return;
+
+	list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head)
+		if (encoder->type == INTEL_OUTPUT_EDP)
+			intel_dp = enc_to_intel_dp(&encoder->base);
+
+	if (!intel_dp)
+		return;
+
+	if (WARN_ON(!intel_dp->psr_setup_done))
+		return;
+
+	mutex_lock(&intel_dp->psr_exit_mutex);
+	I915_WRITE(EDP_PSR_DEBUG_CTL, I915_READ(EDP_PSR_DEBUG_CTL) |
+		   EDP_PSR_DEBUG_FORCE_EXIT);
+	mutex_unlock(&intel_dp->psr_exit_mutex);
+
+	schedule_delayed_work(&intel_dp->edp_psr_delayed_normal_work,
+			      msecs_to_jiffies(100));
+}
+
 void intel_edp_psr_write_vsc(struct intel_dp* intel_dp,
 			     struct edp_vsc_psr *vsc_psr)
 {
@@ -1400,6 +1442,18 @@ void intel_edp_psr_write_vsc(struct intel_dp* intel_dp,
 	POSTING_READ(ctl_reg);
 }
 
+static void intel_edp_psr_setup(struct intel_dp *intel_dp)
+{
+	if (intel_dp->psr_setup_done)
+		return;
+
+	INIT_DELAYED_WORK(&intel_dp->edp_psr_delayed_normal_work,
+			  intel_edp_psr_delayed_normal_work);
+	mutex_init(&intel_dp->psr_exit_mutex);
+
+	intel_dp->psr_setup_done = true;
+}
+
 static void intel_edp_psr_enable_sink(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -1544,6 +1598,9 @@ static bool intel_edp_psr_match_conditions(struct intel_dp *intel_dp)
 
 void intel_edp_psr_do_enable(struct intel_dp* intel_dp)
 {
+	/* Setup PSR once */
+	intel_edp_psr_setup(intel_dp);
+
 	/* Enable PSR on the panel */
 	intel_edp_psr_enable_sink(intel_dp);
 
@@ -3413,6 +3470,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	WARN(error, "intel_dp_i2c_init failed with error %d for port %c\n",
 	     error, port_name(port));
 
+	intel_dp->psr_setup_done = false;
+
 	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
 		i2c_del_adapter(&intel_dp->adapter);
 		if (is_edp(intel_dp)) {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 69224d2..b3d5a97 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -497,6 +497,9 @@ struct intel_dp {
 	int backlight_on_delay;
 	int backlight_off_delay;
 	struct delayed_work panel_vdd_work;
+	struct delayed_work edp_psr_delayed_normal_work;
+	struct mutex psr_exit_mutex;
+	bool psr_setup_done;
 	bool want_panel_vdd;
 	struct intel_connector *attached_connector;
 };
@@ -843,5 +846,6 @@ extern bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev,
 extern void intel_edp_psr_enable(struct intel_dp* intel_dp);
 extern void intel_edp_psr_disable(struct intel_dp* intel_dp);
 extern void intel_edp_psr_update(struct drm_device *dev);
+extern void intel_edp_psr_force_exit(struct drm_device *dev);
 
 #endif /* __INTEL_DRV_H__ */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2013-07-18 16:38 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-11 21:44 [PATCH 00/11] Enable PSR on Haswell Rodrigo Vivi
2013-07-11 21:44 ` [PATCH 01/11] drm: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
2013-07-11 21:44 ` [PATCH 02/11] drm/i915: Read the EDP DPCD and PSR Capability Rodrigo Vivi
2013-07-11 21:44 ` [PATCH 03/11] drm/i915: split aux_clock_divider logic in a separated function for reuse Rodrigo Vivi
2013-07-11 21:44 ` [PATCH 04/11] drm/i915: Enable/Disable PSR Rodrigo Vivi
2013-07-17 17:02   ` Paulo Zanoni
2013-07-18  7:56     ` Daniel Vetter
2013-07-11 21:44 ` [PATCH 05/11] drm/i915: Added debugfs support for PSR Status Rodrigo Vivi
2013-07-15 14:03   ` Chris Wilson
2013-07-15 20:13     ` Rodrigo Vivi
2013-07-15 22:18       ` Chris Wilson
2013-07-11 21:45 ` [PATCH 06/11] drm/i915: Match all PSR mode entry conditions before enabling it Rodrigo Vivi
2013-07-15 14:06   ` Chris Wilson
2013-07-18  8:02     ` Daniel Vetter
2013-07-18 16:36       ` Rodrigo Vivi
2013-07-18 16:38         ` Daniel Vetter
2013-07-17 17:03   ` Paulo Zanoni
2013-07-11 21:45 ` [PATCH 07/11] drm/i915: add update function to disable/enable-back PSR Rodrigo Vivi
2013-07-15 14:00   ` Chris Wilson
2013-07-15 20:21     ` Rodrigo Vivi
2013-07-16  5:16       ` Daniel Vetter
2013-07-17 17:26   ` Paulo Zanoni
2013-07-11 21:45 ` [PATCH 08/11] drm/intel: add enable_psr module option and disable psr by default Rodrigo Vivi
2013-07-15 14:01   ` Chris Wilson
2013-07-15 20:23     ` Rodrigo Vivi
2013-07-15 22:01       ` Chris Wilson
2013-07-16  5:19         ` Daniel Vetter
2013-07-16 13:45         ` Rodrigo Vivi
2013-07-11 21:45 ` [PATCH 09/11] drm/i915: Adding global I915_PARAM for PSR ENABLED Rodrigo Vivi
2013-07-17 17:46   ` Rodrigo Vivi
2013-07-17 20:18     ` Chris Wilson
2013-07-17 21:01       ` Rodrigo Vivi
2013-07-17 21:08         ` Chris Wilson
2013-07-18  8:24           ` Daniel Vetter
2013-07-18 16:28             ` Rodrigo Vivi
2013-07-11 21:45 ` [PATCH 10/11] drm/i915: Add functions to force psr exit Rodrigo Vivi
2013-07-15 13:55   ` Chris Wilson
2013-07-15 20:29     ` [PATCH] " Rodrigo Vivi
2013-07-18  8:33       ` Daniel Vetter
2013-07-18 16:27         ` Rodrigo Vivi
2013-07-11 21:45 ` [PATCH 11/11] drm/i915: Hook PSR functionality Rodrigo Vivi
2013-07-18  9:54   ` Daniel Vetter
2013-07-18 16:17     ` Rodrigo Vivi
2013-07-15  9:53 ` [PATCH 00/11] Enable PSR on Haswell Shobhit Kumar
  -- strict thread matches above, loose matches on Subject: below --
2013-06-26 21:55 [PATCH 10/11] drm/i915: Add functions to force psr exit Rodrigo Vivi
2013-06-27 13:03 ` [PATCH] " Rodrigo Vivi
2013-06-28 17:52   ` Rodrigo Vivi
2013-06-28 17:57     ` Chris Wilson
2013-06-28 18:05       ` Rodrigo Vivi
2013-07-08 13:03     ` Paulo Zanoni
2013-07-08 21:48       ` Rodrigo Vivi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.