Skip to contentSkip to conversation

drm: Remove infrastructure for user-space mode setting

PATCH Applied Thomas Zimmermann 4 participants 31 messages Nov 22, 2023 – Dec 6, 2023

Subsystems (9)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover drm: Remove infrastructure for user-space mode setting

The old drivers for user-space mode setting have been removed in Linux v6.3. No one has complained or requested their return. It is time to remove these drivers' infrastructure from the DRM core.

The recent Linux v6.6 has been designated as long-term release, [1] so any remaining users have a few more years to get a new graphics card. The legacy devices continue to be supported via simpledrm. Merging proper drivers with kernel mode setting is also an option.

Patches 1 to 7 fix a few trivial issues that have been forgotten during the removal of the drivers.

Patches 8 and 9 remove the leagcy ioctl interfaces. One op is different from the others, so it gets its own patch.

Patches 10 to 12 remove the legacy source code from DRM. With that gone patch 13, the AGP code can be simplified as well. There used to be a device file for user-space mode setting, /dev/agpgart, that is now obsolete.

Patch 14 removes the option from Kconfig.

[1] https://kernel.org/category/releases.html

Thomas Zimmermann (14):
arch/powerpc: Remove legacy DRM drivers from default configs
drm: Fix TODO list mentioning non-KMS drivers
drm: Include <drm/drm_auth.h>
drm/i915: Include <drm/drm_auth.h>
accel: Include <drm/drm_auth.h>
drm: Include <drm/drm_device.h>
drm/radeon: Do not include <drm/drm_legacy.h>
drm: Remove entry points for legacy ioctls
drm: Remove the legacy DRM_IOCTL_MODESET_CTL ioctl
drm: Remove support for legacy drivers
drm: Remove locking for legacy ioctls and DRM_UNLOCKED
drm: Remove source code for non-KMS drivers
char/agp: Remove frontend code
drm: Remove Kconfig option for legacy support (CONFIG_DRM_LEGACY)

 Documentation/gpu/todo.rst                    |    7 +-
 arch/powerpc/configs/pmac32_defconfig         |    2 -
 arch/powerpc/configs/ppc6xx_defconfig         |    7 -
 drivers/accel/drm_accel.c                     |    1 +
 drivers/char/agp/Makefile                     |    6 -
 drivers/char/agp/agp.h                        |    9 -
 drivers/char/agp/backend.c                    |   11 -
 drivers/char/agp/compat_ioctl.c               |  291 ---
 drivers/char/agp/compat_ioctl.h               |  106 --
 drivers/char/agp/frontend.c                   | 1068 -----------
 drivers/gpu/drm/Kconfig                       |   21 -
 drivers/gpu/drm/Makefile                      |   12 -
 drivers/gpu/drm/drm_agpsupport.c              |  451 -----
 drivers/gpu/drm/drm_auth.c                    |    8 +-
 drivers/gpu/drm/drm_bufs.c                    | 1627 -----------------
 drivers/gpu/drm/drm_context.c                 |  513 ------
 drivers/gpu/drm/drm_dma.c                     |  178 --
 drivers/gpu/drm/drm_drv.c                     |   17 -
 drivers/gpu/drm/drm_file.c                    |   64 +-
 drivers/gpu/drm/drm_hashtab.c                 |  203 --
 drivers/gpu/drm/drm_internal.h                |    7 -
 drivers/gpu/drm/drm_ioc32.c                   |  613 +------
 drivers/gpu/drm/drm_ioctl.c                   |   82 +-
 drivers/gpu/drm/drm_irq.c                     |  204 ---
 drivers/gpu/drm/drm_legacy.h                  |  290 ---
 drivers/gpu/drm/drm_legacy_misc.c             |  105 --
 drivers/gpu/drm/drm_lock.c                    |  373 ----
 drivers/gpu/drm/drm_memory.c                  |  138 --
 drivers/gpu/drm/drm_pci.c                     |  204 +--
 drivers/gpu/drm/drm_scatter.c                 |  220 ---
 drivers/gpu/drm/drm_vblank.c                  |  101 -
 drivers/gpu/drm/drm_vm.c                      |  665 -------
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |    1 +
 drivers/gpu/drm/radeon/radeon_drv.h           |    1 -
 include/drm/drm_auth.h                        |   22 -
 include/drm/drm_device.h                      |   71 +-
 include/drm/drm_drv.h                         |   19 -
 include/drm/drm_file.h                        |    5 -
 include/drm/drm_ioctl.h                       |   11 -
 include/drm/drm_legacy.h                      |  331 ----
 40 files changed, 20 insertions(+), 8045 deletions(-)
 delete mode 100644 drivers/char/agp/compat_ioctl.c
 delete mode 100644 drivers/char/agp/compat_ioctl.h
 delete mode 100644 drivers/char/agp/frontend.c
 delete mode 100644 drivers/gpu/drm/drm_agpsupport.c
 delete mode 100644 drivers/gpu/drm/drm_bufs.c
 delete mode 100644 drivers/gpu/drm/drm_context.c
 delete mode 100644 drivers/gpu/drm/drm_dma.c
 delete mode 100644 drivers/gpu/drm/drm_hashtab.c
 delete mode 100644 drivers/gpu/drm/drm_irq.c
 delete mode 100644 drivers/gpu/drm/drm_legacy.h
 delete mode 100644 drivers/gpu/drm/drm_legacy_misc.c
 delete mode 100644 drivers/gpu/drm/drm_lock.c
 delete mode 100644 drivers/gpu/drm/drm_memory.c
 delete mode 100644 drivers/gpu/drm/drm_scatter.c
 delete mode 100644 drivers/gpu/drm/drm_vm.c
 delete mode 100644 include/drm/drm_legacy.h
Signature · 1 line
2.42.1
author maintainer
#1 lore raw

PATCH 1/14 arch/powerpc: Remove legacy DRM drivers from default configs

DRM drivers for user-space modesetting have been removed. Do not select the respective options in the default configs.

Fixes a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Cc Cai Huoqing <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc <[email protected]> # v6.3+
---
 arch/powerpc/configs/pmac32_defconfig | 2 --
 arch/powerpc/configs/ppc6xx_defconfig | 7 -------
 2 files changed, 9 deletions(-)
arch/powerpc/configs/pmac32_defconfig +0 -2
index 57ded82c28409..e41e7affd2482 100644
@@ -188,8 +188,6 @@ CONFIG_AGP=m
 CONFIG_AGP_UNINORTH=m
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_R128=m
 CONFIG_FB=y
 CONFIG_FB_OF=y
 CONFIG_FB_CONTROL=y
arch/powerpc/configs/ppc6xx_defconfig +0 -7
index f279703425d45..e680cd086f0e8 100644
@@ -678,13 +678,6 @@ CONFIG_AGP=y
 CONFIG_AGP_UNINORTH=y
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_TDFX=m
-CONFIG_DRM_R128=m
-CONFIG_DRM_MGA=m
-CONFIG_DRM_SIS=m
-CONFIG_DRM_VIA=m
-CONFIG_DRM_SAVAGE=m
 CONFIG_FB=y
 CONFIG_FB_CIRRUS=m
 CONFIG_FB_OF=y
Signature · 1 line
2.42.1
Acked-by on v1 1/14
#2 lore raw

Re: [PATCH 01/14] arch/powerpc: Remove legacy DRM drivers from default configs

Quoted 4 lines · Thomas Zimmermann

DRM drivers for user-space modesetting have been removed. Do not select the respective options in the default configs.

Quoted 12 lines
Fixes a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Cc Cai Huoqing <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc <[email protected]> # v6.3+
Quoted 39 lines
---
 arch/powerpc/configs/pmac32_defconfig | 2 --
 arch/powerpc/configs/ppc6xx_defconfig | 7 -------
 2 files changed, 9 deletions(-)
arch/powerpc/configs/pmac32_defconfig +0 -2
index 57ded82c28409..e41e7affd2482 100644
@@ -188,8 +188,6 @@ CONFIG_AGP=m
 CONFIG_AGP_UNINORTH=m
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_R128=m
 CONFIG_FB=y
 CONFIG_FB_OF=y
 CONFIG_FB_CONTROL=y
arch/powerpc/configs/ppc6xx_defconfig +0 -8
index f279703425d45..e680cd086f0e8 100644
@@ -678,13 +678,6 @@ CONFIG_AGP=y
 CONFIG_AGP_UNINORTH=y
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_TDFX=m
-CONFIG_DRM_R128=m
-CONFIG_DRM_MGA=m
-CONFIG_DRM_SIS=m
-CONFIG_DRM_VIA=m
-CONFIG_DRM_SAVAGE=m
 CONFIG_FB=y
 CONFIG_FB_CIRRUS=m
 CONFIG_FB_OF=y
--

2.42.1

Reviewed-by on v1 1/14
#3 lore raw

Re: [PATCH 01/14] arch/powerpc: Remove legacy DRM drivers from default configs

In reply to Thomas Zimmermann
Quoted 5 lines · Thomas Zimmermann

DRM drivers for user-space modesetting have been removed. Do not select the respective options in the default configs.

Fixes a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Quoted 49 lines
Cc Cai Huoqing <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc <[email protected]> # v6.3+
---
 arch/powerpc/configs/pmac32_defconfig | 2 --
 arch/powerpc/configs/ppc6xx_defconfig | 7 -------
 2 files changed, 9 deletions(-)
arch/powerpc/configs/pmac32_defconfig +0 -2
index 57ded82c28409..e41e7affd2482 100644
@@ -188,8 +188,6 @@ CONFIG_AGP=m
 CONFIG_AGP_UNINORTH=m
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_R128=m
 CONFIG_FB=y
 CONFIG_FB_OF=y
 CONFIG_FB_CONTROL=y
arch/powerpc/configs/ppc6xx_defconfig +0 -7
index f279703425d45..e680cd086f0e8 100644
@@ -678,13 +678,6 @@ CONFIG_AGP=y
 CONFIG_AGP_UNINORTH=y
 CONFIG_DRM=m
 CONFIG_DRM_RADEON=m
-CONFIG_DRM_LEGACY=y
-CONFIG_DRM_TDFX=m
-CONFIG_DRM_R128=m
-CONFIG_DRM_MGA=m
-CONFIG_DRM_SIS=m
-CONFIG_DRM_VIA=m
-CONFIG_DRM_SAVAGE=m
 CONFIG_FB=y
 CONFIG_FB_CIRRUS=m
 CONFIG_FB_OF=y
Signature · 1 line
2.42.1
author maintainer
#4 lore raw

PATCH 2/14 drm: Fix TODO list mentioning non-KMS drivers

In reply to Thomas Zimmermann

Non-KMS drivers have been removed from DRM. Update the TODO list accordingly.

Fixes a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Cc Cai Huoqing <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc <[email protected]> # v6.3+
---
 Documentation/gpu/todo.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/gpu/todo.rst +3 -4
index b62c7fa0c2bcc..3bdb8787960be 100644
@@ -337,8 +337,8 @@ connector register/unregister fixes
 
 Level: Intermediate
 
-Remove load/unload callbacks from all non-DRIVER_LEGACY drivers
----------------------------------------------------------------
+Remove load/unload callbacks
+----------------------------
 
 The load/unload callbacks in struct &drm_driver are very much midlayers, plus
 for historical reasons they get the ordering wrong (and we can't fix that)
@@ -347,8 +347,7 @@ between setting up the &drm_driver structure and calling drm_dev_register().
 - Rework drivers to no longer use the load/unload callbacks, directly coding the
   load/unload sequence into the driver's probe function.
 
-- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload
-  callbacks for all modern drivers.
+- Once all drivers are converted, remove the load/unload callbacks.
 
 Contact: Daniel Vetter
 
Signature · 1 line
2.42.1
Acked-by on v1 2/14
#5 lore raw

Re: [PATCH 02/14] drm: Fix TODO list mentioning non-KMS drivers

Quoted 4 lines · Thomas Zimmermann

Non-KMS drivers have been removed from DRM. Update the TODO list accordingly.

Quoted 14 lines
Fixes a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
Cc Cai Huoqing <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc <[email protected]> # v6.3+
Quoted 32 lines
---
 Documentation/gpu/todo.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/gpu/todo.rst +3 -5
index b62c7fa0c2bcc..3bdb8787960be 100644
@@ -337,8 +337,8 @@ connector register/unregister fixes
 
 Level: Intermediate
 
-Remove load/unload callbacks from all non-DRIVER_LEGACY drivers
----------------------------------------------------------------
+Remove load/unload callbacks
+----------------------------
 
 The load/unload callbacks in struct &drm_driver are very much midlayers, plus
 for historical reasons they get the ordering wrong (and we can't fix that)
@@ -347,8 +347,7 @@ between setting up the &drm_driver structure and calling drm_dev_register().
 - Rework drivers to no longer use the load/unload callbacks, directly coding the
   load/unload sequence into the driver's probe function.
 
-- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload
-  callbacks for all modern drivers.
+- Once all drivers are converted, remove the load/unload callbacks.
 
 Contact: Daniel Vetter
 
--

2.42.1

author maintainer
#6 lore raw

PATCH 3/14 drm: Include <drm/drm_auth.h>

In reply to Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

---
 drivers/gpu/drm/drm_pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_pci.c +1 -0
index 39d35fc3a43bc..67907dd427214 100644
@@ -29,6 +29,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 
+#include <drm/drm_auth.h>
 #include <drm/drm.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_print.h>
Signature · 1 line
2.42.1
Acked-by on v1 3/14
#7 lore raw

Re: [PATCH 03/14] drm: Include <drm/drm_auth.h>

Quoted 5 lines · Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

Quoted 19 lines
---
 drivers/gpu/drm/drm_pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_pci.c +1 -1
index 39d35fc3a43bc..67907dd427214 100644
@@ -29,6 +29,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 
+#include <drm/drm_auth.h>
 #include <drm/drm.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_print.h>
--

2.42.1

author maintainer
#8 lore raw

PATCH 4/14 drm/i915: Include <drm/drm_auth.h>

In reply to Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +1 -0
index b1aa62dfb155d..81a57dd52dfda 100644
@@ -9,6 +9,7 @@
 #include <linux/sync_file.h>
 #include <linux/uaccess.h>
 
+#include <drm/drm_auth.h>
 #include <drm/drm_syncobj.h>
 
 #include "display/intel_frontbuffer.h"
Signature · 1 line
2.42.1
maintainer Acked-by on v1 4/14
#9 lore raw

Re: [PATCH 04/14] drm/i915: Include <drm/drm_auth.h>

Quoted 9 lines · Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Quoted 16 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +1 -0
index b1aa62dfb155d..81a57dd52dfda 100644
@@ -9,6 +9,7 @@
 #include <linux/sync_file.h>
 #include <linux/uaccess.h>
 
+#include <drm/drm_auth.h>
 #include <drm/drm_syncobj.h>
 
 #include "display/intel_frontbuffer.h"
Signature · 1 line
Jani Nikula, Intel
author maintainer
#10 lore raw

PATCH 5/14 accel: Include <drm/drm_auth.h>

In reply to Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

---
 drivers/accel/drm_accel.c | 1 +
 1 file changed, 1 insertion(+)
drivers/accel/drm_accel.c +1 -0
index 294b572a9c331..24cac4c0274bb 100644
@@ -11,6 +11,7 @@
 #include <linux/idr.h>
 
 #include <drm/drm_accel.h>
+#include <drm/drm_auth.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_file.h>
Signature · 1 line
2.42.1
Acked-by on v1 5/14
#11 lore raw

Re: [PATCH 05/14] accel: Include <drm/drm_auth.h>

Quoted 6 lines · Thomas Zimmermann

One of the source files includes <drm/drm_auth.h> via <drm/drm_legacy.h>, which will be removed. Include drm_auth.h directly.

Quoted 19 lines
---
 drivers/accel/drm_accel.c | 1 +
 1 file changed, 1 insertion(+)
drivers/accel/drm_accel.c +1 -1
index 294b572a9c331..24cac4c0274bb 100644
@@ -11,6 +11,7 @@
 #include <linux/idr.h>
 
 #include <drm/drm_accel.h>
+#include <drm/drm_auth.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_file.h>
--

2.42.1

author maintainer
#12 lore raw

PATCH 6/14 drm: Include <drm/drm_device.h>

In reply to Thomas Zimmermann

Include <drm/drm_device.h> in drm_ioc32.c. Resolves a depenency on <drm/drm_legacy.h>, which will be removed.

---
 drivers/gpu/drm/drm_ioc32.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_ioc32.c +1 -0
index 025dc558c94ee..c0163cb076ad8 100644
@@ -31,6 +31,7 @@
 #include <linux/ratelimit.h>
 #include <linux/export.h>
 
+#include <drm/drm_device.h>
 #include <drm/drm_file.h>
 #include <drm/drm_print.h>
 
Signature · 1 line
2.42.1
author maintainer
#13 lore raw

PATCH 7/14 drm/radeon: Do not include <drm/drm_legacy.h>

In reply to Thomas Zimmermann

Including <drm/drm_legacy.h> is not required by radeon.

Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
---
 drivers/gpu/drm/radeon/radeon_drv.h | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/radeon/radeon_drv.h +0 -1
index 34a1c73d3938f..02a65971d140d 100644
@@ -33,7 +33,6 @@
 
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
-#include <drm/drm_legacy.h>
 
 #include "radeon_family.h"
 
Signature · 1 line
2.42.1
Acked-by on v1 7/14
#14 lore raw

Re: [PATCH 07/14] drm/radeon: Do not include <drm/drm_legacy.h>

Quoted 8 lines · Thomas Zimmermann

Including <drm/drm_legacy.h> is not required by radeon.

Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "Pan, Xinhui" <[email protected]>
Quoted 19 lines
---
 drivers/gpu/drm/radeon/radeon_drv.h | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/radeon/radeon_drv.h +0 -2
index 34a1c73d3938f..02a65971d140d 100644
@@ -33,7 +33,6 @@
 
 #include <linux/firmware.h>
 #include <linux/platform_device.h>
-#include <drm/drm_legacy.h>
 
 #include "radeon_family.h"
 
--

2.42.1

author maintainer
#15 lore raw

PATCH 8/14 drm: Remove entry points for legacy ioctls

In reply to Thomas Zimmermann

DRM drivers with user-space mode setting have been removed in Linux v6.3. [1] Now remove the ioctl entry points for these drivers. Invoking any of the ioctl ops will unconditionally return -EINVAL to user space. This has already been the behavior for kernels without CONFIG_DRM_LEGACY set.

---
 drivers/gpu/drm/drm_ioc32.c | 610 ------------------------------------
 drivers/gpu/drm/drm_ioctl.c |  57 ----
 2 files changed, 667 deletions(-)
drivers/gpu/drm/drm_ioc32.c +0 -610
index c0163cb076ad8..910cadf14756e 100644
@@ -37,7 +37,6 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 #define DRM_IOCTL_VERSION32		DRM_IOWR(0x00, drm_version32_t)
 #define DRM_IOCTL_GET_UNIQUE32		DRM_IOWR(0x01, drm_unique32_t)
@@ -164,92 +163,6 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd,
 	return -EINVAL;
 }
 
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-typedef struct drm_map32 {
-	u32 offset;		/* Requested physical address (0 for SAREA) */
-	u32 size;		/* Requested physical size (bytes) */
-	enum drm_map_type type;	/* Type of memory to map */
-	enum drm_map_flags flags;	/* Flags */
-	u32 handle;		/* User-space: "Handle" to pass to mmap() */
-	int mtrr;		/* MTRR slot used */
-} drm_map32_t;
-
-static int compat_drm_getmap(struct file *file, unsigned int cmd,
-			     unsigned long arg)
-{
-	drm_map32_t __user *argp = (void __user *)arg;
-	drm_map32_t m32;
-	struct drm_map map;
-	int err;
-
-	if (copy_from_user(&m32, argp, sizeof(m32)))
-		return -EFAULT;
-
-	map.offset = m32.offset;
-	err = drm_ioctl_kernel(file, drm_legacy_getmap_ioctl, &map, 0);
-	if (err)
-		return err;
-
-	m32.offset = map.offset;
-	m32.size = map.size;
-	m32.type = map.type;
-	m32.flags = map.flags;
-	m32.handle = ptr_to_compat((void __user *)map.handle);
-	m32.mtrr = map.mtrr;
-	if (copy_to_user(argp, &m32, sizeof(m32)))
-		return -EFAULT;
-	return 0;
-
-}
-
-static int compat_drm_addmap(struct file *file, unsigned int cmd,
-			     unsigned long arg)
-{
-	drm_map32_t __user *argp = (void __user *)arg;
-	drm_map32_t m32;
-	struct drm_map map;
-	int err;
-
-	if (copy_from_user(&m32, argp, sizeof(m32)))
-		return -EFAULT;
-
-	map.offset = m32.offset;
-	map.size = m32.size;
-	map.type = m32.type;
-	map.flags = m32.flags;
-
-	err = drm_ioctl_kernel(file, drm_legacy_addmap_ioctl, &map,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-	if (err)
-		return err;
-
-	m32.offset = map.offset;
-	m32.mtrr = map.mtrr;
-	m32.handle = ptr_to_compat((void __user *)map.handle);
-	if (map.handle != compat_ptr(m32.handle))
-		pr_err_ratelimited("compat_drm_addmap truncated handle %p for type %d offset %x\n",
-				   map.handle, m32.type, m32.offset);
-
-	if (copy_to_user(argp, &m32, sizeof(m32)))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int compat_drm_rmmap(struct file *file, unsigned int cmd,
-			    unsigned long arg)
-{
-	drm_map32_t __user *argp = (void __user *)arg;
-	struct drm_map map;
-	u32 handle;
-
-	if (get_user(handle, &argp->handle))
-		return -EFAULT;
-	map.handle = compat_ptr(handle);
-	return drm_ioctl_kernel(file, drm_legacy_rmmap_ioctl, &map, DRM_AUTH);
-}
-#endif
-
 typedef struct drm_client32 {
 	int idx;	/* Which client desired? */
 	int auth;	/* Is client authenticated? */
@@ -309,501 +222,6 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd,
 	return 0;
 }
 
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-typedef struct drm_buf_desc32 {
-	int count;		 /* Number of buffers of this size */
-	int size;		 /* Size in bytes */
-	int low_mark;		 /* Low water mark */
-	int high_mark;		 /* High water mark */
-	int flags;
-	u32 agp_start;		 /* Start address in the AGP aperture */
-} drm_buf_desc32_t;
-
-static int compat_drm_addbufs(struct file *file, unsigned int cmd,
-			      unsigned long arg)
-{
-	drm_buf_desc32_t __user *argp = (void __user *)arg;
-	drm_buf_desc32_t desc32;
-	struct drm_buf_desc desc;
-	int err;
-
-	if (copy_from_user(&desc32, argp, sizeof(drm_buf_desc32_t)))
-		return -EFAULT;
-
-	desc = (struct drm_buf_desc){
-		desc32.count, desc32.size, desc32.low_mark, desc32.high_mark,
-		desc32.flags, desc32.agp_start
-	};
-
-	err = drm_ioctl_kernel(file, drm_legacy_addbufs, &desc,
-				   DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-	if (err)
-		return err;
-
-	desc32 = (drm_buf_desc32_t){
-		desc.count, desc.size, desc.low_mark, desc.high_mark,
-		desc.flags, desc.agp_start
-	};
-	if (copy_to_user(argp, &desc32, sizeof(drm_buf_desc32_t)))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int compat_drm_markbufs(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_buf_desc32_t b32;
-	drm_buf_desc32_t __user *argp = (void __user *)arg;
-	struct drm_buf_desc buf;
-
-	if (copy_from_user(&b32, argp, sizeof(b32)))
-		return -EFAULT;
-
-	buf.size = b32.size;
-	buf.low_mark = b32.low_mark;
-	buf.high_mark = b32.high_mark;
-
-	return drm_ioctl_kernel(file, drm_legacy_markbufs, &buf,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_buf_info32 {
-	int count;		/**< Entries in list */
-	u32 list;
-} drm_buf_info32_t;
-
-static int copy_one_buf32(void *data, int count, struct drm_buf_entry *from)
-{
-	drm_buf_info32_t *request = data;
-	drm_buf_desc32_t __user *to = compat_ptr(request->list);
-	drm_buf_desc32_t v = {.count = from->buf_count,
-			      .size = from->buf_size,
-			      .low_mark = from->low_mark,
-			      .high_mark = from->high_mark};
-
-	if (copy_to_user(to + count, &v, offsetof(drm_buf_desc32_t, flags)))
-		return -EFAULT;
-	return 0;
-}
-
-static int drm_legacy_infobufs32(struct drm_device *dev, void *data,
-			struct drm_file *file_priv)
-{
-	drm_buf_info32_t *request = data;
-
-	return __drm_legacy_infobufs(dev, data, &request->count, copy_one_buf32);
-}
-
-static int compat_drm_infobufs(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_buf_info32_t req32;
-	drm_buf_info32_t __user *argp = (void __user *)arg;
-	int err;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	if (req32.count < 0)
-		req32.count = 0;
-
-	err = drm_ioctl_kernel(file, drm_legacy_infobufs32, &req32, DRM_AUTH);
-	if (err)
-		return err;
-
-	if (put_user(req32.count, &argp->count))
-		return -EFAULT;
-
-	return 0;
-}
-
-typedef struct drm_buf_pub32 {
-	int idx;		/**< Index into the master buffer list */
-	int total;		/**< Buffer size */
-	int used;		/**< Amount of buffer in use (for DMA) */
-	u32 address;		/**< Address of buffer */
-} drm_buf_pub32_t;
-
-typedef struct drm_buf_map32 {
-	int count;		/**< Length of the buffer list */
-	u32 virtual;		/**< Mmap'd area in user-virtual */
-	u32 list;		/**< Buffer information */
-} drm_buf_map32_t;
-
-static int map_one_buf32(void *data, int idx, unsigned long virtual,
-			struct drm_buf *buf)
-{
-	drm_buf_map32_t *request = data;
-	drm_buf_pub32_t __user *to = compat_ptr(request->list) + idx;
-	drm_buf_pub32_t v;
-
-	v.idx = buf->idx;
-	v.total = buf->total;
-	v.used = 0;
-	v.address = virtual + buf->offset;
-	if (copy_to_user(to, &v, sizeof(v)))
-		return -EFAULT;
-	return 0;
-}
-
-static int drm_legacy_mapbufs32(struct drm_device *dev, void *data,
-		       struct drm_file *file_priv)
-{
-	drm_buf_map32_t *request = data;
-	void __user *v;
-	int err = __drm_legacy_mapbufs(dev, data, &request->count,
-				    &v, map_one_buf32,
-				    file_priv);
-	request->virtual = ptr_to_compat(v);
-	return err;
-}
-
-static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
-			      unsigned long arg)
-{
-	drm_buf_map32_t __user *argp = (void __user *)arg;
-	drm_buf_map32_t req32;
-	int err;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-	if (req32.count < 0)
-		return -EINVAL;
-
-	err = drm_ioctl_kernel(file, drm_legacy_mapbufs32, &req32, DRM_AUTH);
-	if (err)
-		return err;
-
-	if (put_user(req32.count, &argp->count)
-	    || put_user(req32.virtual, &argp->virtual))
-		return -EFAULT;
-
-	return 0;
-}
-
-typedef struct drm_buf_free32 {
-	int count;
-	u32 list;
-} drm_buf_free32_t;
-
-static int compat_drm_freebufs(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_buf_free32_t req32;
-	struct drm_buf_free request;
-	drm_buf_free32_t __user *argp = (void __user *)arg;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	request.count = req32.count;
-	request.list = compat_ptr(req32.list);
-	return drm_ioctl_kernel(file, drm_legacy_freebufs, &request, DRM_AUTH);
-}
-
-typedef struct drm_ctx_priv_map32 {
-	unsigned int ctx_id;	 /**< Context requesting private mapping */
-	u32 handle;		/**< Handle of map */
-} drm_ctx_priv_map32_t;
-
-static int compat_drm_setsareactx(struct file *file, unsigned int cmd,
-				  unsigned long arg)
-{
-	drm_ctx_priv_map32_t req32;
-	struct drm_ctx_priv_map request;
-	drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	request.ctx_id = req32.ctx_id;
-	request.handle = compat_ptr(req32.handle);
-	return drm_ioctl_kernel(file, drm_legacy_setsareactx, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-static int compat_drm_getsareactx(struct file *file, unsigned int cmd,
-				  unsigned long arg)
-{
-	struct drm_ctx_priv_map req;
-	drm_ctx_priv_map32_t req32;
-	drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
-	int err;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	req.ctx_id = req32.ctx_id;
-	err = drm_ioctl_kernel(file, drm_legacy_getsareactx, &req, DRM_AUTH);
-	if (err)
-		return err;
-
-	req32.handle = ptr_to_compat((void __user *)req.handle);
-	if (copy_to_user(argp, &req32, sizeof(req32)))
-		return -EFAULT;
-
-	return 0;
-}
-
-typedef struct drm_ctx_res32 {
-	int count;
-	u32 contexts;
-} drm_ctx_res32_t;
-
-static int compat_drm_resctx(struct file *file, unsigned int cmd,
-			     unsigned long arg)
-{
-	drm_ctx_res32_t __user *argp = (void __user *)arg;
-	drm_ctx_res32_t res32;
-	struct drm_ctx_res res;
-	int err;
-
-	if (copy_from_user(&res32, argp, sizeof(res32)))
-		return -EFAULT;
-
-	res.count = res32.count;
-	res.contexts = compat_ptr(res32.contexts);
-	err = drm_ioctl_kernel(file, drm_legacy_resctx, &res, DRM_AUTH);
-	if (err)
-		return err;
-
-	res32.count = res.count;
-	if (copy_to_user(argp, &res32, sizeof(res32)))
-		return -EFAULT;
-
-	return 0;
-}
-
-typedef struct drm_dma32 {
-	int context;		  /**< Context handle */
-	int send_count;		  /**< Number of buffers to send */
-	u32 send_indices;	  /**< List of handles to buffers */
-	u32 send_sizes;		  /**< Lengths of data to send */
-	enum drm_dma_flags flags;		  /**< Flags */
-	int request_count;	  /**< Number of buffers requested */
-	int request_size;	  /**< Desired size for buffers */
-	u32 request_indices;	  /**< Buffer information */
-	u32 request_sizes;
-	int granted_count;	  /**< Number of buffers granted */
-} drm_dma32_t;
-
-static int compat_drm_dma(struct file *file, unsigned int cmd,
-			  unsigned long arg)
-{
-	drm_dma32_t d32;
-	drm_dma32_t __user *argp = (void __user *)arg;
-	struct drm_dma d;
-	int err;
-
-	if (copy_from_user(&d32, argp, sizeof(d32)))
-		return -EFAULT;
-
-	d.context = d32.context;
-	d.send_count = d32.send_count;
-	d.send_indices = compat_ptr(d32.send_indices);
-	d.send_sizes = compat_ptr(d32.send_sizes);
-	d.flags = d32.flags;
-	d.request_count = d32.request_count;
-	d.request_indices = compat_ptr(d32.request_indices);
-	d.request_sizes = compat_ptr(d32.request_sizes);
-	err = drm_ioctl_kernel(file, drm_legacy_dma_ioctl, &d, DRM_AUTH);
-	if (err)
-		return err;
-
-	if (put_user(d.request_size, &argp->request_size)
-	    || put_user(d.granted_count, &argp->granted_count))
-		return -EFAULT;
-
-	return 0;
-}
-#endif
-
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-#if IS_ENABLED(CONFIG_AGP)
-typedef struct drm_agp_mode32 {
-	u32 mode;	/**< AGP mode */
-} drm_agp_mode32_t;
-
-static int compat_drm_agp_enable(struct file *file, unsigned int cmd,
-				 unsigned long arg)
-{
-	drm_agp_mode32_t __user *argp = (void __user *)arg;
-	struct drm_agp_mode mode;
-
-	if (get_user(mode.mode, &argp->mode))
-		return -EFAULT;
-
-	return drm_ioctl_kernel(file,  drm_legacy_agp_enable_ioctl, &mode,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_agp_info32 {
-	int agp_version_major;
-	int agp_version_minor;
-	u32 mode;
-	u32 aperture_base;	/* physical address */
-	u32 aperture_size;	/* bytes */
-	u32 memory_allowed;	/* bytes */
-	u32 memory_used;
-
-	/* PCI information */
-	unsigned short id_vendor;
-	unsigned short id_device;
-} drm_agp_info32_t;
-
-static int compat_drm_agp_info(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_agp_info32_t __user *argp = (void __user *)arg;
-	drm_agp_info32_t i32;
-	struct drm_agp_info info;
-	int err;
-
-	err = drm_ioctl_kernel(file, drm_legacy_agp_info_ioctl, &info, DRM_AUTH);
-	if (err)
-		return err;
-
-	i32.agp_version_major = info.agp_version_major;
-	i32.agp_version_minor = info.agp_version_minor;
-	i32.mode = info.mode;
-	i32.aperture_base = info.aperture_base;
-	i32.aperture_size = info.aperture_size;
-	i32.memory_allowed = info.memory_allowed;
-	i32.memory_used = info.memory_used;
-	i32.id_vendor = info.id_vendor;
-	i32.id_device = info.id_device;
-	if (copy_to_user(argp, &i32, sizeof(i32)))
-		return -EFAULT;
-
-	return 0;
-}
-
-typedef struct drm_agp_buffer32 {
-	u32 size;	/**< In bytes -- will round to page boundary */
-	u32 handle;	/**< Used for binding / unbinding */
-	u32 type;	/**< Type of memory to allocate */
-	u32 physical;	/**< Physical used by i810 */
-} drm_agp_buffer32_t;
-
-static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
-				unsigned long arg)
-{
-	drm_agp_buffer32_t __user *argp = (void __user *)arg;
-	drm_agp_buffer32_t req32;
-	struct drm_agp_buffer request;
-	int err;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	request.size = req32.size;
-	request.type = req32.type;
-	err = drm_ioctl_kernel(file, drm_legacy_agp_alloc_ioctl, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-	if (err)
-		return err;
-
-	req32.handle = request.handle;
-	req32.physical = request.physical;
-	if (copy_to_user(argp, &req32, sizeof(req32))) {
-		drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-		return -EFAULT;
-	}
-
-	return 0;
-}
-
-static int compat_drm_agp_free(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_agp_buffer32_t __user *argp = (void __user *)arg;
-	struct drm_agp_buffer request;
-
-	if (get_user(request.handle, &argp->handle))
-		return -EFAULT;
-
-	return drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_agp_binding32 {
-	u32 handle;	/**< From drm_agp_buffer */
-	u32 offset;	/**< In bytes -- will round to page boundary */
-} drm_agp_binding32_t;
-
-static int compat_drm_agp_bind(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_agp_binding32_t __user *argp = (void __user *)arg;
-	drm_agp_binding32_t req32;
-	struct drm_agp_binding request;
-
-	if (copy_from_user(&req32, argp, sizeof(req32)))
-		return -EFAULT;
-
-	request.handle = req32.handle;
-	request.offset = req32.offset;
-	return drm_ioctl_kernel(file, drm_legacy_agp_bind_ioctl, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
-				 unsigned long arg)
-{
-	drm_agp_binding32_t __user *argp = (void __user *)arg;
-	struct drm_agp_binding request;
-
-	if (get_user(request.handle, &argp->handle))
-		return -EFAULT;
-
-	return drm_ioctl_kernel(file, drm_legacy_agp_unbind_ioctl, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-#endif /* CONFIG_AGP */
-
-typedef struct drm_scatter_gather32 {
-	u32 size;	/**< In bytes -- will round to page boundary */
-	u32 handle;	/**< Used for mapping / unmapping */
-} drm_scatter_gather32_t;
-
-static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
-			       unsigned long arg)
-{
-	drm_scatter_gather32_t __user *argp = (void __user *)arg;
-	struct drm_scatter_gather request;
-	int err;
-
-	if (get_user(request.size, &argp->size))
-		return -EFAULT;
-
-	err = drm_ioctl_kernel(file, drm_legacy_sg_alloc, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-	if (err)
-		return err;
-
-	/* XXX not sure about the handle conversion here... */
-	if (put_user(request.handle >> PAGE_SHIFT, &argp->handle))
-		return -EFAULT;
-
-	return 0;
-}
-
-static int compat_drm_sg_free(struct file *file, unsigned int cmd,
-			      unsigned long arg)
-{
-	drm_scatter_gather32_t __user *argp = (void __user *)arg;
-	struct drm_scatter_gather request;
-	unsigned long x;
-
-	if (get_user(x, &argp->handle))
-		return -EFAULT;
-	request.handle = x << PAGE_SHIFT;
-	return drm_ioctl_kernel(file, drm_legacy_sg_free, &request,
-				DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-#endif
 #if defined(CONFIG_X86)
 typedef struct drm_update_draw32 {
 	drm_drawable_t handle;
@@ -915,37 +333,9 @@ static struct {
 #define DRM_IOCTL32_DEF(n, f) [DRM_IOCTL_NR(n##32)] = {.fn = f, .name = #n}
 	DRM_IOCTL32_DEF(DRM_IOCTL_VERSION, compat_drm_version),
 	DRM_IOCTL32_DEF(DRM_IOCTL_GET_UNIQUE, compat_drm_getunique),
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-	DRM_IOCTL32_DEF(DRM_IOCTL_GET_MAP, compat_drm_getmap),
-#endif
 	DRM_IOCTL32_DEF(DRM_IOCTL_GET_CLIENT, compat_drm_getclient),
 	DRM_IOCTL32_DEF(DRM_IOCTL_GET_STATS, compat_drm_getstats),
 	DRM_IOCTL32_DEF(DRM_IOCTL_SET_UNIQUE, compat_drm_setunique),
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-	DRM_IOCTL32_DEF(DRM_IOCTL_ADD_MAP, compat_drm_addmap),
-	DRM_IOCTL32_DEF(DRM_IOCTL_ADD_BUFS, compat_drm_addbufs),
-	DRM_IOCTL32_DEF(DRM_IOCTL_MARK_BUFS, compat_drm_markbufs),
-	DRM_IOCTL32_DEF(DRM_IOCTL_INFO_BUFS, compat_drm_infobufs),
-	DRM_IOCTL32_DEF(DRM_IOCTL_MAP_BUFS, compat_drm_mapbufs),
-	DRM_IOCTL32_DEF(DRM_IOCTL_FREE_BUFS, compat_drm_freebufs),
-	DRM_IOCTL32_DEF(DRM_IOCTL_RM_MAP, compat_drm_rmmap),
-	DRM_IOCTL32_DEF(DRM_IOCTL_SET_SAREA_CTX, compat_drm_setsareactx),
-	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),
-#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),
-	DRM_IOCTL32_DEF(DRM_IOCTL_AGP_ALLOC, compat_drm_agp_alloc),
-	DRM_IOCTL32_DEF(DRM_IOCTL_AGP_FREE, compat_drm_agp_free),
-	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),
-#endif
 #if defined(CONFIG_X86)
 	DRM_IOCTL32_DEF(DRM_IOCTL_UPDATE_DRAW, compat_drm_update_draw),
 #endif
drivers/gpu/drm/drm_ioctl.c +0 -57

88 lines not on this page · raw message

Signature · 1 line
2.42.1
Acked-by on v1 8/14
#16 lore raw

Re: [PATCH 08/14] drm: Remove entry points for legacy ioctls

Quoted 9 lines · Thomas Zimmermann

DRM drivers with user-space mode setting have been removed in Linux v6.3. [1] Now remove the ioctl entry points for these drivers. Invoking any of the ioctl ops will unconditionally return -EINVAL to user space. This has already been the behavior for kernels without CONFIG_DRM_LEGACY set.

Quoted 748 lines
---
 drivers/gpu/drm/drm_ioc32.c | 610 ------------------------------------
 drivers/gpu/drm/drm_ioctl.c |  57 ----
 2 files changed, 667 deletions(-)
drivers/gpu/drm/drm_ioc32.c +0 -610
index c0163cb076ad8..910cadf14756e 100644
@@ -37,7 +37,6 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 #define DRM_IOCTL_VERSION32            DRM_IOWR(0x00, drm_version32_t)
 #define DRM_IOCTL_GET_UNIQUE32         DRM_IOWR(0x01, drm_unique32_t)
@@ -164,92 +163,6 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd,
        return -EINVAL;
 }
 
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-typedef struct drm_map32 {
-       u32 offset;             /* Requested physical address (0 for SAREA) */
-       u32 size;               /* Requested physical size (bytes) */
-       enum drm_map_type type; /* Type of memory to map */
-       enum drm_map_flags flags;       /* Flags */
-       u32 handle;             /* User-space: "Handle" to pass to mmap() */
-       int mtrr;               /* MTRR slot used */
-} drm_map32_t;
-
-static int compat_drm_getmap(struct file *file, unsigned int cmd,
-                            unsigned long arg)
-{
-       drm_map32_t __user *argp = (void __user *)arg;
-       drm_map32_t m32;
-       struct drm_map map;
-       int err;
-
-       if (copy_from_user(&m32, argp, sizeof(m32)))
-               return -EFAULT;
-
-       map.offset = m32.offset;
-       err = drm_ioctl_kernel(file, drm_legacy_getmap_ioctl, &map, 0);
-       if (err)
-               return err;
-
-       m32.offset = map.offset;
-       m32.size = map.size;
-       m32.type = map.type;
-       m32.flags = map.flags;
-       m32.handle = ptr_to_compat((void __user *)map.handle);
-       m32.mtrr = map.mtrr;
-       if (copy_to_user(argp, &m32, sizeof(m32)))
-               return -EFAULT;
-       return 0;
-
-}
-
-static int compat_drm_addmap(struct file *file, unsigned int cmd,
-                            unsigned long arg)
-{
-       drm_map32_t __user *argp = (void __user *)arg;
-       drm_map32_t m32;
-       struct drm_map map;
-       int err;
-
-       if (copy_from_user(&m32, argp, sizeof(m32)))
-               return -EFAULT;
-
-       map.offset = m32.offset;
-       map.size = m32.size;
-       map.type = m32.type;
-       map.flags = m32.flags;
-
-       err = drm_ioctl_kernel(file, drm_legacy_addmap_ioctl, &map,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-       if (err)
-               return err;
-
-       m32.offset = map.offset;
-       m32.mtrr = map.mtrr;
-       m32.handle = ptr_to_compat((void __user *)map.handle);
-       if (map.handle != compat_ptr(m32.handle))
-               pr_err_ratelimited("compat_drm_addmap truncated handle %p for type %d offset %x\n",
-                                  map.handle, m32.type, m32.offset);
-
-       if (copy_to_user(argp, &m32, sizeof(m32)))
-               return -EFAULT;
-
-       return 0;
-}
-
-static int compat_drm_rmmap(struct file *file, unsigned int cmd,
-                           unsigned long arg)
-{
-       drm_map32_t __user *argp = (void __user *)arg;
-       struct drm_map map;
-       u32 handle;
-
-       if (get_user(handle, &argp->handle))
-               return -EFAULT;
-       map.handle = compat_ptr(handle);
-       return drm_ioctl_kernel(file, drm_legacy_rmmap_ioctl, &map, DRM_AUTH);
-}
-#endif
-
 typedef struct drm_client32 {
        int idx;        /* Which client desired? */
        int auth;       /* Is client authenticated? */
@@ -309,501 +222,6 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd,
        return 0;
 }
 
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-typedef struct drm_buf_desc32 {
-       int count;               /* Number of buffers of this size */
-       int size;                /* Size in bytes */
-       int low_mark;            /* Low water mark */
-       int high_mark;           /* High water mark */
-       int flags;
-       u32 agp_start;           /* Start address in the AGP aperture */
-} drm_buf_desc32_t;
-
-static int compat_drm_addbufs(struct file *file, unsigned int cmd,
-                             unsigned long arg)
-{
-       drm_buf_desc32_t __user *argp = (void __user *)arg;
-       drm_buf_desc32_t desc32;
-       struct drm_buf_desc desc;
-       int err;
-
-       if (copy_from_user(&desc32, argp, sizeof(drm_buf_desc32_t)))
-               return -EFAULT;
-
-       desc = (struct drm_buf_desc){
-               desc32.count, desc32.size, desc32.low_mark, desc32.high_mark,
-               desc32.flags, desc32.agp_start
-       };
-
-       err = drm_ioctl_kernel(file, drm_legacy_addbufs, &desc,
-                                  DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-       if (err)
-               return err;
-
-       desc32 = (drm_buf_desc32_t){
-               desc.count, desc.size, desc.low_mark, desc.high_mark,
-               desc.flags, desc.agp_start
-       };
-       if (copy_to_user(argp, &desc32, sizeof(drm_buf_desc32_t)))
-               return -EFAULT;
-
-       return 0;
-}
-
-static int compat_drm_markbufs(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_buf_desc32_t b32;
-       drm_buf_desc32_t __user *argp = (void __user *)arg;
-       struct drm_buf_desc buf;
-
-       if (copy_from_user(&b32, argp, sizeof(b32)))
-               return -EFAULT;
-
-       buf.size = b32.size;
-       buf.low_mark = b32.low_mark;
-       buf.high_mark = b32.high_mark;
-
-       return drm_ioctl_kernel(file, drm_legacy_markbufs, &buf,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_buf_info32 {
-       int count;              /**< Entries in list */
-       u32 list;
-} drm_buf_info32_t;
-
-static int copy_one_buf32(void *data, int count, struct drm_buf_entry *from)
-{
-       drm_buf_info32_t *request = data;
-       drm_buf_desc32_t __user *to = compat_ptr(request->list);
-       drm_buf_desc32_t v = {.count = from->buf_count,
-                             .size = from->buf_size,
-                             .low_mark = from->low_mark,
-                             .high_mark = from->high_mark};
-
-       if (copy_to_user(to + count, &v, offsetof(drm_buf_desc32_t, flags)))
-               return -EFAULT;
-       return 0;
-}
-
-static int drm_legacy_infobufs32(struct drm_device *dev, void *data,
-                       struct drm_file *file_priv)
-{
-       drm_buf_info32_t *request = data;
-
-       return __drm_legacy_infobufs(dev, data, &request->count, copy_one_buf32);
-}
-
-static int compat_drm_infobufs(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_buf_info32_t req32;
-       drm_buf_info32_t __user *argp = (void __user *)arg;
-       int err;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       if (req32.count < 0)
-               req32.count = 0;
-
-       err = drm_ioctl_kernel(file, drm_legacy_infobufs32, &req32, DRM_AUTH);
-       if (err)
-               return err;
-
-       if (put_user(req32.count, &argp->count))
-               return -EFAULT;
-
-       return 0;
-}
-
-typedef struct drm_buf_pub32 {
-       int idx;                /**< Index into the master buffer list */
-       int total;              /**< Buffer size */
-       int used;               /**< Amount of buffer in use (for DMA) */
-       u32 address;            /**< Address of buffer */
-} drm_buf_pub32_t;
-
-typedef struct drm_buf_map32 {
-       int count;              /**< Length of the buffer list */
-       u32 virtual;            /**< Mmap'd area in user-virtual */
-       u32 list;               /**< Buffer information */
-} drm_buf_map32_t;
-
-static int map_one_buf32(void *data, int idx, unsigned long virtual,
-                       struct drm_buf *buf)
-{
-       drm_buf_map32_t *request = data;
-       drm_buf_pub32_t __user *to = compat_ptr(request->list) + idx;
-       drm_buf_pub32_t v;
-
-       v.idx = buf->idx;
-       v.total = buf->total;
-       v.used = 0;
-       v.address = virtual + buf->offset;
-       if (copy_to_user(to, &v, sizeof(v)))
-               return -EFAULT;
-       return 0;
-}
-
-static int drm_legacy_mapbufs32(struct drm_device *dev, void *data,
-                      struct drm_file *file_priv)
-{
-       drm_buf_map32_t *request = data;
-       void __user *v;
-       int err = __drm_legacy_mapbufs(dev, data, &request->count,
-                                   &v, map_one_buf32,
-                                   file_priv);
-       request->virtual = ptr_to_compat(v);
-       return err;
-}
-
-static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
-                             unsigned long arg)
-{
-       drm_buf_map32_t __user *argp = (void __user *)arg;
-       drm_buf_map32_t req32;
-       int err;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-       if (req32.count < 0)
-               return -EINVAL;
-
-       err = drm_ioctl_kernel(file, drm_legacy_mapbufs32, &req32, DRM_AUTH);
-       if (err)
-               return err;
-
-       if (put_user(req32.count, &argp->count)
-           || put_user(req32.virtual, &argp->virtual))
-               return -EFAULT;
-
-       return 0;
-}
-
-typedef struct drm_buf_free32 {
-       int count;
-       u32 list;
-} drm_buf_free32_t;
-
-static int compat_drm_freebufs(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_buf_free32_t req32;
-       struct drm_buf_free request;
-       drm_buf_free32_t __user *argp = (void __user *)arg;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       request.count = req32.count;
-       request.list = compat_ptr(req32.list);
-       return drm_ioctl_kernel(file, drm_legacy_freebufs, &request, DRM_AUTH);
-}
-
-typedef struct drm_ctx_priv_map32 {
-       unsigned int ctx_id;     /**< Context requesting private mapping */
-       u32 handle;             /**< Handle of map */
-} drm_ctx_priv_map32_t;
-
-static int compat_drm_setsareactx(struct file *file, unsigned int cmd,
-                                 unsigned long arg)
-{
-       drm_ctx_priv_map32_t req32;
-       struct drm_ctx_priv_map request;
-       drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       request.ctx_id = req32.ctx_id;
-       request.handle = compat_ptr(req32.handle);
-       return drm_ioctl_kernel(file, drm_legacy_setsareactx, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-static int compat_drm_getsareactx(struct file *file, unsigned int cmd,
-                                 unsigned long arg)
-{
-       struct drm_ctx_priv_map req;
-       drm_ctx_priv_map32_t req32;
-       drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
-       int err;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       req.ctx_id = req32.ctx_id;
-       err = drm_ioctl_kernel(file, drm_legacy_getsareactx, &req, DRM_AUTH);
-       if (err)
-               return err;
-
-       req32.handle = ptr_to_compat((void __user *)req.handle);
-       if (copy_to_user(argp, &req32, sizeof(req32)))
-               return -EFAULT;
-
-       return 0;
-}
-
-typedef struct drm_ctx_res32 {
-       int count;
-       u32 contexts;
-} drm_ctx_res32_t;
-
-static int compat_drm_resctx(struct file *file, unsigned int cmd,
-                            unsigned long arg)
-{
-       drm_ctx_res32_t __user *argp = (void __user *)arg;
-       drm_ctx_res32_t res32;
-       struct drm_ctx_res res;
-       int err;
-
-       if (copy_from_user(&res32, argp, sizeof(res32)))
-               return -EFAULT;
-
-       res.count = res32.count;
-       res.contexts = compat_ptr(res32.contexts);
-       err = drm_ioctl_kernel(file, drm_legacy_resctx, &res, DRM_AUTH);
-       if (err)
-               return err;
-
-       res32.count = res.count;
-       if (copy_to_user(argp, &res32, sizeof(res32)))
-               return -EFAULT;
-
-       return 0;
-}
-
-typedef struct drm_dma32 {
-       int context;              /**< Context handle */
-       int send_count;           /**< Number of buffers to send */
-       u32 send_indices;         /**< List of handles to buffers */
-       u32 send_sizes;           /**< Lengths of data to send */
-       enum drm_dma_flags flags;                 /**< Flags */
-       int request_count;        /**< Number of buffers requested */
-       int request_size;         /**< Desired size for buffers */
-       u32 request_indices;      /**< Buffer information */
-       u32 request_sizes;
-       int granted_count;        /**< Number of buffers granted */
-} drm_dma32_t;
-
-static int compat_drm_dma(struct file *file, unsigned int cmd,
-                         unsigned long arg)
-{
-       drm_dma32_t d32;
-       drm_dma32_t __user *argp = (void __user *)arg;
-       struct drm_dma d;
-       int err;
-
-       if (copy_from_user(&d32, argp, sizeof(d32)))
-               return -EFAULT;
-
-       d.context = d32.context;
-       d.send_count = d32.send_count;
-       d.send_indices = compat_ptr(d32.send_indices);
-       d.send_sizes = compat_ptr(d32.send_sizes);
-       d.flags = d32.flags;
-       d.request_count = d32.request_count;
-       d.request_indices = compat_ptr(d32.request_indices);
-       d.request_sizes = compat_ptr(d32.request_sizes);
-       err = drm_ioctl_kernel(file, drm_legacy_dma_ioctl, &d, DRM_AUTH);
-       if (err)
-               return err;
-
-       if (put_user(d.request_size, &argp->request_size)
-           || put_user(d.granted_count, &argp->granted_count))
-               return -EFAULT;
-
-       return 0;
-}
-#endif
-
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-#if IS_ENABLED(CONFIG_AGP)
-typedef struct drm_agp_mode32 {
-       u32 mode;       /**< AGP mode */
-} drm_agp_mode32_t;
-
-static int compat_drm_agp_enable(struct file *file, unsigned int cmd,
-                                unsigned long arg)
-{
-       drm_agp_mode32_t __user *argp = (void __user *)arg;
-       struct drm_agp_mode mode;
-
-       if (get_user(mode.mode, &argp->mode))
-               return -EFAULT;
-
-       return drm_ioctl_kernel(file,  drm_legacy_agp_enable_ioctl, &mode,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_agp_info32 {
-       int agp_version_major;
-       int agp_version_minor;
-       u32 mode;
-       u32 aperture_base;      /* physical address */
-       u32 aperture_size;      /* bytes */
-       u32 memory_allowed;     /* bytes */
-       u32 memory_used;
-
-       /* PCI information */
-       unsigned short id_vendor;
-       unsigned short id_device;
-} drm_agp_info32_t;
-
-static int compat_drm_agp_info(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_agp_info32_t __user *argp = (void __user *)arg;
-       drm_agp_info32_t i32;
-       struct drm_agp_info info;
-       int err;
-
-       err = drm_ioctl_kernel(file, drm_legacy_agp_info_ioctl, &info, DRM_AUTH);
-       if (err)
-               return err;
-
-       i32.agp_version_major = info.agp_version_major;
-       i32.agp_version_minor = info.agp_version_minor;
-       i32.mode = info.mode;
-       i32.aperture_base = info.aperture_base;
-       i32.aperture_size = info.aperture_size;
-       i32.memory_allowed = info.memory_allowed;
-       i32.memory_used = info.memory_used;
-       i32.id_vendor = info.id_vendor;
-       i32.id_device = info.id_device;
-       if (copy_to_user(argp, &i32, sizeof(i32)))
-               return -EFAULT;
-
-       return 0;
-}
-
-typedef struct drm_agp_buffer32 {
-       u32 size;       /**< In bytes -- will round to page boundary */
-       u32 handle;     /**< Used for binding / unbinding */
-       u32 type;       /**< Type of memory to allocate */
-       u32 physical;   /**< Physical used by i810 */
-} drm_agp_buffer32_t;
-
-static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
-                               unsigned long arg)
-{
-       drm_agp_buffer32_t __user *argp = (void __user *)arg;
-       drm_agp_buffer32_t req32;
-       struct drm_agp_buffer request;
-       int err;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       request.size = req32.size;
-       request.type = req32.type;
-       err = drm_ioctl_kernel(file, drm_legacy_agp_alloc_ioctl, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-       if (err)
-               return err;
-
-       req32.handle = request.handle;
-       req32.physical = request.physical;
-       if (copy_to_user(argp, &req32, sizeof(req32))) {
-               drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-               return -EFAULT;
-       }
-
-       return 0;
-}
-
-static int compat_drm_agp_free(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_agp_buffer32_t __user *argp = (void __user *)arg;
-       struct drm_agp_buffer request;
-
-       if (get_user(request.handle, &argp->handle))
-               return -EFAULT;
-
-       return drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-typedef struct drm_agp_binding32 {
-       u32 handle;     /**< From drm_agp_buffer */
-       u32 offset;     /**< In bytes -- will round to page boundary */
-} drm_agp_binding32_t;
-
-static int compat_drm_agp_bind(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_agp_binding32_t __user *argp = (void __user *)arg;
-       drm_agp_binding32_t req32;
-       struct drm_agp_binding request;
-
-       if (copy_from_user(&req32, argp, sizeof(req32)))
-               return -EFAULT;
-
-       request.handle = req32.handle;
-       request.offset = req32.offset;
-       return drm_ioctl_kernel(file, drm_legacy_agp_bind_ioctl, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-
-static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
-                                unsigned long arg)
-{
-       drm_agp_binding32_t __user *argp = (void __user *)arg;
-       struct drm_agp_binding request;
-
-       if (get_user(request.handle, &argp->handle))
-               return -EFAULT;
-
-       return drm_ioctl_kernel(file, drm_legacy_agp_unbind_ioctl, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-#endif /* CONFIG_AGP */
-
-typedef struct drm_scatter_gather32 {
-       u32 size;       /**< In bytes -- will round to page boundary */
-       u32 handle;     /**< Used for mapping / unmapping */
-} drm_scatter_gather32_t;
-
-static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
-                              unsigned long arg)
-{
-       drm_scatter_gather32_t __user *argp = (void __user *)arg;
-       struct drm_scatter_gather request;
-       int err;
-
-       if (get_user(request.size, &argp->size))
-               return -EFAULT;
-
-       err = drm_ioctl_kernel(file, drm_legacy_sg_alloc, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-       if (err)
-               return err;
-
-       /* XXX not sure about the handle conversion here... */
-       if (put_user(request.handle >> PAGE_SHIFT, &argp->handle))
-               return -EFAULT;
-
-       return 0;
-}
-
-static int compat_drm_sg_free(struct file *file, unsigned int cmd,
-                             unsigned long arg)
-{
-       drm_scatter_gather32_t __user *argp = (void __user *)arg;
-       struct drm_scatter_gather request;
-       unsigned long x;
-
-       if (get_user(x, &argp->handle))
-               return -EFAULT;
-       request.handle = x << PAGE_SHIFT;
-       return drm_ioctl_kernel(file, drm_legacy_sg_free, &request,
-                               DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY);
-}
-#endif
 #if defined(CONFIG_X86)
 typedef struct drm_update_draw32 {
        drm_drawable_t handle;
@@ -915,37 +333,9 @@ static struct {
 #define DRM_IOCTL32_DEF(n, f) [DRM_IOCTL_NR(n##32)] = {.fn = f, .name = #n}
        DRM_IOCTL32_DEF(DRM_IOCTL_VERSION, compat_drm_version),
        DRM_IOCTL32_DEF(DRM_IOCTL_GET_UNIQUE, compat_drm_getunique),
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-       DRM_IOCTL32_DEF(DRM_IOCTL_GET_MAP, compat_drm_getmap),
-#endif
        DRM_IOCTL32_DEF(DRM_IOCTL_GET_CLIENT, compat_drm_getclient),
        DRM_IOCTL32_DEF(DRM_IOCTL_GET_STATS, compat_drm_getstats),
        DRM_IOCTL32_DEF(DRM_IOCTL_SET_UNIQUE, compat_drm_setunique),
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-       DRM_IOCTL32_DEF(DRM_IOCTL_ADD_MAP, compat_drm_addmap),
-       DRM_IOCTL32_DEF(DRM_IOCTL_ADD_BUFS, compat_drm_addbufs),
-       DRM_IOCTL32_DEF(DRM_IOCTL_MARK_BUFS, compat_drm_markbufs),
-       DRM_IOCTL32_DEF(DRM_IOCTL_INFO_BUFS, compat_drm_infobufs),
-       DRM_IOCTL32_DEF(DRM_IOCTL_MAP_BUFS, compat_drm_mapbufs),
-       DRM_IOCTL32_DEF(DRM_IOCTL_FREE_BUFS, compat_drm_freebufs),
-       DRM_IOCTL32_DEF(DRM_IOCTL_RM_MAP, compat_drm_rmmap),
-       DRM_IOCTL32_DEF(DRM_IOCTL_SET_SAREA_CTX, compat_drm_setsareactx),
-       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),
-#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),
-       DRM_IOCTL32_DEF(DRM_IOCTL_AGP_ALLOC, compat_drm_agp_alloc),
-       DRM_IOCTL32_DEF(DRM_IOCTL_AGP_FREE, compat_drm_agp_free),
-       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),
-#endif
 #if defined(CONFIG_X86)
        DRM_IOCTL32_DEF(DRM_IOCTL_UPDATE_DRAW, compat_drm_update_draw),
 #endif
drivers/gpu/drm/drm_ioctl.c +0 -58
index 44fda68c28aeb..e6c32f76c7452 100644
@@ -42,7 +42,6 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 /**
  * DOC: getunique and setversion story
@@ -559,21 +558,11 @@ static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
                .name = #ioctl                  \
        }
 
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-#define DRM_LEGACY_IOCTL_DEF(ioctl, _func, _flags)  DRM_IOCTL_DEF(ioctl, _func, _flags)
-#else
-#define DRM_LEGACY_IOCTL_DEF(ioctl, _func, _flags) DRM_IOCTL_DEF(ioctl, drm_invalid_op, _flags)
-#endif
-
 /* Ioctl table */
 static const struct drm_ioctl_desc drm_ioctls[] = {
        DRM_IOCTL_DEF(DRM_IOCTL_VERSION, drm_version, DRM_RENDER_ALLOW),
        DRM_IOCTL_DEF(DRM_IOCTL_GET_UNIQUE, drm_getunique, 0),
        DRM_IOCTL_DEF(DRM_IOCTL_GET_MAGIC, drm_getmagic, 0),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_IRQ_BUSID, drm_legacy_irq_by_busid,
-                            DRM_MASTER|DRM_ROOT_ONLY),
-
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_legacy_getmap_ioctl, 0),
 
        DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, 0),
        DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, 0),
@@ -586,60 +575,14 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
        DRM_IOCTL_DEF(DRM_IOCTL_UNBLOCK, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
        DRM_IOCTL_DEF(DRM_IOCTL_AUTH_MAGIC, drm_authmagic, DRM_MASTER),
 
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_ADD_MAP, drm_legacy_addmap_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_RM_MAP, drm_legacy_rmmap_ioctl, DRM_AUTH),
-
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_SET_SAREA_CTX, drm_legacy_setsareactx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_GET_SAREA_CTX, drm_legacy_getsareactx, DRM_AUTH),
-
        DRM_IOCTL_DEF(DRM_IOCTL_SET_MASTER, drm_setmaster_ioctl, 0),
        DRM_IOCTL_DEF(DRM_IOCTL_DROP_MASTER, drm_dropmaster_ioctl, 0),
 
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_ADD_CTX, drm_legacy_addctx, DRM_AUTH|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_RM_CTX, drm_legacy_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_MOD_CTX, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_GET_CTX, drm_legacy_getctx, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_SWITCH_CTX, drm_legacy_switchctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_NEW_CTX, drm_legacy_newctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_RES_CTX, drm_legacy_resctx, DRM_AUTH),
-
        DRM_IOCTL_DEF(DRM_IOCTL_ADD_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
        DRM_IOCTL_DEF(DRM_IOCTL_RM_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_LOCK, drm_legacy_lock, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_UNLOCK, drm_legacy_unlock, DRM_AUTH),
-
        DRM_IOCTL_DEF(DRM_IOCTL_FINISH, drm_noop, DRM_AUTH),
 
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_ADD_BUFS, drm_legacy_addbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_MARK_BUFS, drm_legacy_markbufs, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_INFO_BUFS, drm_legacy_infobufs, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_MAP_BUFS, drm_legacy_mapbufs, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_FREE_BUFS, drm_legacy_freebufs, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_DMA, drm_legacy_dma_ioctl, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_CONTROL, drm_legacy_irq_control, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-
-#if IS_ENABLED(CONFIG_AGP)
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_ACQUIRE, drm_legacy_agp_acquire_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_RELEASE, drm_legacy_agp_release_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_ENABLE, drm_legacy_agp_enable_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_INFO, drm_legacy_agp_info_ioctl, DRM_AUTH),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_ALLOC, drm_legacy_agp_alloc_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_FREE, drm_legacy_agp_free_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_BIND, drm_legacy_agp_bind_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_AGP_UNBIND, drm_legacy_agp_unbind_ioctl,
-                            DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-#endif
-
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_SG_ALLOC, drm_legacy_sg_alloc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-       DRM_LEGACY_IOCTL_DEF(DRM_IOCTL_SG_FREE, drm_legacy_sg_free, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
-
        DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, DRM_UNLOCKED),
 
        DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_legacy_modeset_ctl_ioctl, 0),
--

2.42.1

author maintainer
#17 lore raw

PATCH 9/14 drm: Remove the legacy DRM_IOCTL_MODESET_CTL ioctl

In reply to Thomas Zimmermann

DRM drivers with user-space mode setting have been removed in Linux v6.3. [1] Now remove the ioctl entry points for these drivers. Invoking any of the ioctl ops will unconditionally return -EINVAL to user space.

Invoking DRM_IOCTL_MODESET_CTL is different from the other legacy ioctl ops as it returns 0 even without CONFIG_DRM_LEGACY set. From the original commit 29935554b384 ("drm: Disallow DRM_IOCTL_MODESET_CTL for KMS drivers") it is not apparent how or why the operation differs from the others. It is likely just an oversight in commit 61ae227032e7 ("drm: allow removal of legacy codepaths (v4.1)"), which allowed disabling leagacy ioctls in the first place. Still keep this removal separate from the other ioctls to allow an easy revert, if necessary.

---
 drivers/gpu/drm/drm_internal.h |  2 -
 drivers/gpu/drm/drm_ioctl.c    |  2 -
 drivers/gpu/drm/drm_vblank.c   | 82 ----------------------------------
 3 files changed, 86 deletions(-)
drivers/gpu/drm/drm_internal.h +0 -2
index b12c463bc4605..a538a48c7d952 100644
@@ -117,8 +117,6 @@ void drm_handle_vblank_works(struct drm_vblank_crtc *vblank);
 /* IOCTLS */
 int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
 			  struct drm_file *filp);
-int drm_legacy_modeset_ctl_ioctl(struct drm_device *dev, void *data,
-				 struct drm_file *file_priv);
 
 /* drm_irq.c */
 
drivers/gpu/drm/drm_ioctl.c +0 -2
index e6c32f76c7452..9c6326b908e74 100644
@@ -585,8 +585,6 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 
 	DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, DRM_UNLOCKED),
 
-	DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_legacy_modeset_ctl_ioctl, 0),
-
 	DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
 	DRM_IOCTL_DEF(DRM_IOCTL_GEM_CLOSE, drm_gem_close_ioctl, DRM_RENDER_ALLOW),
drivers/gpu/drm/drm_vblank.c +0 -82

88 lines not on this page · raw message

Signature · 1 line
2.42.1
Acked-by on v1 9/14
#18 lore raw

Re: [PATCH 09/14] drm: Remove the legacy DRM_IOCTL_MODESET_CTL ioctl

Quoted 14 lines · Thomas Zimmermann

DRM drivers with user-space mode setting have been removed in Linux v6.3. [1] Now remove the ioctl entry points for these drivers. Invoking any of the ioctl ops will unconditionally return -EINVAL to user space.

Invoking DRM_IOCTL_MODESET_CTL is different from the other legacy ioctl ops as it returns 0 even without CONFIG_DRM_LEGACY set. From the original commit 29935554b384 ("drm: Disallow DRM_IOCTL_MODESET_CTL for KMS drivers") it is not apparent how or why the operation differs from the others. It is likely just an oversight in commit 61ae227032e7 ("drm: allow removal of legacy codepaths (v4.1)"), which allowed disabling leagacy ioctls in the first place. Still keep this removal separate from the other ioctls to allow an easy revert, if necessary.

Quoted 2 lines
Quoted 128 lines
---
 drivers/gpu/drm/drm_internal.h |  2 -
 drivers/gpu/drm/drm_ioctl.c    |  2 -
 drivers/gpu/drm/drm_vblank.c   | 82 ----------------------------------
 3 files changed, 86 deletions(-)
drivers/gpu/drm/drm_internal.h +0 -2
index b12c463bc4605..a538a48c7d952 100644
@@ -117,8 +117,6 @@ void drm_handle_vblank_works(struct drm_vblank_crtc *vblank);
 /* IOCTLS */
 int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
                          struct drm_file *filp);
-int drm_legacy_modeset_ctl_ioctl(struct drm_device *dev, void *data,
-                                struct drm_file *file_priv);
 
 /* drm_irq.c */
 
drivers/gpu/drm/drm_ioctl.c +0 -2
index e6c32f76c7452..9c6326b908e74 100644
@@ -585,8 +585,6 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 
        DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, DRM_UNLOCKED),
 
-       DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_legacy_modeset_ctl_ioctl, 0),
-
        DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
        DRM_IOCTL_DEF(DRM_IOCTL_GEM_CLOSE, drm_gem_close_ioctl, DRM_RENDER_ALLOW),
drivers/gpu/drm/drm_vblank.c +0 -83
index 877e2067534fa..a11f164b2384f 100644
@@ -1574,88 +1574,6 @@ void drm_crtc_vblank_restore(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_crtc_vblank_restore);
 
-static void drm_legacy_vblank_pre_modeset(struct drm_device *dev,
-                                         unsigned int pipe)
-{
-       struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
-
-       /* vblank is not initialized (IRQ not installed ?), or has been freed */
-       if (!drm_dev_has_vblank(dev))
-               return;
-
-       if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
-               return;
-
-       /*
-        * To avoid all the problems that might happen if interrupts
-        * were enabled/disabled around or between these calls, we just
-        * have the kernel take a reference on the CRTC (just once though
-        * to avoid corrupting the count if multiple, mismatch calls occur),
-        * so that interrupts remain enabled in the interim.
-        */
-       if (!vblank->inmodeset) {
-               vblank->inmodeset = 0x1;
-               if (drm_vblank_get(dev, pipe) == 0)
-                       vblank->inmodeset |= 0x2;
-       }
-}
-
-static void drm_legacy_vblank_post_modeset(struct drm_device *dev,
-                                          unsigned int pipe)
-{
-       struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
-
-       /* vblank is not initialized (IRQ not installed ?), or has been freed */
-       if (!drm_dev_has_vblank(dev))
-               return;
-
-       if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
-               return;
-
-       if (vblank->inmodeset) {
-               spin_lock_irq(&dev->vbl_lock);
-               drm_reset_vblank_timestamp(dev, pipe);
-               spin_unlock_irq(&dev->vbl_lock);
-
-               if (vblank->inmodeset & 0x2)
-                       drm_vblank_put(dev, pipe);
-
-               vblank->inmodeset = 0;
-       }
-}
-
-int drm_legacy_modeset_ctl_ioctl(struct drm_device *dev, void *data,
-                                struct drm_file *file_priv)
-{
-       struct drm_modeset_ctl *modeset = data;
-       unsigned int pipe;
-
-       /* If drm_vblank_init() hasn't been called yet, just no-op */
-       if (!drm_dev_has_vblank(dev))
-               return 0;
-
-       /* KMS drivers handle this internally */
-       if (!drm_core_check_feature(dev, DRIVER_LEGACY))
-               return 0;
-
-       pipe = modeset->crtc;
-       if (pipe >= dev->num_crtcs)
-               return -EINVAL;
-
-       switch (modeset->cmd) {
-       case _DRM_PRE_MODESET:
-               drm_legacy_vblank_pre_modeset(dev, pipe);
-               break;
-       case _DRM_POST_MODESET:
-               drm_legacy_vblank_post_modeset(dev, pipe);
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
 static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
                                  u64 req_seq,
                                  union drm_wait_vblank *vblwait,
--

2.42.1

author maintainer
#19 lore raw

PATCH 10/14 drm: Remove support for legacy drivers

In reply to Thomas Zimmermann

Remove all hooks and calls into code for user-space mode setting from the DRM core. Without the drivers and ioctl entry points, none of this is required any longer.

---
 drivers/gpu/drm/drm_auth.c   |  8 +----
 drivers/gpu/drm/drm_drv.c    | 17 ----------
 drivers/gpu/drm/drm_file.c   | 64 ++----------------------------------
 drivers/gpu/drm/drm_vblank.c | 19 -----------
 4 files changed, 3 insertions(+), 105 deletions(-)
drivers/gpu/drm/drm_auth.c +1 -7
index 2ed2585ded378..252c105d614ff 100644
@@ -37,13 +37,12 @@
 #include <drm/drm_print.h>
 
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 /**
  * DOC: master and authentication
  *
  * &struct drm_master is used to track groups of clients with open
- * primary/legacy device nodes. For every &struct drm_file which has had at
+ * primary device nodes. For every &struct drm_file which has had at
  * least once successfully became the device master (either through the
  * SET_MASTER IOCTL, or implicitly through opening the primary device node when
  * no one else is the current master that time) there exists one &drm_master.
@@ -139,7 +138,6 @@ struct drm_master *drm_master_create(struct drm_device *dev)
 		return NULL;
 
 	kref_init(&master->refcount);
-	drm_master_legacy_init(master);
 	idr_init_base(&master->magic_map, 1);
 	master->dev = dev;
 
@@ -365,8 +363,6 @@ void drm_master_release(struct drm_file *file_priv)
 	if (!drm_is_current_master_locked(file_priv))
 		goto out;
 
-	drm_legacy_lock_master_cleanup(dev, master);
-
 	if (dev->master == file_priv->master)
 		drm_drop_master(dev, file_priv);
 out:
@@ -429,8 +425,6 @@ static void drm_master_destroy(struct kref *kref)
 	if (drm_core_check_feature(dev, DRIVER_MODESET))
 		drm_lease_destroy(master);
 
-	drm_legacy_master_rmmaps(dev, master);
-
 	idr_destroy(&master->magic_map);
 	idr_destroy(&master->leases);
 	idr_destroy(&master->lessee_idr);
drivers/gpu/drm/drm_drv.c +0 -17
index 535f16e7882e7..979366e68dbb8 100644
@@ -48,7 +48,6 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 MODULE_AUTHOR("Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl");
 MODULE_DESCRIPTION("DRM shared core routines");
@@ -585,8 +584,6 @@ static void drm_fs_inode_free(struct inode *inode)
 
 static void drm_dev_init_release(struct drm_device *dev, void *res)
 {
-	drm_legacy_ctxbitmap_cleanup(dev);
-	drm_legacy_remove_map_hash(dev);
 	drm_fs_inode_free(dev->anon_inode);
 
 	put_device(dev->dev);
@@ -597,7 +594,6 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
 	mutex_destroy(&dev->clientlist_mutex);
 	mutex_destroy(&dev->filelist_mutex);
 	mutex_destroy(&dev->struct_mutex);
-	drm_legacy_destroy_members(dev);
 }
 
 static int drm_dev_init(struct drm_device *dev,
@@ -632,7 +628,6 @@ static int drm_dev_init(struct drm_device *dev,
 		return -EINVAL;
 	}
 
-	drm_legacy_init_members(dev);
 	INIT_LIST_HEAD(&dev->filelist);
 	INIT_LIST_HEAD(&dev->filelist_internal);
 	INIT_LIST_HEAD(&dev->clientlist);
@@ -673,12 +668,6 @@ static int drm_dev_init(struct drm_device *dev,
 			goto err;
 	}
 
-	ret = drm_legacy_create_map_hash(dev);
-	if (ret)
-		goto err;
-
-	drm_legacy_ctxbitmap_init(dev);
-
 	if (drm_core_check_feature(dev, DRIVER_GEM)) {
 		ret = drm_gem_init(dev);
 		if (ret) {
@@ -990,9 +979,6 @@ EXPORT_SYMBOL(drm_dev_register);
  */
 void drm_dev_unregister(struct drm_device *dev)
 {
-	if (drm_core_check_feature(dev, DRIVER_LEGACY))
-		drm_lastclose(dev);
-
 	dev->registered = false;
 
 	drm_client_dev_unregister(dev);
@@ -1003,9 +989,6 @@ void drm_dev_unregister(struct drm_device *dev)
 	if (dev->driver->unload)
 		dev->driver->unload(dev);
 
-	drm_legacy_pci_agp_destroy(dev);
-	drm_legacy_rmmaps(dev);
-
 	remove_compat_control_link(dev);
 	drm_minor_unregister(dev, DRM_MINOR_ACCEL);
 	drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
drivers/gpu/drm/drm_file.c +2 -62

124 lines not on this page · raw message

drivers/gpu/drm/drm_vblank.c +0 -19
index a11f164b2384f..702a12bc93bd9 100644
@@ -210,11 +210,6 @@ static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 		if (crtc->funcs->get_vblank_counter)
 			return crtc->funcs->get_vblank_counter(crtc);
 	}
-#ifdef CONFIG_DRM_LEGACY
-	else if (dev->driver->get_vblank_counter) {
-		return dev->driver->get_vblank_counter(dev, pipe);
-	}
-#endif
 
 	return drm_vblank_no_hw_counter(dev, pipe);
 }
@@ -433,11 +428,6 @@ static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
 		if (crtc->funcs->disable_vblank)
 			crtc->funcs->disable_vblank(crtc);
 	}
-#ifdef CONFIG_DRM_LEGACY
-	else {
-		dev->driver->disable_vblank(dev, pipe);
-	}
-#endif
 }
 
 /*
@@ -1151,11 +1141,6 @@ static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
 		if (crtc->funcs->enable_vblank)
 			return crtc->funcs->enable_vblank(crtc);
 	}
-#ifdef CONFIG_DRM_LEGACY
-	else if (dev->driver->enable_vblank) {
-		return dev->driver->enable_vblank(dev, pipe);
-	}
-#endif
 
 	return -EINVAL;
 }
@@ -1698,10 +1683,6 @@ static void drm_wait_vblank_reply(struct drm_device *dev, unsigned int pipe,
 
 static bool drm_wait_vblank_supported(struct drm_device *dev)
 {
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-	if (unlikely(drm_core_check_feature(dev, DRIVER_LEGACY)))
-		return dev->irq_enabled;
-#endif
 	return drm_dev_has_vblank(dev);
 }
 
Signature · 1 line
2.42.1
Acked-by on v1 10/14
#20 lore raw

Re: [PATCH 10/14] drm: Remove support for legacy drivers

Quoted 6 lines · Thomas Zimmermann

Remove all hooks and calls into code for user-space mode setting from the DRM core. Without the drivers and ioctl entry points, none of this is required any longer.

Quoted 313 lines
---
 drivers/gpu/drm/drm_auth.c   |  8 +----
 drivers/gpu/drm/drm_drv.c    | 17 ----------
 drivers/gpu/drm/drm_file.c   | 64 ++----------------------------------
 drivers/gpu/drm/drm_vblank.c | 19 -----------
 4 files changed, 3 insertions(+), 105 deletions(-)
drivers/gpu/drm/drm_auth.c +1 -7
index 2ed2585ded378..252c105d614ff 100644
@@ -37,13 +37,12 @@
 #include <drm/drm_print.h>
 
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 /**
  * DOC: master and authentication
  *
  * &struct drm_master is used to track groups of clients with open
- * primary/legacy device nodes. For every &struct drm_file which has had at
+ * primary device nodes. For every &struct drm_file which has had at
  * least once successfully became the device master (either through the
  * SET_MASTER IOCTL, or implicitly through opening the primary device node when
  * no one else is the current master that time) there exists one &drm_master.
@@ -139,7 +138,6 @@ struct drm_master *drm_master_create(struct drm_device *dev)
                return NULL;
 
        kref_init(&master->refcount);
-       drm_master_legacy_init(master);
        idr_init_base(&master->magic_map, 1);
        master->dev = dev;
 
@@ -365,8 +363,6 @@ void drm_master_release(struct drm_file *file_priv)
        if (!drm_is_current_master_locked(file_priv))
                goto out;
 
-       drm_legacy_lock_master_cleanup(dev, master);
-
        if (dev->master == file_priv->master)
                drm_drop_master(dev, file_priv);
 out:
@@ -429,8 +425,6 @@ static void drm_master_destroy(struct kref *kref)
        if (drm_core_check_feature(dev, DRIVER_MODESET))
                drm_lease_destroy(master);
 
-       drm_legacy_master_rmmaps(dev, master);
-
        idr_destroy(&master->magic_map);
        idr_destroy(&master->leases);
        idr_destroy(&master->lessee_idr);
drivers/gpu/drm/drm_drv.c +0 -17
index 535f16e7882e7..979366e68dbb8 100644
@@ -48,7 +48,6 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 MODULE_AUTHOR("Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl");
 MODULE_DESCRIPTION("DRM shared core routines");
@@ -585,8 +584,6 @@ static void drm_fs_inode_free(struct inode *inode)
 
 static void drm_dev_init_release(struct drm_device *dev, void *res)
 {
-       drm_legacy_ctxbitmap_cleanup(dev);
-       drm_legacy_remove_map_hash(dev);
        drm_fs_inode_free(dev->anon_inode);
 
        put_device(dev->dev);
@@ -597,7 +594,6 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
        mutex_destroy(&dev->clientlist_mutex);
        mutex_destroy(&dev->filelist_mutex);
        mutex_destroy(&dev->struct_mutex);
-       drm_legacy_destroy_members(dev);
 }
 
 static int drm_dev_init(struct drm_device *dev,
@@ -632,7 +628,6 @@ static int drm_dev_init(struct drm_device *dev,
                return -EINVAL;
        }
 
-       drm_legacy_init_members(dev);
        INIT_LIST_HEAD(&dev->filelist);
        INIT_LIST_HEAD(&dev->filelist_internal);
        INIT_LIST_HEAD(&dev->clientlist);
@@ -673,12 +668,6 @@ static int drm_dev_init(struct drm_device *dev,
                        goto err;
        }
 
-       ret = drm_legacy_create_map_hash(dev);
-       if (ret)
-               goto err;
-
-       drm_legacy_ctxbitmap_init(dev);
-
        if (drm_core_check_feature(dev, DRIVER_GEM)) {
                ret = drm_gem_init(dev);
                if (ret) {
@@ -990,9 +979,6 @@ EXPORT_SYMBOL(drm_dev_register);
  */
 void drm_dev_unregister(struct drm_device *dev)
 {
-       if (drm_core_check_feature(dev, DRIVER_LEGACY))
-               drm_lastclose(dev);
-
        dev->registered = false;
 
        drm_client_dev_unregister(dev);
@@ -1003,9 +989,6 @@ void drm_dev_unregister(struct drm_device *dev)
        if (dev->driver->unload)
                dev->driver->unload(dev);
 
-       drm_legacy_pci_agp_destroy(dev);
-       drm_legacy_rmmaps(dev);
-
        remove_compat_control_link(dev);
        drm_minor_unregister(dev, DRM_MINOR_ACCEL);
        drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
drivers/gpu/drm/drm_file.c +2 -62
index 5ddaffd325865..987c1a5d1773b 100644
@@ -47,21 +47,12 @@
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
-#include "drm_legacy.h"
 
 /* from BKL pushdown */
 DEFINE_MUTEX(drm_global_mutex);
 
 bool drm_dev_needs_global_mutex(struct drm_device *dev)
 {
-       /*
-        * Legacy drivers rely on all kinds of BKL locking semantics, don't
-        * bother. They also still need BKL locking for their ioctls, so better
-        * safe than sorry.
-        */
-       if (drm_core_check_feature(dev, DRIVER_LEGACY))
-               return true;
-
        /*
         * The deprecated ->load callback must be called after the driver is
         * already registered. This means such drivers rely on the BKL to make
@@ -107,9 +98,7 @@ bool drm_dev_needs_global_mutex(struct drm_device *dev)
  * drm_send_event() as the main starting points.
  *
  * The memory mapping implementation will vary depending on how the driver
- * manages memory. Legacy drivers will use the deprecated drm_legacy_mmap()
- * function, modern drivers should use one of the provided memory-manager
- * specific implementations. For GEM-based drivers this is drm_gem_mmap().
+ * manages memory. For GEM-based drivers this is drm_gem_mmap().
  *
  * No other file operations are supported by the DRM userspace API. Overall the
  * following is an example &file_operations structure::
@@ -254,18 +243,6 @@ void drm_file_free(struct drm_file *file)
                     (long)old_encode_dev(file->minor->kdev->devt),
                     atomic_read(&dev->open_count));
 
-#ifdef CONFIG_DRM_LEGACY
-       if (drm_core_check_feature(dev, DRIVER_LEGACY) &&
-           dev->driver->preclose)
-               dev->driver->preclose(dev, file);
-#endif
-
-       if (drm_core_check_feature(dev, DRIVER_LEGACY))
-               drm_legacy_lock_release(dev, file->filp);
-
-       if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
-               drm_legacy_reclaim_buffers(dev, file);
-
        drm_events_release(file);
 
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
@@ -279,8 +256,6 @@ void drm_file_free(struct drm_file *file)
        if (drm_core_check_feature(dev, DRIVER_GEM))
                drm_gem_release(dev, file);
 
-       drm_legacy_ctxbitmap_flush(dev, file);
-
        if (drm_is_primary_client(file))
                drm_master_release(file);
 
@@ -367,29 +342,6 @@ int drm_open_helper(struct file *filp, struct drm_minor *minor)
        list_add(&priv->lhead, &dev->filelist);
        mutex_unlock(&dev->filelist_mutex);
 
-#ifdef CONFIG_DRM_LEGACY
-#ifdef __alpha__
-       /*
-        * Default the hose
-        */
-       if (!dev->hose) {
-               struct pci_dev *pci_dev;
-
-               pci_dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, NULL);
-               if (pci_dev) {
-                       dev->hose = pci_dev->sysdata;
-                       pci_dev_put(pci_dev);
-               }
-               if (!dev->hose) {
-                       struct pci_bus *b = list_entry(pci_root_buses.next,
-                               struct pci_bus, node);
-                       if (b)
-                               dev->hose = b->sysdata;
-               }
-       }
-#endif
-#endif
-
        return 0;
 }
 
@@ -411,7 +363,6 @@ int drm_open(struct inode *inode, struct file *filp)
        struct drm_device *dev;
        struct drm_minor *minor;
        int retcode;
-       int need_setup = 0;
 
        minor = drm_minor_acquire(iminor(inode));
        if (IS_ERR(minor))
@@ -421,8 +372,7 @@ int drm_open(struct inode *inode, struct file *filp)
        if (drm_dev_needs_global_mutex(dev))
                mutex_lock(&drm_global_mutex);
 
-       if (!atomic_fetch_inc(&dev->open_count))
-               need_setup = 1;
+       atomic_fetch_inc(&dev->open_count);
 
        /* share address_space across all char-devs of a single device */
        filp->f_mapping = dev->anon_inode->i_mapping;
@@ -430,13 +380,6 @@ int drm_open(struct inode *inode, struct file *filp)
        retcode = drm_open_helper(filp, minor);
        if (retcode)
                goto err_undo;
-       if (need_setup) {
-               retcode = drm_legacy_setup(dev);
-               if (retcode) {
-                       drm_close_helper(filp);
-                       goto err_undo;
-               }
-       }
 
        if (drm_dev_needs_global_mutex(dev))
                mutex_unlock(&drm_global_mutex);
@@ -460,9 +403,6 @@ void drm_lastclose(struct drm_device * dev)
                dev->driver->lastclose(dev);
        drm_dbg_core(dev, "driver lastclose completed\n");
 
-       if (drm_core_check_feature(dev, DRIVER_LEGACY))
-               drm_legacy_dev_reinit(dev);
-
        drm_client_dev_restore(dev);
 }
 
drivers/gpu/drm/drm_vblank.c +0 -20
index a11f164b2384f..702a12bc93bd9 100644
@@ -210,11 +210,6 @@ static u32 __get_vblank_counter(struct drm_device *dev, unsigned int pipe)
                if (crtc->funcs->get_vblank_counter)
                        return crtc->funcs->get_vblank_counter(crtc);
        }
-#ifdef CONFIG_DRM_LEGACY
-       else if (dev->driver->get_vblank_counter) {
-               return dev->driver->get_vblank_counter(dev, pipe);
-       }
-#endif
 
        return drm_vblank_no_hw_counter(dev, pipe);
 }
@@ -433,11 +428,6 @@ static void __disable_vblank(struct drm_device *dev, unsigned int pipe)
                if (crtc->funcs->disable_vblank)
                        crtc->funcs->disable_vblank(crtc);
        }
-#ifdef CONFIG_DRM_LEGACY
-       else {
-               dev->driver->disable_vblank(dev, pipe);
-       }
-#endif
 }
 
 /*
@@ -1151,11 +1141,6 @@ static int __enable_vblank(struct drm_device *dev, unsigned int pipe)
                if (crtc->funcs->enable_vblank)
                        return crtc->funcs->enable_vblank(crtc);
        }
-#ifdef CONFIG_DRM_LEGACY
-       else if (dev->driver->enable_vblank) {
-               return dev->driver->enable_vblank(dev, pipe);
-       }
-#endif
 
        return -EINVAL;
 }
@@ -1698,10 +1683,6 @@ static void drm_wait_vblank_reply(struct drm_device *dev, unsigned int pipe,
 
 static bool drm_wait_vblank_supported(struct drm_device *dev)
 {
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-       if (unlikely(drm_core_check_feature(dev, DRIVER_LEGACY)))
-               return dev->irq_enabled;
-#endif
        return drm_dev_has_vblank(dev);
 }
 
--

2.42.1

author maintainer
#21 lore raw

PATCH 11/14 drm: Remove locking for legacy ioctls and DRM_UNLOCKED

In reply to Thomas Zimmermann

Modern DRM drivers acquire ioctl locks by themselves. Legacy ioctls for user-space mode setting used to acquire drm_global_mutex. After removing the ioctl entry points, also remove the locking code. The only legacy ioctl without global locking was VBLANK_WAIT, which has been removed as well. Hence remove the related DRM_UNLOCKED flag.

---
 drivers/gpu/drm/drm_ioc32.c |  2 +-
 drivers/gpu/drm/drm_ioctl.c | 23 +++++++----------------
 include/drm/drm_ioctl.h     | 11 -----------
 3 files changed, 8 insertions(+), 28 deletions(-)
drivers/gpu/drm/drm_ioc32.c +1 -1
index 910cadf14756e..129e2b91dbfe7 100644
@@ -273,7 +273,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
 	req.request.type = req32.request.type;
 	req.request.sequence = req32.request.sequence;
 	req.request.signal = req32.request.signal;
-	err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, DRM_UNLOCKED);
+	err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, 0);
 
 	req32.reply.type = req.reply.type;
 	req32.reply.sequence = req.reply.sequence;
drivers/gpu/drm/drm_ioctl.c +7 -16
index 9c6326b908e74..1cf1de342d6aa 100644
@@ -583,7 +583,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 
 	DRM_IOCTL_DEF(DRM_IOCTL_FINISH, drm_noop, DRM_AUTH),
 
-	DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, DRM_UNLOCKED),
+	DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, 0),
 
 	DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
@@ -716,7 +716,7 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
 {
 	struct drm_file *file_priv = file->private_data;
 	struct drm_device *dev = file_priv->minor->dev;
-	int retcode;
+	int ret;
 
 	/* Update drm_file owner if fd was passed along. */
 	drm_file_update_pid(file_priv);
@@ -724,20 +724,11 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
 	if (drm_dev_is_unplugged(dev))
 		return -ENODEV;
 
-	retcode = drm_ioctl_permit(flags, file_priv);
-	if (unlikely(retcode))
-		return retcode;
-
-	/* Enforce sane locking for modern driver ioctls. */
-	if (likely(!drm_core_check_feature(dev, DRIVER_LEGACY)) ||
-	    (flags & DRM_UNLOCKED))
-		retcode = func(dev, kdata, file_priv);
-	else {
-		mutex_lock(&drm_global_mutex);
-		retcode = func(dev, kdata, file_priv);
-		mutex_unlock(&drm_global_mutex);
-	}
-	return retcode;
+	ret = drm_ioctl_permit(flags, file_priv);
+	if (unlikely(ret))
+		return ret;
+
+	return func(dev, kdata, file_priv);
 }
 EXPORT_SYMBOL(drm_ioctl_kernel);
 
include/drm/drm_ioctl.h +0 -11
index 6ed61c371f6ce..171760b6c4a14 100644
@@ -109,17 +109,6 @@ enum drm_ioctl_flags {
 	 * This is equivalent to callers with the SYSADMIN capability.
 	 */
 	DRM_ROOT_ONLY		= BIT(2),
-	/**
-	 * @DRM_UNLOCKED:
-	 *
-	 * Whether &drm_ioctl_desc.func should be called with the DRM BKL held
-	 * or not. Enforced as the default for all modern drivers, hence there
-	 * should never be a need to set this flag.
-	 *
-	 * Do not use anywhere else than for the VBLANK_WAIT IOCTL, which is the
-	 * only legacy IOCTL which needs this.
-	 */
-	DRM_UNLOCKED		= BIT(4),
 	/**
 	 * @DRM_RENDER_ALLOW:
 	 *
Signature · 1 line
2.42.1
Acked-by on v1 11/14
#22 lore raw

Re: [PATCH 11/14] drm: Remove locking for legacy ioctls and DRM_UNLOCKED

Quoted 8 lines · Thomas Zimmermann

Modern DRM drivers acquire ioctl locks by themselves. Legacy ioctls for user-space mode setting used to acquire drm_global_mutex. After removing the ioctl entry points, also remove the locking code. The only legacy ioctl without global locking was VBLANK_WAIT, which has been removed as well. Hence remove the related DRM_UNLOCKED flag.

Quoted 92 lines
---
 drivers/gpu/drm/drm_ioc32.c |  2 +-
 drivers/gpu/drm/drm_ioctl.c | 23 +++++++----------------
 include/drm/drm_ioctl.h     | 11 -----------
 3 files changed, 8 insertions(+), 28 deletions(-)
drivers/gpu/drm/drm_ioc32.c +1 -1
index 910cadf14756e..129e2b91dbfe7 100644
@@ -273,7 +273,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
        req.request.type = req32.request.type;
        req.request.sequence = req32.request.sequence;
        req.request.signal = req32.request.signal;
-       err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, DRM_UNLOCKED);
+       err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, 0);
 
        req32.reply.type = req.reply.type;
        req32.reply.sequence = req.reply.sequence;
drivers/gpu/drm/drm_ioctl.c +7 -16
index 9c6326b908e74..1cf1de342d6aa 100644
@@ -583,7 +583,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 
        DRM_IOCTL_DEF(DRM_IOCTL_FINISH, drm_noop, DRM_AUTH),
 
-       DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, DRM_UNLOCKED),
+       DRM_IOCTL_DEF(DRM_IOCTL_WAIT_VBLANK, drm_wait_vblank_ioctl, 0),
 
        DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
 
@@ -716,7 +716,7 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
 {
        struct drm_file *file_priv = file->private_data;
        struct drm_device *dev = file_priv->minor->dev;
-       int retcode;
+       int ret;
 
        /* Update drm_file owner if fd was passed along. */
        drm_file_update_pid(file_priv);
@@ -724,20 +724,11 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
        if (drm_dev_is_unplugged(dev))
                return -ENODEV;
 
-       retcode = drm_ioctl_permit(flags, file_priv);
-       if (unlikely(retcode))
-               return retcode;
-
-       /* Enforce sane locking for modern driver ioctls. */
-       if (likely(!drm_core_check_feature(dev, DRIVER_LEGACY)) ||
-           (flags & DRM_UNLOCKED))
-               retcode = func(dev, kdata, file_priv);
-       else {
-               mutex_lock(&drm_global_mutex);
-               retcode = func(dev, kdata, file_priv);
-               mutex_unlock(&drm_global_mutex);
-       }
-       return retcode;
+       ret = drm_ioctl_permit(flags, file_priv);
+       if (unlikely(ret))
+               return ret;
+
+       return func(dev, kdata, file_priv);
 }
 EXPORT_SYMBOL(drm_ioctl_kernel);
 
include/drm/drm_ioctl.h +0 -12
index 6ed61c371f6ce..171760b6c4a14 100644
@@ -109,17 +109,6 @@ enum drm_ioctl_flags {
         * This is equivalent to callers with the SYSADMIN capability.
         */
        DRM_ROOT_ONLY           = BIT(2),
-       /**
-        * @DRM_UNLOCKED:
-        *
-        * Whether &drm_ioctl_desc.func should be called with the DRM BKL held
-        * or not. Enforced as the default for all modern drivers, hence there
-        * should never be a need to set this flag.
-        *
-        * Do not use anywhere else than for the VBLANK_WAIT IOCTL, which is the
-        * only legacy IOCTL which needs this.
-        */
-       DRM_UNLOCKED            = BIT(4),
        /**
         * @DRM_RENDER_ALLOW:
         *
--

2.42.1

author maintainer
#23 lore raw

PATCH 12/14 drm: Remove source code for non-KMS drivers

In reply to Thomas Zimmermann

Remove all remaining source code for non-KMS drivers. These drivers have been removed in v6.3 and won't comeback.

---
 drivers/gpu/drm/Makefile          |   12 -
 drivers/gpu/drm/drm_agpsupport.c  |  451 --------
 drivers/gpu/drm/drm_bufs.c        | 1627 -----------------------------
 drivers/gpu/drm/drm_context.c     |  513 ---------
 drivers/gpu/drm/drm_dma.c         |  178 ----
 drivers/gpu/drm/drm_hashtab.c     |  203 ----
 drivers/gpu/drm/drm_internal.h    |    5 -
 drivers/gpu/drm/drm_irq.c         |  204 ----
 drivers/gpu/drm/drm_legacy.h      |  290 -----
 drivers/gpu/drm/drm_legacy_misc.c |  105 --
 drivers/gpu/drm/drm_lock.c        |  373 -------
 drivers/gpu/drm/drm_memory.c      |  138 ---
 drivers/gpu/drm/drm_pci.c         |  203 ----
 drivers/gpu/drm/drm_scatter.c     |  220 ----
 drivers/gpu/drm/drm_vm.c          |  665 ------------
 include/drm/drm_auth.h            |   22 -
 include/drm/drm_device.h          |   71 +-
 include/drm/drm_drv.h             |   19 -
 include/drm/drm_file.h            |    5 -
 include/drm/drm_legacy.h          |  331 ------
 20 files changed, 2 insertions(+), 5633 deletions(-)
 delete mode 100644 drivers/gpu/drm/drm_agpsupport.c
 delete mode 100644 drivers/gpu/drm/drm_bufs.c
 delete mode 100644 drivers/gpu/drm/drm_context.c
 delete mode 100644 drivers/gpu/drm/drm_dma.c
 delete mode 100644 drivers/gpu/drm/drm_hashtab.c
 delete mode 100644 drivers/gpu/drm/drm_irq.c
 delete mode 100644 drivers/gpu/drm/drm_legacy.h
 delete mode 100644 drivers/gpu/drm/drm_legacy_misc.c
 delete mode 100644 drivers/gpu/drm/drm_lock.c
 delete mode 100644 drivers/gpu/drm/drm_memory.c
 delete mode 100644 drivers/gpu/drm/drm_scatter.c
 delete mode 100644 drivers/gpu/drm/drm_vm.c
 delete mode 100644 include/drm/drm_legacy.h
drivers/gpu/drm/Makefile +0 -12
index cdbe91ac0bfc8..1b5f3d8bd443f 100644
@@ -47,18 +47,6 @@ drm-y := \
 	drm_vblank_work.o \
 	drm_vma_manager.o \
 	drm_writeback.o
-drm-$(CONFIG_DRM_LEGACY) += \
-	drm_agpsupport.o \
-	drm_bufs.o \
-	drm_context.o \
-	drm_dma.o \
-	drm_hashtab.o \
-	drm_irq.o \
-	drm_legacy_misc.o \
-	drm_lock.o \
-	drm_memory.o \
-	drm_scatter.o \
-	drm_vm.o
 drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drivers/gpu/drm/drm_agpsupport.c deleted +0 -451

451 lines not on this page · raw message

drivers/gpu/drm/drm_bufs.c deleted +0 -1627

1,627 lines not on this page · raw message

drivers/gpu/drm/drm_context.c deleted +0 -513

513 lines not on this page · raw message

drivers/gpu/drm/drm_dma.c deleted +0 -178

178 lines not on this page · raw message

drivers/gpu/drm/drm_hashtab.c deleted +0 -203

203 lines not on this page · raw message

drivers/gpu/drm/drm_internal.h +0 -5
index a538a48c7d952..abeb51092e184 100644
@@ -121,11 +121,6 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
 /* drm_irq.c */
 
 /* IOCTLS */
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-int drm_legacy_irq_control(struct drm_device *dev, void *data,
-			   struct drm_file *file_priv);
-#endif
-
 int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
 				struct drm_file *filp);
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/drm_irq.c deleted +0 -204

204 lines not on this page · raw message

drivers/gpu/drm/drm_legacy.h deleted +0 -290

290 lines not on this page · raw message

drivers/gpu/drm/drm_legacy_misc.c deleted +0 -105

105 lines not on this page · raw message

drivers/gpu/drm/drm_lock.c deleted +0 -373

373 lines not on this page · raw message

drivers/gpu/drm/drm_memory.c deleted +0 -138

138 lines not on this page · raw message

drivers/gpu/drm/drm_pci.c +0 -203

203 lines not on this page · raw message

drivers/gpu/drm/drm_scatter.c deleted +0 -220

220 lines not on this page · raw message

drivers/gpu/drm/drm_vm.c deleted +0 -665

665 lines not on this page · raw message

include/drm/drm_auth.h +0 -22
index ba248ca8866f5..50131383ed814 100644

Lines of this file are not shown. View the raw message.

include/drm/drm_device.h +2 -69

71 lines not on this page · raw message

include/drm/drm_drv.h +0 -19
index e2640dc64e081..0bd2298ba7523 100644

Lines of this file are not shown. View the raw message.

include/drm/drm_file.h +0 -5
index e1b5b4282f75d..e7e1860d0a342 100644

Lines of this file are not shown. View the raw message.

include/drm/drm_legacy.h deleted +0 -331

331 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.42.1

Part of the diff is not shown here. View the raw message.

author maintainer
#25 lore raw

PATCH 13/14 char/agp: Remove frontend code

In reply to Thomas Zimmermann

The AGP subsystem supports a user-space interface via /dev/agpgart. It is only enabled with DRM support for mode setting in user space. (i.e., CONFIG_DRM_LEGACY). All of that DRM code has been removed and the option will go away. Hence remove the AGP frontend.

Modern DRM drivers with kernel mode setting handle AGP support internally.

---
 drivers/char/agp/Makefile       |    6 -
 drivers/char/agp/agp.h          |    9 -
 drivers/char/agp/backend.c      |   11 -
 drivers/char/agp/compat_ioctl.c |  291 ---------
 drivers/char/agp/compat_ioctl.h |  106 ---
 drivers/char/agp/frontend.c     | 1068 -------------------------------
 6 files changed, 1491 deletions(-)
 delete mode 100644 drivers/char/agp/compat_ioctl.c
 delete mode 100644 drivers/char/agp/compat_ioctl.h
 delete mode 100644 drivers/char/agp/frontend.c
drivers/char/agp/Makefile +0 -6
index 25834557e4865..43b09cf193bb7 100644
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 agpgart-y := backend.o generic.o isoch.o
 
-ifeq ($(CONFIG_DRM_LEGACY),y)
-agpgart-$(CONFIG_COMPAT)	+= compat_ioctl.o
-agpgart-y			+= frontend.o
-endif
-
-
 obj-$(CONFIG_AGP)		+= agpgart.o
 obj-$(CONFIG_AGP_ALI)		+= ali-agp.o
 obj-$(CONFIG_AGP_ATI)		+= ati-agp.o
drivers/char/agp/agp.h +0 -9
index 8771dcc9b8e2f..5c36ab85f80b7 100644
@@ -185,15 +185,6 @@ void agp_put_bridge(struct agp_bridge_data *bridge);
 int agp_add_bridge(struct agp_bridge_data *bridge);
 void agp_remove_bridge(struct agp_bridge_data *bridge);
 
-/* Frontend routines. */
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-int agp_frontend_initialize(void);
-void agp_frontend_cleanup(void);
-#else
-static inline int agp_frontend_initialize(void) { return 0; }
-static inline void agp_frontend_cleanup(void) {}
-#endif
-
 /* Generic routines. */
 void agp_generic_enable(struct agp_bridge_data *bridge, u32 mode);
 int agp_generic_create_gatt_table(struct agp_bridge_data *bridge);
drivers/char/agp/backend.c +0 -11
index 0e19c600db531..1776afd3ee078 100644
@@ -293,13 +293,6 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
 	}
 
 	if (list_empty(&agp_bridges)) {
-		error = agp_frontend_initialize();
-		if (error) {
-			dev_info(&bridge->dev->dev,
-				 "agp_frontend_initialize() failed\n");
-			goto frontend_err;
-		}
-
 		dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n",
 			 bridge->driver->fetch_size(), bridge->gart_bus_addr);
 
@@ -308,8 +301,6 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
 	list_add(&bridge->list, &agp_bridges);
 	return 0;
 
-frontend_err:
-	agp_backend_cleanup(bridge);
 err_out:
 	module_put(bridge->driver->owner);
 err_put_bridge:
@@ -323,8 +314,6 @@ void agp_remove_bridge(struct agp_bridge_data *bridge)
 {
 	agp_backend_cleanup(bridge);
 	list_del(&bridge->list);
-	if (list_empty(&agp_bridges))
-		agp_frontend_cleanup();
 	module_put(bridge->driver->owner);
 }
 EXPORT_SYMBOL_GPL(agp_remove_bridge);
drivers/char/agp/compat_ioctl.c deleted +0 -291

291 lines not on this page · raw message

drivers/char/agp/compat_ioctl.h deleted +0 -106

106 lines not on this page · raw message

drivers/char/agp/frontend.c deleted +0 -1068

1,068 lines not on this page · raw message

Signature · 1 line
2.42.1
Acked-by on v1 13/14
#26 lore raw

Re: [PATCH 13/14] char/agp: Remove frontend code

Quoted 9 lines · Thomas Zimmermann

The AGP subsystem supports a user-space interface via /dev/agpgart. It is only enabled with DRM support for mode setting in user space. (i.e., CONFIG_DRM_LEGACY). All of that DRM code has been removed and the option will go away. Hence remove the AGP frontend.

Modern DRM drivers with kernel mode setting handle AGP support internally.

Quoted 1,571 lines
---
 drivers/char/agp/Makefile       |    6 -
 drivers/char/agp/agp.h          |    9 -
 drivers/char/agp/backend.c      |   11 -
 drivers/char/agp/compat_ioctl.c |  291 ---------
 drivers/char/agp/compat_ioctl.h |  106 ---
 drivers/char/agp/frontend.c     | 1068 -------------------------------
 6 files changed, 1491 deletions(-)
 delete mode 100644 drivers/char/agp/compat_ioctl.c
 delete mode 100644 drivers/char/agp/compat_ioctl.h
 delete mode 100644 drivers/char/agp/frontend.c
drivers/char/agp/Makefile +0 -6
index 25834557e4865..43b09cf193bb7 100644
@@ -1,12 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 agpgart-y := backend.o generic.o isoch.o
 
-ifeq ($(CONFIG_DRM_LEGACY),y)
-agpgart-$(CONFIG_COMPAT)       += compat_ioctl.o
-agpgart-y                      += frontend.o
-endif
-
-
 obj-$(CONFIG_AGP)              += agpgart.o
 obj-$(CONFIG_AGP_ALI)          += ali-agp.o
 obj-$(CONFIG_AGP_ATI)          += ati-agp.o
drivers/char/agp/agp.h +0 -9
index 8771dcc9b8e2f..5c36ab85f80b7 100644
@@ -185,15 +185,6 @@ void agp_put_bridge(struct agp_bridge_data *bridge);
 int agp_add_bridge(struct agp_bridge_data *bridge);
 void agp_remove_bridge(struct agp_bridge_data *bridge);
 
-/* Frontend routines. */
-#if IS_ENABLED(CONFIG_DRM_LEGACY)
-int agp_frontend_initialize(void);
-void agp_frontend_cleanup(void);
-#else
-static inline int agp_frontend_initialize(void) { return 0; }
-static inline void agp_frontend_cleanup(void) {}
-#endif
-
 /* Generic routines. */
 void agp_generic_enable(struct agp_bridge_data *bridge, u32 mode);
 int agp_generic_create_gatt_table(struct agp_bridge_data *bridge);
drivers/char/agp/backend.c +0 -11
index 0e19c600db531..1776afd3ee078 100644
@@ -293,13 +293,6 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
        }
 
        if (list_empty(&agp_bridges)) {
-               error = agp_frontend_initialize();
-               if (error) {
-                       dev_info(&bridge->dev->dev,
-                                "agp_frontend_initialize() failed\n");
-                       goto frontend_err;
-               }
-
                dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n",
                         bridge->driver->fetch_size(), bridge->gart_bus_addr);
 
@@ -308,8 +301,6 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
        list_add(&bridge->list, &agp_bridges);
        return 0;
 
-frontend_err:
-       agp_backend_cleanup(bridge);
 err_out:
        module_put(bridge->driver->owner);
 err_put_bridge:
@@ -323,8 +314,6 @@ void agp_remove_bridge(struct agp_bridge_data *bridge)
 {
        agp_backend_cleanup(bridge);
        list_del(&bridge->list);
-       if (list_empty(&agp_bridges))
-               agp_frontend_cleanup();
        module_put(bridge->driver->owner);
 }
 EXPORT_SYMBOL_GPL(agp_remove_bridge);
drivers/char/agp/compat_ioctl.c deleted +0 -291
deleted file mode 100644
index 52ffe1706ce05..0000000000000
@@ -1,291 +0,0 @@
-/*
- * AGPGART driver frontend compatibility ioctls
- * Copyright (C) 2004 Silicon Graphics, Inc.
- * Copyright (C) 2002-2003 Dave Jones
- * Copyright (C) 1999 Jeff Hartmann
- * Copyright (C) 1999 Precision Insight, Inc.
- * Copyright (C) 1999 Xi Graphics, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
- * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <linux/fs.h>
-#include <linux/agpgart.h>
-#include <linux/slab.h>
-#include <linux/uaccess.h>
-#include "agp.h"
-#include "compat_ioctl.h"
-
-static int compat_agpioc_info_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_info32 userinfo;
-       struct agp_kern_info kerninfo;
-
-       agp_copy_info(agp_bridge, &kerninfo);
-
-       userinfo.version.major = kerninfo.version.major;
-       userinfo.version.minor = kerninfo.version.minor;
-       userinfo.bridge_id = kerninfo.device->vendor |
-           (kerninfo.device->device << 16);
-       userinfo.agp_mode = kerninfo.mode;
-       userinfo.aper_base = (compat_long_t)kerninfo.aper_base;
-       userinfo.aper_size = kerninfo.aper_size;
-       userinfo.pg_total = userinfo.pg_system = kerninfo.max_memory;
-       userinfo.pg_used = kerninfo.current_memory;
-
-       if (copy_to_user(arg, &userinfo, sizeof(userinfo)))
-               return -EFAULT;
-
-       return 0;
-}
-
-static int compat_agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_region32 ureserve;
-       struct agp_region kreserve;
-       struct agp_client *client;
-       struct agp_file_private *client_priv;
-
-       DBG("");
-       if (copy_from_user(&ureserve, arg, sizeof(ureserve)))
-               return -EFAULT;
-
-       if ((unsigned) ureserve.seg_count >= ~0U/sizeof(struct agp_segment32))
-               return -EFAULT;
-
-       kreserve.pid = ureserve.pid;
-       kreserve.seg_count = ureserve.seg_count;
-
-       client = agp_find_client_by_pid(kreserve.pid);
-
-       if (kreserve.seg_count == 0) {
-               /* remove a client */
-               client_priv = agp_find_private(kreserve.pid);
-
-               if (client_priv != NULL) {
-                       set_bit(AGP_FF_IS_CLIENT, &client_priv->access_flags);
-                       set_bit(AGP_FF_IS_VALID, &client_priv->access_flags);
-               }
-               if (client == NULL) {
-                       /* client is already removed */
-                       return 0;
-               }
-               return agp_remove_client(kreserve.pid);
-       } else {
-               struct agp_segment32 *usegment;
-               struct agp_segment *ksegment;
-               int seg;
-
-               if (ureserve.seg_count >= 16384)
-                       return -EINVAL;
-
-               usegment = kmalloc_array(ureserve.seg_count,
-                                        sizeof(*usegment),
-                                        GFP_KERNEL);
-               if (!usegment)
-                       return -ENOMEM;
-
-               ksegment = kmalloc_array(kreserve.seg_count,
-                                        sizeof(*ksegment),
-                                        GFP_KERNEL);
-               if (!ksegment) {
-                       kfree(usegment);
-                       return -ENOMEM;
-               }
-
-               if (copy_from_user(usegment, (void __user *) ureserve.seg_list,
-                                  sizeof(*usegment) * ureserve.seg_count)) {
-                       kfree(usegment);
-                       kfree(ksegment);
-                       return -EFAULT;
-               }
-
-               for (seg = 0; seg < ureserve.seg_count; seg++) {
-                       ksegment[seg].pg_start = usegment[seg].pg_start;
-                       ksegment[seg].pg_count = usegment[seg].pg_count;
-                       ksegment[seg].prot = usegment[seg].prot;
-               }
-
-               kfree(usegment);
-               kreserve.seg_list = ksegment;
-
-               if (client == NULL) {
-                       /* Create the client and add the segment */
-                       client = agp_create_client(kreserve.pid);
-
-                       if (client == NULL) {
-                               kfree(ksegment);
-                               return -ENOMEM;
-                       }
-                       client_priv = agp_find_private(kreserve.pid);
-
-                       if (client_priv != NULL) {
-                               set_bit(AGP_FF_IS_CLIENT, &client_priv->access_flags);
-                               set_bit(AGP_FF_IS_VALID, &client_priv->access_flags);
-                       }
-               }
-               return agp_create_segment(client, &kreserve);
-       }
-       /* Will never really happen */
-       return -EINVAL;
-}
-
-static int compat_agpioc_allocate_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_memory *memory;
-       struct agp_allocate32 alloc;
-
-       DBG("");
-       if (copy_from_user(&alloc, arg, sizeof(alloc)))
-               return -EFAULT;
-
-       memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type);
-
-       if (memory == NULL)
-               return -ENOMEM;
-
-       alloc.key = memory->key;
-       alloc.physical = memory->physical;
-
-       if (copy_to_user(arg, &alloc, sizeof(alloc))) {
-               agp_free_memory_wrap(memory);
-               return -EFAULT;
-       }
-       return 0;
-}
-
-static int compat_agpioc_bind_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_bind32 bind_info;
-       struct agp_memory *memory;
-
-       DBG("");
-       if (copy_from_user(&bind_info, arg, sizeof(bind_info)))
-               return -EFAULT;
-
-       memory = agp_find_mem_by_key(bind_info.key);
-
-       if (memory == NULL)
-               return -EINVAL;
-
-       return agp_bind_memory(memory, bind_info.pg_start);
-}
-
-static int compat_agpioc_unbind_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_memory *memory;
-       struct agp_unbind32 unbind;
-
-       DBG("");
-       if (copy_from_user(&unbind, arg, sizeof(unbind)))
-               return -EFAULT;
-
-       memory = agp_find_mem_by_key(unbind.key);
-
-       if (memory == NULL)
-               return -EINVAL;
-
-       return agp_unbind_memory(memory);
-}
-
-long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
-       struct agp_file_private *curr_priv = file->private_data;
-       int ret_val = -ENOTTY;
-
-       mutex_lock(&(agp_fe.agp_mutex));
-
-       if ((agp_fe.current_controller == NULL) &&
-           (cmd != AGPIOC_ACQUIRE32)) {
-               ret_val = -EINVAL;
-               goto ioctl_out;
-       }
-       if ((agp_fe.backend_acquired != true) &&
-           (cmd != AGPIOC_ACQUIRE32)) {
-               ret_val = -EBUSY;
-               goto ioctl_out;
-       }
-       if (cmd != AGPIOC_ACQUIRE32) {
-               if (!(test_bit(AGP_FF_IS_CONTROLLER, &curr_priv->access_flags))) {
-                       ret_val = -EPERM;
-                       goto ioctl_out;
-               }
-               /* Use the original pid of the controller,
-                * in case it's threaded */
-
-               if (agp_fe.current_controller->pid != curr_priv->my_pid) {
-                       ret_val = -EBUSY;
-                       goto ioctl_out;
-               }
-       }
-
-       switch (cmd) {
-       case AGPIOC_INFO32:
-               ret_val = compat_agpioc_info_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_ACQUIRE32:
-               ret_val = agpioc_acquire_wrap(curr_priv);
-               break;
-
-       case AGPIOC_RELEASE32:
-               ret_val = agpioc_release_wrap(curr_priv);
-               break;
-
-       case AGPIOC_SETUP32:
-               ret_val = agpioc_setup_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_RESERVE32:
-               ret_val = compat_agpioc_reserve_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_PROTECT32:
-               ret_val = agpioc_protect_wrap(curr_priv);
-               break;
-
-       case AGPIOC_ALLOCATE32:
-               ret_val = compat_agpioc_allocate_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_DEALLOCATE32:
-               ret_val = agpioc_deallocate_wrap(curr_priv, (int) arg);
-               break;
-
-       case AGPIOC_BIND32:
-               ret_val = compat_agpioc_bind_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_UNBIND32:
-               ret_val = compat_agpioc_unbind_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_CHIPSET_FLUSH32:
-               break;
-       }
-
-ioctl_out:
-       DBG("ioctl returns %d\n", ret_val);
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return ret_val;
-}
-
drivers/char/agp/compat_ioctl.h deleted +0 -106
deleted file mode 100644
index f30e0fd979635..0000000000000
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 1999 Jeff Hartmann
- * Copyright (C) 1999 Precision Insight, Inc.
- * Copyright (C) 1999 Xi Graphics, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
- * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#ifndef _AGP_COMPAT_IOCTL_H
-#define _AGP_COMPAT_IOCTL_H
-
-#include <linux/compat.h>
-#include <linux/agpgart.h>
-
-#define AGPIOC_INFO32       _IOR (AGPIOC_BASE, 0, compat_uptr_t)
-#define AGPIOC_ACQUIRE32    _IO  (AGPIOC_BASE, 1)
-#define AGPIOC_RELEASE32    _IO  (AGPIOC_BASE, 2)
-#define AGPIOC_SETUP32      _IOW (AGPIOC_BASE, 3, compat_uptr_t)
-#define AGPIOC_RESERVE32    _IOW (AGPIOC_BASE, 4, compat_uptr_t)
-#define AGPIOC_PROTECT32    _IOW (AGPIOC_BASE, 5, compat_uptr_t)
-#define AGPIOC_ALLOCATE32   _IOWR(AGPIOC_BASE, 6, compat_uptr_t)
-#define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
-#define AGPIOC_BIND32       _IOW (AGPIOC_BASE, 8, compat_uptr_t)
-#define AGPIOC_UNBIND32     _IOW (AGPIOC_BASE, 9, compat_uptr_t)
-#define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)
-
-struct agp_info32 {
-       struct agp_version version;     /* version of the driver        */
-       u32 bridge_id;          /* bridge vendor/device         */
-       u32 agp_mode;           /* mode info of bridge          */
-       compat_long_t aper_base;        /* base of aperture             */
-       compat_size_t aper_size;        /* size of aperture             */
-       compat_size_t pg_total; /* max pages (swap + system)    */
-       compat_size_t pg_system;        /* max pages (system)           */
-       compat_size_t pg_used;          /* current pages used           */
-};
-
-/*
- * The "prot" down below needs still a "sleep" flag somehow ...
- */
-struct agp_segment32 {
-       compat_off_t pg_start;          /* starting page to populate    */
-       compat_size_t pg_count; /* number of pages              */
-       compat_int_t prot;              /* prot flags for mmap          */
-};
-
-struct agp_region32 {
-       compat_pid_t pid;               /* pid of process               */
-       compat_size_t seg_count;        /* number of segments           */
-       struct agp_segment32 *seg_list;
-};
-
-struct agp_allocate32 {
-       compat_int_t key;               /* tag of allocation            */
-       compat_size_t pg_count; /* number of pages              */
-       u32 type;               /* 0 == normal, other devspec   */
-       u32 physical;           /* device specific (some devices
-                                * need a phys address of the
-                                * actual page behind the gatt
-                                * table)                        */
-};
-
-struct agp_bind32 {
-       compat_int_t key;               /* tag of allocation            */
-       compat_off_t pg_start;          /* starting page to populate    */
-};
-
-struct agp_unbind32 {
-       compat_int_t key;               /* tag of allocation            */
-       u32 priority;           /* priority for paging out      */
-};
-
-extern struct agp_front_data agp_fe;
-
-int agpioc_acquire_wrap(struct agp_file_private *priv);
-int agpioc_release_wrap(struct agp_file_private *priv);
-int agpioc_protect_wrap(struct agp_file_private *priv);
-int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
-int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
-struct agp_file_private *agp_find_private(pid_t pid);
-struct agp_client *agp_create_client(pid_t id);
-int agp_remove_client(pid_t id);
-int agp_create_segment(struct agp_client *client, struct agp_region *region);
-void agp_free_memory_wrap(struct agp_memory *memory);
-struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
-struct agp_memory *agp_find_mem_by_key(int key);
-struct agp_client *agp_find_client_by_pid(pid_t id);
-
-#endif /* _AGP_COMPAT_H */
drivers/char/agp/frontend.c deleted +0 -1069
deleted file mode 100644
index 321118a9cfa52..0000000000000
@@ -1,1068 +0,0 @@
-/*
- * AGPGART driver frontend
- * Copyright (C) 2004 Silicon Graphics, Inc.
- * Copyright (C) 2002-2003 Dave Jones
- * Copyright (C) 1999 Jeff Hartmann
- * Copyright (C) 1999 Precision Insight, Inc.
- * Copyright (C) 1999 Xi Graphics, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
- * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/mman.h>
-#include <linux/pci.h>
-#include <linux/miscdevice.h>
-#include <linux/agp_backend.h>
-#include <linux/agpgart.h>
-#include <linux/slab.h>
-#include <linux/mm.h>
-#include <linux/fs.h>
-#include <linux/sched.h>
-#include <linux/uaccess.h>
-
-#include "agp.h"
-#include "compat_ioctl.h"
-
-struct agp_front_data agp_fe;
-
-struct agp_memory *agp_find_mem_by_key(int key)
-{
-       struct agp_memory *curr;
-
-       if (agp_fe.current_controller == NULL)
-               return NULL;
-
-       curr = agp_fe.current_controller->pool;
-
-       while (curr != NULL) {
-               if (curr->key == key)
-                       break;
-               curr = curr->next;
-       }
-
-       DBG("key=%d -> mem=%p", key, curr);
-       return curr;
-}
-
-static void agp_remove_from_pool(struct agp_memory *temp)
-{
-       struct agp_memory *prev;
-       struct agp_memory *next;
-
-       /* Check to see if this is even in the memory pool */
-
-       DBG("mem=%p", temp);
-       if (agp_find_mem_by_key(temp->key) != NULL) {
-               next = temp->next;
-               prev = temp->prev;
-
-               if (prev != NULL) {
-                       prev->next = next;
-                       if (next != NULL)
-                               next->prev = prev;
-
-               } else {
-                       /* This is the first item on the list */
-                       if (next != NULL)
-                               next->prev = NULL;
-
-                       agp_fe.current_controller->pool = next;
-               }
-       }
-}
-
-/*
- * Routines for managing each client's segment list -
- * These routines handle adding and removing segments
- * to each auth'ed client.
- */
-
-static struct
-agp_segment_priv *agp_find_seg_in_client(const struct agp_client *client,
-                                               unsigned long offset,
-                                           int size, pgprot_t page_prot)
-{
-       struct agp_segment_priv *seg;
-       int i;
-       off_t pg_start;
-       size_t pg_count;
-
-       pg_start = offset / 4096;
-       pg_count = size / 4096;
-       seg = *(client->segments);
-
-       for (i = 0; i < client->num_segments; i++) {
-               if ((seg[i].pg_start == pg_start) &&
-                   (seg[i].pg_count == pg_count) &&
-                   (pgprot_val(seg[i].prot) == pgprot_val(page_prot))) {
-                       return seg + i;
-               }
-       }
-
-       return NULL;
-}
-
-static void agp_remove_seg_from_client(struct agp_client *client)
-{
-       DBG("client=%p", client);
-
-       if (client->segments != NULL) {
-               if (*(client->segments) != NULL) {
-                       DBG("Freeing %p from client %p", *(client->segments), client);
-                       kfree(*(client->segments));
-               }
-               DBG("Freeing %p from client %p", client->segments, client);
-               kfree(client->segments);
-               client->segments = NULL;
-       }
-}
-
-static void agp_add_seg_to_client(struct agp_client *client,
-                              struct agp_segment_priv ** seg, int num_segments)
-{
-       struct agp_segment_priv **prev_seg;
-
-       prev_seg = client->segments;
-
-       if (prev_seg != NULL)
-               agp_remove_seg_from_client(client);
-
-       DBG("Adding seg %p (%d segments) to client %p", seg, num_segments, client);
-       client->num_segments = num_segments;
-       client->segments = seg;
-}
-
-static pgprot_t agp_convert_mmap_flags(int prot)
-{
-       unsigned long prot_bits;
-
-       prot_bits = calc_vm_prot_bits(prot, 0) | VM_SHARED;
-       return vm_get_page_prot(prot_bits);
-}
-
-int agp_create_segment(struct agp_client *client, struct agp_region *region)
-{
-       struct agp_segment_priv **ret_seg;
-       struct agp_segment_priv *seg;
-       struct agp_segment *user_seg;
-       size_t i;
-
-       seg = kzalloc((sizeof(struct agp_segment_priv) * region->seg_count), GFP_KERNEL);
-       if (seg == NULL) {
-               kfree(region->seg_list);
-               region->seg_list = NULL;
-               return -ENOMEM;
-       }
-       user_seg = region->seg_list;
-
-       for (i = 0; i < region->seg_count; i++) {
-               seg[i].pg_start = user_seg[i].pg_start;
-               seg[i].pg_count = user_seg[i].pg_count;
-               seg[i].prot = agp_convert_mmap_flags(user_seg[i].prot);
-       }
-       kfree(region->seg_list);
-       region->seg_list = NULL;
-
-       ret_seg = kmalloc(sizeof(void *), GFP_KERNEL);
-       if (ret_seg == NULL) {
-               kfree(seg);
-               return -ENOMEM;
-       }
-       *ret_seg = seg;
-       agp_add_seg_to_client(client, ret_seg, region->seg_count);
-       return 0;
-}
-
-/* End - Routines for managing each client's segment list */
-
-/* This function must only be called when current_controller != NULL */
-static void agp_insert_into_pool(struct agp_memory * temp)
-{
-       struct agp_memory *prev;
-
-       prev = agp_fe.current_controller->pool;
-
-       if (prev != NULL) {
-               prev->prev = temp;
-               temp->next = prev;
-       }
-       agp_fe.current_controller->pool = temp;
-}
-
-
-/* File private list routines */
-
-struct agp_file_private *agp_find_private(pid_t pid)
-{
-       struct agp_file_private *curr;
-
-       curr = agp_fe.file_priv_list;
-
-       while (curr != NULL) {
-               if (curr->my_pid == pid)
-                       return curr;
-               curr = curr->next;
-       }
-
-       return NULL;
-}
-
-static void agp_insert_file_private(struct agp_file_private * priv)
-{
-       struct agp_file_private *prev;
-
-       prev = agp_fe.file_priv_list;
-
-       if (prev != NULL)
-               prev->prev = priv;
-       priv->next = prev;
-       agp_fe.file_priv_list = priv;
-}
-
-static void agp_remove_file_private(struct agp_file_private * priv)
-{
-       struct agp_file_private *next;
-       struct agp_file_private *prev;
-
-       next = priv->next;
-       prev = priv->prev;
-
-       if (prev != NULL) {
-               prev->next = next;
-
-               if (next != NULL)
-                       next->prev = prev;
-
-       } else {
-               if (next != NULL)
-                       next->prev = NULL;
-
-               agp_fe.file_priv_list = next;
-       }
-}
-
-/* End - File flag list routines */
-
-/*
- * Wrappers for agp_free_memory & agp_allocate_memory
- * These make sure that internal lists are kept updated.
- */
-void agp_free_memory_wrap(struct agp_memory *memory)
-{
-       agp_remove_from_pool(memory);
-       agp_free_memory(memory);
-}
-
-struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type)
-{
-       struct agp_memory *memory;
-
-       memory = agp_allocate_memory(agp_bridge, pg_count, type);
-       if (memory == NULL)
-               return NULL;
-
-       agp_insert_into_pool(memory);
-       return memory;
-}
-
-/* Routines for managing the list of controllers -
- * These routines manage the current controller, and the list of
- * controllers
- */
-
-static struct agp_controller *agp_find_controller_by_pid(pid_t id)
-{
-       struct agp_controller *controller;
-
-       controller = agp_fe.controllers;
-
-       while (controller != NULL) {
-               if (controller->pid == id)
-                       return controller;
-               controller = controller->next;
-       }
-
-       return NULL;
-}
-
-static struct agp_controller *agp_create_controller(pid_t id)
-{
-       struct agp_controller *controller;
-
-       controller = kzalloc(sizeof(struct agp_controller), GFP_KERNEL);
-       if (controller == NULL)
-               return NULL;
-
-       controller->pid = id;
-       return controller;
-}
-
-static int agp_insert_controller(struct agp_controller *controller)
-{
-       struct agp_controller *prev_controller;
-
-       prev_controller = agp_fe.controllers;
-       controller->next = prev_controller;
-
-       if (prev_controller != NULL)
-               prev_controller->prev = controller;
-
-       agp_fe.controllers = controller;
-
-       return 0;
-}
-
-static void agp_remove_all_clients(struct agp_controller *controller)
-{
-       struct agp_client *client;
-       struct agp_client *temp;
-
-       client = controller->clients;
-
-       while (client) {
-               struct agp_file_private *priv;
-
-               temp = client;
-               agp_remove_seg_from_client(temp);
-               priv = agp_find_private(temp->pid);
-
-               if (priv != NULL) {
-                       clear_bit(AGP_FF_IS_VALID, &priv->access_flags);
-                       clear_bit(AGP_FF_IS_CLIENT, &priv->access_flags);
-               }
-               client = client->next;
-               kfree(temp);
-       }
-}
-
-static void agp_remove_all_memory(struct agp_controller *controller)
-{
-       struct agp_memory *memory;
-       struct agp_memory *temp;
-
-       memory = controller->pool;
-
-       while (memory) {
-               temp = memory;
-               memory = memory->next;
-               agp_free_memory_wrap(temp);
-       }
-}
-
-static int agp_remove_controller(struct agp_controller *controller)
-{
-       struct agp_controller *prev_controller;
-       struct agp_controller *next_controller;
-
-       prev_controller = controller->prev;
-       next_controller = controller->next;
-
-       if (prev_controller != NULL) {
-               prev_controller->next = next_controller;
-               if (next_controller != NULL)
-                       next_controller->prev = prev_controller;
-
-       } else {
-               if (next_controller != NULL)
-                       next_controller->prev = NULL;
-
-               agp_fe.controllers = next_controller;
-       }
-
-       agp_remove_all_memory(controller);
-       agp_remove_all_clients(controller);
-
-       if (agp_fe.current_controller == controller) {
-               agp_fe.current_controller = NULL;
-               agp_fe.backend_acquired = false;
-               agp_backend_release(agp_bridge);
-       }
-       kfree(controller);
-       return 0;
-}
-
-static void agp_controller_make_current(struct agp_controller *controller)
-{
-       struct agp_client *clients;
-
-       clients = controller->clients;
-
-       while (clients != NULL) {
-               struct agp_file_private *priv;
-
-               priv = agp_find_private(clients->pid);
-
-               if (priv != NULL) {
-                       set_bit(AGP_FF_IS_VALID, &priv->access_flags);
-                       set_bit(AGP_FF_IS_CLIENT, &priv->access_flags);
-               }
-               clients = clients->next;
-       }
-
-       agp_fe.current_controller = controller;
-}
-
-static void agp_controller_release_current(struct agp_controller *controller,
-                                     struct agp_file_private *controller_priv)
-{
-       struct agp_client *clients;
-
-       clear_bit(AGP_FF_IS_VALID, &controller_priv->access_flags);
-       clients = controller->clients;
-
-       while (clients != NULL) {
-               struct agp_file_private *priv;
-
-               priv = agp_find_private(clients->pid);
-
-               if (priv != NULL)
-                       clear_bit(AGP_FF_IS_VALID, &priv->access_flags);
-
-               clients = clients->next;
-       }
-
-       agp_fe.current_controller = NULL;
-       agp_fe.used_by_controller = false;
-       agp_backend_release(agp_bridge);
-}
-
-/*
- * Routines for managing client lists -
- * These routines are for managing the list of auth'ed clients.
- */
-
-static struct agp_client
-*agp_find_client_in_controller(struct agp_controller *controller, pid_t id)
-{
-       struct agp_client *client;
-
-       if (controller == NULL)
-               return NULL;
-
-       client = controller->clients;
-
-       while (client != NULL) {
-               if (client->pid == id)
-                       return client;
-               client = client->next;
-       }
-
-       return NULL;
-}
-
-static struct agp_controller *agp_find_controller_for_client(pid_t id)
-{
-       struct agp_controller *controller;
-
-       controller = agp_fe.controllers;
-
-       while (controller != NULL) {
-               if ((agp_find_client_in_controller(controller, id)) != NULL)
-                       return controller;
-               controller = controller->next;
-       }
-
-       return NULL;
-}
-
-struct agp_client *agp_find_client_by_pid(pid_t id)
-{
-       struct agp_client *temp;
-
-       if (agp_fe.current_controller == NULL)
-               return NULL;
-
-       temp = agp_find_client_in_controller(agp_fe.current_controller, id);
-       return temp;
-}
-
-static void agp_insert_client(struct agp_client *client)
-{
-       struct agp_client *prev_client;
-
-       prev_client = agp_fe.current_controller->clients;
-       client->next = prev_client;
-
-       if (prev_client != NULL)
-               prev_client->prev = client;
-
-       agp_fe.current_controller->clients = client;
-       agp_fe.current_controller->num_clients++;
-}
-
-struct agp_client *agp_create_client(pid_t id)
-{
-       struct agp_client *new_client;
-
-       new_client = kzalloc(sizeof(struct agp_client), GFP_KERNEL);
-       if (new_client == NULL)
-               return NULL;
-
-       new_client->pid = id;
-       agp_insert_client(new_client);
-       return new_client;
-}
-
-int agp_remove_client(pid_t id)
-{
-       struct agp_client *client;
-       struct agp_client *prev_client;
-       struct agp_client *next_client;
-       struct agp_controller *controller;
-
-       controller = agp_find_controller_for_client(id);
-       if (controller == NULL)
-               return -EINVAL;
-
-       client = agp_find_client_in_controller(controller, id);
-       if (client == NULL)
-               return -EINVAL;
-
-       prev_client = client->prev;
-       next_client = client->next;
-
-       if (prev_client != NULL) {
-               prev_client->next = next_client;
-               if (next_client != NULL)
-                       next_client->prev = prev_client;
-
-       } else {
-               if (next_client != NULL)
-                       next_client->prev = NULL;
-               controller->clients = next_client;
-       }
-
-       controller->num_clients--;
-       agp_remove_seg_from_client(client);
-       kfree(client);
-       return 0;
-}
-
-/* End - Routines for managing client lists */
-
-/* File Operations */
-
-static int agp_mmap(struct file *file, struct vm_area_struct *vma)
-{
-       unsigned int size, current_size;
-       unsigned long offset;
-       struct agp_client *client;
-       struct agp_file_private *priv = file->private_data;
-       struct agp_kern_info kerninfo;
-
-       mutex_lock(&(agp_fe.agp_mutex));
-
-       if (agp_fe.backend_acquired != true)
-               goto out_eperm;
-
-       if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags)))
-               goto out_eperm;
-
-       agp_copy_info(agp_bridge, &kerninfo);
-       size = vma->vm_end - vma->vm_start;
-       current_size = kerninfo.aper_size;
-       current_size = current_size * 0x100000;
-       offset = vma->vm_pgoff << PAGE_SHIFT;
-       DBG("%lx:%lx", offset, offset+size);
-
-       if (test_bit(AGP_FF_IS_CLIENT, &priv->access_flags)) {
-               if ((size + offset) > current_size)
-                       goto out_inval;
-
-               client = agp_find_client_by_pid(current->pid);
-
-               if (client == NULL)
-                       goto out_eperm;
-
-               if (!agp_find_seg_in_client(client, offset, size, vma->vm_page_prot))
-                       goto out_inval;
-
-               DBG("client vm_ops=%p", kerninfo.vm_ops);
-               if (kerninfo.vm_ops) {
-                       vma->vm_ops = kerninfo.vm_ops;
-               } else if (io_remap_pfn_range(vma, vma->vm_start,
-                               (kerninfo.aper_base + offset) >> PAGE_SHIFT,
-                               size,
-                               pgprot_writecombine(vma->vm_page_prot))) {
-                       goto out_again;
-               }
-               mutex_unlock(&(agp_fe.agp_mutex));
-               return 0;
-       }
-
-       if (test_bit(AGP_FF_IS_CONTROLLER, &priv->access_flags)) {
-               if (size != current_size)
-                       goto out_inval;
-
-               DBG("controller vm_ops=%p", kerninfo.vm_ops);
-               if (kerninfo.vm_ops) {
-                       vma->vm_ops = kerninfo.vm_ops;
-               } else if (io_remap_pfn_range(vma, vma->vm_start,
-                               kerninfo.aper_base >> PAGE_SHIFT,
-                               size,
-                               pgprot_writecombine(vma->vm_page_prot))) {
-                       goto out_again;
-               }
-               mutex_unlock(&(agp_fe.agp_mutex));
-               return 0;
-       }
-
-out_eperm:
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return -EPERM;
-
-out_inval:
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return -EINVAL;
-
-out_again:
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return -EAGAIN;
-}
-
-static int agp_release(struct inode *inode, struct file *file)
-{
-       struct agp_file_private *priv = file->private_data;
-
-       mutex_lock(&(agp_fe.agp_mutex));
-
-       DBG("priv=%p", priv);
-
-       if (test_bit(AGP_FF_IS_CONTROLLER, &priv->access_flags)) {
-               struct agp_controller *controller;
-
-               controller = agp_find_controller_by_pid(priv->my_pid);
-
-               if (controller != NULL) {
-                       if (controller == agp_fe.current_controller)
-                               agp_controller_release_current(controller, priv);
-                       agp_remove_controller(controller);
-                       controller = NULL;
-               }
-       }
-
-       if (test_bit(AGP_FF_IS_CLIENT, &priv->access_flags))
-               agp_remove_client(priv->my_pid);
-
-       agp_remove_file_private(priv);
-       kfree(priv);
-       file->private_data = NULL;
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return 0;
-}
-
-static int agp_open(struct inode *inode, struct file *file)
-{
-       int minor = iminor(inode);
-       struct agp_file_private *priv;
-       struct agp_client *client;
-
-       if (minor != AGPGART_MINOR)
-               return -ENXIO;
-
-       mutex_lock(&(agp_fe.agp_mutex));
-
-       priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL);
-       if (priv == NULL) {
-               mutex_unlock(&(agp_fe.agp_mutex));
-               return -ENOMEM;
-       }
-
-       set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags);
-       priv->my_pid = current->pid;
-
-       if (capable(CAP_SYS_RAWIO))
-               /* Root priv, can be controller */
-               set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags);
-
-       client = agp_find_client_by_pid(current->pid);
-
-       if (client != NULL) {
-               set_bit(AGP_FF_IS_CLIENT, &priv->access_flags);
-               set_bit(AGP_FF_IS_VALID, &priv->access_flags);
-       }
-       file->private_data = (void *) priv;
-       agp_insert_file_private(priv);
-       DBG("private=%p, client=%p", priv, client);
-
-       mutex_unlock(&(agp_fe.agp_mutex));
-
-       return 0;
-}
-
-static int agpioc_info_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_info userinfo;
-       struct agp_kern_info kerninfo;
-
-       agp_copy_info(agp_bridge, &kerninfo);
-
-       memset(&userinfo, 0, sizeof(userinfo));
-       userinfo.version.major = kerninfo.version.major;
-       userinfo.version.minor = kerninfo.version.minor;
-       userinfo.bridge_id = kerninfo.device->vendor |
-           (kerninfo.device->device << 16);
-       userinfo.agp_mode = kerninfo.mode;
-       userinfo.aper_base = kerninfo.aper_base;
-       userinfo.aper_size = kerninfo.aper_size;
-       userinfo.pg_total = userinfo.pg_system = kerninfo.max_memory;
-       userinfo.pg_used = kerninfo.current_memory;
-
-       if (copy_to_user(arg, &userinfo, sizeof(struct agp_info)))
-               return -EFAULT;
-
-       return 0;
-}
-
-int agpioc_acquire_wrap(struct agp_file_private *priv)
-{
-       struct agp_controller *controller;
-
-       DBG("");
-
-       if (!(test_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags)))
-               return -EPERM;
-
-       if (agp_fe.current_controller != NULL)
-               return -EBUSY;
-
-       if (!agp_bridge)
-               return -ENODEV;
-
-        if (atomic_read(&agp_bridge->agp_in_use))
-                return -EBUSY;
-
-       atomic_inc(&agp_bridge->agp_in_use);
-
-       agp_fe.backend_acquired = true;
-
-       controller = agp_find_controller_by_pid(priv->my_pid);
-
-       if (controller != NULL) {
-               agp_controller_make_current(controller);
-       } else {
-               controller = agp_create_controller(priv->my_pid);
-
-               if (controller == NULL) {
-                       agp_fe.backend_acquired = false;
-                       agp_backend_release(agp_bridge);
-                       return -ENOMEM;
-               }
-               agp_insert_controller(controller);
-               agp_controller_make_current(controller);
-       }
-
-       set_bit(AGP_FF_IS_CONTROLLER, &priv->access_flags);
-       set_bit(AGP_FF_IS_VALID, &priv->access_flags);
-       return 0;
-}
-
-int agpioc_release_wrap(struct agp_file_private *priv)
-{
-       DBG("");
-       agp_controller_release_current(agp_fe.current_controller, priv);
-       return 0;
-}
-
-int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_setup mode;
-
-       DBG("");
-       if (copy_from_user(&mode, arg, sizeof(struct agp_setup)))
-               return -EFAULT;
-
-       agp_enable(agp_bridge, mode.agp_mode);
-       return 0;
-}
-
-static int agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_region reserve;
-       struct agp_client *client;
-       struct agp_file_private *client_priv;
-
-       DBG("");
-       if (copy_from_user(&reserve, arg, sizeof(struct agp_region)))
-               return -EFAULT;
-
-       if ((unsigned) reserve.seg_count >= ~0U/sizeof(struct agp_segment))
-               return -EFAULT;
-
-       client = agp_find_client_by_pid(reserve.pid);
-
-       if (reserve.seg_count == 0) {
-               /* remove a client */
-               client_priv = agp_find_private(reserve.pid);
-
-               if (client_priv != NULL) {
-                       set_bit(AGP_FF_IS_CLIENT, &client_priv->access_flags);
-                       set_bit(AGP_FF_IS_VALID, &client_priv->access_flags);
-               }
-               if (client == NULL) {
-                       /* client is already removed */
-                       return 0;
-               }
-               return agp_remove_client(reserve.pid);
-       } else {
-               struct agp_segment *segment;
-
-               if (reserve.seg_count >= 16384)
-                       return -EINVAL;
-
-               segment = kmalloc((sizeof(struct agp_segment) * reserve.seg_count),
-                                 GFP_KERNEL);
-
-               if (segment == NULL)
-                       return -ENOMEM;
-
-               if (copy_from_user(segment, (void __user *) reserve.seg_list,
-                                  sizeof(struct agp_segment) * reserve.seg_count)) {
-                       kfree(segment);
-                       return -EFAULT;
-               }
-               reserve.seg_list = segment;
-
-               if (client == NULL) {
-                       /* Create the client and add the segment */
-                       client = agp_create_client(reserve.pid);
-
-                       if (client == NULL) {
-                               kfree(segment);
-                               return -ENOMEM;
-                       }
-                       client_priv = agp_find_private(reserve.pid);
-
-                       if (client_priv != NULL) {
-                               set_bit(AGP_FF_IS_CLIENT, &client_priv->access_flags);
-                               set_bit(AGP_FF_IS_VALID, &client_priv->access_flags);
-                       }
-               }
-               return agp_create_segment(client, &reserve);
-       }
-       /* Will never really happen */
-       return -EINVAL;
-}
-
-int agpioc_protect_wrap(struct agp_file_private *priv)
-{
-       DBG("");
-       /* This function is not currently implemented */
-       return -EINVAL;
-}
-
-static int agpioc_allocate_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_memory *memory;
-       struct agp_allocate alloc;
-
-       DBG("");
-       if (copy_from_user(&alloc, arg, sizeof(struct agp_allocate)))
-               return -EFAULT;
-
-       if (alloc.type >= AGP_USER_TYPES)
-               return -EINVAL;
-
-       memory = agp_allocate_memory_wrap(alloc.pg_count, alloc.type);
-
-       if (memory == NULL)
-               return -ENOMEM;
-
-       alloc.key = memory->key;
-       alloc.physical = memory->physical;
-
-       if (copy_to_user(arg, &alloc, sizeof(struct agp_allocate))) {
-               agp_free_memory_wrap(memory);
-               return -EFAULT;
-       }
-       return 0;
-}
-
-int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg)
-{
-       struct agp_memory *memory;
-
-       DBG("");
-       memory = agp_find_mem_by_key(arg);
-
-       if (memory == NULL)
-               return -EINVAL;
-
-       agp_free_memory_wrap(memory);
-       return 0;
-}
-
-static int agpioc_bind_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_bind bind_info;
-       struct agp_memory *memory;
-
-       DBG("");
-       if (copy_from_user(&bind_info, arg, sizeof(struct agp_bind)))
-               return -EFAULT;
-
-       memory = agp_find_mem_by_key(bind_info.key);
-
-       if (memory == NULL)
-               return -EINVAL;
-
-       return agp_bind_memory(memory, bind_info.pg_start);
-}
-
-static int agpioc_unbind_wrap(struct agp_file_private *priv, void __user *arg)
-{
-       struct agp_memory *memory;
-       struct agp_unbind unbind;
-
-       DBG("");
-       if (copy_from_user(&unbind, arg, sizeof(struct agp_unbind)))
-               return -EFAULT;
-
-       memory = agp_find_mem_by_key(unbind.key);
-
-       if (memory == NULL)
-               return -EINVAL;
-
-       return agp_unbind_memory(memory);
-}
-
-static long agp_ioctl(struct file *file,
-                    unsigned int cmd, unsigned long arg)
-{
-       struct agp_file_private *curr_priv = file->private_data;
-       int ret_val = -ENOTTY;
-
-       DBG("priv=%p, cmd=%x", curr_priv, cmd);
-       mutex_lock(&(agp_fe.agp_mutex));
-
-       if ((agp_fe.current_controller == NULL) &&
-           (cmd != AGPIOC_ACQUIRE)) {
-               ret_val = -EINVAL;
-               goto ioctl_out;
-       }
-       if ((agp_fe.backend_acquired != true) &&
-           (cmd != AGPIOC_ACQUIRE)) {
-               ret_val = -EBUSY;
-               goto ioctl_out;
-       }
-       if (cmd != AGPIOC_ACQUIRE) {
-               if (!(test_bit(AGP_FF_IS_CONTROLLER, &curr_priv->access_flags))) {
-                       ret_val = -EPERM;
-                       goto ioctl_out;
-               }
-               /* Use the original pid of the controller,
-                * in case it's threaded */
-
-               if (agp_fe.current_controller->pid != curr_priv->my_pid) {
-                       ret_val = -EBUSY;
-                       goto ioctl_out;
-               }
-       }
-
-       switch (cmd) {
-       case AGPIOC_INFO:
-               ret_val = agpioc_info_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_ACQUIRE:
-               ret_val = agpioc_acquire_wrap(curr_priv);
-               break;
-
-       case AGPIOC_RELEASE:
-               ret_val = agpioc_release_wrap(curr_priv);
-               break;
-
-       case AGPIOC_SETUP:
-               ret_val = agpioc_setup_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_RESERVE:
-               ret_val = agpioc_reserve_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_PROTECT:
-               ret_val = agpioc_protect_wrap(curr_priv);
-               break;
-
-       case AGPIOC_ALLOCATE:
-               ret_val = agpioc_allocate_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_DEALLOCATE:
-               ret_val = agpioc_deallocate_wrap(curr_priv, (int) arg);
-               break;
-
-       case AGPIOC_BIND:
-               ret_val = agpioc_bind_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_UNBIND:
-               ret_val = agpioc_unbind_wrap(curr_priv, (void __user *) arg);
-               break;
-
-       case AGPIOC_CHIPSET_FLUSH:
-               break;
-       }
-
-ioctl_out:
-       DBG("ioctl returns %d\n", ret_val);
-       mutex_unlock(&(agp_fe.agp_mutex));
-       return ret_val;
-}
-
-static const struct file_operations agp_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .unlocked_ioctl = agp_ioctl,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = compat_agp_ioctl,
-#endif
-       .mmap           = agp_mmap,
-       .open           = agp_open,
-       .release        = agp_release,
-};
-
-static struct miscdevice agp_miscdev =
-{
-       .minor  = AGPGART_MINOR,
-       .name   = "agpgart",
-       .fops   = &agp_fops
-};
-
-int agp_frontend_initialize(void)
-{
-       memset(&agp_fe, 0, sizeof(struct agp_front_data));
-       mutex_init(&(agp_fe.agp_mutex));
-
-       if (misc_register(&agp_miscdev)) {
-               printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
-               return -EIO;
-       }
-       return 0;
-}
-
-void agp_frontend_cleanup(void)
-{
-       misc_deregister(&agp_miscdev);
-}
--

2.42.1

author maintainer
#27 lore raw

PATCH 14/14 drm: Remove Kconfig option for legacy support (CONFIG_DRM_LEGACY)

In reply to Thomas Zimmermann

Remove CONFIG_DRM_LEGACY from Kconfig. Nothing depends on the option.

---
 drivers/gpu/drm/Kconfig | 21 ---------------------
 1 file changed, 21 deletions(-)
drivers/gpu/drm/Kconfig +0 -21
index cdbc56e076498..5150c8699a8b5 100644
@@ -407,27 +407,6 @@ config DRM_HYPERV
 
 	 If M is selected the module will be called hyperv_drm.
 
-# Keep legacy drivers last
-
-menuconfig DRM_LEGACY
-	bool "Enable legacy drivers (DANGEROUS)"
-	depends on DRM && MMU
-	help
-	  Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous
-	  APIs to user-space, which can be used to circumvent access
-	  restrictions and other security measures. For backwards compatibility
-	  those drivers are still available, but their use is highly
-	  inadvisable and might harm your system.
-
-	  You are recommended to use the safe modeset-only drivers instead, and
-	  perform 3D emulation in user-space.
-
-	  Unless you have strong reasons to go rogue, say "N".
-
-if DRM_LEGACY
-# leave here to list legacy drivers
-endif # DRM_LEGACY
-
 config DRM_EXPORT_FOR_TESTS
 	bool
 
Signature · 1 line
2.42.1
Acked-by on v1 14/14
#28 lore raw

Re: [PATCH 14/14] drm: Remove Kconfig option for legacy support (CONFIG_DRM_LEGACY)

Quoted 4 lines · Thomas Zimmermann

Remove CONFIG_DRM_LEGACY from Kconfig. Nothing depends on the option.

Quoted 39 lines
---
 drivers/gpu/drm/Kconfig | 21 ---------------------
 1 file changed, 21 deletions(-)
drivers/gpu/drm/Kconfig +0 -22
index cdbc56e076498..5150c8699a8b5 100644
@@ -407,27 +407,6 @@ config DRM_HYPERV
 
         If M is selected the module will be called hyperv_drm.
 
-# Keep legacy drivers last
-
-menuconfig DRM_LEGACY
-       bool "Enable legacy drivers (DANGEROUS)"
-       depends on DRM && MMU
-       help
-         Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous
-         APIs to user-space, which can be used to circumvent access
-         restrictions and other security measures. For backwards compatibility
-         those drivers are still available, but their use is highly
-         inadvisable and might harm your system.
-
-         You are recommended to use the safe modeset-only drivers instead, and
-         perform 3D emulation in user-space.
-
-         Unless you have strong reasons to go rogue, say "N".
-
-if DRM_LEGACY
-# leave here to list legacy drivers
-endif # DRM_LEGACY
-
 config DRM_EXPORT_FOR_TESTS
        bool
 
--

2.42.1

author maintainer
#29 lore raw
In reply to Thomas Zimmermann

Am 22.11.23 um 13:09 schrieb Thomas Zimmermann:

Quoted 3 lines

The old drivers for user-space mode setting have been removed in Linux v6.3. No one has complained or requested their return. It is time to remove these drivers' infrastructure from the DRM core.

FTR: acked by airlied and sima via dri-devel

https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&highlight_names=&date=2023-11-30

Quoted 95 lines

The recent Linux v6.6 has been designated as long-term release, [1] so any remaining users have a few more years to get a new graphics card. The legacy devices continue to be supported via simpledrm. Merging proper drivers with kernel mode setting is also an option.

Patches 1 to 7 fix a few trivial issues that have been forgotten during the removal of the drivers.

Patches 8 and 9 remove the leagcy ioctl interfaces. One op is different from the others, so it gets its own patch.

Patches 10 to 12 remove the legacy source code from DRM. With that gone patch 13, the AGP code can be simplified as well. There used to be a device file for user-space mode setting, /dev/agpgart, that is now obsolete.

Patch 14 removes the option from Kconfig.

[1] https://kernel.org/category/releases.html

Thomas Zimmermann (14):
arch/powerpc: Remove legacy DRM drivers from default configs
drm: Fix TODO list mentioning non-KMS drivers
drm: Include <drm/drm_auth.h>
drm/i915: Include <drm/drm_auth.h>
accel: Include <drm/drm_auth.h>
drm: Include <drm/drm_device.h>
drm/radeon: Do not include <drm/drm_legacy.h>
drm: Remove entry points for legacy ioctls
drm: Remove the legacy DRM_IOCTL_MODESET_CTL ioctl
drm: Remove support for legacy drivers
drm: Remove locking for legacy ioctls and DRM_UNLOCKED
drm: Remove source code for non-KMS drivers
char/agp: Remove frontend code
drm: Remove Kconfig option for legacy support (CONFIG_DRM_LEGACY)

  Documentation/gpu/todo.rst                    |    7 +-
  arch/powerpc/configs/pmac32_defconfig         |    2 -
  arch/powerpc/configs/ppc6xx_defconfig         |    7 -
  drivers/accel/drm_accel.c                     |    1 +
  drivers/char/agp/Makefile                     |    6 -
  drivers/char/agp/agp.h                        |    9 -
  drivers/char/agp/backend.c                    |   11 -
  drivers/char/agp/compat_ioctl.c               |  291 ---
  drivers/char/agp/compat_ioctl.h               |  106 --
  drivers/char/agp/frontend.c                   | 1068 -----------
  drivers/gpu/drm/Kconfig                       |   21 -
  drivers/gpu/drm/Makefile                      |   12 -
  drivers/gpu/drm/drm_agpsupport.c              |  451 -----
  drivers/gpu/drm/drm_auth.c                    |    8 +-
  drivers/gpu/drm/drm_bufs.c                    | 1627 -----------------
  drivers/gpu/drm/drm_context.c                 |  513 ------
  drivers/gpu/drm/drm_dma.c                     |  178 --
  drivers/gpu/drm/drm_drv.c                     |   17 -
  drivers/gpu/drm/drm_file.c                    |   64 +-
  drivers/gpu/drm/drm_hashtab.c                 |  203 --
  drivers/gpu/drm/drm_internal.h                |    7 -
  drivers/gpu/drm/drm_ioc32.c                   |  613 +------
  drivers/gpu/drm/drm_ioctl.c                   |   82 +-
  drivers/gpu/drm/drm_irq.c                     |  204 ---
  drivers/gpu/drm/drm_legacy.h                  |  290 ---
  drivers/gpu/drm/drm_legacy_misc.c             |  105 --
  drivers/gpu/drm/drm_lock.c                    |  373 ----
  drivers/gpu/drm/drm_memory.c                  |  138 --
  drivers/gpu/drm/drm_pci.c                     |  204 +--
  drivers/gpu/drm/drm_scatter.c                 |  220 ---
  drivers/gpu/drm/drm_vblank.c                  |  101 -
  drivers/gpu/drm/drm_vm.c                      |  665 -------
  .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |    1 +
  drivers/gpu/drm/radeon/radeon_drv.h           |    1 -
  include/drm/drm_auth.h                        |   22 -
  include/drm/drm_device.h                      |   71 +-
  include/drm/drm_drv.h                         |   19 -
  include/drm/drm_file.h                        |    5 -
  include/drm/drm_ioctl.h                       |   11 -
  include/drm/drm_legacy.h                      |  331 ----
  40 files changed, 20 insertions(+), 8045 deletions(-)

delete mode 100644 drivers/char/agp/compat_ioctl.c delete mode 100644 drivers/char/agp/compat_ioctl.h delete mode 100644 drivers/char/agp/frontend.c delete mode 100644 drivers/gpu/drm/drm_agpsupport.c delete mode 100644 drivers/gpu/drm/drm_bufs.c delete mode 100644 drivers/gpu/drm/drm_context.c delete mode 100644 drivers/gpu/drm/drm_dma.c delete mode 100644 drivers/gpu/drm/drm_hashtab.c delete mode 100644 drivers/gpu/drm/drm_irq.c delete mode 100644 drivers/gpu/drm/drm_legacy.h delete mode 100644 drivers/gpu/drm/drm_legacy_misc.c delete mode 100644 drivers/gpu/drm/drm_lock.c delete mode 100644 drivers/gpu/drm/drm_memory.c delete mode 100644 drivers/gpu/drm/drm_scatter.c delete mode 100644 drivers/gpu/drm/drm_vm.c delete mode 100644 include/drm/drm_legacy.h

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
author maintainer Applied
#30 lore raw
In reply to Thomas Zimmermann

Merged into drm-misc-next, except for patch 1. It's fairly independent from the other patches and I'll resend it directly to the the PPC list.

Best regards
Thomas

Am 22.11.23 um 13:09 schrieb Thomas Zimmermann:

Quoted 98 lines

The old drivers for user-space mode setting have been removed in Linux v6.3. No one has complained or requested their return. It is time to remove these drivers' infrastructure from the DRM core.

The recent Linux v6.6 has been designated as long-term release, [1] so any remaining users have a few more years to get a new graphics card. The legacy devices continue to be supported via simpledrm. Merging proper drivers with kernel mode setting is also an option.

Patches 1 to 7 fix a few trivial issues that have been forgotten during the removal of the drivers.

Patches 8 and 9 remove the leagcy ioctl interfaces. One op is different from the others, so it gets its own patch.

Patches 10 to 12 remove the legacy source code from DRM. With that gone patch 13, the AGP code can be simplified as well. There used to be a device file for user-space mode setting, /dev/agpgart, that is now obsolete.

Patch 14 removes the option from Kconfig.

[1] https://kernel.org/category/releases.html

Thomas Zimmermann (14):
arch/powerpc: Remove legacy DRM drivers from default configs
drm: Fix TODO list mentioning non-KMS drivers
drm: Include <drm/drm_auth.h>
drm/i915: Include <drm/drm_auth.h>
accel: Include <drm/drm_auth.h>
drm: Include <drm/drm_device.h>
drm/radeon: Do not include <drm/drm_legacy.h>
drm: Remove entry points for legacy ioctls
drm: Remove the legacy DRM_IOCTL_MODESET_CTL ioctl
drm: Remove support for legacy drivers
drm: Remove locking for legacy ioctls and DRM_UNLOCKED
drm: Remove source code for non-KMS drivers
char/agp: Remove frontend code
drm: Remove Kconfig option for legacy support (CONFIG_DRM_LEGACY)

  Documentation/gpu/todo.rst                    |    7 +-
  arch/powerpc/configs/pmac32_defconfig         |    2 -
  arch/powerpc/configs/ppc6xx_defconfig         |    7 -
  drivers/accel/drm_accel.c                     |    1 +
  drivers/char/agp/Makefile                     |    6 -
  drivers/char/agp/agp.h                        |    9 -
  drivers/char/agp/backend.c                    |   11 -
  drivers/char/agp/compat_ioctl.c               |  291 ---
  drivers/char/agp/compat_ioctl.h               |  106 --
  drivers/char/agp/frontend.c                   | 1068 -----------
  drivers/gpu/drm/Kconfig                       |   21 -
  drivers/gpu/drm/Makefile                      |   12 -
  drivers/gpu/drm/drm_agpsupport.c              |  451 -----
  drivers/gpu/drm/drm_auth.c                    |    8 +-
  drivers/gpu/drm/drm_bufs.c                    | 1627 -----------------
  drivers/gpu/drm/drm_context.c                 |  513 ------
  drivers/gpu/drm/drm_dma.c                     |  178 --
  drivers/gpu/drm/drm_drv.c                     |   17 -
  drivers/gpu/drm/drm_file.c                    |   64 +-
  drivers/gpu/drm/drm_hashtab.c                 |  203 --
  drivers/gpu/drm/drm_internal.h                |    7 -
  drivers/gpu/drm/drm_ioc32.c                   |  613 +------
  drivers/gpu/drm/drm_ioctl.c                   |   82 +-
  drivers/gpu/drm/drm_irq.c                     |  204 ---
  drivers/gpu/drm/drm_legacy.h                  |  290 ---
  drivers/gpu/drm/drm_legacy_misc.c             |  105 --
  drivers/gpu/drm/drm_lock.c                    |  373 ----
  drivers/gpu/drm/drm_memory.c                  |  138 --
  drivers/gpu/drm/drm_pci.c                     |  204 +--
  drivers/gpu/drm/drm_scatter.c                 |  220 ---
  drivers/gpu/drm/drm_vblank.c                  |  101 -
  drivers/gpu/drm/drm_vm.c                      |  665 -------
  .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |    1 +
  drivers/gpu/drm/radeon/radeon_drv.h           |    1 -
  include/drm/drm_auth.h                        |   22 -
  include/drm/drm_device.h                      |   71 +-
  include/drm/drm_drv.h                         |   19 -
  include/drm/drm_file.h                        |    5 -
  include/drm/drm_ioctl.h                       |   11 -
  include/drm/drm_legacy.h                      |  331 ----
  40 files changed, 20 insertions(+), 8045 deletions(-)

delete mode 100644 drivers/char/agp/compat_ioctl.c delete mode 100644 drivers/char/agp/compat_ioctl.h delete mode 100644 drivers/char/agp/frontend.c delete mode 100644 drivers/gpu/drm/drm_agpsupport.c delete mode 100644 drivers/gpu/drm/drm_bufs.c delete mode 100644 drivers/gpu/drm/drm_context.c delete mode 100644 drivers/gpu/drm/drm_dma.c delete mode 100644 drivers/gpu/drm/drm_hashtab.c delete mode 100644 drivers/gpu/drm/drm_irq.c delete mode 100644 drivers/gpu/drm/drm_legacy.h delete mode 100644 drivers/gpu/drm/drm_legacy_misc.c delete mode 100644 drivers/gpu/drm/drm_lock.c delete mode 100644 drivers/gpu/drm/drm_memory.c delete mode 100644 drivers/gpu/drm/drm_scatter.c delete mode 100644 drivers/gpu/drm/drm_vm.c delete mode 100644 include/drm/drm_legacy.h

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)