From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 02/11] drm/i915: Read the EDP DPCD and PSR Capability
Date: Thu, 11 Jul 2013 18:44:56 -0300 [thread overview]
Message-ID: <1373579105-1732-3-git-send-email-rodrigo.vivi@gmail.com> (raw)
In-Reply-To: <1373579105-1732-1-git-send-email-rodrigo.vivi@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
v4: remove parentheses. Noticed by Paulo.
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 7db2cd7..bf0bfa1 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1369,6 +1369,12 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
}
}
+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);
@@ -2282,6 +2288,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 5dfc1a0..d25726d 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -487,6 +487,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.7.11.7
next prev parent reply other threads:[~2013-07-11 21:45 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Rodrigo Vivi [this message]
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 01/11] drm: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 02/11] drm/i915: Read the EDP DPCD and PSR Capability 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=1373579105-1732-3-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).