All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Sateesh Kavuri <sateesh.kavuri@intel.com>,
	Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 01/11] drm: Added SDP and VSC structures for handling PSR for eDP
Date: Thu, 11 Jul 2013 18:44:55 -0300	[thread overview]
Message-ID: <1373579105-1732-2-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>

SDP header and SDP VSC header as per eDP 1.3 spec, section 3.5,
chapter "PSR Secondary Data Package Support".

v2: Modified and corrected the structures to be more in line for
kernel coding guidelines and rebased the code on Paulo's DP patchset
v3: removing unecessary identation at DP_RECEIVER_CAP_SIZE
v4: moving them to include/drm/drm_dp_helper.h and also already
    icluding EDP_PSR_RECEIVER_CAP_SIZE to add everything needed
    for PSR at once at drm_dp_helper.h
v5: Fix SDP VSC header and identation by (Paulo Zanoni) and
    remove i915 from title (Daniel Vetter)
v6: Fix spec version and move comments from code to commit message
    since numbers might change in the future (by Paulo Zanoni).

CC: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 include/drm/drm_dp_helper.h | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index e8e1417..ae8dbfb 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -342,13 +342,42 @@ u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
 u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
 					  int lane);
 
-#define DP_RECEIVER_CAP_SIZE	0xf
+#define DP_RECEIVER_CAP_SIZE		0xf
+#define EDP_PSR_RECEIVER_CAP_SIZE	2
+
 void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
 void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
 
 u8 drm_dp_link_rate_to_bw_code(int link_rate);
 int drm_dp_bw_code_to_link_rate(u8 link_bw);
 
+struct edp_sdp_header {
+	u8 HB0; /* Secondary Data Packet ID */
+	u8 HB1; /* Secondary Data Packet Type */
+	u8 HB2; /* 7:5 reserved, 4:0 revision number */
+	u8 HB3; /* 7:5 reserved, 4:0 number of valid data bytes */
+} __packed;
+
+#define EDP_SDP_HEADER_REVISION_MASK		0x1F
+#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES	0x1F
+
+struct edp_vsc_psr {
+	struct edp_sdp_header sdp_header;
+	u8 DB0; /* Stereo Interface */
+	u8 DB1; /* 0 - PSR State; 1 - Update RFB; 2 - CRC Valid */
+	u8 DB2; /* CRC value bits 7:0 of the R or Cr component */
+	u8 DB3; /* CRC value bits 15:8 of the R or Cr component */
+	u8 DB4; /* CRC value bits 7:0 of the G or Y component */
+	u8 DB5; /* CRC value bits 15:8 of the G or Y component */
+	u8 DB6; /* CRC value bits 7:0 of the B or Cb component */
+	u8 DB7; /* CRC value bits 15:8 of the B or Cb component */
+	u8 DB8_31[24]; /* Reserved */
+} __packed;
+
+#define EDP_VSC_PSR_STATE_ACTIVE	(1<<0)
+#define EDP_VSC_PSR_UPDATE_RFB		(1<<1)
+#define EDP_VSC_PSR_CRC_VALUES_VALID	(1<<2)
+
 static inline int
 drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
 {
-- 
1.7.11.7

  reply	other threads:[~2013-07-11 21:45 UTC|newest]

Thread overview: 46+ 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 ` Rodrigo Vivi [this message]
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 01/11] drm: Added SDP and VSC structures for handling PSR for eDP Rodrigo Vivi
2013-06-26 21:52 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-2-git-send-email-rodrigo.vivi@gmail.com \
    --to=rodrigo.vivi@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=sateesh.kavuri@intel.com \
    /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 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.