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

Commit 3d77461e authored by Dave Airlie's avatar Dave Airlie
Browse files

drm: cleanup old compat code and DRM fns from Linux only code



This patch removes some of the old compatibility macros from the DRM,
and removes use of DRM wrappers from Linux specific code.

Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent e478bec0
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -140,16 +140,6 @@

/*@}*/

/***********************************************************************/
/** \name Backward compatibility section */
/*@{*/

#define DRM_RPR_ARG(vma) vma,

#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)

/*@}*/

/***********************************************************************/
/** \name Macros to make printk easier */
/*@{*/
@@ -211,8 +201,6 @@
/*@{*/

#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x)
#define DRM_MIN(a,b) min(a,b)
#define DRM_MAX(a,b) max(a,b)

#define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
#define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ static drm_ioctl_desc_t drm_ioctls[] = {
	[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)] = {drm_wait_vblank, 0},
};

#define DRIVER_IOCTL_COUNT	DRM_ARRAY_SIZE( drm_ioctls )
#define DRIVER_IOCTL_COUNT	ARRAY_SIZE( drm_ioctls )

/**
 * Take down the DRM device.
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ static int drm_setup(drm_device_t * dev)
			return i;
	}

	for (i = 0; i < DRM_ARRAY_SIZE(dev->counts); i++)
	for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
		atomic_set(&dev->counts[i], 0);

	for (i = 0; i < DRM_HASH_SIZE; i++) {
+1 −1
Original line number Diff line number Diff line
@@ -1051,7 +1051,7 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
	drm_ioctl_compat_t *fn;
	int ret;

	if (nr >= DRM_ARRAY_SIZE(drm_compat_ioctls))
	if (nr >= ARRAY_SIZE(drm_compat_ioctls))
		return -ENOTTY;

	fn = drm_compat_ioctls[nr];
+5 −3
Original line number Diff line number Diff line
@@ -331,21 +331,23 @@ int drm_setversion(DRM_IOCTL_ARGS)
	int if_version;
	drm_set_version_t __user *argp = (void __user *)data;

	DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
	if (copy_from_user(&sv, argp, sizeof(sv)))
		return -EFAULT;

	retv.drm_di_major = DRM_IF_MAJOR;
	retv.drm_di_minor = DRM_IF_MINOR;
	retv.drm_dd_major = dev->driver->major;
	retv.drm_dd_minor = dev->driver->minor;

	DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv));
	if (copy_to_user(argp, &retv, sizeof(sv)))
		return -EFAULT;

	if (sv.drm_di_major != -1) {
		if (sv.drm_di_major != DRM_IF_MAJOR ||
		    sv.drm_di_minor < 0 || sv.drm_di_minor > DRM_IF_MINOR)
			return EINVAL;
		if_version = DRM_IF_VERSION(sv.drm_di_major, sv.drm_di_minor);
		dev->if_version = DRM_MAX(if_version, dev->if_version);
		dev->if_version = max(if_version, dev->if_version);
		if (sv.drm_di_minor >= 1) {
			/*
			 * Version 1.1 includes tying of DRM to specific device
Loading