From: Jack Leigh <jack.leigh@collabora.com>
Date: Wed, 1 Oct 2014 17:24:28 +0100
Subject: Revert use of vgacon

This reverts commit 1bb9e632a0aeee1121e652ee4dc80e5e6f14bcd2.
This reverts commit a4de05268e674e8ed31df6348269e22d6c6a1803.

>From 3.16.2.

also reverts f96de58fc7e7d3d717c7c63975c3b896c906b5e3
and 0485c9dc24ec0939b42ca5104c0373297506b555.
---
 drivers/gpu/drm/i915/i915_dma.c | 44 +----------------------------------------
 1 file changed, 1 insertion(+), 43 deletions(-)

--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -39,8 +39,6 @@
 #include "i915_vgpu.h"
 #include "i915_trace.h"
 #include <linux/pci.h>
-#include <linux/console.h>
-#include <linux/vt.h>
 #include <linux/vgaarb.h>
 #include <linux/acpi.h>
 #include <linux/pnp.h>
@@ -481,16 +479,15 @@ out:
 }
 
 #if IS_ENABLED(CONFIG_FB)
-static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
+static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 {
 	struct apertures_struct *ap;
 	struct pci_dev *pdev = dev_priv->dev->pdev;
 	bool primary;
-	int ret;
 
 	ap = alloc_apertures(1);
 	if (!ap)
-		return -ENOMEM;
+		return;
 
 	ap->ranges[0].base = dev_priv->gtt.mappable_base;
 	ap->ranges[0].size = dev_priv->gtt.mappable_end;
@@ -498,49 +495,14 @@ static int i915_kick_out_firmware_fb(str
 	primary =
 		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 
-	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
+	remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
 
 	kfree(ap);
 
-	return ret;
-}
-#else
-static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
-{
-	return 0;
-}
-#endif
-
-#if !defined(CONFIG_VGA_CONSOLE)
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
-{
-	return 0;
-}
-#elif !defined(CONFIG_DUMMY_CONSOLE)
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
-{
-	return -ENODEV;
 }
 #else
-static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
+static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 {
-	int ret = 0;
-
-	DRM_INFO("Replacing VGA console driver\n");
-
-	console_lock();
-	if (con_is_bound(&vga_con))
-		ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
-	if (ret == 0) {
-		ret = do_unregister_con_driver(&vga_con);
-
-		/* Ignore "already unregistered". */
-		if (ret == -ENODEV)
-			ret = 0;
-	}
-	console_unlock();
-
-	return ret;
 }
 #endif
 
@@ -869,19 +831,7 @@ int i915_driver_load(struct drm_device *
 	if (ret)
 		goto out_freecsr;
 
-	/* WARNING: Apparently we must kick fbdev drivers before vgacon,
-	 * otherwise the vga fbdev driver falls over. */
-	ret = i915_kick_out_firmware_fb(dev_priv);
-	if (ret) {
-		DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
-		goto out_gtt;
-	}
-
-	ret = i915_kick_out_vgacon(dev_priv);
-	if (ret) {
-		DRM_ERROR("failed to remove conflicting VGA console\n");
-		goto out_gtt;
-	}
+	i915_kick_out_firmware_fb(dev_priv);
 
 	pci_set_master(dev->pdev);
 
