From patchwork Tue Mar 19 09:24:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 13596471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 71108C54E5D for ; Tue, 19 Mar 2024 09:24:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C67BF10E84F; Tue, 19 Mar 2024 09:24:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XedcbL8m"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id D9DE110E9D4 for ; Tue, 19 Mar 2024 09:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710840286; x=1742376286; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HXyiMMTeSojl+C2vg1LYW7kwzoeeV8JIKqcUUrGkj7U=; b=XedcbL8mYUzHOSSHFsAyHyREfPgsQv8VH5MGQ4ZQEdDWh275Q7rnwfXw pmoS5NoEE+Bqkb2apEvnmwN/RTaFewDS6kfB+Bk9OwMOaC+j9XBf/WnxN GL1VVSwEZ63lIrhPIygm/V/RyItRfrgIDwQYwz0MTPXLMhbIGvSXjH4H1 jujTtUxqlEyA0gVeIR1E4zkyl3qeUt+1Y2J58QqGADbd1MpQMEGak2SOr P9kvjM726koQirujQR5h4EtjMjRO6arznjdbciwmNMhCK3nGJa7pJfZnv NlWETTcKiK5yJqhYOWFBnFaz+05yHUhU0sgNxu+KGbLOX3MDht2ylSzif Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5530414" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="5530414" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 02:24:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="827782094" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="827782094" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 19 Mar 2024 02:24:44 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 19 Mar 2024 11:24:43 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Cc: stable@vger.kernel.org Subject: [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode() Date: Tue, 19 Mar 2024 11:24:42 +0200 Message-ID: <20240319092443.15769-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 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" From: Ville Syrjälä If we have no VBT, or the VBT didn't declare the encoder in question, we won't have the 'devdata' for the encoder. Instead of oopsing just bail early. We won't be able to tell whether the port is DP++ or not, but so be it. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464 Signed-off-by: Ville Syrjälä Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_bios.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index c7841b3eede8..c13a98431a7b 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da { const struct child_device_config *child = &devdata->child; + if (!devdata) + return false; + if (!intel_bios_encoder_supports_dp(devdata) || !intel_bios_encoder_supports_hdmi(devdata)) return false; From patchwork Tue Mar 19 09:24:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 13596472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 67807C54E68 for ; Tue, 19 Mar 2024 09:24:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D37EA10EC1A; Tue, 19 Mar 2024 09:24:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="n8bcUFHs"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5250910EC1A for ; Tue, 19 Mar 2024 09:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710840289; x=1742376289; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=5xhIcuoQD2Lg33RI4Lewyp764qnfQL0SAH6nY9W3ETg=; b=n8bcUFHsEtdruXn+D6BtyqlBzNBBz1uM8sl8dRffBXb8R6+gTmNjHqEM lYzPNArkeG1osGsxmbGTVJ1fXD5xalQostc+Yv56t2Syz0tCWqMKoPs30 5YQ+BargapnlJP/tebK80jmMaa/4MAn7AhKmnizfge15qNQcz4aExO1aq zw+FAW4/g+1IKDuwKLkasQOGAIjli5K1QkpjjHrduP7V7cJzb2xNu9N1M WRjAgQPxDK8yB60tHsUCRRFhEbxOD7+fLvihmptCrU1ALmfp5KG9UuJIi VqB210hrO40ThFrUg4jF0FCWnfuRKz+357CFi1iNT/eP+aF80IvwOtVrd w==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5530419" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="5530419" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 02:24:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="827782095" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="827782095" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by orsmga001.jf.intel.com with SMTP; 19 Mar 2024 02:24:47 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 19 Mar 2024 11:24:46 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915/bios: Use the platform's port_mask when there is no VBT Date: Tue, 19 Mar 2024 11:24:43 +0200 Message-ID: <20240319092443.15769-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240319092443.15769-1-ville.syrjala@linux.intel.com> References: <20240319092443.15769-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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" From: Ville Syrjälä When we have no VBT we currently assume ports A-F are all pontially valid for every platform. That is nonsense. Grab the bitmask of valid ports from the runtime info instead. Although the defaults we actually fill here look semi-sensible only for hsw-skl era hardware. Dunno if we should try to do something more appropriate here for other platforms, or just try to nuke the whole thing? Signed-off-by: Ville Syrjälä Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_bios.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index c13a98431a7b..2abd2d7ceda2 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -2890,9 +2890,8 @@ init_vbt_panel_defaults(struct intel_panel *panel) static void init_vbt_missing_defaults(struct drm_i915_private *i915) { + unsigned int ports = DISPLAY_RUNTIME_INFO(i915)->port_mask; enum port port; - int ports = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | - BIT(PORT_D) | BIT(PORT_E) | BIT(PORT_F); if (!HAS_DDI(i915) && !IS_CHERRYVIEW(i915)) return;