Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311569
b: refs/heads/master
c: 9f846a1
h: refs/heads/master
i:
  311567: 6b700bb
v: v3
  • Loading branch information
Daniel Vetter authored and Dave Airlie committed Jul 3, 2012
1 parent 752b085 commit f5bc08a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b668ebe2fce517873b0c28dd70c10fef1d3dc2f
refs/heads/master: 9f846a16d213523fbe6daea17e20df6b8ac5a1e5
37 changes: 30 additions & 7 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,27 @@ i915_mtrr_setup(struct drm_i915_private *dev_priv, unsigned long base,
}
}

static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
{
struct apertures_struct *ap;
struct pci_dev *pdev = dev_priv->dev->pdev;
bool primary;

ap = alloc_apertures(1);
if (!ap)
return;

ap->ranges[0].base = dev_priv->dev->agp->base;
ap->ranges[0].size =
dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
primary =
pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;

remove_conflicting_framebuffers(ap, "inteldrmfb", primary);

kfree(ap);
}

/**
* i915_driver_load - setup chip and create an initial config
* @dev: DRM device
Expand Down Expand Up @@ -1446,6 +1467,15 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
goto free_priv;
}

dev_priv->mm.gtt = intel_gtt_get();
if (!dev_priv->mm.gtt) {
DRM_ERROR("Failed to initialize GTT\n");
ret = -ENODEV;
goto put_bridge;
}

i915_kick_out_firmware_fb(dev_priv);

pci_set_master(dev->pdev);

/* overlay on gen2 is broken and can't address above 1G */
Expand All @@ -1471,13 +1501,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
goto put_bridge;
}

dev_priv->mm.gtt = intel_gtt_get();
if (!dev_priv->mm.gtt) {
DRM_ERROR("Failed to initialize GTT\n");
ret = -ENODEV;
goto out_rmmap;
}

aperture_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;

dev_priv->mm.gtt_mapping =
Expand Down

0 comments on commit f5bc08a

Please sign in to comment.