From d2e546b855646f251046098ddaccef50bf3d4302 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 11 Dec 2013 11:34:40 +0100 Subject: [PATCH] drm: rip out DRM_AGP_MEM and DRM_AGP_KERN The header provides dummy functions and fallbacks, so no need for screaming macros. Signed-off-by: Daniel Vetter Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_agpsupport.c | 8 ++++---- drivers/gpu/drm/drm_memory.c | 6 +++--- include/drm/drmP.h | 5 +++-- include/drm/drm_agpsupport.h | 16 ++++++++-------- include/drm/drm_os_linux.h | 14 -------------- 5 files changed, 18 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c index 74fabe6956cb..dde205cef384 100644 --- a/drivers/gpu/drm/drm_agpsupport.c +++ b/drivers/gpu/drm/drm_agpsupport.c @@ -53,7 +53,7 @@ */ int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info) { - DRM_AGP_KERN *kern; + struct agp_kern_info *kern; if (!dev->agp || !dev->agp->acquired) return -EINVAL; @@ -198,7 +198,7 @@ int drm_agp_enable_ioctl(struct drm_device *dev, void *data, int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) { struct drm_agp_mem *entry; - DRM_AGP_MEM *memory; + struct agp_memory *memory; unsigned long pages; u32 type; @@ -466,14 +466,14 @@ void drm_agp_clear(struct drm_device *dev) * No reference is held on the pages during this time -- it is up to the * caller to handle that. */ -DRM_AGP_MEM * +struct agp_memory * drm_agp_bind_pages(struct drm_device *dev, struct page **pages, unsigned long num_pages, uint32_t gtt_offset, u32 type) { - DRM_AGP_MEM *mem; + struct agp_memory *mem; int ret, i; DRM_DEBUG("\n"); diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c index 3359bc453e11..00c67c0f2381 100644 --- a/drivers/gpu/drm/drm_memory.c +++ b/drivers/gpu/drm/drm_memory.c @@ -82,19 +82,19 @@ static void *agp_remap(unsigned long offset, unsigned long size, } /** Wrapper around agp_free_memory() */ -void drm_free_agp(DRM_AGP_MEM * handle, int pages) +void drm_free_agp(struct agp_memory * handle, int pages) { agp_free_memory(handle); } /** Wrapper around agp_bind_memory() */ -int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start) +int drm_bind_agp(struct agp_memory * handle, unsigned int start) { return agp_bind_memory(handle, start); } /** Wrapper around agp_unbind_memory() */ -int drm_unbind_agp(DRM_AGP_MEM * handle) +int drm_unbind_agp(struct agp_memory * handle) { return agp_unbind_memory(handle); } diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8e05ff81428d..90a99807e48d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -527,7 +527,7 @@ struct drm_device_dma { */ struct drm_agp_mem { unsigned long handle; /**< handle */ - DRM_AGP_MEM *memory; + struct agp_memory *memory; unsigned long bound; /**< address */ int pages; struct list_head head; @@ -539,7 +539,7 @@ struct drm_agp_mem { * \sa drm_agp_init() and drm_device::agp. */ struct drm_agp_head { - DRM_AGP_KERN agp_info; /**< AGP device information */ + struct agp_kern_info agp_info; /**< AGP device information */ struct list_head memory; unsigned long mode; /**< AGP mode */ struct agp_bridge_data *bridge; @@ -1280,6 +1280,7 @@ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); /* Memory management support (drm_memory.h) */ #include + /* Misc. IOCTL support (drm_ioctl.h) */ extern int drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv); diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h index 56a861b2ceaa..86a02188074b 100644 --- a/include/drm/drm_agpsupport.h +++ b/include/drm/drm_agpsupport.h @@ -10,10 +10,10 @@ #if __OS_HAS_AGP -void drm_free_agp(DRM_AGP_MEM * handle, int pages); -int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); -int drm_unbind_agp(DRM_AGP_MEM * handle); -DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, +void drm_free_agp(struct agp_memory * handle, int pages); +int drm_bind_agp(struct agp_memory * handle, unsigned int start); +int drm_unbind_agp(struct agp_memory * handle); +struct agp_memory *drm_agp_bind_pages(struct drm_device *dev, struct page **pages, unsigned long num_pages, uint32_t gtt_offset, @@ -47,21 +47,21 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); #else /* __OS_HAS_AGP */ -static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages) +static inline void drm_free_agp(struct agp_memory * handle, int pages) { } -static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start) +static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start) { return -ENODEV; } -static inline int drm_unbind_agp(DRM_AGP_MEM * handle) +static inline int drm_unbind_agp(struct agp_memory * handle) { return -ENODEV; } -static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, +static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev, struct page **pages, unsigned long num_pages, uint32_t gtt_offset, diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h index 815fafc6b4ad..fb90132b912e 100644 --- a/include/drm/drm_os_linux.h +++ b/include/drm/drm_os_linux.h @@ -51,20 +51,6 @@ static inline void writeq(u64 val, void __iomem *reg) /** IRQ handler arguments and return type and values */ #define DRM_IRQ_ARGS int irq, void *arg -/** AGP types */ -#if __OS_HAS_AGP -#define DRM_AGP_MEM struct agp_memory -#define DRM_AGP_KERN struct agp_kern_info -#else -/* define some dummy types for non AGP supporting kernels */ -struct no_agp_kern { - unsigned long aper_base; - unsigned long aper_size; -}; -#define DRM_AGP_MEM int -#define DRM_AGP_KERN struct no_agp_kern -#endif - /** Other copying of data to kernel space */ #define DRM_COPY_FROM_USER(arg1, arg2, arg3) \ copy_from_user(arg1, arg2, arg3) -- 2.20.1