From patchwork Tue Feb 4 00:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kasireddy, Vivek" X-Patchwork-Id: 11363747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CED492A for ; Tue, 4 Feb 2020 00:07:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C69C20720 for ; Tue, 4 Feb 2020 00:07:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C69C20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E22A6E45F; Tue, 4 Feb 2020 00:07:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A17B6E45F for ; Tue, 4 Feb 2020 00:07:17 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 16:07:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="249170106" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga002.jf.intel.com with ESMTP; 03 Feb 2020 16:07:16 -0800 Received: from vkasired-desk2.fm.intel.com (10.22.254.140) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Feb 2020 16:07:16 -0800 From: Vivek Kasireddy To: Date: Mon, 3 Feb 2020 16:02:42 -0800 Message-ID: <20200204000242.30542-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-Originating-IP: [10.22.254.140] Subject: [Intel-gfx] [PATCH] drm/i915/ehl: Check VBT before updating the transcoder for pipe X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Since the pipe->transcoder mapping is not expected to change unless there is either eDP or DSI connectors present, check the VBT to confirm their presence in addition to checking TRANS_DDI_FUNC_CTL(transcoder). This additional check is needed on platforms like Elkhart Lake because we cannot just rely on GOP/Firmware programmed values in TRANS_DDI_FUNC_CTL(transcoder) before updating the transcoder mapping. This patch is only relevant to EHL -- and a no-op on others -- because some of the PHYs are shared between the different DDIs and we rely on the VBT to present the most accurate information to the driver. Cc: Matt Roper Cc: José Roberto de Souza Signed-off-by: Vivek Kasireddy --- drivers/gpu/drm/i915/display/intel_display.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index c0e5002ce64c..4b38f293bd88 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -10805,6 +10805,18 @@ static void hsw_get_ddi_pll(struct drm_i915_private *dev_priv, enum port port, pipe_config->shared_dpll = intel_get_shared_dpll_by_id(dev_priv, id); } +static bool ehl_vbt_edp_dsi_present(struct drm_i915_private *dev_priv, + enum transcoder transcoder) +{ + bool edp_present = intel_bios_is_port_present(dev_priv, PORT_A); + bool dsi_present = intel_bios_is_dsi_present(dev_priv, NULL); + + if (IS_ELKHARTLAKE(dev_priv)) + return transcoder == TRANSCODER_EDP ? edp_present : dsi_present; + + return true; +} + static bool hsw_get_transcoder_state(struct intel_crtc *crtc, struct intel_crtc_state *pipe_config, u64 *power_domain_mask, @@ -10844,7 +10856,8 @@ static bool hsw_get_transcoder_state(struct intel_crtc *crtc, tmp = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(panel_transcoder)); - if (!(tmp & TRANS_DDI_FUNC_ENABLE)) + if (!(tmp & TRANS_DDI_FUNC_ENABLE) || + !ehl_vbt_edp_dsi_present(dev_priv, panel_transcoder)) continue; /*