Skip to content

Commit 26394d9

Browse files
committed
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>
1 parent e7b4c6b commit 26394d9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpu/drm/i915/i915_dma.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,9 +1956,17 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base,
19561956
int i915_driver_load(struct drm_device *dev, unsigned long flags)
19571957
{
19581958
struct drm_i915_private *dev_priv;
1959+
struct intel_device_info *info;
19591960
int ret = 0, mmio_bar;
19601961
uint32_t aperture_size;
19611962

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+
19621970
/* i915 has 4 more counters */
19631971
dev->counters += 4;
19641972
dev->types[6] = _DRM_STAT_IRQ;
@@ -1972,7 +1980,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
19721980

19731981
dev->dev_private = (void *)dev_priv;
19741982
dev_priv->dev = dev;
1975-
dev_priv->info = (struct intel_device_info *) flags;
1983+
dev_priv->info = info;
19761984

19771985
if (i915_get_bridge_dev(dev)) {
19781986
ret = -EIO;

0 commit comments

Comments
 (0)