intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: refuse to load on gen6+ without kms
@ 2012-03-26 19:33 Daniel Vetter
  2012-03-26 19:44 ` Chris Wilson
  2012-03-26 20:06 ` Adam Jackson
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Vetter @ 2012-03-26 19:33 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Spurred by an irc discussion, let's start to clear up which parts of
our kms + ums/gem + ums/dri1 + vbios/dri1 kernel driver pieces
userspace in the wild actually uses.

The idea is that we introduce checks at entry-points (module load
time, ioctls, ...) first and then reap any obviously dead code in a
second step.

As a first step refuse to load without kms on chips where userspace
never supported ums. Now upstream hasn't supported ums on ilk, ever.
But RHEL had the great idea to backport the kms support to their ums
driver.

Cc: Dave Airlie <airlied@gmail.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_dma.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 64dfbb8..8567fdf 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1955,9 +1955,17 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base,
 int i915_driver_load(struct drm_device *dev, unsigned long flags)
 {
 	struct drm_i915_private *dev_priv;
+	struct intel_device_info *info;
 	int ret = 0, mmio_bar;
 	uint32_t agp_size;
 
+	info = (struct intel_device_info *) flags;
+
+	/* Refuse to load on gen6+ without kms enabled. */
+	if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET))
+		return -ENODEV;
+
+
 	/* i915 has 4 more counters */
 	dev->counters += 4;
 	dev->types[6] = _DRM_STAT_IRQ;
@@ -1971,7 +1979,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 
 	dev->dev_private = (void *)dev_priv;
 	dev_priv->dev = dev;
-	dev_priv->info = (struct intel_device_info *) flags;
+	dev_priv->info = info;
 
 	if (i915_get_bridge_dev(dev)) {
 		ret = -EIO;
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-03-31 10:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-26 19:33 [PATCH] drm/i915: refuse to load on gen6+ without kms Daniel Vetter
2012-03-26 19:44 ` Chris Wilson
2012-03-26 19:50   ` Daniel Vetter
2012-03-26 21:21     ` Chris Wilson
2012-03-26 20:06 ` Adam Jackson
2012-03-26 20:37   ` [PATCH] drm/i915: disallow gem init ioctl on ilk Daniel Vetter
2012-03-26 20:43     ` Adam Jackson
2012-03-31 10:05       ` Daniel Vetter
2012-03-26 21:16     ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).