From patchwork Tue Nov 24 10:42:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1405454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgLHk1n3hz9sRR; Tue, 24 Nov 2020 21:44:34 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1khVoC-0003dc-Jd; Tue, 24 Nov 2020 10:44:28 +0000 Received: from mail-pf1-f196.google.com ([209.85.210.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khVnx-0003RL-62 for kernel-team@lists.ubuntu.com; Tue, 24 Nov 2020 10:44:13 +0000 Received: by mail-pf1-f196.google.com with SMTP id v12so18080315pfm.13 for ; Tue, 24 Nov 2020 02:44:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+X2J6AcciWHd4KwhTT8AsE4+yohHabRlziSyBw5i9g4=; b=QooPI6IqH2ofpDcWeuU3UkjJrIo9NFDjYQxItm5n5it4w+L2vb75RKUlybwEw2RNCo C3ermfSafGePayr5yk8UrQo/VdrSnCkC9r873PfnCv7gICfEhAGIbWbQGnvsewwcpA4V RhcRUuHdR2JgrlkQz9X3RrXvfs/2pDIVbNV1LSBt5dFhC0la4la6XU4ZgCmXvtXxHVD9 hqtZURECeO0EqbSNkcfWlA+qoNXOYuWK95X2g9kOmjwB0QQHcOg2H8EEe+LrIKJX0Trz c8A4wdawdVooiCgjQ/siCzcUOKhmfFao0aIt5QrIjz+Y6z6W178G9+ZvHF7Z8fP9/Sg9 11Eg== X-Gm-Message-State: AOAM532r90mZnmqIQQSw6GtFHvKE0e84LDfsXcX2MnTWZjoLg1nf8MW4 ADCT5L40JpqETcD9ELQkDjQ/qkHJ8R6TXg== X-Google-Smtp-Source: ABdhPJxvDDM+YWcXEIV1bK8w6U8hVOv4ZJBwyhAa9EKpskUcWK+UWeBQ36eHKfztfCAhRbbsA4jsfQ== X-Received: by 2002:a17:90a:f317:: with SMTP id ca23mr4261364pjb.141.1606214650373; Tue, 24 Nov 2020 02:44:10 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id w18sm15165056pfi.216.2020.11.24.02.44.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 02:44:09 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 21/38][SRU][G/H] drm/i915/display/ehl: Use EHL DP tables for eDP ports without low power support Date: Tue, 24 Nov 2020 18:42:56 +0800 Message-Id: <20201124104313.421860-22-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124104313.421860-1-vicamo.yang@canonical.com> References: <20201124104313.421860-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.210.196; envelope-from=vicamo@gmail.com; helo=mail-pf1-f196.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: José Roberto de Souza BugLink: https://bugs.launchpad.net/bugs/1903969 Reusing icl_get_combo_buf_trans() for eDP was causing the wrong table being used when the eDP port don't support low power voltage swing table. v2: Only use icl_combo_phy_ddi_translations_edp_hbr3 if low_vswing is set as EHL combo phy supports HBR3 (Matt R) Reviewed-by: Matt Roper Cc: Lee Shawn C Cc: Khaled Almahallawy Cc: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20200826201549.83658-2-jose.souza@intel.com (cherry picked from commit 2a498ab49256eafd2bba1f19b7fe22ce5d880a44) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_ddi.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index ac9aa5c7076f..bf7e3f6e97fd 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -1060,12 +1060,28 @@ static const struct cnl_ddi_buf_trans * ehl_get_combo_buf_trans(struct intel_encoder *encoder, int type, int rate, int *n_entries) { - if (type != INTEL_OUTPUT_HDMI && type != INTEL_OUTPUT_EDP) { + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + + switch (type) { + case INTEL_OUTPUT_HDMI: + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_hdmi); + return icl_combo_phy_ddi_translations_hdmi; + case INTEL_OUTPUT_EDP: + if (dev_priv->vbt.edp.low_vswing) { + if (rate > 540000) { + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_hbr3); + return icl_combo_phy_ddi_translations_edp_hbr3; + } else { + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_hbr2); + return icl_combo_phy_ddi_translations_edp_hbr2; + } + } + /* fall through */ + default: + /* All combo DP and eDP ports that do not support low_vswing */ *n_entries = ARRAY_SIZE(ehl_combo_phy_ddi_translations_dp); return ehl_combo_phy_ddi_translations_dp; } - - return icl_get_combo_buf_trans(encoder, type, rate, n_entries); } static const struct cnl_ddi_buf_trans *