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

drm: move AGP definitions harder

Move drm_agp_head to drm_agpsupport.h and drm_agp_mem into drm_legacy.h.
Unfortunately, drivers still heavily access drm_agp_head so we cannot
move it to drm_legacy.h. However, at least it's no longer visible in
drmP.h now (it's directly included from it, though).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

David Herrmann and committed by
Dave Airlie
cc5ea594 cc33db0a

+32 -29
+1
drivers/gpu/drm/drm_agpsupport.c
··· 34 34 #include <drm/drmP.h> 35 35 #include <linux/module.h> 36 36 #include <linux/slab.h> 37 + #include "drm_legacy.h" 37 38 38 39 #if __OS_HAS_AGP 39 40
+15
drivers/gpu/drm/drm_legacy.h
··· 28 28 * should no longer be using. They cannot be removed as legacy 29 29 * drivers use them, and removing them are API breaks. 30 30 */ 31 + #include <linux/list.h> 32 + 33 + struct agp_memory; 31 34 struct drm_device; 32 35 struct drm_file; 33 36 ··· 70 67 int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f); 71 68 int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f); 72 69 int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f); 70 + 71 + /* 72 + * AGP Support 73 + */ 74 + 75 + struct drm_agp_mem { 76 + unsigned long handle; 77 + struct agp_memory *memory; 78 + unsigned long bound; 79 + int pages; 80 + struct list_head head; 81 + }; 73 82 74 83 #endif /* __DRM_LEGACY_H__ */
+1
drivers/gpu/drm/drm_memory.c
··· 36 36 #include <linux/highmem.h> 37 37 #include <linux/export.h> 38 38 #include <drm/drmP.h> 39 + #include "drm_legacy.h" 39 40 40 41 #if __OS_HAS_AGP 41 42 static void *agp_remap(unsigned long offset, unsigned long size,
+1
drivers/gpu/drm/drm_vm.c
··· 40 40 #include <linux/efi.h> 41 41 #include <linux/slab.h> 42 42 #endif 43 + #include "drm_legacy.h" 43 44 44 45 struct drm_vma_entry { 45 46 struct list_head head;
+1 -29
include/drm/drmP.h
··· 80 80 81 81 struct drm_file; 82 82 struct drm_device; 83 + struct drm_agp_head; 83 84 84 85 struct device_node; 85 86 struct videomode; ··· 438 437 _DRM_DMA_USE_PCI_RO = 0x08 439 438 } flags; 440 439 441 - }; 442 - 443 - /** 444 - * AGP memory entry. Stored as a doubly linked list. 445 - */ 446 - struct drm_agp_mem { 447 - unsigned long handle; /**< handle */ 448 - struct agp_memory *memory; 449 - unsigned long bound; /**< address */ 450 - int pages; 451 - struct list_head head; 452 - }; 453 - 454 - /** 455 - * AGP data. 456 - * 457 - * \sa drm_agp_init() and drm_device::agp. 458 - */ 459 - struct drm_agp_head { 460 - struct agp_kern_info agp_info; /**< AGP device information */ 461 - struct list_head memory; 462 - unsigned long mode; /**< AGP mode */ 463 - struct agp_bridge_data *bridge; 464 - int enabled; /**< whether the AGP bus as been enabled */ 465 - int acquired; /**< whether the AGP device has been acquired */ 466 - unsigned long base; 467 - int agp_mtrr; 468 - int cant_use_aperture; 469 - unsigned long page_mask; 470 440 }; 471 441 472 442 /**
+13
include/drm/drm_agpsupport.h
··· 8 8 #include <linux/agp_backend.h> 9 9 #include <drm/drmP.h> 10 10 11 + struct drm_agp_head { 12 + struct agp_kern_info agp_info; 13 + struct list_head memory; 14 + unsigned long mode; 15 + struct agp_bridge_data *bridge; 16 + int enabled; 17 + int acquired; 18 + unsigned long base; 19 + int agp_mtrr; 20 + int cant_use_aperture; 21 + unsigned long page_mask; 22 + }; 23 + 11 24 #if __OS_HAS_AGP 12 25 13 26 void drm_free_agp(struct agp_memory * handle, int pages);