Selectable Platform Support Proposed Again For Intel's DRM Driver
Independent driver contributor Tvrtko Ursulin is seeking comment on a set of 15 patches allowing for users/developers building their own kernel to allow Kconfig switches for limiting the hardware support that gets enabled for the Intel DRM driver. The Kconfig switches toggle what platform support is present and then relies upon the compiler's dead code elimination (DCE) passes for automatically stripping out the unnecessary bits.
These latest patches allow for toggling i830 / i845G / i85X / i865G / Gen 2 / Gen 3 / Gen 4 / Gen 5 / Gen 6 / Gen 7 generations of support.
When disabling hardware support for all pre-Skylake Intel graphics hardware, the Intel DRM kernel module ended up being a savings of about ~124 kB or about 8.5% of the overall driver size. Tvrtko Ursulin hypothesizes once the longstanding Linux kernel Link Time Optimization (LTO) support mainlines, the savings could be potentially a bit greater.
It's not clear yet if these patches will fly, but in the past they have always been quickly shot down... Especially with the added code burden all for saving less than a half MB of a kernel build. Given most Linux distributions' default kernels tend to continue shipping with old drivers and old CPU support, it seems unlikely most vendors would even make use of this selectable platform support aside from the enthusiasts tweaking the kernel on their own for their hardware.
The patches if you are interested can be found on intel-gfx.