From patchwork Tue Nov 24 10:43:02 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: 1405460 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 4CgLJG1krgz9sRK; Tue, 24 Nov 2020 21:45:02 +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 1khVod-00040y-Ox; Tue, 24 Nov 2020 10:44:55 +0000 Received: from mail-pl1-f193.google.com ([209.85.214.193]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khVoL-0003cB-8Z for kernel-team@lists.ubuntu.com; Tue, 24 Nov 2020 10:44:37 +0000 Received: by mail-pl1-f193.google.com with SMTP id 5so10486778plj.8 for ; Tue, 24 Nov 2020 02:44:28 -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=+bsE/031YhXfR7UeTq2Ro5i4lGCy23Ef2YXuOwMewSw=; b=CCtbgO4gJBmikkqc7IcLM9+aatcE68Xoeuw0njJ4l9gtGUC6FQwCEgXps5EJHl+w+t IpnOZBMx1b+4H1eQcu0gJ76tZbmakm+Rbfkvrt/oR1/M4Q+HC8/H+OrRIWIhyHAX7aD6 gfDC3hQIvL3M5LFjwNJImSqN2cEiris2j6i+FFwd16SudVJK02Sp62IRBNUCFuB7EWNf S/CfAvWSvziIr0rwADS8g6vqBSeyzbKt7TBjbsbMT24j5BcRM9rM6zKKe8eI3PRcoLNd qDkPoZRMswHfFWILQLiEzlkrcIHAF9wYCIUEJNxGe8SI6TMU/P+7HE4HERJx6TaUsto7 er3Q== X-Gm-Message-State: AOAM533SOwu/kj2gEAg7e509+bySH0ScSn1UBv7YGaSjYIK4siTAkKbS Oi2XLvoz8jXk613oLr9Sfos7OQrmiSad5w== X-Google-Smtp-Source: ABdhPJxWUi+M1GnQusgOolKyeKqLukv09xQ3AZR+wUt0sTyyBuSg3iAWXn9d2RS5Lx6KYnXJV7BPDQ== X-Received: by 2002:a17:902:8a8c:b029:d8:c4bb:e427 with SMTP id p12-20020a1709028a8cb02900d8c4bbe427mr3338528plo.23.1606214665386; Tue, 24 Nov 2020 02:44:25 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id v18sm14303103pfn.35.2020.11.24.02.44.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 02:44:24 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 27/38][SRU][G/H] UBUNTU SAUCE: drm/i915: Split ICL combo PHY buf trans per output type Date: Tue, 24 Nov 2020 18:43:02 +0800 Message-Id: <20201124104313.421860-28-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.214.193; envelope-from=vicamo@gmail.com; helo=mail-pl1-f193.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: Ville Syrjälä BugLink: https://bugs.launchpad.net/bugs/1903969 Make the mess inside the buf trans funcs a bit more manageable by splitting along the lines of output type. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200929233449.32323-6-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 6ed9aefa69fc0085a197c2a32c2e2de87164672d https://anongit.freedesktop.org/git/drm-tip.git) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_ddi.c | 42 +++++++++++++++++++----- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index a61665101531..d317c3f0d86b 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -1020,24 +1020,48 @@ cnl_get_buf_trans_edp(struct intel_encoder *encoder, int *n_entries) } static const struct cnl_ddi_buf_trans * -icl_get_combo_buf_trans(struct intel_encoder *encoder, int type, int rate, - int *n_entries) +icl_get_combo_buf_trans_hdmi(struct intel_encoder *encoder, int type, int rate, + int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_hdmi); + return icl_combo_phy_ddi_translations_hdmi; +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans_dp(struct intel_encoder *encoder, int type, int rate, + int *n_entries) +{ + *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hbr2); + return icl_combo_phy_ddi_translations_dp_hbr2; +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans_edp(struct intel_encoder *encoder, int type, int rate, + int *n_entries) { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); - if (type == INTEL_OUTPUT_HDMI) { - *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_hdmi); - return icl_combo_phy_ddi_translations_hdmi; - } else if (rate > 540000 && type == INTEL_OUTPUT_EDP) { + if (rate > 540000) { *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_hbr3); return icl_combo_phy_ddi_translations_edp_hbr3; - } else if (type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp.low_vswing) { + } else if (dev_priv->vbt.edp.low_vswing) { *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_hbr2); return icl_combo_phy_ddi_translations_edp_hbr2; } - *n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hbr2); - return icl_combo_phy_ddi_translations_dp_hbr2; + return icl_get_combo_buf_trans_dp(encoder, type, rate, n_entries); +} + +static const struct cnl_ddi_buf_trans * +icl_get_combo_buf_trans(struct intel_encoder *encoder, int type, int rate, + int *n_entries) +{ + if (type == INTEL_OUTPUT_HDMI) + return icl_get_combo_buf_trans_hdmi(encoder, type, rate, n_entries); + else if (type == INTEL_OUTPUT_EDP) + return icl_get_combo_buf_trans_edp(encoder, type, rate, n_entries); + else + return icl_get_combo_buf_trans_dp(encoder, type, rate, n_entries); } static const struct icl_mg_phy_ddi_buf_trans *