# DRM Janitor Tasks Smaller janitorial tasks in the kernel DRM graphics subsystem useful as newbie projects. Or for slow rainy days. ## Subsystem-wide refactorings #### Proper primary plane support Convert all drivers to explicitly set up the primary plane, or at least have the appropriate list of supported pixel formats. Contact: [[Daniel Vetter|DanielVetter]], Matt Roper #### Support for cursor planes Needs to wait for Matt's cursor plane patches to land first, but similar to the primary plane task. Contact: [[Daniel Vetter|DanielVetter]], Matt Roper #### De-midlayer usb/platform drivers With the recent drm_bus cleanup patches for 3.16 it is no longer required to have a drm_bus structure set up for non-pci devices. Drivers can directly set up the drm device structure instead of relying on bus methods in drm_usb.c and drm_platform.c. Once all existing drivers are converted we can also remove those bus support files for usb/platform devices. Contact: [[Daniel Vetter|DanielVetter]], Thierry Redding ## DRM Core refactorings #### Create a drm-internal header Currently the drm subsystem has only one global header, drmP.h. This is used both for functions exported to helper libraries and drivers and functions only used internally in the drm.ko module. The goal would be to move all header declarations not needed outside of drm.ko into drivers/gpu/drm/drm_*_internal.h header files. EXPORT_SYMBOL also needs to be dropped for these functions. This would nicely tie in with the below task to create kerneldoc after the api is cleaned up. Or with the "hide legacy cruft better" task. Contact: [[Daniel Vetter|DanielVetter]] #### Add missing kerneldoc for exported functions The drm reference documentation is still lacking kerneldoc in a few areas. The task would be to clean up interfaces like moving functions around between files to better group them and improving the interfaces like dropping return values for functions that never fail. Then write kerneldoc for all exported functions and an overview section and integrate it all into the drm DocBook. See [[https://www.kernel.org/doc/htmldocs/drm/]] for what's there already. Contact: [[Daniel Vetter|DanielVetter]] #### Hide legacy cruft better Way back DRM supported only drivers which shadow-attached to pci devices with userspace or fbdev drivers setting up outputs. Modern DRM drives take charge of the entire device, you can spot them with the DRIVER_MODESET flag. Unfortunately there's still large piles of legacy code around which needs to be hidden so that driver writers don't accidentally end up using it. And to prevent security issues in those legacy ioctls from being exploited on modern drviers. This has multiple possible subtasks: - Make sure legacy ioctls can't be used on modern drivers. - Extract support code for legacy features into a drm-legacy.ko kernel module and compile it only when one of the legacy drivers is enabled. - Extract legacy functions into their own headers and remove it that from the monolithic drmP.h header. - Remove any lingering cruft from the OS abstraction layer from modern drivers. Contact: [[Daniel Vetter|DanielVetter]] ## Driver Specific ### Nuke i915 user-modesetting support In 3.17 (after more than a year of deprecating the code harder) UMS support is fully disabled and can't be built any more. So once 3.17 is out of a bit we can start to nuke all the support code only used by UMS. Pretty much all of it should be behind DRIVER_MODESET checks, but those are all over the place. If someone notices the lack of UMS support plan B is to still nuke it, but have a 2nd copy of the old code lying around to bitrot. ## Outside DRM #### Better kerneldoc Most of the drm documentation is kerneldoc embedded into the overall DocBook structure. Unfortunately the kerneldoc system is seriously lacking compared to contemporary solutions used elsewhere like gtkdoc: - No support for markdown, which makes creating lists and tables a nightmare. We need two copies of them, one in the code as a plain (non-kerneldoc) comment and one as fairly horrible DocBook xml table. - No support for auto-generated links. Functions/structures/etc are only marked up but not automatically cross-referenced when generating the DocBook from the kerneldoc comments. Adding these features would improve the value and usefulness of the drm docs by a lot. Unfortunately kerneldoc is processed by a fairly horrid perl script ... So probably requires a full rewrite. An interesting way to rewrite the kerneldoc parser would be use sparse. It would at least solve the C parsing problem, adding broken down kernel-doc comments to the AST. Contact: [[Daniel Vetter|DanielVetter]], Thomas Wood