Skip to contentSkip to conversation

drm/radeon: Deprecate UMS support

PATCH New Christian König 1 participant 1 message Jan 6, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: Deprecate UMS support

From: Christian König <[email protected]>

KMS support is out and stable for a couple of years now and the userspace code has deprecated or abandoned the old UMS interface.

So make the KMS interface the default and deprecate the UMS interface in the kernel as well.

---
 drivers/gpu/drm/Kconfig                |    1 +
 drivers/gpu/drm/radeon/Kconfig         |   33 ++-------
 drivers/gpu/drm/radeon/Makefile        |    6 +-
 drivers/gpu/drm/radeon/r300_cmdbuf.c   |    2 +
 drivers/gpu/drm/radeon/r600_blit.c     |   33 +--------
 drivers/gpu/drm/radeon/r600_blit_kms.c |   31 ++++++++
 drivers/gpu/drm/radeon/r600_cp.c       |    2 +
 drivers/gpu/drm/radeon/r600_cs.c       |  122 ++++++++++++++++----------------
 drivers/gpu/drm/radeon/radeon_cp.c     |    2 +
 drivers/gpu/drm/radeon/radeon_drv.c    |   70 +++++++++---------
 drivers/gpu/drm/radeon/radeon_drv.h    |   16 ++---
 drivers/gpu/drm/radeon/radeon_irq.c    |    2 +
 drivers/gpu/drm/radeon/radeon_mem.c    |    2 +
 drivers/gpu/drm/radeon/radeon_state.c  |    2 +
 14 files changed, 160 insertions(+), 164 deletions(-)
drivers/gpu/drm/Kconfig +1 -0
index 983201b..3399b20 100644
@@ -96,6 +96,7 @@ config DRM_RADEON
         select DRM_TTM
 	select POWER_SUPPLY
 	select HWMON
+	select BACKLIGHT_CLASS_DEVICE
 	help
 	  Choose this option if you have an ATI Radeon graphics card.  There
 	  are both PCI and AGP versions.  You don't need to choose this to
drivers/gpu/drm/radeon/Kconfig +5 -28
index ea92bbe..970f8e9 100644
@@ -1,31 +1,8 @@
-config DRM_RADEON_KMS
-	bool "Enable modesetting on radeon by default - NEW DRIVER"
+config DRM_RADEON_UMS
+	bool "Enable userspace modesetting on radeon (DEPRECATED)"
 	depends on DRM_RADEON
-	select BACKLIGHT_CLASS_DEVICE
 	help
-	  Choose this option if you want kernel modesetting enabled by default.
+	  Choose this option if you still need userspace modesetting.
 
-	  This is a completely new driver. It's only part of the existing drm
-	  for compatibility reasons. It requires an entirely different graphics
-	  stack above it and works very differently from the old drm stack.
-	  i.e. don't enable this unless you know what you are doing it may
-	  cause issues or bugs compared to the previous userspace driver stack.
-
-	  When kernel modesetting is enabled the IOCTL of radeon/drm
-	  driver are considered as invalid and an error message is printed
-	  in the log and they return failure.
-
-	  KMS enabled userspace will use new API to talk with the radeon/drm
-	  driver. The new API provide functions to create/destroy/share/mmap
-	  buffer object which are then managed by the kernel memory manager
-	  (here TTM). In order to submit command to the GPU the userspace
-	  provide a buffer holding the command stream, along this buffer
-	  userspace have to provide a list of buffer object used by the
-	  command stream. The kernel radeon driver will then place buffer
-	  in GPU accessible memory and will update command stream to reflect
-	  the position of the different buffers.
-
-	  The kernel will also perform security check on command stream
-	  provided by the user, we want to catch and forbid any illegal use
-	  of the GPU such as DMA into random system memory or into memory
-	  not owned by the process supplying the command stream.
+	  Userspace modesetting is deprecated for quite some time now, so
+	  enable this only if you have ancient versions of the DDX drivers.
drivers/gpu/drm/radeon/Makefile +5 -1
index a6598fd..93c0d72 100644
@@ -56,8 +56,12 @@ $(obj)/r600_cs.o: $(obj)/r600_reg_safe.h
 
 $(obj)/evergreen_cs.o: $(obj)/evergreen_reg_safe.h $(obj)/cayman_reg_safe.h
 
-radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \
+radeon-y := radeon_drv.o
+
+# add UMS driver
+radeon-$(CONFIG_DRM_RADEON_UMS)+= radeon_cp.o radeon_state.o radeon_mem.o \
 	radeon_irq.o r300_cmdbuf.o r600_cp.o
+
 # add KMS driver
 radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \
 	radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \
drivers/gpu/drm/radeon/r300_cmdbuf.c +2 -0
index 002ab03..865e2c9 100644
@@ -29,6 +29,8 @@
  *
  * Authors:
  *    Nicolai Haehnle <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <drm/drmP.h>
drivers/gpu/drm/radeon/r600_blit.c +2 -31
index 77da1f9..f651881 100644
@@ -22,6 +22,8 @@
  *
  * Authors:
  *     Alex Deucher <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
@@ -488,37 +490,6 @@ set_default_state(drm_radeon_private_t *dev_priv)
 	ADVANCE_RING();
 }
 
-/* 23 bits of float fractional data */
-#define I2F_FRAC_BITS  23
-#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1)
-
-/*
- * Converts unsigned integer into 32-bit IEEE floating point representation.
- * Will be exact from 0 to 2^24.  Above that, we round towards zero
- * as the fractional bits will not fit in a float.  (It would be better to
- * round towards even as the fpu does, but that is slower.)
- */
-__pure uint32_t int2float(uint32_t x)
-{
-	uint32_t msb, exponent, fraction;
-
-	/* Zero is special */
-	if (!x) return 0;
-
-	/* Get location of the most significant bit */
-	msb = __fls(x);
-
-	/*
-	 * Use a rotate instead of a shift because that works both leftwards
-	 * and rightwards due to the mod(32) behaviour.  This means we don't
-	 * need to check to see if we are above 2^24 or not.
-	 */
-	fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
-	exponent = (127 + msb) << I2F_FRAC_BITS;
-
-	return fraction + exponent;
-}
-
 static int r600_nomm_get_vb(struct drm_device *dev)
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
drivers/gpu/drm/radeon/r600_blit_kms.c +31 -0
index e082dca..9fb5780 100644
@@ -31,6 +31,37 @@
 #include "r600_blit_shaders.h"
 #include "radeon_blit_common.h"
 
+/* 23 bits of float fractional data */
+#define I2F_FRAC_BITS  23
+#define I2F_MASK ((1 << I2F_FRAC_BITS) - 1)
+
+/*
+ * Converts unsigned integer into 32-bit IEEE floating point representation.
+ * Will be exact from 0 to 2^24.  Above that, we round towards zero
+ * as the fractional bits will not fit in a float.  (It would be better to
+ * round towards even as the fpu does, but that is slower.)
+ */
+__pure uint32_t int2float(uint32_t x)
+{
+	uint32_t msb, exponent, fraction;
+
+	/* Zero is special */
+	if (!x) return 0;
+
+	/* Get location of the most significant bit */
+	msb = __fls(x);
+
+	/*
+	 * Use a rotate instead of a shift because that works both leftwards
+	 * and rightwards due to the mod(32) behaviour.  This means we don't
+	 * need to check to see if we are above 2^24 or not.
+	 */
+	fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK;
+	exponent = (127 + msb) << I2F_FRAC_BITS;
+
+	return fraction + exponent;
+}
+
 /* emits 21 on rv770+, 23 on r600 */
 static void
 set_render_target(struct radeon_device *rdev, int format,
drivers/gpu/drm/radeon/r600_cp.c +2 -0
index be85f75..1c51c08 100644
@@ -24,6 +24,8 @@
  * Authors:
  *     Dave Airlie <[email protected]>
  *     Alex Deucher <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <linux/module.h>
drivers/gpu/drm/radeon/r600_cs.c +62 -60

152 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_cp.c +2 -0
index 9143fc4..efc4f64 100644
@@ -27,6 +27,8 @@
  * Authors:
  *    Kevin E. Martin <[email protected]>
  *    Gareth Hughes <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <linux/module.h>
drivers/gpu/drm/radeon/radeon_drv.c +37 -33

125 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_drv.h +5 -11
index e7fdf16..b369d42 100644
@@ -113,6 +113,9 @@
 #define DRIVER_MINOR		33
 #define DRIVER_PATCHLEVEL	0
 
+/* The rest of the file is DEPRECATED! */
+#ifdef CONFIG_DRM_RADEON_UMS
+
 enum radeon_cp_microcode_version {
 	UCODE_R100,
 	UCODE_R200,
@@ -418,8 +421,6 @@ extern int radeon_driver_open(struct drm_device *dev,
 			      struct drm_file *file_priv);
 extern long radeon_compat_ioctl(struct file *filp, unsigned int cmd,
 				unsigned long arg);
-extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd,
-				    unsigned long arg);
 
 extern int radeon_master_create(struct drm_device *dev, struct drm_master *master);
 extern void radeon_master_destroy(struct drm_device *dev, struct drm_master *master);
@@ -462,15 +463,6 @@ extern void r600_blit_swap(struct drm_device *dev,
 			   int sx, int sy, int dx, int dy,
 			   int w, int h, int src_pitch, int dst_pitch, int cpp);
 
-/* atpx handler */
-#if defined(CONFIG_VGA_SWITCHEROO)
-void radeon_register_atpx_handler(void);
-void radeon_unregister_atpx_handler(void);
-#else
-static inline void radeon_register_atpx_handler(void) {}
-static inline void radeon_unregister_atpx_handler(void) {}
-#endif
-
 /* Flags for stats.boxes
  */
 #define RADEON_BOX_DMA_IDLE      0x1
@@ -2167,4 +2159,6 @@ extern void radeon_commit_ring(drm_radeon_private_t *dev_priv);
 } while (0)
 
 
+#endif				/* CONFIG_DRM_RADEON_UMS */
+
 #endif				/* __RADEON_DRV_H__ */
drivers/gpu/drm/radeon/radeon_irq.c +2 -0
index e771033..8d68e97 100644
@@ -28,6 +28,8 @@
  * Authors:
  *    Keith Whitwell <[email protected]>
  *    Michel D�zer <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <drm/drmP.h>
drivers/gpu/drm/radeon/radeon_mem.c +2 -0
index b9f0672..d54d2d7 100644
@@ -27,6 +27,8 @@
  *
  * Authors:
  *    Keith Whitwell <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <drm/drmP.h>
drivers/gpu/drm/radeon/radeon_state.c +2 -0
index 8e9057b..4d20910 100644
@@ -25,6 +25,8 @@
  * Authors:
  *    Gareth Hughes <[email protected]>
  *    Kevin E. Martin <[email protected]>
+ *
+ * ------------------------ This file is DEPRECATED! -------------------------
  */
 
 #include <drm/drmP.h>
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel