diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-03-26 15:33:18 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-09 12:04:07 -0400 |
commit | 26394d9251879231b85e6c8cf899fa43e75c68f1 (patch) | |
tree | bedc4bc58e05b38bb0a0bc38e40ac46cba3cd1ef /drivers | |
parent | e7b4c6b122443254bc7cab0f17fd67871dbe0a19 (diff) |
drm/i915: refuse to load on gen6+ without kms
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 a9caf62b5dd2..4636391ded38 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1956,9 +1956,17 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base, | |||
1956 | int i915_driver_load(struct drm_device *dev, unsigned long flags) | 1956 | int i915_driver_load(struct drm_device *dev, unsigned long flags) |
1957 | { | 1957 | { |
1958 | struct drm_i915_private *dev_priv; | 1958 | struct drm_i915_private *dev_priv; |
1959 | struct intel_device_info *info; | ||
1959 | int ret = 0, mmio_bar; | 1960 | int ret = 0, mmio_bar; |
1960 | uint32_t aperture_size; | 1961 | uint32_t aperture_size; |
1961 | 1962 | ||
1963 | info = (struct intel_device_info *) flags; | ||
1964 | |||
1965 | /* Refuse to load on gen6+ without kms enabled. */ | ||
1966 | if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) | ||
1967 | return -ENODEV; | ||
1968 | |||
1969 | |||
1962 | /* i915 has 4 more counters */ | 1970 | /* i915 has 4 more counters */ |
1963 | dev->counters += 4; | 1971 | dev->counters += 4; |
1964 | dev->types[6] = _DRM_STAT_IRQ; | 1972 | dev->types[6] = _DRM_STAT_IRQ; |
@@ -1972,7 +1980,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1972 | 1980 | ||
1973 | dev->dev_private = (void *)dev_priv; | 1981 | dev->dev_private = (void *)dev_priv; |
1974 | dev_priv->dev = dev; | 1982 | dev_priv->dev = dev; |
1975 | dev_priv->info = (struct intel_device_info *) flags; | 1983 | dev_priv->info = info; |
1976 | 1984 | ||
1977 | if (i915_get_bridge_dev(dev)) { | 1985 | if (i915_get_bridge_dev(dev)) { |
1978 | ret = -EIO; | 1986 | ret = -EIO; |