Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/r128: make ATI PCI GART part of its only user, r128

The ATI Rage 128 driver has been the only user of ATI PCI GART code
since Radeon dropped UMS support in commit 8333f607a631 ("drm/radeon:
remove UMS support"). Clean up the drm top level directory, Kconfig and
Makefile by making ati_pcigart.[ch] part of r128. Drop the
CONFIG_DRM_ATI_PCIGART config option made redundant by the change.

This reduces drm.ko module size slightly when legacy drivers are
enabled, and moves the baggage to r128.ko instead.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191119100536.12024-1-jani.nikula@intel.com

+5 -10
-4
drivers/gpu/drm/Kconfig
··· 272 272 273 273 If M is selected the module will be called vkms. 274 274 275 - config DRM_ATI_PCIGART 276 - bool 277 - 278 275 source "drivers/gpu/drm/exynos/Kconfig" 279 276 280 277 source "drivers/gpu/drm/rockchip/Kconfig" ··· 368 371 bool "Enable legacy drivers (DANGEROUS)" 369 372 depends on DRM && MMU 370 373 select DRM_VM 371 - select DRM_ATI_PCIGART if PCI 372 374 help 373 375 Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous 374 376 APIs to user-space, which can be used to circumvent access
-1
drivers/gpu/drm/Makefile
··· 25 25 drm-$(CONFIG_COMPAT) += drm_ioc32.o 26 26 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o 27 27 drm-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_gem_shmem_helper.o 28 - drm-$(CONFIG_DRM_ATI_PCIGART) += ati_pcigart.o 29 28 drm-$(CONFIG_DRM_PANEL) += drm_panel.o 30 29 drm-$(CONFIG_OF) += drm_of.o 31 30 drm-$(CONFIG_AGP) += drm_agpsupport.o
+2 -3
drivers/gpu/drm/ati_pcigart.c drivers/gpu/drm/r128/ati_pcigart.c
··· 33 33 34 34 #include <linux/export.h> 35 35 36 - #include <drm/ati_pcigart.h> 37 36 #include <drm/drm_device.h> 38 37 #include <drm/drm_pci.h> 39 38 #include <drm/drm_print.h> 39 + 40 + #include "ati_pcigart.h" 40 41 41 42 # define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */ 42 43 ··· 96 95 97 96 return 1; 98 97 } 99 - EXPORT_SYMBOL(drm_ati_pcigart_cleanup); 100 98 101 99 int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info) 102 100 { ··· 207 207 gart_info->bus_addr = bus_address; 208 208 return ret; 209 209 } 210 - EXPORT_SYMBOL(drm_ati_pcigart_init);
+1 -1
drivers/gpu/drm/r128/Makefile
··· 3 3 # Makefile for the drm device driver. This driver provides support for the 4 4 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. 5 5 6 - r128-y := r128_drv.o r128_cce.o r128_state.o r128_irq.o 6 + r128-y := r128_drv.o r128_cce.o r128_state.o r128_irq.o ati_pcigart.o 7 7 8 8 r128-$(CONFIG_COMPAT) += r128_ioc32.o 9 9
+2 -1
drivers/gpu/drm/r128/r128_drv.h
··· 39 39 #include <linux/io.h> 40 40 #include <linux/irqreturn.h> 41 41 42 - #include <drm/ati_pcigart.h> 43 42 #include <drm/drm_ioctl.h> 44 43 #include <drm/drm_legacy.h> 45 44 #include <drm/r128_drm.h> 45 + 46 + #include "ati_pcigart.h" 46 47 47 48 /* General customization: 48 49 */
include/drm/ati_pcigart.h drivers/gpu/drm/r128/ati_pcigart.h