Commit ff28a9f8 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm: Inline AGP wrappers into their only callers

The AGP wrapper functions serve no purpose. They used to handle
builds that have CONFIG_AGP unset. But their callers are all in
drm_agpsupport.c, which only gets build with CONFIG_AGP.

v2:
	* clarify CONFIG_AGP in commit description (Daniel)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210112081035.6882-2-tzimmermann@suse.de
parent fa49fdbe
...@@ -285,7 +285,7 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request) ...@@ -285,7 +285,7 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
entry = drm_agp_lookup_entry(dev, request->handle); entry = drm_agp_lookup_entry(dev, request->handle);
if (!entry || !entry->bound) if (!entry || !entry->bound)
return -EINVAL; return -EINVAL;
ret = drm_unbind_agp(entry->memory); ret = agp_unbind_memory(entry->memory);
if (ret == 0) if (ret == 0)
entry->bound = 0; entry->bound = 0;
return ret; return ret;
...@@ -326,7 +326,7 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) ...@@ -326,7 +326,7 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
if (!entry || entry->bound) if (!entry || entry->bound)
return -EINVAL; return -EINVAL;
page = DIV_ROUND_UP(request->offset, PAGE_SIZE); page = DIV_ROUND_UP(request->offset, PAGE_SIZE);
retcode = drm_bind_agp(entry->memory, page); retcode = agp_bind_memory(entry->memory, page);
if (retcode) if (retcode)
return retcode; return retcode;
entry->bound = dev->agp->base + (page << PAGE_SHIFT); entry->bound = dev->agp->base + (page << PAGE_SHIFT);
...@@ -369,11 +369,11 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request) ...@@ -369,11 +369,11 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
if (!entry) if (!entry)
return -EINVAL; return -EINVAL;
if (entry->bound) if (entry->bound)
drm_unbind_agp(entry->memory); agp_unbind_memory(entry->memory);
list_del(&entry->head); list_del(&entry->head);
drm_free_agp(entry->memory, entry->pages); agp_free_memory(entry->memory);
kfree(entry); kfree(entry);
return 0; return 0;
} }
...@@ -453,8 +453,8 @@ void drm_legacy_agp_clear(struct drm_device *dev) ...@@ -453,8 +453,8 @@ void drm_legacy_agp_clear(struct drm_device *dev)
list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) { list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
if (entry->bound) if (entry->bound)
drm_unbind_agp(entry->memory); agp_unbind_memory(entry->memory);
drm_free_agp(entry->memory, entry->pages); agp_free_memory(entry->memory);
kfree(entry); kfree(entry);
} }
INIT_LIST_HEAD(&dev->agp->memory); INIT_LIST_HEAD(&dev->agp->memory);
......
...@@ -100,24 +100,6 @@ static void *agp_remap(unsigned long offset, unsigned long size, ...@@ -100,24 +100,6 @@ static void *agp_remap(unsigned long offset, unsigned long size,
return addr; return addr;
} }
/** Wrapper around agp_free_memory() */
void drm_free_agp(struct agp_memory *handle, int pages)
{
agp_free_memory(handle);
}
/** Wrapper around agp_bind_memory() */
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(struct agp_memory *handle)
{
return agp_unbind_memory(handle);
}
#else /* CONFIG_AGP */ #else /* CONFIG_AGP */
static inline void *agp_remap(unsigned long offset, unsigned long size, static inline void *agp_remap(unsigned long offset, unsigned long size,
struct drm_device *dev) struct drm_device *dev)
......
...@@ -28,10 +28,6 @@ struct drm_agp_head { ...@@ -28,10 +28,6 @@ struct drm_agp_head {
#if IS_ENABLED(CONFIG_AGP) #if IS_ENABLED(CONFIG_AGP)
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 drm_agp_head *drm_agp_init(struct drm_device *dev); struct drm_agp_head *drm_agp_init(struct drm_device *dev);
void drm_legacy_agp_clear(struct drm_device *dev); void drm_legacy_agp_clear(struct drm_device *dev);
int drm_agp_acquire(struct drm_device *dev); int drm_agp_acquire(struct drm_device *dev);
...@@ -61,20 +57,6 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void *data, ...@@ -61,20 +57,6 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
#else /* CONFIG_AGP */ #else /* CONFIG_AGP */
static inline void drm_free_agp(struct agp_memory * handle, int pages)
{
}
static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
{
return -ENODEV;
}
static inline int drm_unbind_agp(struct agp_memory * handle)
{
return -ENODEV;
}
static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev) static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
{ {
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment