From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: refuse to load on gen6+ without kms Date: Mon, 26 Mar 2012 22:21:57 +0100 Message-ID: <1332796926_104488@CP5-2952> References: <1332790398-5837-1-git-send-email-daniel.vetter@ffwll.ch> <1332791100_103676@CP5-2952> <20120326194957.GA1618@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id D2B589ED17 for ; Mon, 26 Mar 2012 14:22:09 -0700 (PDT) In-Reply-To: <20120326194957.GA1618@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Mon, 26 Mar 2012 21:50:17 +0200, Daniel Vetter wrote: > On Mon, Mar 26, 2012 at 08:44:51PM +0100, Chris Wilson wrote: > > On Mon, 26 Mar 2012 21:33:18 +0200, Daniel Vetter wrote: > > > 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 > > > Signed-Off-by: Daniel Vetter > > > --- > > > 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; > > > > The problem here is that this highlights that with the default > > configuration we have no driver for our current hardware in the kernel. > > Well, with the default configuration we _do_ have no driver for our > hardware. Non-kms doesn't do anything really on it's own, and without any > userspace existing no-one will call the entervt or gem_init ioctls. > > No change at all imo. Just to make me happy, can you add a warning here that we are refusing to load the driver because the user hasn't set a flag? DRM_INFO("Not loading driver without KMS as this is an unsupported configuration for this hardware; please enable CONFIG_DRM_I915_KMS or pass i915.modeset=1 to proceed.\n"); -Chris -- Chris Wilson, Intel Open Source Technology Centre