From patchwork Tue Nov 24 10:43:03 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: 1405461 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 4CgLJK6tpYz9sRK; Tue, 24 Nov 2020 21:45:05 +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 1khVoh-00043q-Pz; Tue, 24 Nov 2020 10:44:59 +0000 Received: from mail-pf1-f170.google.com ([209.85.210.170]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khVoQ-0003eh-I9 for kernel-team@lists.ubuntu.com; Tue, 24 Nov 2020 10:44:42 +0000 Received: by mail-pf1-f170.google.com with SMTP id 131so18108373pfb.9 for ; Tue, 24 Nov 2020 02:44:30 -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=j4bcQwLC+0kDkCTn2N/uT+chmAOeK101j4g9nnLkUtY=; b=P9hW82c5uFyrrfiJ6qv1a/RThLrV9yfI2uBg01NAJXUI/ENQzjXl0K5uO6o8TrpFNc LZcWGp1bqti6e3WNPQIkT9nf9HvwKf6U43pjeHf4j/cRU6ZQhcZDHDJE6u5+rNRy0z2b 9nH4TLEk0X9uJPk6RtKyularSMRni3t8urwD48ANqghqTJPWPXu6CZ7J4O4/5Cr0V22R mFizwbuPDYfZKVQrBmo2AkCcbAdGbPEtzjf/8Z4/4klQs4gxrCDsUX84QEYtVw063MSa vUiaU8rQPTO2xqxt+4CDV+f43ZC4uxUuzObcQ01edbsgYeTcCKLMMPB6cZQ7GDEs0YiI uGTw== X-Gm-Message-State: AOAM532xZZpkI56p+Vw2NJoZrLXm26o2NHM3KyQAQwn1j0jRCPVfzzbq 1E12hfvhMyWrpjLdoHierNHYX630gwCueg== X-Google-Smtp-Source: ABdhPJwFUf6a7M6YGV7DkxIRr7EVrhDYXsNwqL16d44MIeu6lMoCWHTywSwNF18MgDnRIH1qQ2WYBA== X-Received: by 2002:a17:90a:5309:: with SMTP id x9mr4091009pjh.98.1606214668201; Tue, 24 Nov 2020 02:44:28 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id q188sm5933828pfc.204.2020.11.24.02.44.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 02:44:27 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 28/38][SRU][G/H] UBUNTU SAUCE: drm/i915: Split ICL MG PHY buf trans per output type Date: Tue, 24 Nov 2020 18:43:03 +0800 Message-Id: <20201124104313.421860-29-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.170; envelope-from=vicamo@gmail.com; helo=mail-pf1-f170.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-7-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 5ee3e1daa8165105346a3b14dfd4917b628d2e9d https://anongit.freedesktop.org/git/drm-tip.git) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_ddi.c | 31 ++++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index d317c3f0d86b..c7154766d19d 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -1065,19 +1065,34 @@ icl_get_combo_buf_trans(struct intel_encoder *encoder, int type, int rate, } static const struct icl_mg_phy_ddi_buf_trans * -icl_get_mg_buf_trans(struct intel_encoder *encoder, int type, int rate, - int *n_entries) +icl_get_mg_buf_trans_hdmi(struct intel_encoder *encoder, int type, int rate, + int *n_entries) { - if (type == INTEL_OUTPUT_HDMI) { - *n_entries = ARRAY_SIZE(icl_mg_phy_ddi_translations_hdmi); - return icl_mg_phy_ddi_translations_hdmi; - } else if (rate > 270000) { + *n_entries = ARRAY_SIZE(icl_mg_phy_ddi_translations_hdmi); + return icl_mg_phy_ddi_translations_hdmi; +} + +static const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans_dp(struct intel_encoder *encoder, int type, int rate, + int *n_entries) +{ + if (rate > 270000) { *n_entries = ARRAY_SIZE(icl_mg_phy_ddi_translations_hbr2_hbr3); return icl_mg_phy_ddi_translations_hbr2_hbr3; + } else { + *n_entries = ARRAY_SIZE(icl_mg_phy_ddi_translations_rbr_hbr); + return icl_mg_phy_ddi_translations_rbr_hbr; } +} - *n_entries = ARRAY_SIZE(icl_mg_phy_ddi_translations_rbr_hbr); - return icl_mg_phy_ddi_translations_rbr_hbr; +static const struct icl_mg_phy_ddi_buf_trans * +icl_get_mg_buf_trans(struct intel_encoder *encoder, int type, int rate, + int *n_entries) +{ + if (type == INTEL_OUTPUT_HDMI) + return icl_get_mg_buf_trans_hdmi(encoder, type, rate, n_entries); + else + return icl_get_mg_buf_trans_dp(encoder, type, rate, n_entries); } static const struct cnl_ddi_buf_trans *