From patchwork Fri Jul 12 20:54:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?St=C3=A9phane_Marchesin?= X-Patchwork-Id: 2827068 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D40F6C0AB2 for ; Fri, 12 Jul 2013 20:54:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 002EB2013B for ; Fri, 12 Jul 2013 20:54:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 22F2E20136 for ; Fri, 12 Jul 2013 20:54:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13D36E686D for ; Fri, 12 Jul 2013 13:54:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C258E5E56 for ; Fri, 12 Jul 2013 13:54:47 -0700 (PDT) Received: by mail-pd0-f182.google.com with SMTP id r10so8940775pdi.13 for ; Fri, 12 Jul 2013 13:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=AhlE3mAhMbaquVgJejxyidoUrC4tqQyuSTUTokXl/cI=; b=W5v1evgGQstQqpJKbuLBq9dYdKTsgeIXO92b/KlThTZ8JXd/d3wuVwsqfx6f1EbFlr 5rW2DbHSS70l5eCoX8wmlD/ErTj2DAvsj1bhEmqM28s66XHJwZFyRkz8o1VQTous2ifx s4+D99pmPuCbI5Ehy0zwghoVkS6rm/2Ai13mw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding:x-gm-message-state; bh=AhlE3mAhMbaquVgJejxyidoUrC4tqQyuSTUTokXl/cI=; b=LoYhczMw+zxoP8GhLSjx7eKFZ+w8v6dvnWcDrMh7/W6Y1sII5vg73z2pCQ19GpvlRH H54YIZF8MRTxdP+CFAyWSJMd4xY5DfqjVYIykEYMBnv3sRrIdsZcrSg+w0J17NMEKwlt yx1cPR4Zmjyog2bhW2DPI20PTYTZyL+Rv4rOnb7E/AfO50JCTGNm8dktKbmuAVXYwr3r +1E8jkJNjzNXmjg8o7pLXLIvKAINwC89YZP67kNy0xV7J4ZIBnxgGk4m8tU59P3mFIjh g78Gp7H5zA0zz1GhIIL1zd8p89X0z1jBW1JOn5ACW+gN5mhlX3SQmv9gfELwSNcvvEt9 ej4Q== X-Received: by 10.68.200.104 with SMTP id jr8mr43851370pbc.43.1373662486869; Fri, 12 Jul 2013 13:54:46 -0700 (PDT) Received: from localhost ([2620:0:1000:1b01:82c1:6eff:fef8:b068]) by mx.google.com with ESMTPSA id wr9sm47083262pbc.7.2013.07.12.13.54.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:54:45 -0700 (PDT) From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= To: intel-gfx@lists.freedesktop.org Date: Fri, 12 Jul 2013 13:54:41 -0700 Message-Id: <1373662481-23831-1-git-send-email-marcheu@chromium.org> X-Mailer: git-send-email 1.8.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl5coItOhXs4lvgVoAevupMb1zgnQQpGEclrBGE4pfclNim5sUaJhDAqdx1nerFFIdnUVyn Subject: [Intel-gfx] [PATCH] drm/i915: Preserve the DDI_A_4_LANES bit from the bios 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: , 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Otherwise the DDI_A_4_LANES bit gets lost and we can't use > 2 lanes on eDP. This fixes eDP on hsw with > 2 lanes. Also s/port_reversal/saved_port_bits/ since the current name is confusing. Signed-off-by: Stéphane Marchesin Reviewed-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_ddi.c | 10 ++++++---- drivers/gpu/drm/i915/intel_drv.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 324211a..b042ee5 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -301,7 +301,7 @@ static void intel_ddi_mode_set(struct drm_encoder *encoder, struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder); - intel_dp->DP = intel_dig_port->port_reversal | + intel_dp->DP = intel_dig_port->saved_port_bits | DDI_BUF_CTL_ENABLE | DDI_BUF_EMP_400MV_0DB_HSW; intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count); @@ -1109,7 +1109,8 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder) * enabling the port. */ I915_WRITE(DDI_BUF_CTL(port), - intel_dig_port->port_reversal | DDI_BUF_CTL_ENABLE); + intel_dig_port->saved_port_bits | + DDI_BUF_CTL_ENABLE); } else if (type == INTEL_OUTPUT_EDP) { struct intel_dp *intel_dp = enc_to_intel_dp(encoder); @@ -1347,8 +1348,9 @@ void intel_ddi_init(struct drm_device *dev, enum port port) intel_encoder->get_config = intel_ddi_get_config; intel_dig_port->port = port; - intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) & - DDI_BUF_PORT_REVERSAL; + intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) & + (DDI_BUF_PORT_REVERSAL | + DDI_A_4_LANES); intel_dig_port->dp.output_reg = DDI_BUF_CTL(port); intel_encoder->type = INTEL_OUTPUT_UNKNOWN; diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index c8c9b6f..b7d6e09 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -504,7 +504,7 @@ struct intel_dp { struct intel_digital_port { struct intel_encoder base; enum port port; - u32 port_reversal; + u32 saved_port_bits; struct intel_dp dp; struct intel_hdmi hdmi; };