From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DB511E89C; Tue, 27 May 2025 17:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366677; cv=none; b=urtds9P8Aga5b6PDgkx4N2HPfvtvZkICBkGxQQ+w7XkO2itS/onDD3gHUkn1eqDAbBeyTKrD9GI5d9BjUdt5U3IWYIn06kCKVVgsqsfZL6LzHeeNJzxt22Qdh9eV7gnORrVBgpAnRI67eHrdqTk9FGQz88zYYCKYo47Tk7ic8iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748366677; c=relaxed/simple; bh=R7Y61dYlnjyg/4owqPtChL/LQsBfY80V94zZPxQJvbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hP81Gl3QFd2qAGbTavLHhNiKvzyW5hxRp16YgeyQGnX6j7TgUCNxPTjLLo6ZT9v5sIQV/3lgjummKsFMRjpTyt7Vz9xKCMc2C4oCYikUKT1uEo2pc6mOwO584RahDtW919v8p1dCLR9A0RAdM3VSA3V3Ra28SfyJeC1z9Zv6BNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=S4S1brGT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="S4S1brGT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D97AFC4CEE9; Tue, 27 May 2025 17:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748366677; bh=R7Y61dYlnjyg/4owqPtChL/LQsBfY80V94zZPxQJvbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S4S1brGTp87S5OLB+/1sWlkbR5h48x1o1AUZ1lWfdIIIwH0SYta8x0oe8SnpjcZvz PjpWCcBfS0yJv6mKS/xayp9mkMQm9QG+JUZi9ctcEFyTE92SXBL+FxBh34etZygoYy 4i2bEyUJ7E8OehT2RN/hA0Z5yqKiARhKfpgnx7JE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kent Russell , Alex Deucher , Sasha Levin Subject: [PATCH 6.14 144/783] drm/amdgpu: adjust drm_firmware_drivers_only() handling Date: Tue, 27 May 2025 18:19:01 +0200 Message-ID: <20250527162519.022052107@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162513.035720581@linuxfoundation.org> References: <20250527162513.035720581@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alex Deucher [ Upstream commit e00e5c223878a60e391e5422d173c3382d378f87 ] Move to probe so we can check the PCI device type and only apply the drm_firmware_drivers_only() check for PCI DISPLAY classes. Also add a module parameter to override the nomodeset kernel parameter as a workaround for platforms that have this hardcoded on their kernel command lines. Reviewed-by: Kent Russell Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index bb8ab25ea76ad..e4ce33e69a48b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -173,6 +173,7 @@ uint amdgpu_sdma_phase_quantum = 32; char *amdgpu_disable_cu; char *amdgpu_virtual_display; bool enforce_isolation; +int amdgpu_modeset = -1; /* Specifies the default granularity for SVM, used in buffer * migration and restoration of backing memory when handling @@ -1033,6 +1034,13 @@ module_param_named(user_partt_mode, amdgpu_user_partt_mode, uint, 0444); module_param(enforce_isolation, bool, 0444); MODULE_PARM_DESC(enforce_isolation, "enforce process isolation between graphics and compute . enforce_isolation = on"); +/** + * DOC: modeset (int) + * Override nomodeset (1 = override, -1 = auto). The default is -1 (auto). + */ +MODULE_PARM_DESC(modeset, "Override nomodeset (1 = enable, -1 = auto)"); +module_param_named(modeset, amdgpu_modeset, int, 0444); + /** * DOC: seamless (int) * Seamless boot will keep the image on the screen during the boot process. @@ -2244,6 +2252,12 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, int ret, retry = 0, i; bool supports_atomic = false; + if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA || + (pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) { + if (drm_firmware_drivers_only() && amdgpu_modeset == -1) + return -EINVAL; + } + /* skip devices which are owned by radeon */ for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) { if (amdgpu_unsupported_pciidlist[i] == pdev->device) -- 2.39.5