intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm/i915: Read the EDP DPCD and PSR Capability
Date: Mon, 24 Jun 2013 22:58:19 -0300	[thread overview]
Message-ID: <1372125499-7217-1-git-send-email-rodrigo.vivi@gmail.com> (raw)
In-Reply-To: <CA+gsUGQ_KQcBW3aYcgXkUgUnGXhhkkeBAESFnKPfRHktsMxqog@mail.gmail.com>

From: Shobhit Kumar <shobhit.kumar@intel.com>

v2: reuse of just created is_edp_psr and put it at right place.
v3: move is_edp_psr above intel_edp_disable

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/intel_dp.c  | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 759a1c5..5332186 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1342,6 +1342,12 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
 	pipe_config->adjusted_mode.flags |= flags;
 }
 
+static bool is_edp_psr(struct intel_dp *intel_dp)
+{
+	return (is_edp(intel_dp) &&
+		(intel_dp->psr_dpcd[0] & DP_PSR_IS_SUPPORTED));
+}
+
 static void intel_disable_dp(struct intel_encoder *encoder)
 {
 	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
@@ -2255,6 +2261,13 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 	if (intel_dp->dpcd[DP_DPCD_REV] == 0)
 		return false; /* DPCD not present */
 
+	/* Check if the panel supports PSR */
+	memset(intel_dp->psr_dpcd, 0, sizeof(intel_dp->psr_dpcd));
+	intel_dp_aux_native_read_retry(intel_dp, DP_PSR_SUPPORT,
+				       intel_dp->psr_dpcd,
+				       sizeof(intel_dp->psr_dpcd));
+	if (is_edp_psr(intel_dp))
+		DRM_DEBUG_KMS("Detected EDP PSR Panel.\n");
 	if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
 	      DP_DWN_STRM_PORT_PRESENT))
 		return true; /* native DP sink */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 0445d8c..18d9dea 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -470,6 +470,7 @@ struct intel_dp {
 	uint8_t link_bw;
 	uint8_t lane_count;
 	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
+	uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
 	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
 	struct i2c_adapter adapter;
 	struct i2c_algo_dp_aux_data algo;
-- 
1.8.1.4

  reply	other threads:[~2013-06-25  1:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 20:55 [PATCH 01/13] drm: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 02/13] drm/i915: Read the EDP DPCD and PSR Capability Rodrigo Vivi
2013-06-14 16:42   ` Paulo Zanoni
2013-06-25  1:58     ` Rodrigo Vivi [this message]
2013-06-12 20:55 ` [PATCH 03/13] drm/i915: VBT Parsing for the PSR Feature Block for HSW Rodrigo Vivi
2013-06-13 13:41   ` Chris Wilson
2013-06-14 17:02   ` Paulo Zanoni
2013-06-12 20:55 ` [PATCH 04/13] drm/i915: split aux_clock_divider logic in a separated function for reuse Rodrigo Vivi
2013-06-14 17:18   ` Paulo Zanoni
2013-06-12 20:55 ` [PATCH 05/13] drm/i915: Enable/Disable PSR Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 06/13] drm/i915: Added debugfs support for PSR Status Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 07/13] drm/i915: Match all PSR mode entry conditions before enabling it Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 08/13] drm/i915: Hook PSR functionality Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 09/13] drm/i915: add update function to disable/enable-back PSR Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 10/13] drm/intel: add enable_psr module option Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 11/13] drm/i915: PSR: Make a clear separation between Sink (Panel) and Source (HW) enabling Rodrigo Vivi
2013-06-13 13:01   ` Daniel Vetter
2013-06-12 20:55 ` [PATCH 12/13] drm/i915: Adding global I915_PARAM for PSR ACTIVE Rodrigo Vivi
2013-06-12 20:55 ` [PATCH 13/13] drm/i915: force psr exit when busy Rodrigo Vivi
2013-06-14 16:21 ` [PATCH 01/13] drm: Added SDP and VSC structures for handling PSR for eDP Paulo Zanoni
2013-06-25  1:56   ` [PATCH] " Rodrigo Vivi
  -- strict thread matches above, loose matches on Subject: below --
2013-06-26 21:55 [PATCH 02/11] drm/i915: Read the EDP DPCD and PSR Capability Rodrigo Vivi
2013-06-28 16:57 ` [PATCH] " Rodrigo Vivi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372125499-7217-1-git-send-email-rodrigo.vivi@gmail.com \
    --to=rodrigo.vivi@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).