From patchwork Mon Feb 25 22:55:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2183051 Return-Path: X-Original-To: patchwork-intel-gfx@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 7C3053FD4E for ; Mon, 25 Feb 2013 23:03:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DFB8E5F50 for ; Mon, 25 Feb 2013 15:03:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gh0-f174.google.com (mail-gh0-f174.google.com [209.85.160.174]) by gabe.freedesktop.org (Postfix) with ESMTP id D63F2E5C89; Mon, 25 Feb 2013 14:55:48 -0800 (PST) Received: by mail-gh0-f174.google.com with SMTP id g15so606072ghb.5 for ; Mon, 25 Feb 2013 14:55:48 -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=dwtQLC/z63ZvcnShMNjG8GNds9PzC3zivJfc9kQJc6E=; b=gXPjRvOWBo9qavH8qXFlDNK9rDWyrcgoDyoU3BF9+9XkcDl0fCBK3DEOddCf9Fzosy 8sF4ZW8QrFs+xRCKnHRlp4D8LTzOFJo6X0Q2XJsgHXYKlDXF9l7iy23JcF4xsd8+QREh E238E4N6nvdOksBhG9vat6aLjhF6yHIDWbQynakYU4I+Ax7eO74A1AUI3TI19+BMTILE Ot0U6nyCEy8P847gUQwZLMRGFlxOKr7R06ydolZCiOELCNn7zlQA1DUfmXY1kasptnEe YDQ1yTuqWFeWJVmR1W9KNYt33n2p3pXpcOxFQ7ZKuiPRaRuMwTl7SbzxIP7LUab1ERZ7 ZVNQ== X-Received: by 10.236.46.229 with SMTP id r65mr21216622yhb.58.1361832948310; Mon, 25 Feb 2013 14:55:48 -0800 (PST) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPS id w7sm28350950yhj.0.2013.02.25.14.55.46 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Feb 2013 14:55:47 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 25 Feb 2013 19:55:19 -0300 Message-Id: <1361832922-19801-6-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: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 5/8] drm/i915: VBT Parsing for the PSR Feature Block for HSW X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Shobhit Kumar Parse and store useful information in i915_dev_private Signed-off-by: Shobhit Kumar v2: Add to new vbt struct and call them psr_* Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_drv.h | 7 +++++++ drivers/gpu/drm/i915/intel_bios.c | 30 ++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_bios.h | 20 +++++++++++++++++++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7adb6d0..1b52dca 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -877,6 +877,13 @@ struct intel_vbt_data { int edp_bpp; struct edp_power_seq edp_pps; + /* eDP PSR*/ + u8 psr_full_link_state; + u8 psr_wait_lines; + u8 psr_idle_frames; + u16 psr_wakeup_tp1; + u16 psr_wakeup_tp2_tp3; + int crt_ddc_pin; int child_dev_num; diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index e145151..2a3fa8b 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -381,6 +381,35 @@ parse_general_definitions(struct drm_i915_private *dev_priv, } } + +static void +parse_edp_psr(struct drm_i915_private *dev_priv, struct bdb_header *bdb) +{ + struct bdb_psr_features *psr; + struct bdb_lvds_options *lvds_opts; + int index = 0; + lvds_opts = find_section(bdb, BDB_LVDS_OPTIONS); + if (!lvds_opts) { + DRM_DEBUG_KMS("No LVDS Options block found.\n"); + return; + } + + index = lvds_opts->panel_type; + + psr = find_section(bdb, BDB_PSR_FEATURES); + if (!psr) { + DRM_DEBUG_KMS("No PSR feature block found.\n"); + return; + } + + dev_priv->vbt.psr_full_link_state = psr[index].link_disable; + dev_priv->vbt.psr_wait_lines = psr[index].wait_lines; + dev_priv->vbt.psr_idle_frames = psr[index].idle_frames; + dev_priv->vbt.psr_wakeup_tp1 = psr[index].wakeup_tp1; + dev_priv->vbt.psr_wakeup_tp2_tp3 = psr[index].wakeup_tp2; +} + + static void parse_sdvo_device_mapping(struct drm_i915_private *dev_priv, struct bdb_header *bdb) @@ -740,6 +769,7 @@ intel_parse_bios(struct drm_device *dev) parse_device_mapping(dev_priv, bdb); parse_driver_features(dev_priv, bdb); parse_edp(dev_priv, bdb); + parse_edp_psr(dev_priv, bdb); if (bios) pci_unmap_rom(pdev, bios); diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h index 36e57f9..c1d39de 100644 --- a/drivers/gpu/drm/i915/intel_bios.h +++ b/drivers/gpu/drm/i915/intel_bios.h @@ -80,7 +80,7 @@ struct vbios_data { #define BDB_EXT_MMIO_REGS 6 #define BDB_SWF_IO 7 #define BDB_SWF_MMIO 8 -#define BDB_DOT_CLOCK_TABLE 9 +#define BDB_PSR_FEATURES 9 #define BDB_MODE_REMOVAL_TABLE 10 #define BDB_CHILD_DEVICE_TABLE 11 #define BDB_DRIVER_FEATURES 12 @@ -263,6 +263,24 @@ struct bdb_lvds_options { u8 rsvd4; } __attribute__((packed)); +struct bdb_psr_features { + /* psr_enable byte */ + u8 link_disable:1; + u8 require_aux:1; + u8 rsvd1:6; + + /* panel wait times */ + u8 idle_frames:4; + u8 wait_lines:3; + u8 rsvd2:1; + + /* TP1 wakeup time */ + u16 wakeup_tp1; + + /* TP2 wakeup time */ + u16 wakeup_tp2; +} __attribute__((packed)); + /* LFP pointer table contains entries to the struct below */ struct bdb_lvds_lfp_data_ptr { u16 fp_timing_offset; /* offsets are from start of bdb */