summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_ioc32.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2021-05-07 21:57:09 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2021-05-10 16:46:58 +0300
commit04dfe19a5ed683e91d8285df5be1dbde2f2f39af (patch)
tree8b7854ec73fdbc1341c1e8187eed1307717c7d1d /drivers/gpu/drm/drm_ioc32.c
parent6bff2279836ebeb2e8becaf9e30642e4bade0a49 (diff)
downloadlinux-04dfe19a5ed683e91d8285df5be1dbde2f2f39af.tar.xz
drm: Mark AGP implementation and ioctls as legacy
Only UMs drivers use DRM's core AGP code and ioctls. Mark the icotls as legacy. Add the _legacy_ infix to all AGP functions. Move the declarations to the public and internal legacy header files. The agp field in struct drm_device is now located in the structure's legacy section. Adapt drivers to the changes. AGP code now depends on CONFIG_DRM_LEGACY. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210507185709.22797-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/drm_ioc32.c')
-rw-r--r--drivers/gpu/drm/drm_ioc32.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 33390f02f5eb..d29907955ff7 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -31,7 +31,6 @@
#include <linux/ratelimit.h>
#include <linux/export.h>
-#include <drm/drm_agpsupport.h>
#include <drm/drm_file.h>
#include <drm/drm_print.h>
@@ -619,6 +618,7 @@ static int compat_drm_dma(struct file *file, unsigned int cmd,
}
#endif
+#if IS_ENABLED(CONFIG_DRM_LEGACY)
#if IS_ENABLED(CONFIG_AGP)
typedef struct drm_agp_mode32 {
u32 mode; /**< AGP mode */
@@ -633,7 +633,7 @@ static int compat_drm_agp_enable(struct file *file, unsigned int cmd,
if (get_user(mode.mode, &argp->mode))
return -EFAULT;
- return drm_ioctl_kernel(file, drm_agp_enable_ioctl, &mode,
+ return drm_ioctl_kernel(file, drm_legacy_agp_enable_ioctl, &mode,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
}
@@ -659,7 +659,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd,
struct drm_agp_info info;
int err;
- err = drm_ioctl_kernel(file, drm_agp_info_ioctl, &info, DRM_AUTH);
+ err = drm_ioctl_kernel(file, drm_legacy_agp_info_ioctl, &info, DRM_AUTH);
if (err)
return err;
@@ -698,7 +698,7 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
request.size = req32.size;
request.type = req32.type;
- err = drm_ioctl_kernel(file, drm_agp_alloc_ioctl, &request,
+ err = drm_ioctl_kernel(file, drm_legacy_agp_alloc_ioctl, &request,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
if (err)
return err;
@@ -706,7 +706,7 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
req32.handle = request.handle;
req32.physical = request.physical;
if (copy_to_user(argp, &req32, sizeof(req32))) {
- drm_ioctl_kernel(file, drm_agp_free_ioctl, &request,
+ drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
return -EFAULT;
}
@@ -723,7 +723,7 @@ static int compat_drm_agp_free(struct file *file, unsigned int cmd,
if (get_user(request.handle, &argp->handle))
return -EFAULT;
- return drm_ioctl_kernel(file, drm_agp_free_ioctl, &request,
+ return drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
}
@@ -744,7 +744,7 @@ static int compat_drm_agp_bind(struct file *file, unsigned int cmd,
request.handle = req32.handle;
request.offset = req32.offset;
- return drm_ioctl_kernel(file, drm_agp_bind_ioctl, &request,
+ return drm_ioctl_kernel(file, drm_legacy_agp_bind_ioctl, &request,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
}
@@ -757,12 +757,11 @@ static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
if (get_user(request.handle, &argp->handle))
return -EFAULT;
- return drm_ioctl_kernel(file, drm_agp_unbind_ioctl, &request,
+ return drm_ioctl_kernel(file, drm_legacy_agp_unbind_ioctl, &request,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
}
#endif /* CONFIG_AGP */
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
typedef struct drm_scatter_gather32 {
u32 size; /**< In bytes -- will round to page boundary */
u32 handle; /**< Used for mapping / unmapping */
@@ -935,7 +934,6 @@ static struct {
DRM_IOCTL32_DEF(DRM_IOCTL_GET_SAREA_CTX, compat_drm_getsareactx),
DRM_IOCTL32_DEF(DRM_IOCTL_RES_CTX, compat_drm_resctx),
DRM_IOCTL32_DEF(DRM_IOCTL_DMA, compat_drm_dma),
-#endif
#if IS_ENABLED(CONFIG_AGP)
DRM_IOCTL32_DEF(DRM_IOCTL_AGP_ENABLE, compat_drm_agp_enable),
DRM_IOCTL32_DEF(DRM_IOCTL_AGP_INFO, compat_drm_agp_info),
@@ -944,6 +942,7 @@ static struct {
DRM_IOCTL32_DEF(DRM_IOCTL_AGP_BIND, compat_drm_agp_bind),
DRM_IOCTL32_DEF(DRM_IOCTL_AGP_UNBIND, compat_drm_agp_unbind),
#endif
+#endif
#if IS_ENABLED(CONFIG_DRM_LEGACY)
DRM_IOCTL32_DEF(DRM_IOCTL_SG_ALLOC, compat_drm_sg_alloc),
DRM_IOCTL32_DEF(DRM_IOCTL_SG_FREE, compat_drm_sg_free),