From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: kick any firmware framebuffers before claiming the gtt Date: Mon, 11 Jun 2012 18:13:44 +0200 Message-ID: <20120611161344.GF4695@phenom.ffwll.local> References: <1339427223-29805-1-git-send-email-daniel.vetter@ffwll.ch> <20120611153513.GW13065@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B92E9F04C for ; Mon, 11 Jun 2012 09:12:15 -0700 (PDT) Received: by wibhm14 with SMTP id hm14so2270359wib.12 for ; Mon, 11 Jun 2012 09:12:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20120611153513.GW13065@intel.com> 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: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Mon, Jun 11, 2012 at 06:35:13PM +0300, Ville Syrj=E4l=E4 wrote: > On Mon, Jun 11, 2012 at 05:07:03PM +0200, Daniel Vetter wrote: > > Especially vesafb likes to map everything as uc- (yikes), and if that > > mapping hangs around still while we try to map the gtt as wc the > > kernel will downgrade our request to uc-, resulting in abyssal > > performance. > > = > > Unfortunately we can't do this as early as readon does (i.e. as the > > first thing we do when initializing the hw) because our fb/mmio space > > region moves around on a per-gen basis. So I've had to move it below > > the gtt initialization, but that seems to work, too. The important > > thing is that we do this before we set up the gtt wc mapping. > > = > > Now an altogether different question is why people compile their > > kernels with vesafb enabled, but I guess making things just work isn't > > bad per se ... > > = > > Reported-and-tested-by: "Kilarski, Bernard R" > > Signed-Off-by: Daniel Vetter > > --- > > drivers/gpu/drm/i915/i915_dma.c | 35 ++++++++++++++++++++++++++++---= ---- > > 1 file changed, 28 insertions(+), 7 deletions(-) > > = > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i91= 5_dma.c > > index 262a74d..6be01c8 100644 > > --- a/drivers/gpu/drm/i915/i915_dma.c > > +++ b/drivers/gpu/drm/i915/i915_dma.c > > @@ -1401,6 +1401,25 @@ i915_mtrr_setup(struct drm_i915_private *dev_pri= v, unsigned long base, > > } > > } > > = > > +static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_pri= v) > > +{ > > + struct apertures_struct *ap; > > + struct pci_dev *pdev =3D dev_priv->dev->pdev; > > + bool primary =3D false; > > + > > + ap =3D alloc_apertures(1); > > + ap->ranges[0].base =3D dev_priv->dev->agp->base; > > + ap->ranges[0].size =3D > > + dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; > > + > > +#ifdef CONFIG_X86 > > + primary =3D pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_S= HADOW; > > +#endif > > + > > + remove_conflicting_framebuffers(ap, "radeondrmfb", primary); > ^^^^^^^^^^^ > = > Nice disguise :) Meh, failure to git add :( I'll fix it up with the other thing Jani noticed. -Daniel -- = Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48