/* Called whenever a 32-bit process running under a 64-bit kernel performs an ioctl on /dev/dri/card<n>. */
long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
/* Called whenever a 32-bit process running under a 64-bit kernel performs an ioctl on /dev/dri/card<n>. */
long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
	unsigned int nr = DRM_IOCTL_NR(cmd);
	drm_ioctl_compat_t *fn = NULL;
	int ret;
	if (nr < DRM_COMMAND_BASE)
		return drm_compat_ioctl(filp, cmd, arg);
	if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(r128_compat_ioctls))
		fn = r128_compat_ioctls[nr - DRM_COMMAND_BASE];
	if (fn != NULL)
		ret = (*fn) (filp, cmd, arg);
	else
		ret = drm_ioctl(filp, cmd, arg);
	return ret;
}