From patchwork Mon Feb 25 22:55:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2183011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 72F42DF230 for ; Mon, 25 Feb 2013 23:00:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73BEBE61F7 for ; Mon, 25 Feb 2013 15:00:50 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yh0-f49.google.com (mail-yh0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 73747E5C7C; Mon, 25 Feb 2013 14:55:44 -0800 (PST) Received: by mail-yh0-f49.google.com with SMTP id m1so591537yhg.22 for ; Mon, 25 Feb 2013 14:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=RWP1yE2+BJtkpoAmilOxMxKdhH444q2HPghjyLAf1yk=; b=FYR7n2AxVtzlP7K8nu9D+NMHCTPS+DrWF/ZVjCclPqrSqieda1rw3AMwwwxoVj1FN3 HhfcIQRSkMAlNVwLfSbOWN0+19Y0hjVM2JZOVS37+Y6yE0WLF3JZdNhih9+ITNxKSwKB UxMtwrx5QqhtCu6664gVDVuxW3TBhBX2tnYnhj0PRA35+rnWY7GM2StJe10ohpHaaUDu Zd+8udTQq8yMzvqfBDyDfn4bC3e+dRVYSjIlFcmbpFSrsu2FcMzeSGelYGUwJaaD4QSL bjWuGh/d9TOTuZcelhu8Z7rAHmULMkhwdksxjKIjneDVJvasIR3XBFw6z9XGxL57LayF 5Rpw== X-Received: by 10.236.180.42 with SMTP id i30mr21174591yhm.68.1361832943788; Mon, 25 Feb 2013 14:55:43 -0800 (PST) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPS id w7sm28350950yhj.0.2013.02.25.14.55.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Feb 2013 14:55:42 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/8] drm/i915: Added SDP and VSC structures for handling PSR for eDP Date: Mon, 25 Feb 2013 19:55:17 -0300 Message-Id: <1361832922-19801-4-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1361832922-19801-1-git-send-email-rodrigo.vivi@gmail.com> References: <1361832922-19801-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Shobhit Kumar , Sateesh Kavuri , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Shobhit Kumar Signed-off-by: Sateesh Kavuri v2: Modified and corrected the structures to be more in line for kernel coding guidelines and rebased the code on Paulo's DP patchset Signed-off-by: Shobhit Kumar 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 Signed-off-by: Rodrigo Vivi --- include/drm/drm_dp_helper.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index e8e1417..06c5060 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -343,12 +343,34 @@ u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], int lane); #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); +/* SDP header as per eDP 1.3 spec, section 3.6 */ +struct edp_sdp_header { + u8 id; + u8 type; + u8 revision; + u8 valid_payload_bytes; +} __attribute__((packed)); + +/* SDP VSC header as per eDP 1.3 spec, section 3.6 */ +struct edp_vsc_psr { + struct edp_sdp_header sdp_header; + 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 */ +} __attribute__((packed)); + static inline int drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) {