From patchwork Mon Nov 8 14:06:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608469 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B990C433FE for ; Mon, 8 Nov 2021 14:07:17 +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 5C98D61077 for ; Mon, 8 Nov 2021 14:07:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5C98D61077 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 80E3A6E095; Mon, 8 Nov 2021 14:07:11 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 872D06E095 for ; Mon, 8 Nov 2021 14:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PQLIAbh+UwGTeTD7BCUD1byG8sr2htzPW9HYf/GbWOQ=; b=iB5geGdd6oscOpm0+9grzUvHL0oCyFhDrNzaN+3Jk8dKbvgR7XrOn6irbe/UktZ3NrbdPC 2Hk4DU4W6Z8GbtCqkg7NvIX+DhsZsQb8UF0EaGPeOTZsrnRBncDoeBsF5TD24rM+pxv8Yi B0OhNrNIpTow79BCXkZ4QDuTEchiVe4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-j76dW-lGN6unKJ37nLQxDQ-1; Mon, 08 Nov 2021 09:07:05 -0500 X-MC-Unique: j76dW-lGN6unKJ37nLQxDQ-1 Received: by mail-wr1-f70.google.com with SMTP id k8-20020a5d5248000000b001763e7c9ce5so4098632wrc.22 for ; Mon, 08 Nov 2021 06:07:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PQLIAbh+UwGTeTD7BCUD1byG8sr2htzPW9HYf/GbWOQ=; b=iSV1KvLWpQd0G/mDwgTVwrwHLfCk4PSisyuKgkrOBqDPs8vX9v3sJOSw9SqykC6dUb dbqwk0qN7334pg2jWMFgYm7yl8meup7gRt3JU4gRqIdQFOimv4Sm2JJOu+8qOFEsbilO GIm/a3UYXXEkzsatuaI1403DzgIHRbv3LiXNcucrYVzkY4eL4wtebuAWEJAK1CpJhsgK zQvfV69+rZrK6ff+UKEmwvGXQIlz5RVdcvvYArkE2U56lLPjs9XjsHyIn9sj2uCZrJIk +09vOI1dSdL/6sqrPkNFB6Dt/I3C/QKSGLCpdSAUQim+2hQxYf9bm/w73X62iL1uEqwh V+mg== X-Gm-Message-State: AOAM5331Xw+H73uy/wjgjBoiahXowhNoCc/zxMH3Py6fWlGeMRTSmm89 pXaxxJpHgyZMadYOTT6PPmlkorlzXq8W1F0w+LZr0eXzjmqW6mIScv5LD3kMXiVp8ncXjr/2fqa HJGRpIWjmkoLYLjzpg3wBJS/TQK7h X-Received: by 2002:a05:600c:3586:: with SMTP id p6mr47543278wmq.34.1636380424176; Mon, 08 Nov 2021 06:07:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvtINAP8QSTe4tTfHVmZkm28rbBCr0xKoz60mO3RAPdu9pz4/mqVyT59DP/qN1jloJAVX4uA== X-Received: by 2002:a05:600c:3586:: with SMTP id p6mr47543247wmq.34.1636380423968; Mon, 08 Nov 2021 06:07:03 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:03 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 1/6] drm: Don't print messages if drivers are disabled due nomodeset Date: Mon, 8 Nov 2021 15:06:43 +0100 Message-Id: <20211108140648.795268-2-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The nomodeset kernel parameter handler already prints a message that the DRM drivers will be disabled, so there's no need for drivers to do that. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann --- (no changes since v1) drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +--- drivers/gpu/drm/radeon/radeon_drv.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index c718fb5f3f8a..289d04999ced 100644 --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2514,10 +2514,8 @@ static int __init amdgpu_init(void) { int r; - if (vgacon_text_force()) { - DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); + if (vgacon_text_force()) return -EINVAL; - } r = amdgpu_sync_init(); if (r) diff --git drivers/gpu/drm/radeon/radeon_drv.c drivers/gpu/drm/radeon/radeon_drv.c index b74cebca1f89..380adc61e71c 100644 --- drivers/gpu/drm/radeon/radeon_drv.c +++ drivers/gpu/drm/radeon/radeon_drv.c @@ -637,15 +637,11 @@ static struct pci_driver radeon_kms_pci_driver = { static int __init radeon_module_init(void) { - if (vgacon_text_force() && radeon_modeset == -1) { - DRM_INFO("VGACON disable radeon kernel modesetting.\n"); + if (vgacon_text_force() && radeon_modeset == -1) radeon_modeset = 0; - } - if (radeon_modeset == 0) { - DRM_ERROR("No UMS support in radeon module!\n"); + if (radeon_modeset == 0) return -EINVAL; - } DRM_INFO("radeon kernel modesetting enabled.\n"); radeon_register_atpx_handler(); From patchwork Mon Nov 8 14:06:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608467 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 693B3C433EF for ; Mon, 8 Nov 2021 14:07:13 +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 24280610A5 for ; Mon, 8 Nov 2021 14:07:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 24280610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 B3D456E0A8; Mon, 8 Nov 2021 14:07:09 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 831FD6E095 for ; Mon, 8 Nov 2021 14:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QBLSYCGNnxL90t/5H+fXmKYwqgv0hYBDnt/wGxwYShQ=; b=YZYT8UUqXRoH8YaltqYuuMAjiYZGAjWAfpWPKq2wEPeVpq0LAHuW2KlwNPPJW39L+VGzFO U7//x9TNrjDYcTs83xRl3Yv8NGbyYhtMlZ1UZ1vLB1c7zdxtkwfeVjDoTzkzFN4v3ZVnYS zU19gPHHAlQuA2X6t7Ax9VV/n/IZ/N8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-555-qGcOH9HWMHWN0R5mkNMobw-1; Mon, 08 Nov 2021 09:07:06 -0500 X-MC-Unique: qGcOH9HWMHWN0R5mkNMobw-1 Received: by mail-wm1-f69.google.com with SMTP id z137-20020a1c7e8f000000b0030cd1800d86so6267775wmc.2 for ; Mon, 08 Nov 2021 06:07:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QBLSYCGNnxL90t/5H+fXmKYwqgv0hYBDnt/wGxwYShQ=; b=I4/4JcTTJ00OV/EcQQBPqIsSx9BZK5XWrCJP9Bb1O+XSfQg4rwJ6WK95EYfjep40q/ Y9IUFzYhOmdY/v5h52+/CGq42i0oBjvMo4UwUclDnGqimx/2n089iuL3bh3IlafW0kPA ZXuyQ/j2BgrKvJ54m++yXL3zBZi9gwCOZRHujx52NoF2Zd7SFBUZcEuO8+L5iDhbxb6H wYvBQJonhN+td7DrfFijWQRmAHYAi7hvxVSGF8HewQ7pCfrBOy0lwZSNhgAbYwQMUzn7 78UcNrrUdXA0Czs8pLd3bdvwZbCB08oWrYCKzTr3Pznb9ya8FkckYQNJk5yyfIZmZgCv uZYQ== X-Gm-Message-State: AOAM530SfiPmoL06ST1kMSqt+GO9/DdFhE+FZYt8/xRyApr2CT6ZXSqz ZEj+mWKvqsCBOuvB2Bo/EKkz4idpihXcAxgGDyOKhJfLz7NY8PyVvzu3v/pk32u9I25xaOgl/MX 7Ik1+SLZ4kmiaa8F+vO2BYQzKrC+j X-Received: by 2002:a5d:5651:: with SMTP id j17mr68102wrw.166.1636380425219; Mon, 08 Nov 2021 06:07:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHyDgAew+dtCqACNkmDLzBa0RJwibVQ2fmqgfKLQQb8uNEyhZ+QodkcyI1wWViqtj63Ut+JA== X-Received: by 2002:a5d:5651:: with SMTP id j17mr68067wrw.166.1636380425058; Mon, 08 Nov 2021 06:07:05 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:04 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] drm/vboxvideo: Drop CONFIG_VGA_CONSOLE guard to call vgacon_text_force() Date: Mon, 8 Nov 2021 15:06:44 +0100 Message-Id: <20211108140648.795268-3-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It is already handled by the console.h macro since a stub inline function is defined for vgacon_text_force() if CONFIG_VGA_CONSOLE is not set. There's no need to have ifdefery in the driver when calling the function. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann --- (no changes since v1) drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 -- 1 file changed, 2 deletions(-) diff --git drivers/gpu/drm/vboxvideo/vbox_drv.c drivers/gpu/drm/vboxvideo/vbox_drv.c index a6c81af37345..fd7abb029c65 100644 --- drivers/gpu/drm/vboxvideo/vbox_drv.c +++ drivers/gpu/drm/vboxvideo/vbox_drv.c @@ -193,10 +193,8 @@ static const struct drm_driver driver = { static int __init vbox_init(void) { -#ifdef CONFIG_VGA_CONSOLE if (vgacon_text_force() && vbox_modeset == -1) return -EINVAL; -#endif if (vbox_modeset == 0) return -EINVAL; From patchwork Mon Nov 8 14:06:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608475 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 180C2C433EF for ; Mon, 8 Nov 2021 14:07:26 +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 DC0A261077 for ; Mon, 8 Nov 2021 14:07:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC0A261077 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 C35586E174; Mon, 8 Nov 2021 14:07:16 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03ED96E20A for ; Mon, 8 Nov 2021 14:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/yvlcrsItarsWPgEw53QfPOwi87fy6vuntnoJW5osHw=; b=SgFNH2YIMiTlyd1rPHxymQp4Otc3XCB90lU+eJ747SbyCMvlH5gcO3/EcjX6XblYWbCoqo FJKW6tXIpboNC1AIrK98/wxCphy8Ba7fQnTRn/RS50xpq8Wzn0nuEyR8gwYUh4iB1VAAMU gw9OTj9GPdx5CPaI8wcYNMHGhTtdVyc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-rgXS6U0fMba6g-iYb55Q0w-1; Mon, 08 Nov 2021 09:07:07 -0500 X-MC-Unique: rgXS6U0fMba6g-iYb55Q0w-1 Received: by mail-wr1-f72.google.com with SMTP id d7-20020a5d6447000000b00186a113463dso4073578wrw.10 for ; Mon, 08 Nov 2021 06:07:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/yvlcrsItarsWPgEw53QfPOwi87fy6vuntnoJW5osHw=; b=7uxPrQnbsqqsBbldUttyPKBWBJWGtL4Z46GcI+3kSfOa7yeUuRhrX0WCVW6wgQapKa Tol9MLY/6gXlfkzTsW2c34/2bIgPMNmRWiXA63EWG9pWqjBNUKg+6NstwQ1IZE+6d016 BmF6TcQwLNPUr3mVFVxq9MWyb9pP3a1rgJy5LqW/DtrNMhBy3+BJtnJMofRrHT89R8Eq w96dwIUYJKXBkuqwo3Yj78qm8yU/J8yMLgKV1cJnimLG2/fDZDi7glzhggmJH8yRXRfX h2IivlO1uaUyimpLtLxtSDbFKqgKZ0dHJeOLc+MWLhoRb9D6HTBwXWnOi25pASmKBzTu xQIQ== X-Gm-Message-State: AOAM530MXlTpA9sfkGh9kIIc4oiZVGV5pNXbAHdf9XGbRfn6vBfcyOTs mE9qDCnA02/iMA1cqo1QsjxpT2e6h49HKHdE590apPcMJ69DMdKWijmmiEcH3IufQ3gCXQ6EalW fJpeC2MSrf1j+UhPrFXggqiNkyvcF X-Received: by 2002:a05:600c:3b0a:: with SMTP id m10mr51728983wms.130.1636380426339; Mon, 08 Nov 2021 06:07:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJylFfHQFzfQh25tFqs5uZaCY0+tKWOTyy1k5MyRMJc+2lF2XPtqDn3wyz5xsrBVif+vRWXG7w== X-Received: by 2002:a05:600c:3b0a:: with SMTP id m10mr51728935wms.130.1636380425983; Mon, 08 Nov 2021 06:07:05 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:05 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 3/6] drm: Move nomodeset kernel parameter to the DRM subsystem Date: Mon, 8 Nov 2021 15:06:45 +0100 Message-Id: <20211108140648.795268-4-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The "nomodeset" kernel cmdline parameter is handled by the vgacon driver but the exported vgacon_text_force() symbol is only used by DRM drivers. It makes much more sense for the parameter logic to be in the subsystem of the drivers that are making use of it. Let's move the vgacon_text_force() function and related logic to the DRM subsystem. While doing that, rename the function to drm_get_modeset() and make it return true if modesetting is enabled and false otherwise. This better reflects the condition that drivers are actually testing for. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann --- (no changes since v3) Changes in v3: - Drop the drm_drv_enabled() function and just call to drm_get_modeset(). - Make drm_get_modeset() just a getter function and don't return an error. - Move independent cleanups in drivers as separate preparatory patches. Changes in v2: - Conditionally build drm_nomodeset.o if CONFIG_VGA_CONSOLE is set. - Squash patches to move nomodeset logic to DRM and do the renaming. - Name the function drm_check_modeset() and make it return -ENODEV. - Squash patch to add drm_drv_enabled() and make drivers use it. - Make the drivers changes before moving nomodeset logic to DRM. - Make drm_drv_enabled() return an errno and -ENODEV if nomodeset. - Remove debug and error messages in drivers. drivers/gpu/drm/Makefile | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++-- drivers/gpu/drm/ast/ast_drv.c | 4 ++-- drivers/gpu/drm/drm_nomodeset.c | 26 +++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_module.c | 4 ++-- drivers/gpu/drm/mgag200/mgag200_drv.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_drm.c | 4 ++-- drivers/gpu/drm/qxl/qxl_drv.c | 4 ++-- drivers/gpu/drm/radeon/radeon_drv.c | 4 ++-- drivers/gpu/drm/tiny/bochs.c | 4 ++-- drivers/gpu/drm/tiny/cirrus.c | 5 +++-- drivers/gpu/drm/vboxvideo/vbox_drv.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_drv.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 ++-- drivers/video/console/vgacon.c | 21 -------------------- include/drm/drm_mode_config.h | 6 ++++++ include/linux/console.h | 6 ------ 17 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 drivers/gpu/drm/drm_nomodeset.c diff --git drivers/gpu/drm/Makefile drivers/gpu/drm/Makefile index 1c41156deb5f..c74810c285af 100644 --- drivers/gpu/drm/Makefile +++ drivers/gpu/drm/Makefile @@ -33,6 +33,8 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86. obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o +obj-$(CONFIG_VGA_CONSOLE) += drm_nomodeset.o + drm_cma_helper-y := drm_gem_cma_helper.o obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o diff --git drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 289d04999ced..0da7f0b14700 100644 --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -28,10 +28,10 @@ #include #include #include +#include #include "amdgpu_drv.h" #include -#include #include #include #include @@ -2514,7 +2514,7 @@ static int __init amdgpu_init(void) { int r; - if (vgacon_text_force()) + if (!drm_get_modeset()) return -EINVAL; r = amdgpu_sync_init(); diff --git drivers/gpu/drm/ast/ast_drv.c drivers/gpu/drm/ast/ast_drv.c index 86d5cd7b6318..e788deac15cb 100644 --- drivers/gpu/drm/ast/ast_drv.c +++ drivers/gpu/drm/ast/ast_drv.c @@ -26,7 +26,6 @@ * Authors: Dave Airlie */ -#include #include #include @@ -35,6 +34,7 @@ #include #include #include +#include #include #include "ast_drv.h" @@ -233,7 +233,7 @@ static struct pci_driver ast_pci_driver = { static int __init ast_init(void) { - if (vgacon_text_force() && ast_modeset == -1) + if (!drm_get_modeset() && ast_modeset == -1) return -EINVAL; if (ast_modeset == 0) diff --git drivers/gpu/drm/drm_nomodeset.c drivers/gpu/drm/drm_nomodeset.c new file mode 100644 index 000000000000..fc3acf3ab2e2 --- /dev/null +++ drivers/gpu/drm/drm_nomodeset.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +static bool drm_nomodeset; + +bool drm_get_modeset(void) +{ + return !drm_nomodeset; +} +EXPORT_SYMBOL(drm_get_modeset); + +static int __init disable_modeset(char *str) +{ + drm_nomodeset = true; + + pr_warn("You have booted with nomodeset. This means your GPU drivers are DISABLED\n"); + pr_warn("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n"); + pr_warn("Unless you actually understand what nomodeset does, you should reboot without enabling it\n"); + + return 1; +} + +/* Disable kernel modesetting */ +__setup("nomodeset", disable_modeset); diff --git drivers/gpu/drm/i915/i915_module.c drivers/gpu/drm/i915/i915_module.c index ab2295dd4500..f952e8b69465 100644 --- drivers/gpu/drm/i915/i915_module.c +++ drivers/gpu/drm/i915/i915_module.c @@ -4,7 +4,7 @@ * Copyright © 2021 Intel Corporation */ -#include +#include #include "gem/i915_gem_context.h" #include "gem/i915_gem_object.h" @@ -31,7 +31,7 @@ static int i915_check_nomodeset(void) if (i915_modparams.modeset == 0) use_kms = false; - if (vgacon_text_force() && i915_modparams.modeset == -1) + if (!drm_get_modeset() && i915_modparams.modeset == -1) use_kms = false; if (!use_kms) { diff --git drivers/gpu/drm/mgag200/mgag200_drv.c drivers/gpu/drm/mgag200/mgag200_drv.c index 6b9243713b3c..3df5a608d0e7 100644 --- drivers/gpu/drm/mgag200/mgag200_drv.c +++ drivers/gpu/drm/mgag200/mgag200_drv.c @@ -6,7 +6,6 @@ * Dave Airlie */ -#include #include #include #include @@ -15,6 +14,7 @@ #include #include #include +#include #include #include "mgag200_drv.h" @@ -378,7 +378,7 @@ static struct pci_driver mgag200_pci_driver = { static int __init mgag200_init(void) { - if (vgacon_text_force() && mgag200_modeset == -1) + if (!drm_get_modeset() && mgag200_modeset == -1) return -EINVAL; if (mgag200_modeset == 0) diff --git drivers/gpu/drm/nouveau/nouveau_drm.c drivers/gpu/drm/nouveau/nouveau_drm.c index 1f828c9f691c..d42e07de6460 100644 --- drivers/gpu/drm/nouveau/nouveau_drm.c +++ drivers/gpu/drm/nouveau/nouveau_drm.c @@ -22,7 +22,6 @@ * Authors: Ben Skeggs */ -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include #include @@ -1322,7 +1322,7 @@ nouveau_drm_init(void) nouveau_display_options(); if (nouveau_modeset == -1) { - if (vgacon_text_force()) + if (!drm_get_modeset()) nouveau_modeset = 0; } diff --git drivers/gpu/drm/qxl/qxl_drv.c drivers/gpu/drm/qxl/qxl_drv.c index fc47b0deb021..2d87a95ae431 100644 --- drivers/gpu/drm/qxl/qxl_drv.c +++ drivers/gpu/drm/qxl/qxl_drv.c @@ -29,7 +29,6 @@ #include "qxl_drv.h" -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -295,7 +295,7 @@ static struct drm_driver qxl_driver = { static int __init qxl_init(void) { - if (vgacon_text_force() && qxl_modeset == -1) + if (!drm_get_modeset() && qxl_modeset == -1) return -EINVAL; if (qxl_modeset == 0) diff --git drivers/gpu/drm/radeon/radeon_drv.c drivers/gpu/drm/radeon/radeon_drv.c index 380adc61e71c..802a28d55d0a 100644 --- drivers/gpu/drm/radeon/radeon_drv.c +++ drivers/gpu/drm/radeon/radeon_drv.c @@ -31,7 +31,6 @@ #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -637,7 +637,7 @@ static struct pci_driver radeon_kms_pci_driver = { static int __init radeon_module_init(void) { - if (vgacon_text_force() && radeon_modeset == -1) + if (!drm_get_modeset() && radeon_modeset == -1) radeon_modeset = 0; if (radeon_modeset == 0) diff --git drivers/gpu/drm/tiny/bochs.c drivers/gpu/drm/tiny/bochs.c index 2ce3bd903b70..500101f8a6e9 100644 --- drivers/gpu/drm/tiny/bochs.c +++ drivers/gpu/drm/tiny/bochs.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -#include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include #include #include @@ -719,7 +719,7 @@ static struct pci_driver bochs_pci_driver = { static int __init bochs_init(void) { - if (vgacon_text_force() && bochs_modeset == -1) + if (!drm_get_modeset() && bochs_modeset == -1) return -EINVAL; if (bochs_modeset == 0) diff --git drivers/gpu/drm/tiny/cirrus.c drivers/gpu/drm/tiny/cirrus.c index 4611ec408506..c94a030b6b3b 100644 --- drivers/gpu/drm/tiny/cirrus.c +++ drivers/gpu/drm/tiny/cirrus.c @@ -16,7 +16,6 @@ * Copyright 1999-2001 Jeff Garzik */ -#include #include #include #include @@ -39,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -636,8 +636,9 @@ static struct pci_driver cirrus_pci_driver = { static int __init cirrus_init(void) { - if (vgacon_text_force()) + if (!drm_get_modeset()) return -EINVAL; + return pci_register_driver(&cirrus_pci_driver); } diff --git drivers/gpu/drm/vboxvideo/vbox_drv.c drivers/gpu/drm/vboxvideo/vbox_drv.c index fd7abb029c65..74b8c93a664f 100644 --- drivers/gpu/drm/vboxvideo/vbox_drv.c +++ drivers/gpu/drm/vboxvideo/vbox_drv.c @@ -7,7 +7,6 @@ * Michael Thayer */ -#include #include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include "vbox_drv.h" @@ -193,7 +193,7 @@ static const struct drm_driver driver = { static int __init vbox_init(void) { - if (vgacon_text_force() && vbox_modeset == -1) + if (!drm_get_modeset() && vbox_modeset == -1) return -EINVAL; if (vbox_modeset == 0) diff --git drivers/gpu/drm/virtio/virtgpu_drv.c drivers/gpu/drm/virtio/virtgpu_drv.c index 749db18dcfa2..6ad20c225eed 100644 --- drivers/gpu/drm/virtio/virtgpu_drv.c +++ drivers/gpu/drm/virtio/virtgpu_drv.c @@ -27,7 +27,6 @@ */ #include -#include #include #include #include @@ -37,6 +36,7 @@ #include #include #include +#include #include "virtgpu_drv.h" @@ -104,7 +104,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev) struct drm_device *dev; int ret; - if (vgacon_text_force() && virtio_gpu_modeset == -1) + if (!drm_get_modeset() && virtio_gpu_modeset == -1) return -EINVAL; if (virtio_gpu_modeset == 0) diff --git drivers/gpu/drm/vmwgfx/vmwgfx_drv.c drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index ab9a1750e1df..049fd017dca5 100644 --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -25,7 +25,6 @@ * **************************************************************************/ -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1651,7 +1651,7 @@ static int __init vmwgfx_init(void) { int ret; - if (vgacon_text_force()) + if (!drm_get_modeset()) return -EINVAL; ret = pci_register_driver(&vmw_pci_driver); diff --git drivers/video/console/vgacon.c drivers/video/console/vgacon.c index ef9c57ce0906..d4320b147956 100644 --- drivers/video/console/vgacon.c +++ drivers/video/console/vgacon.c @@ -97,30 +97,9 @@ static int vga_video_font_height; static int vga_scan_lines __read_mostly; static unsigned int vga_rolled_over; /* last vc_origin offset before wrap */ -static bool vgacon_text_mode_force; static bool vga_hardscroll_enabled; static bool vga_hardscroll_user_enable = true; -bool vgacon_text_force(void) -{ - return vgacon_text_mode_force; -} -EXPORT_SYMBOL(vgacon_text_force); - -static int __init text_mode(char *str) -{ - vgacon_text_mode_force = true; - - pr_warn("You have booted with nomodeset. This means your GPU drivers are DISABLED\n"); - pr_warn("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n"); - pr_warn("Unless you actually understand what nomodeset does, you should reboot without enabling it\n"); - - return 1; -} - -/* force text mode - used by kernel modesetting */ -__setup("nomodeset", text_mode); - static int __init no_scroll(char *str) { /* diff --git include/drm/drm_mode_config.h include/drm/drm_mode_config.h index 48b7de80daf5..f4d407908348 100644 --- include/drm/drm_mode_config.h +++ include/drm/drm_mode_config.h @@ -969,4 +969,10 @@ static inline int drm_mode_config_init(struct drm_device *dev) void drm_mode_config_reset(struct drm_device *dev); void drm_mode_config_cleanup(struct drm_device *dev); +#ifdef CONFIG_VGA_CONSOLE +extern bool drm_get_modeset(void); +#else +static inline bool drm_get_modeset(void) { return true; } +#endif + #endif diff --git include/linux/console.h include/linux/console.h index 20874db50bc8..d4dd8384898b 100644 --- include/linux/console.h +++ include/linux/console.h @@ -217,12 +217,6 @@ extern atomic_t ignore_console_lock_warning; #define VESA_HSYNC_SUSPEND 2 #define VESA_POWERDOWN 3 -#ifdef CONFIG_VGA_CONSOLE -extern bool vgacon_text_force(void); -#else -static inline bool vgacon_text_force(void) { return false; } -#endif - extern void console_init(void); /* For deferred console takeover */ From patchwork Mon Nov 8 14:06:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608473 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3E35C43219 for ; Mon, 8 Nov 2021 14:07:23 +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 B43B461077 for ; Mon, 8 Nov 2021 14:07:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B43B461077 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 C85186E0CE; Mon, 8 Nov 2021 14:07:14 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEE176E0AB for ; Mon, 8 Nov 2021 14:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZPjF0q/sVEPX9a+zAsNTT+5st42KW0ioDba0FRy7So0=; b=IGIlF0++ic0B473yd83NzgKoO1zX2FaY6bgLrxQTUiXeXWeju7EwnERpV1I4YfISbf5TzD DJrzQiyvve9VZW6w0sSPh3+We7r9IUM8lBvilI3vPWqke4evYfmmNR9AZaOZBYl1Aw87VH lY+MU2Vg0nMSF2gf9C4PpTl2U6i0+bA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-MhTBUxdHMoaZJ-yv_fJfIg-1; Mon, 08 Nov 2021 09:07:08 -0500 X-MC-Unique: MhTBUxdHMoaZJ-yv_fJfIg-1 Received: by mail-wr1-f72.google.com with SMTP id y10-20020adffa4a000000b0017eea6cb05dso4073237wrr.6 for ; Mon, 08 Nov 2021 06:07:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZPjF0q/sVEPX9a+zAsNTT+5st42KW0ioDba0FRy7So0=; b=Rpn+wQLBvAcMZ3qJ6BwDg2mLDmqkpbg3PwgrWgnoBSQgXyUmtOi+wJ6swc4Mm6tyAy GtFRMgd/eINGPZwJPqBdh4nGezUo/4Oak5SXg1OlfYxLMTmhOp9baklZ8d9VBMsNwqmg iNpBIdxLS/oW/dFTu5/GaNf8jJP3D7RjC3gwynGxBnMlnN1yGZmru2gr5Z7UYeEZp9m8 UsnUjiVIEm7+cUnnwhacd+RMvYniHqU/DaT8DRlJRKaFHqKlAm78XDpvbTyvQod5tjZ8 Z91AgRGSEBxOf6gZWrK/eZE9AIsKa6VBQYvQ1NT73szN8nzrv10Gc+CxVkAub59Q7VI0 wqjw== X-Gm-Message-State: AOAM530WgFu4V9wH3Ik9B2ZdI/8coYPtNBmEZ7l2k2cXOFMx7GJnUgHm C4hG4IxEr0SzoFUO9dpGMPrb3fhZ3BgN7+C0nLTPJIU0gO5HG4x3CN8FRBwhQFsoLEgb8inNaep 2XrQNfQ702EzGjs5n02FSPUqIf7qp X-Received: by 2002:a5d:6481:: with SMTP id o1mr48028040wri.305.1636380427610; Mon, 08 Nov 2021 06:07:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpZwgscwTuqbX3FM0P7plr2LbKZCfnFDWGyt9ZGyuhmO5dPrrJxu4VvdTcsUZXQXtqpR3eCw== X-Received: by 2002:a5d:6481:: with SMTP id o1mr48027995wri.305.1636380427367; Mon, 08 Nov 2021 06:07:07 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:06 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] drm: Decouple nomodeset from CONFIG_VGA_CONSOLE Date: Mon, 8 Nov 2021 15:06:46 +0100 Message-Id: <20211108140648.795268-5-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This relationship was only for historical reasons and the nomodeset option should be available even on platforms that don't enable CONFIG_VGA_CONSOLE. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann --- (no changes since v1) drivers/gpu/drm/Kconfig | 6 ++++++ drivers/gpu/drm/Makefile | 2 +- include/drm/drm_mode_config.h | 4 ---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git drivers/gpu/drm/Kconfig drivers/gpu/drm/Kconfig index fb144617055b..483d534eb074 100644 --- drivers/gpu/drm/Kconfig +++ drivers/gpu/drm/Kconfig @@ -8,6 +8,7 @@ menuconfig DRM tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA + select DRM_NOMODESET select DRM_PANEL_ORIENTATION_QUIRKS select HDMI select FB_CMDLINE @@ -493,6 +494,11 @@ config DRM_EXPORT_FOR_TESTS config DRM_PANEL_ORIENTATION_QUIRKS tristate +# Separate option because nomodeset parameter is global and expected built-in +config DRM_NOMODESET + bool + default n + config DRM_LIB_RANDOM bool default n diff --git drivers/gpu/drm/Makefile drivers/gpu/drm/Makefile index c74810c285af..fa16d3e0bbdc 100644 --- drivers/gpu/drm/Makefile +++ drivers/gpu/drm/Makefile @@ -33,7 +33,7 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86. obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o -obj-$(CONFIG_VGA_CONSOLE) += drm_nomodeset.o +obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o drm_cma_helper-y := drm_gem_cma_helper.o obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o diff --git include/drm/drm_mode_config.h include/drm/drm_mode_config.h index f4d407908348..4bb129040185 100644 --- include/drm/drm_mode_config.h +++ include/drm/drm_mode_config.h @@ -969,10 +969,6 @@ static inline int drm_mode_config_init(struct drm_device *dev) void drm_mode_config_reset(struct drm_device *dev); void drm_mode_config_cleanup(struct drm_device *dev); -#ifdef CONFIG_VGA_CONSOLE extern bool drm_get_modeset(void); -#else -static inline bool drm_get_modeset(void) { return true; } -#endif #endif From patchwork Mon Nov 8 14:06:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608471 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF91C433F5 for ; Mon, 8 Nov 2021 14: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 2B930610E9 for ; Mon, 8 Nov 2021 14:07:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2B930610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 81B596E0B7; Mon, 8 Nov 2021 14:07:14 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1DEF6E0AB for ; Mon, 8 Nov 2021 14:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VOreeT9xy7J8ItI94NHKifuwS46AUpOFOueH2yffi6I=; b=KKVNeWo5ig2LBJSGCBB3DJLQARzu4wndpl916olDH2ZNSciFJJh51r7LcDyb3WqH/aamfi 4u6ywGXLdTyb4h9lsejufWeTGVzPXcZswcduC7TBhViaL9awn0EuN2It6Z6ECK+lpWK+b5 PdvwMDY37XoRkB1j/8jI/AIi/ONCV3Q= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-384-2-TqsR_wOl-T79gNPWATyg-1; Mon, 08 Nov 2021 09:07:09 -0500 X-MC-Unique: 2-TqsR_wOl-T79gNPWATyg-1 Received: by mail-wm1-f69.google.com with SMTP id r6-20020a1c4406000000b0033119c22fdbso6259800wma.4 for ; Mon, 08 Nov 2021 06:07:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VOreeT9xy7J8ItI94NHKifuwS46AUpOFOueH2yffi6I=; b=viKmqT2wvwrZB4qCTmCHh59ISoBMyocncbQE+rhqJF8put1EG0ZXwgXIGLFUqSDZ5H KU6iFQayH919Kq7PwuqSXiufTnXb2JP+53kxTE/Rq9Q4ySyh5+oIbvEIjuXTBsRRwYa4 RdRZRFm5JSOYCItS6EeI2YCANjcfQ80PRgXH3vRF1vB1ZZaST4G+BDnD6nJfQNKW5NES P0w0cOuhFIqVvyeij7k5CLvjlj3ceYcUvczxuPPLVfLiQy1gw6Rh/nHl0XP2voZ4MqPB ZhveiwyMEHlWvvCK3gYakIjSeEUIRsao44riEiFsxsbtrnS9se73rHGUxHM9CbBngB1Y F1jg== X-Gm-Message-State: AOAM531htTw9q5EY3OiYuIXd7/EzcKw/c2ZuBiB6Xt7jwubJ5cDkY0Uf QE+MMKxWkUHKjxd+nizLwPRC1T20HAqKG+bmgxRxEKfEVu1Bcf/Z8v5UoemgsozCTeFyBk6Jm8J wRXDyiU4tugEeM16ux9m50sFmU3Dr X-Received: by 2002:a5d:51cf:: with SMTP id n15mr80152wrv.106.1636380428653; Mon, 08 Nov 2021 06:07:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsYYuejGw7CybgaCxd/E1fUntxtMWk95iWPCbVv910JhxO1p9TBwfd54lnbUNLk9ILcI1Iiw== X-Received: by 2002:a5d:51cf:: with SMTP id n15mr80114wrv.106.1636380428489; Mon, 08 Nov 2021 06:07:08 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:08 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 5/6] Documentation/admin-guide: Document nomodeset kernel parameter Date: Mon, 8 Nov 2021 15:06:47 +0100 Message-Id: <20211108140648.795268-6-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The nomodeset kernel command line parameter is not documented. Its name is quite vague and is not intuitive what's the behaviour when it is set. Document in kernel-parameters.txt what actually happens when nomodeset is used. That way, users could know if they want to enable this option. Signed-off-by: Javier Martinez Canillas --- Changes in v4: - Don't mention the simpledrm driver and instead explain in high level terms what the nomodeset option is about. Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git Documentation/admin-guide/kernel-parameters.txt Documentation/admin-guide/kernel-parameters.txt index 91ba391f9b32..f6434aff943d 100644 --- Documentation/admin-guide/kernel-parameters.txt +++ Documentation/admin-guide/kernel-parameters.txt @@ -3521,6 +3521,13 @@ shutdown the other cpus. Instead use the REBOOT_VECTOR irq. + nomodeset Disable kernel modesetting. DRM drivers will not perform + display-mode changes or accelerated rendering. Only the + system framebuffer will be available for use if this was + set-up by the firmware or boot loader. + + Useful as fallback, or for testing and debugging. + nomodule Disable module load nopat [X86] Disable PAT (page attribute table extension of From patchwork Mon Nov 8 14:06:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12608477 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 163B1C4321E for ; Mon, 8 Nov 2021 14:07:29 +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 D5AB9610A5 for ; Mon, 8 Nov 2021 14:07:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D5AB9610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 64D176E20C; Mon, 8 Nov 2021 14:07:19 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC69A6E174 for ; Mon, 8 Nov 2021 14:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636380434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cHhiP8dWU/yCrRHfZ4flhCwBp7rRmlRP7VQTJMKR8q4=; b=CZGeZe1k4thZwE2QJ6OPSQ8AW0fsb0etBKVitOkS13gVCqMZoKulN7gyleDJL/+joHauU9 2YUVp2avv68PEena7tpfqoovjMDpWw6EHF7sMe0yQRGUUqWDAVAIVQa4qpDlx4tnO71G/t Cz+wui07KMpvKIyQr26+cEaYwW8ccR0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155-N2Bh7PvaOMW1cP0twK1A_g-1; Mon, 08 Nov 2021 09:07:11 -0500 X-MC-Unique: N2Bh7PvaOMW1cP0twK1A_g-1 Received: by mail-wm1-f72.google.com with SMTP id l4-20020a05600c1d0400b00332f47a0fa3so5784238wms.8 for ; Mon, 08 Nov 2021 06:07:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cHhiP8dWU/yCrRHfZ4flhCwBp7rRmlRP7VQTJMKR8q4=; b=CeOYvKVe5GATtucvOO9brhwFfURxEAtP64uDoczOJp1scBAMEHCvDJ2gOFHhJ7qktL /Zjuy4Dc4azB10dmFaLVAUZBxCHZXlTNMWw+9Jw8gyhHm8kMLcjJzxROZPZfxIya/vqJ TmqrkZB2yfMCWqhwzdZlyvr7nddRdMi8VDdd52UX7PDRMqGSLqUkt5QKVs07pPKQlY5X nTZu3n8YwXJcn9DRMpiJJqssGrHzquVK5mpLsyO66TVRV9OfGdcTfDLRnbRaSb1CQneb m6JQBXtcgjA2pd4M2RWpMIQVCFd8cZoyF0dzEyDf55fy0Wfrhbu3aX63NOlE8yeKonDW GUXw== X-Gm-Message-State: AOAM531dZBwy9GgrbJCVgrqqDc4uBiiIiOA9MtQAqUP6wbJTV20P5oUx ZPfVPB3Ms1Hyc0z9RjCKEKKzPn3ebr/PMsbxH04UOwBZgUfmAVvFL2yGKk213tm11mFHBnxpHv8 sp8C/rrIM/XTy+rG+FHkrB4SgSytD X-Received: by 2002:a05:6000:1869:: with SMTP id d9mr23356wri.416.1636380429730; Mon, 08 Nov 2021 06:07:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBR8kNUJGMU0WDyzFvHqppXC/rJqD8zpASqe2AAp4OC/OcZbz6W8aHlANT8ClrikiGMpRVMg== X-Received: by 2002:a05:6000:1869:: with SMTP id d9mr23323wri.416.1636380429544; Mon, 08 Nov 2021 06:07:09 -0800 (PST) Received: from minerva.home ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id m14sm10081696wrp.28.2021.11.08.06.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 06:07:09 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v4 6/6] drm: Make the nomodeset message less sensational Date: Mon, 8 Nov 2021 15:06:48 +0100 Message-Id: <20211108140648.795268-7-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211108140648.795268-1-javierm@redhat.com> References: <20211108140648.795268-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Paalanen , Jani Nikula , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Peter Robinson , Thomas Zimmermann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The message printed when nomodeset is present in the kernel command line makes it look as if the parameter must never be used and it's a bad idea. But there are valid reasons to use this parameter and the message should not imply otherwise. Change the text to be more accurate and restrained. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas --- Changes in v4: - Don't mention DRM drivers in the kernel message and instead explain that only the system framebuffer will be available. drivers/gpu/drm/drm_nomodeset.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git drivers/gpu/drm/drm_nomodeset.c drivers/gpu/drm/drm_nomodeset.c index fc3acf3ab2e2..148b01f7183b 100644 --- drivers/gpu/drm/drm_nomodeset.c +++ drivers/gpu/drm/drm_nomodeset.c @@ -15,9 +15,7 @@ static int __init disable_modeset(char *str) { drm_nomodeset = true; - pr_warn("You have booted with nomodeset. This means your GPU drivers are DISABLED\n"); - pr_warn("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n"); - pr_warn("Unless you actually understand what nomodeset does, you should reboot without enabling it\n"); + pr_warn("Booted with the nomodeset parameter. Only the system framebuffer will be available\n"); return 1; }