From patchwork Wed Jan 30 18:24:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2069311 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 8813C3FD1A for ; Wed, 30 Jan 2013 18:34:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A080E64DC for ; Wed, 30 Jan 2013 10:34:41 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gg0-f181.google.com (mail-gg0-f181.google.com [209.85.161.181]) by gabe.freedesktop.org (Postfix) with ESMTP id 45798E63BA; Wed, 30 Jan 2013 10:30:26 -0800 (PST) Received: by mail-gg0-f181.google.com with SMTP id e5so310911ggh.26 for ; Wed, 30 Jan 2013 10:30:25 -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=xVAD415YXTXszokc7oyLUwHgv8GbeeSpjHg4rrFQVZk=; b=LEL/6xY+FFEeGj/Mkz+ZF0SeonXvs30mquxGsMFuGxF3QLI6QCsLy8hFGVyBqTT0+a X2rg9aJc5+n+uyQtCTlGL6Dgzr8McKPHRb4Ykft0Z+dJX0PbsTrRD7Fzui5Ca3TYza1K F6wSMDJNeVRNoY+dG+HI5Br5rz8x5L2V2ULdZ0PhoTzv06GHryLiAGn+6mOaDuqrBdbK DqgFICsjma0IHVJkZFRnF5rAD8xp6Xl97AFjB0of8bPigyhLDHgBltnBx+9xdHZ2cq07 AmrRG9+j2jX46jV8xtzrz5VNtSttKDsIkkCftipTe6Hr04JbjlrkKzfgx6Ge4ExdTW6z Y44A== X-Received: by 10.236.69.71 with SMTP id m47mr6927911yhd.30.1359570625887; Wed, 30 Jan 2013 10:30:25 -0800 (PST) Received: from localhost.localdomain (200.188.217.18.dedicated.neoviatelecom.com.br. [200.188.217.18]) by mx.google.com with ESMTPS id c16sm1873528ann.15.2013.01.30.10.30.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 10:30:25 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/9] drm/i915: Added SDP and VSC structures for handling PSR for eDP Date: Wed, 30 Jan 2013 16:24:45 -0200 Message-Id: <1359570291-2170-4-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359570291-2170-1-git-send-email-rodrigo.vivi@gmail.com> References: <1359570291-2170-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Shobhit Kumar , 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index e8e1417..e9b7c4b 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -343,12 +343,41 @@ 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 : 5; /* Bits 0:4 */ + u8 rsvd1 : 3; /* Bits 5:7 */ + u8 valid_payload_bytes : 5; /* Bits 0:4 */ + u8 rsvd2 : 3; /* Bits 5:7 */ +} __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 unused; + u8 psr_state : 1; /* Bit 0 */ + u8 update_rfb : 1; /* Bit 1 */ + u8 valid_crc : 1; /* Bit 2 */ + u8 reserved1 : 5; /* Bits 3:7 */ + u8 crc_r_lower; + u8 crc_r_higher; + u8 crc_g_lower; + u8 crc_g_higher; + u8 crc_b_lower; + u8 crc_b_higher; + u8 reserved2[24]; +} __attribute__((packed)); + static inline int drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) {