Re: [RESEND PATCH 2/5] drm: Move nomodeset kernel parameter handler to the DRM subsystem

Javier Martinez Canillas
2021-11-03T13:06:25Z

Hello Thomas,

On 11/3/21 13:41, Thomas Zimmermann wrote:
> Hi
>
> Am 03.11.21 um 13:28 schrieb Javier Martinez Canillas:
>> 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 that to DRM.
>>
>> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>>
>> drivers/gpu/drm/Makefile | 2 ++
>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +--
>> drivers/gpu/drm/ast/ast_drv.c | 1 -
>> drivers/gpu/drm/drm_nomodeset.c | 26 +++++++++++++++++++++++++
>> drivers/gpu/drm/i915/i915_module.c | 2 --
>> drivers/gpu/drm/mgag200/mgag200_drv.c | 1 -
>> drivers/gpu/drm/nouveau/nouveau_drm.c | 1 -
>> drivers/gpu/drm/qxl/qxl_drv.c | 1 -
>> drivers/gpu/drm/radeon/radeon_drv.c | 1 -
>> drivers/gpu/drm/tiny/bochs.c | 1 -
>> drivers/gpu/drm/tiny/cirrus.c | 1 -
>> drivers/gpu/drm/vboxvideo/vbox_drv.c | 1 -
>> drivers/gpu/drm/virtio/virtgpu_drv.c | 1 -
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 -
>> drivers/video/console/vgacon.c | 21 --------------------
>> include/drm/drm_mode_config.h | 6 ++++++
>> include/linux/console.h | 6 ------
>> 17 files changed, 35 insertions(+), 41 deletions(-)
>> create mode 100644 drivers/gpu/drm/drm_nomodeset.c
>>
>> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
>> index 1c41156deb5f..0e2d60ea93ca 100644
>> --- a/drivers/gpu/drm/Makefile
>> +++ b/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-y += drm_nomodeset.o
>
> Repeating my other comment, should this rather be protected by a
> separate config symbol that is selected by CONFIG_DRM?
>

I actually thought about that and my opinion is that obj-y reflects
what we really want here or do you envision this getting disabled
in some cases ?

Probably the problem is Kbuild descending into the drivers/gpu dir
even when CONFIG_DRM is not set. Maybe what we want is something
like the following instead?

diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
index 835c88318cec..ef12ee05ba6e 100644
--- a/drivers/gpu/Makefile
+++ b/drivers/gpu/Makefile
@@ -3,6 +3,7 @@
# taken to initialize them in the correct order. Link order is the only way
# to ensure this currently.
obj-$(CONFIG_TEGRA_HOST1X) += host1x/
-obj-y += drm/ vga/
+obj-$(CONFIG_DRM) += drm/
+obj-y += vga/
obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/
obj-$(CONFIG_TRACE_GPU_MEM) += trace/

Best regards, --
Javier Martinez Canillas
Linux Engineering
Red Hat