Re: [PATCH 0/3] drm: Move several files from DRM core into modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 21.10.21 um 14:38 schrieb Jani Nikula:
On Wed, 20 Oct 2021, Thomas Zimmermann <tzimmermann@xxxxxxx> wrote:
Move a number of files into modules and behind config options.

So far, early boot graphics was provided by fbdev. With simpledrm, and
possibly other generic DRM drivers, it's now possible to have general
early-boot output with DRM. This requires the DRM core to be linked into
the kernel binary image.

The reduction in size here is only ~1%, but the patchset is part of a
larger effort to reduce the size of the DRM core module.

I think the main problem is really that of organization. You have all of
the files under drivers/gpu/drm/ and the only way to know which module
the files belong to is to look at the Makefile and the Kconfig. It's not
obvious based on the file names or directory, at all. And there are
nearly a hundred drm_*.c files there!

We also seem to have stuff depend on DRM alone, while functionally they
should really depend on DRM_KMS_HELPER too.

The point of my effort is to have a built-in simpledrm for early-boot graphics that requires only a minimal set of built-in dependency. Most of the 'advanced' features that native drivers use should go into modules. It's a bit unrealistic, but any progress is good.


The subdirectories under drm/ also don't have any distinction between
being part of drm core and helpers or drivers. We have lib, scheduler,
selftests, and ttm next to the drivers.

We should start adding drm_* subdirectories, and moving the modules
separate from drm core there. We should rename the current non-driver
directories drm_*. We need better structure.

Well, there are core functions and helpers. Often, both are in the same file and the core 'accidentally' pulls in helpers. For example, I found that the core connector automatically creates an EDID property and tries to fill in some values, which in turn pulls all the EDID parsing helpers. It would be nice to move the parsing code into a module, but it's not possible ATM.

For a start we could try to split files into core and helper code and link them into different modules.

Best regards
Thomas



BR,
Jani.





Thomas Zimmermann (3):
   drm: Build drm_irq.o only if CONFIG_DRM_LEGACY has been set
   drm: Link several object files into drm_kms_helper.ko
   drm: Move GEM memory managers into modules

  drivers/gpu/drm/Kconfig                |  4 ++--
  drivers/gpu/drm/Makefile               | 26 +++++++++++++++-----------
  drivers/gpu/drm/drm_gem_cma_helper.c   |  4 ++++
  drivers/gpu/drm/drm_gem_shmem_helper.c |  4 ++++
  drivers/gpu/drm/drm_irq.c              |  2 --
  5 files changed, 25 insertions(+), 15 deletions(-)

--
2.33.0



--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux