From patchwork Wed Jun 10 00:22:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6575961 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F9F1C0433 for ; Wed, 10 Jun 2015 00:22:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B54D204D2 for ; Wed, 10 Jun 2015 00:22:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 043A520561 for ; Wed, 10 Jun 2015 00:22:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A2966E294; Tue, 9 Jun 2015 17:22:32 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by gabe.freedesktop.org (Postfix) with ESMTP id DDD9B6E297 for ; Tue, 9 Jun 2015 17:22:31 -0700 (PDT) Received: by pabqy3 with SMTP id qy3so22851883pab.3 for ; Tue, 09 Jun 2015 17:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TA0JaIkmFEEzr4cHwVFATq9W4bDOYZsLLucYnPIyg4s=; b=hw7p1BCg/mBpe1bFP9bVLoL6MW6r9swigDPkPOX5LvoeVbYKyKXu9pgcD9IfK6LDoz yQ50WQ8qZHBXhr3qxVQAur88kGMiaEYoN70DGe4/EbMKGiaR/Vn6OFgQvMybfImwTPtk 28Hx3KhBBKBNns02b9MPeP9LZH5T7HraU+/+sPXyZXQ4mZ0XcYS5IIAS07CiB3A4Y3MN /tjwgJV6CBqdHWTN2cnvHS+PXGclowbETl4sn95TN31op8Ty+cvD7VFPlHc2gobh39+a 9tDNQd8eZNa8uyDLaUDC38RBnrMSUQg+9V8xGSorCdh1fiWGO8bQX/T6v74AaZtN/uZs BL0Q== X-Received: by 10.66.65.162 with SMTP id y2mr523922pas.101.1433895751704; Tue, 09 Jun 2015 17:22:31 -0700 (PDT) Received: from localhost.localdomain (ip70-162-72-208.ph.ph.cox.net. [70.162.72.208]) by mx.google.com with ESMTPSA id f4sm6677230pdc.95.2015.06.09.17.22.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 17:22:31 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Tue, 9 Jun 2015 17:22:19 -0700 Message-Id: <1433895740-13698-3-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433895740-13698-1-git-send-email-tprevite@gmail.com> References: <1433895740-13698-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Displayport compliance test 4.2.2.7 support X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds support for complying with the requirements for test 4.2.2.7 Branch Device Detection upon HPD Plug Event in the Displayport Link CTS 1.2 Core rev1.1. This test checks to see if the source device can properly detect a downstream branch device connected to the attached sink. It does so by advertising the presence of a downstream port through the DPCD. The sink count and content protection readiness bits are saved in the intel_dp struct. Note that as of HDCP 1.3 Displayport amendment, the CP_READY bit (bit 6) in the SINK_COUNT register (DPCD 0x200) is no longer used. This bit is stored here for compatibility for pre-HDCP 1.3 devices. V1: - Fixed formatting errors V2: - Updated for versioning Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/intel_dp.c | 12 +++++++++++- drivers/gpu/drm/i915/intel_drv.h | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 14147d0..697857a 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3856,8 +3856,18 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) intel_dp_print_rates(intel_dp); if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] & - DP_DWN_STRM_PORT_PRESENT)) + DP_DWN_STRM_PORT_PRESENT)) { return true; /* native DP sink */ + } else { + uint8_t dpcd_byte; + /* Read Sink Count - DP Link CTS 1.2a rev1.1 4.2.2.7 */ + intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_COUNT, + &dpcd_byte, 1); + intel_dp->sink_count = DP_GET_SINK_COUNT(dpcd_byte); + intel_dp->cp_ready = (dpcd_byte & DP_SINK_CP_READY) >> 6; + DRM_DEBUG_KMS("Sink count: %d CP: %02x\n", + intel_dp->sink_count, intel_dp->cp_ready); + } if (intel_dp->dpcd[DP_DPCD_REV] == 0x10) return true; /* no per-port downstream info */ diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 6c71be9..f9a935c 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -744,6 +744,10 @@ struct intel_dp { unsigned long compliance_test_type; unsigned long compliance_test_data; bool compliance_test_active; + + /* Branch device support */ + uint8_t sink_count; + uint8_t cp_ready; }; struct intel_digital_port {