From patchwork Thu Jul 29 21:55:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 12409913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA22C432BE for ; Thu, 29 Jul 2021 21:51:44 +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 ADEA56069E for ; Thu, 29 Jul 2021 21:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ADEA56069E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D80206EE84; Thu, 29 Jul 2021 21:51:42 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id D3F3F6E0FD for ; Thu, 29 Jul 2021 21:51:24 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10060"; a="192578354" X-IronPort-AV: E=Sophos;i="5.84,279,1620716400"; d="scan'208";a="192578354" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2021 14:51:24 -0700 X-IronPort-AV: E=Sophos;i="5.84,279,1620716400"; d="scan'208";a="664570781" Received: from josouza-mobl2.jf.intel.com (HELO josouza-mobl2.intel.com) ([10.24.14.59]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2021 14:51:24 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Thu, 29 Jul 2021 14:55:44 -0700 Message-Id: <20210729215545.192606-9-jose.souza@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210729215545.192606-1-jose.souza@intel.com> References: <20210729215545.192606-1-jose.souza@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH CI 09/10] drm/i915/bios: Only use opregion panel index for display ver 8 and older 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: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On newer platform this opregion call always fails, also it do not support multiple panels so dropping it. Reviewed-by: Matt Atwood Cc: Ville Syrjälä Cc: Jani Nikula Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/display/intel_bios.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index ded04e5b7772b..8775983a75c6b 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -1924,7 +1924,7 @@ static void parse_integrated_panel(struct drm_i915_private *i915, { const struct vbt_header *vbt = i915->opregion.vbt; const struct bdb_header *bdb; - int lfp_inst = 0, panel_index, opregion_panel_index; + int lfp_inst = 0, panel_index; if (devdata->child.handle == HANDLE_LFP_1) lfp_inst = 1; @@ -1937,17 +1937,12 @@ static void parse_integrated_panel(struct drm_i915_private *i915, bdb = get_bdb_header(vbt); panel_index = get_lfp_panel_index(i915, bdb, lfp_inst); - opregion_panel_index = intel_opregion_get_panel_type(i915); - /* - * TODO: the current implementation always use the panel index from - * opregion if available due to issues with old platforms. - * But this do not supports two panels and in SKL or newer I never saw a - * system were this call returns a valid value. - * So will change this to only use opregion up to BDW in a separated - * commit. - */ - if (opregion_panel_index >= 0) - panel_index = opregion_panel_index; + if (DISPLAY_VER(i915) < 9) { + int opregion_panel_index = intel_opregion_get_panel_type(i915); + + if (opregion_panel_index >= 0) + opregion_panel_index = panel_index; + } if (panel_index == -1) return;