intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/11] drm: Added SDP and VSC structures for handling PSR for eDP
@ 2013-06-26 21:55 Rodrigo Vivi
  2013-06-26 21:55 ` [PATCH 02/11] drm/i915: Read the EDP DPCD and PSR Capability Rodrigo Vivi
                   ` (9 more replies)
  0 siblings, 10 replies; 51+ messages in thread
From: Rodrigo Vivi @ 2013-06-26 21:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: Shobhit Kumar, Sateesh Kavuri, Paulo Zanoni, dri-devel

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.8.1.4

^ permalink raw reply related	[flat|nested] 51+ messages in thread
* Re: [PATCH 02/13] drm/i915: Read the EDP DPCD and PSR Capability
@ 2013-06-14 16:42 Paulo Zanoni
  2013-06-25  1:58 ` [PATCH] " Rodrigo Vivi
  0 siblings, 1 reply; 51+ messages in thread
From: Paulo Zanoni @ 2013-06-14 16:42 UTC (permalink / raw)
  To: Rodrigo Vivi; +Cc: intel-gfx

2013/6/12 Rodrigo Vivi <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
>
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> Reviewed-by: Jani Nikula <jani.nikula@intel.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));
> +}

My only concern about this is: what will happen when they define PSR
version 02? Will that DP_PSR_IS_SUPPORTED bit still be 1? Anyway, if
things change in the future we should fix the DP_PSR_IS_SUPPORTED
definition and all its users, so for now I think the code is fine.

The patch looks good and I think that we could try to merge patches 1
and 2 now because they allow us to at least properly detect which
panels support PSR and which panels don't.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

> +
>  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.7.11.7
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni

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

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

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-06-28 16:57   ` [PATCH] " Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 03/11] drm/i915: split aux_clock_divider logic in a separated function for reuse Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 04/11] drm/i915: Enable/Disable PSR Rodrigo Vivi
2013-06-28 17:16   ` [PATCH] " Rodrigo Vivi
2013-06-28 19:31     ` Paulo Zanoni
2013-07-01 20:40       ` Rodrigo Vivi
2013-07-05 21:58         ` Paulo Zanoni
2013-07-05 22:14           ` Daniel Vetter
2013-07-08 22:09           ` Rodrigo Vivi
2013-07-02  0:29       ` Rodrigo Vivi
2013-07-05 22:20         ` Paulo Zanoni
2013-06-26 21:55 ` [PATCH 05/11] drm/i915: Added debugfs support for PSR Status Rodrigo Vivi
2013-06-28 17:29   ` [PATCH] " Rodrigo Vivi
2013-06-28 20:08     ` Paulo Zanoni
2013-06-28 20:14       ` Paulo Zanoni
2013-07-02  0:46         ` Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 06/11] drm/i915: Match all PSR mode entry conditions before enabling it Rodrigo Vivi
2013-06-28 17:36   ` [PATCH] " Rodrigo Vivi
2013-06-28 20:46     ` Paulo Zanoni
2013-07-01 20:47       ` Rodrigo Vivi
2013-07-05 20:32         ` Daniel Vetter
2013-07-08 22:25           ` Rodrigo Vivi
2013-07-11 18:09             ` Rodrigo Vivi
2013-07-02  0:50       ` Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 07/11] drm/i915: add update function to disable/enable-back PSR Rodrigo Vivi
2013-06-28 17:44   ` [PATCH] " Rodrigo Vivi
2013-07-05 22:48     ` Paulo Zanoni
2013-07-08 21:52       ` Rodrigo Vivi
2013-06-26 21:55 ` [PATCH 08/11] drm/intel: add enable_psr module option Rodrigo Vivi
2013-06-28 17:47   ` [PATCH] " Rodrigo Vivi
2013-07-08 12:45     ` Paulo Zanoni
2013-06-26 21:55 ` [PATCH 09/11] drm/i915: Adding global I915_PARAM for PSR ACTIVE Rodrigo Vivi
2013-06-26 22:18   ` Chris Wilson
2013-06-26 23:23     ` [PATCH] drm/i915: Adding global I915_PARAM for PSR ENABLED Rodrigo Vivi
2013-06-27 12:51       ` Rodrigo Vivi
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
2013-06-26 21:55 ` [PATCH 11/11] drm/i915: Hook PSR functionality Rodrigo Vivi
2013-06-28 21:00   ` Paulo Zanoni
2013-07-02  0:52     ` [PATCH] " Rodrigo Vivi
2013-07-08 13:13       ` Paulo Zanoni
2013-07-08 19:46         ` Daniel Vetter
2013-07-08 21:40           ` Rodrigo Vivi
  -- strict thread matches above, loose matches on Subject: below --
2013-06-14 16:42 [PATCH 02/13] drm/i915: Read the EDP DPCD and PSR Capability Paulo Zanoni
2013-06-25  1:58 ` [PATCH] " Rodrigo Vivi

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).