Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358000
b: refs/heads/master
c: 93d1879
h: refs/heads/master
v: v3
  • Loading branch information
Ben Widawsky authored and Daniel Vetter committed Jan 20, 2013
1 parent 2a892aa commit 2b491ef
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 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: dabb7a91ae6442d642a52e0de22d781a8ad2af12
refs/heads/master: 93d187993b783c68383a884091a600d9ad499ea6
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
seq_printf(m, "%u fault mappable objects, %zu bytes\n",
count, size);

seq_printf(m, "%zu [%zu] gtt total\n",
seq_printf(m, "%zu [%lu] gtt total\n",
dev_priv->gtt.total,
dev_priv->gtt.mappable_end - dev_priv->gtt.start);

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,8 +1427,8 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
return;

ap->ranges[0].base = dev_priv->gtt.mappable_base;
ap->ranges[0].size =
dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
ap->ranges[0].size = dev_priv->gtt.mappable_end - dev_priv->gtt.start;

primary =
pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;

Expand Down Expand Up @@ -1542,7 +1542,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
goto put_gmch;
}

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

dev_priv->gtt.mappable =
io_mapping_create_wc(dev_priv->gtt.mappable_base,
Expand Down Expand Up @@ -1699,7 +1699,7 @@ int i915_driver_unload(struct drm_device *dev)
if (dev_priv->mm.gtt_mtrr >= 0) {
mtrr_del(dev_priv->mm.gtt_mtrr,
dev_priv->gtt.mappable_base,
dev_priv->mm.gtt->gtt_mappable_entries * PAGE_SIZE);
dev_priv->gtt.mappable_end);
dev_priv->mm.gtt_mtrr = -1;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ int
i915_gem_init_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_init *args = data;

if (drm_core_check_feature(dev, DRIVER_MODESET))
Expand All @@ -165,6 +166,7 @@ i915_gem_init_ioctl(struct drm_device *dev, void *data,
mutex_lock(&dev->struct_mutex);
i915_gem_setup_global_gtt(dev, args->gtt_start, args->gtt_end,
args->gtt_end);
dev_priv->gtt.mappable_end = args->gtt_end;
mutex_unlock(&dev->struct_mutex);

return 0;
Expand Down
15 changes: 7 additions & 8 deletions trunk/drivers/gpu/drm/i915/i915_gem_gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
}

dev_priv->gtt.start = start;
dev_priv->gtt.mappable_end = mappable_end;
dev_priv->gtt.total = end - start;

/* Clear any non-preallocated blocks */
Expand Down Expand Up @@ -596,7 +595,7 @@ void i915_gem_init_global_gtt(struct drm_device *dev)
int ret;

gtt_size = dev_priv->mm.gtt->gtt_total_entries << PAGE_SHIFT;
mappable_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
mappable_size = dev_priv->gtt.mappable_end;

if (intel_enable_ppgtt(dev) && HAS_ALIASING_PPGTT(dev)) {
/* PPGTT pdes are stolen from global gtt ptes, so shrink the
Expand Down Expand Up @@ -692,6 +691,7 @@ int i915_gem_gtt_init(struct drm_device *dev)
int ret;

dev_priv->gtt.mappable_base = pci_resource_start(dev->pdev, 2);
dev_priv->gtt.mappable_end = pci_resource_len(dev->pdev, 2);

/* On modern platforms we need not worry ourself with the legacy
* hostbridge query stuff. Skip it entirely
Expand Down Expand Up @@ -735,14 +735,13 @@ int i915_gem_gtt_init(struct drm_device *dev)
else
dev_priv->mm.gtt->stolen_size = gen7_get_stolen_size(snb_gmch_ctl);

dev_priv->mm.gtt->gtt_mappable_entries = pci_resource_len(dev->pdev, 2) >> PAGE_SHIFT;
/* 64/512MB is the current min/max we actually know of, but this is just a
* coarse sanity check.
*/
if ((dev_priv->mm.gtt->gtt_mappable_entries >> 8) < 64 ||
dev_priv->mm.gtt->gtt_mappable_entries > dev_priv->mm.gtt->gtt_total_entries) {
DRM_ERROR("Unknown GMADR entries (%d)\n",
dev_priv->mm.gtt->gtt_mappable_entries);
if ((dev_priv->gtt.mappable_end < (64<<20) ||
(dev_priv->gtt.mappable_end > (512<<20)))) {
DRM_ERROR("Unknown GMADR size (%lx)\n",
dev_priv->gtt.mappable_end);
ret = -ENXIO;
goto err_out;
}
Expand All @@ -764,7 +763,7 @@ int i915_gem_gtt_init(struct drm_device *dev)

/* GMADR is the PCI aperture used by SW to access tiled GFX surfaces in a linear fashion. */
DRM_INFO("Memory usable by graphics device = %dM\n", dev_priv->mm.gtt->gtt_total_entries >> 8);
DRM_DEBUG_DRIVER("GMADR size = %dM\n", dev_priv->mm.gtt->gtt_mappable_entries >> 8);
DRM_DEBUG_DRIVER("GMADR size = %ldM\n", dev_priv->gtt.mappable_end >> 20);
DRM_DEBUG_DRIVER("GTT stolen size = %dM\n", dev_priv->mm.gtt->stolen_size >> 20);

return 0;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/gpu/drm/i915/intel_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
goto out_unpin;
}
info->apertures->ranges[0].base = dev->mode_config.fb_base;
info->apertures->ranges[0].size =
dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
info->apertures->ranges[0].size = dev_priv->gtt.mappable_end;

info->fix.smem_start = dev->mode_config.fb_base + obj->gtt_offset;
info->fix.smem_len = size;
Expand Down

0 comments on commit 2b491ef

Please sign in to comment.