[Nouveau] [PATCH] drm: remove UMS leftover

okias d.okias at gmail.com
Mon Jan 18 04:39:30 PST 2010


Compiled, tested. Look ok.

-- 
Jabber/XMPP: okias at isgeek.info
SIP VoIP: sip:17474537254 at proxy01.sipphone.com
-------------- next part --------------
This patch remove leftover from UMS.

Signed-off-by: David Heidelberger <d.okias at gmail.com>
---
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c
--- a/drivers/gpu/drm/nouveau/nouveau_dma.c	2010-01-18 12:48:09.193872773 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_dma.c	2010-01-18 12:50:01.639874519 +0100
@@ -77,11 +77,9 @@
 		return ret;
 
 	/* Map M2MF notifier object - fbcon. */
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		ret = nouveau_bo_map(chan->notifier_bo);
-		if (ret)
-			return ret;
-	}
+	ret = nouveau_bo_map(chan->notifier_bo);
+	if (ret)
+		return ret;
 
 	/* Insert NOPS for NOUVEAU_DMA_SKIPS */
 	ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS);
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c	2010-01-18 12:42:14.396872703 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c	2010-01-18 13:00:57.044879755 +0100
@@ -43,10 +43,6 @@
 int nouveau_noagp;
 module_param_named(noagp, nouveau_noagp, int, 0400);
 
-MODULE_PARM_DESC(modeset, "Enable kernel modesetting");
-static int nouveau_modeset = -1; /* kms */
-module_param_named(modeset, nouveau_modeset, int, 0400);
-
 MODULE_PARM_DESC(vbios, "Override default VBIOS location");
 char *nouveau_vbios;
 module_param_named(vbios, nouveau_vbios, charp, 0400);
@@ -136,9 +132,6 @@
 	uint32_t fbdev_flags;
 	int ret, i;
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET))
-		return -ENODEV;
-
 	if (pm_state.event == PM_EVENT_PRETHAW)
 		return 0;
 
@@ -231,9 +224,6 @@
 	uint32_t fbdev_flags;
 	int ret, i;
 
-	if (!drm_core_check_feature(dev, DRIVER_MODESET))
-		return -ENODEV;
-
 	fbdev_flags = dev_priv->fbdev_info->flags;
 	dev_priv->fbdev_info->flags |= FBINFO_HWACCEL_DISABLED;
 
@@ -323,10 +313,10 @@
 static struct drm_driver driver = {
 	.driver_features =
 		DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
-		DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM,
+		DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM |
+		DRIVER_MODESET,
 	.load = nouveau_load,
 	.firstopen = nouveau_firstopen,
-	.lastclose = nouveau_lastclose,
 	.unload = nouveau_unload,
 	.preclose = nouveau_preclose,
 #if defined(CONFIG_DRM_NOUVEAU_DEBUG)
@@ -381,18 +371,6 @@
 {
 	driver.num_ioctls = nouveau_max_ioctl;
 
-	if (nouveau_modeset == -1) {
-#ifdef CONFIG_VGA_CONSOLE
-		if (vgacon_text_force())
-			nouveau_modeset = 0;
-		else
-#endif
-			nouveau_modeset = 1;
-	}
-
-	if (nouveau_modeset == 1)
-		driver.driver_features |= DRIVER_MODESET;
-
 	return drm_init(&driver);
 }
 
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h	2010-01-18 13:27:46.135878011 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h	2010-01-18 13:29:54.262883109 +0100
@@ -1151,10 +1151,6 @@
 					  struct drm_file *);
 extern int nouveau_gem_ioctl_pushbuf_call2(struct drm_device *, void *,
 					   struct drm_file *);
-extern int nouveau_gem_ioctl_pin(struct drm_device *, void *,
-				 struct drm_file *);
-extern int nouveau_gem_ioctl_unpin(struct drm_device *, void *,
-				   struct drm_file *);
 extern int nouveau_gem_ioctl_tile(struct drm_device *, void *,
 				  struct drm_file *);
 extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *,
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c	2010-01-18 12:48:52.592873539 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c	2010-01-18 12:53:02.136129301 +0100
@@ -817,74 +817,6 @@
 }
 
 int
-nouveau_gem_ioctl_pin(struct drm_device *dev, void *data,
-		      struct drm_file *file_priv)
-{
-	struct drm_nouveau_gem_pin *req = data;
-	struct drm_gem_object *gem;
-	struct nouveau_bo *nvbo;
-	int ret = 0;
-
-	NOUVEAU_CHECK_INITIALISED_WITH_RETURN;
-
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		NV_ERROR(dev, "pin only allowed without kernel modesetting\n");
-		return -EINVAL;
-	}
-
-	if (!DRM_SUSER(DRM_CURPROC))
-		return -EPERM;
-
-	gem = drm_gem_object_lookup(dev, file_priv, req->handle);
-	if (!gem)
-		return -EINVAL;
-	nvbo = nouveau_gem_object(gem);
-
-	ret = nouveau_bo_pin(nvbo, domain_to_ttm(nvbo, req->domain));
-	if (ret)
-		goto out;
-
-	req->offset = nvbo->bo.offset;
-	if (nvbo->bo.mem.mem_type == TTM_PL_TT)
-		req->domain = NOUVEAU_GEM_DOMAIN_GART;
-	else
-		req->domain = NOUVEAU_GEM_DOMAIN_VRAM;
-
-out:
-	mutex_lock(&dev->struct_mutex);
-	drm_gem_object_unreference(gem);
-	mutex_unlock(&dev->struct_mutex);
-
-	return ret;
-}
-
-int
-nouveau_gem_ioctl_unpin(struct drm_device *dev, void *data,
-			struct drm_file *file_priv)
-{
-	struct drm_nouveau_gem_pin *req = data;
-	struct drm_gem_object *gem;
-	int ret;
-
-	NOUVEAU_CHECK_INITIALISED_WITH_RETURN;
-
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return -EINVAL;
-
-	gem = drm_gem_object_lookup(dev, file_priv, req->handle);
-	if (!gem)
-		return -EINVAL;
-
-	ret = nouveau_bo_unpin(nouveau_gem_object(gem));
-
-	mutex_lock(&dev->struct_mutex);
-	drm_gem_object_unreference(gem);
-	mutex_unlock(&dev->struct_mutex);
-
-	return ret;
-}
-
-int
 nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data,
 			   struct drm_file *file_priv)
 {
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c	2010-01-18 13:27:35.702877591 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c	2010-01-18 13:30:35.002877939 +0100
@@ -420,8 +420,6 @@
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_NEW, nouveau_gem_ioctl_new, DRM_AUTH),
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF, nouveau_gem_ioctl_pushbuf, DRM_AUTH),
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PUSHBUF_CALL, nouveau_gem_ioctl_pushbuf_call, DRM_AUTH),
-	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_PIN, nouveau_gem_ioctl_pin, DRM_AUTH),
-	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_UNPIN, nouveau_gem_ioctl_unpin, DRM_AUTH),
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_PREP, nouveau_gem_ioctl_cpu_prep, DRM_AUTH),
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_CPU_FINI, nouveau_gem_ioctl_cpu_fini, DRM_AUTH),
 	DRM_IOCTL_DEF(DRM_NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH),
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c	2010-01-18 12:48:59.522122876 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c	2010-01-18 12:53:36.730888627 +0100
@@ -391,8 +391,7 @@
 
 	nouveau_ttm_global_release(dev_priv);
 
-	if (drm_core_has_AGP(dev) && dev->agp &&
-	    drm_core_check_feature(dev, DRIVER_MODESET)) {
+	if (drm_core_has_AGP(dev) && dev->agp) {
 		struct drm_agp_mem *entry, *tempe;
 
 		/* Remove AGP resources, but leave dev->agp
diff -Naur a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
--- a/drivers/gpu/drm/nouveau/nouveau_state.c	2010-01-18 12:49:06.825872912 +0100
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c	2010-01-18 13:00:34.039879476 +0100
@@ -385,11 +385,9 @@
 	dev_priv->init_state = NOUVEAU_CARD_INIT_FAILED;
 
 	/* Parse BIOS tables / Run init tables if card not POSTed */
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		ret = nouveau_bios_init(dev);
-		if (ret)
-			goto out;
-	}
+	ret = nouveau_bios_init(dev);
+	if (ret)
+		goto out;
 
 	ret = nouveau_gpuobj_early_init(dev);
 	if (ret)
@@ -456,14 +454,12 @@
 			goto out_irq;
 	}
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		if (dev_priv->card_type >= NV_50)
-			ret = nv50_display_create(dev);
-		else
-			ret = nv04_display_create(dev);
-		if (ret)
-			goto out_irq;
-	}
+	if (dev_priv->card_type >= NV_50)
+		ret = nv50_display_create(dev);
+	else
+		ret = nv04_display_create(dev);
+	if (ret)
+		goto out_irq;
 
 	ret = nouveau_backlight_init(dev);
 	if (ret)
@@ -471,8 +467,7 @@
 
 	dev_priv->init_state = NOUVEAU_CARD_INIT_DONE;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		drm_helper_initial_config(dev);
+	drm_helper_initial_config(dev);
 
 	return 0;
 
@@ -533,8 +528,7 @@
 		nouveau_mem_close(dev);
 		engine->instmem.takedown(dev);
 
-		if (drm_core_check_feature(dev, DRIVER_MODESET))
-			drm_irq_uninstall(dev);
+		drm_irq_uninstall(dev);
 
 		nouveau_gpuobj_late_takedown(dev);
 		nouveau_bios_takedown(dev);
@@ -712,11 +706,9 @@
 		dev_priv->flags |= NV_NFORCE2;
 
 	/* For kernel modesetting, init card now and bring up fbcon */
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		int ret = nouveau_card_init(dev);
-		if (ret)
-			return ret;
-	}
+	int ret = nouveau_card_init(dev);
+	if (ret)
+		return ret;
 
 	return 0;
 }
@@ -730,26 +722,16 @@
 		nouveau_card_takedown(dev);
 }
 
-/* KMS: we need mmio at load time, not when the first drm client opens. */
-void nouveau_lastclose(struct drm_device *dev)
-{
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		return;
-
-	nouveau_close(dev);
-}
 
 int nouveau_unload(struct drm_device *dev)
 {
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		if (dev_priv->card_type >= NV_50)
-			nv50_display_destroy(dev);
-		else
-			nv04_display_destroy(dev);
-		nouveau_close(dev);
-	}
+	if (dev_priv->card_type >= NV_50)
+		nv50_display_destroy(dev);
+	else
+		nv04_display_destroy(dev);
+	nouveau_close(dev);
 
 	iounmap(dev_priv->mmio);
 	iounmap(dev_priv->ramin);


More information about the Nouveau mailing list