Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14adc892 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/radeon: Deprecate UMS support v2



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.

v2: rebased on alex/drm-next-3.9-wip

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0fcb6155
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+5 −28
Original line number Diff line number Diff line
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.
+7 −3
Original line number Diff line number Diff line
@@ -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_irq.o r300_cmdbuf.o r600_cp.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 r600_blit.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 \
@@ -67,7 +71,7 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \
	radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \
	radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \
	rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \
	r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \
	r200.o radeon_legacy_tv.o r600_cs.o r600_blit_shaders.o \
	r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \
	evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \
	evergreen_hdmi.o radeon_trace_points.o ni.o cayman_blit_shaders.o \
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@
 *
 * Authors:
 *    Nicolai Haehnle <prefect_@gmx.net>
 *
 * ------------------------ This file is DEPRECATED! -------------------------
 */

#include <drm/drmP.h>
+2 −31
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
 *
 * Authors:
 *     Alex Deucher <alexander.deucher@amd.com>
 *
 * ------------------------ 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;
Loading