Re: [Intel-gfx] [PATCH 07/12] drm/i915: only enable drm agp support when required

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 12, 2012 at 02:58:25PM +0300, Jani Nikula wrote:
> On Thu, 07 Jun 2012, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
> > We need it for all things ums (which essentially only means up to
> > gen5) and to support b0rked XvMC userspace on gen3.
> >
> > Signed-Off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_dma.c |   21 ++++++++++++---------
> >  1 files changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index e4203df..0ab5d3d 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1422,15 +1422,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >  	int ret = 0, mmio_bar;
> >  	uint32_t aperture_size;
> >  
> > -	ret = drm_pci_agp_init(dev);
> > -	if (ret)
> > -		return ret;
> > -
> > -	if (!dev->agp) {
> > -		DRM_ERROR("Cannot initialize the agpgart module.\n");
> > -		return -EINVAL;
> > -	}
> > -
> >  	info = (struct intel_device_info *) flags;
> >  
> >  	/* Refuse to load on gen6+ without kms enabled. */
> > @@ -1453,6 +1444,18 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >  	dev_priv->dev = dev;
> >  	dev_priv->info = info;
> >  
> > +	if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
> > +	    IS_GEN3(dev)) {
> > +		ret = drm_pci_agp_init(dev);
> > +		if (ret)
> > +			return ret;
> > +
> > +		if (!dev->agp) {
> > +			DRM_ERROR("Cannot initialize the agpgart module.\n");
> > +			return -EINVAL;
> > +		}
> 
> You need to goto free_priv in the above error paths.

Nice catch, will fix.

> Should there be a deinit of drm_pci_agp_init() if something goes wrong
> afterwards?

drm core should do that for use (but currently doesn't) by deinit agp if
it's initialized. The follow-up patches to wrestle the drm driver init
paths /should/ take care of this though.
-Daniel
-- 
Daniel Vetter
Mail: daniel@xxxxxxxx
Mobile: +41 (0)79 365 57 48
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux