From patchwork Wed Jan 30 18:24:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2069341 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 7F41F3FD1A for ; Wed, 30 Jan 2013 18:36:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AF42E63DD for ; Wed, 30 Jan 2013 10:36:19 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yh0-f54.google.com (mail-yh0-f54.google.com [209.85.213.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B827E6281; Wed, 30 Jan 2013 10:30:28 -0800 (PST) Received: by mail-yh0-f54.google.com with SMTP id 29so311599yhr.41 for ; Wed, 30 Jan 2013 10:30:27 -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=iKnzhwTwfkggi6c5qauNQ1wJgGHkh3mlTCDAa/mkrQA=; b=B1tKHwRDvrdoWitqkLbRUnwx5KnMqeN3rYwY3He70znJD1VgKcCxYWYEV0QliFS43h bQB6nF2JH6ZEgnrLDAUChH20YSzgiD+CCf80sTyFffNw56RKLw7HPKHTVyBppJjfKhvW kXdFDkhHowjYjImZGNL+tladcuPNeYKv6yleovgZYYuxZz2QvJmmemgZZBP5OK2IJJV0 +2B/RqBeQ/FiAYFM7byuAoJuDhMSBxWdyoj63z95TBZzKbe0zgBJ311FgrKFyENgtVYW 56oKCdzEyK2jy5e0OLitSFlNzzLigSuujLE0dyN1WDxRpnU30BtDwtZminIbALM3Jae2 Pj0A== X-Received: by 10.236.162.69 with SMTP id x45mr6800598yhk.111.1359570627646; Wed, 30 Jan 2013 10:30:27 -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.26 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 10:30:27 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/9] drm/i915: Read the EDP DPCD and PSR Capability Date: Wed, 30 Jan 2013 16:24:46 -0200 Message-Id: <1359570291-2170-5-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: Shobhit Kumar v2: reuse of just created is_edp_psr and put it at right place. Signed-off-by: Rodrigo Vivi Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/intel_dp.c | 12 ++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index cbd3236..aeb0ef1 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1435,6 +1435,11 @@ static void intel_post_disable_dp(struct intel_encoder *encoder) } } +static bool is_edp_psr(struct intel_dp *intel_dp) +{ + return (is_edp(intel_dp) && (intel_dp->psr_dpcd[0] & 0x1)); +} + static void intel_enable_dp(struct intel_encoder *encoder) { struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); @@ -2111,6 +2116,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, EDP_PSR_RECEIVER_CAP_SIZE); + 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 aeff0d1..d4b3bac 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -371,6 +371,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;