Commit 5cdf5881 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Make get/put pages static

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 8f2480fb
...@@ -406,16 +406,19 @@ static int i915_hws_info(struct seq_file *m, void *data) ...@@ -406,16 +406,19 @@ static int i915_hws_info(struct seq_file *m, void *data)
return 0; return 0;
} }
static void i915_dump_pages(struct seq_file *m, struct page **pages, int page_count) static void i915_dump_object(struct seq_file *m,
struct io_mapping *mapping,
struct drm_i915_gem_object *obj_priv)
{ {
int page, i; int page, page_count, i;
uint32_t *mem;
page_count = obj_priv->base.size / PAGE_SIZE;
for (page = 0; page < page_count; page++) { for (page = 0; page < page_count; page++) {
mem = kmap(pages[page]); u32 *mem = io_mapping_map_wc(mapping,
obj_priv->gtt_offset + page * PAGE_SIZE);
for (i = 0; i < PAGE_SIZE; i += 4) for (i = 0; i < PAGE_SIZE; i += 4)
seq_printf(m, "%08x : %08x\n", i, mem[i / 4]); seq_printf(m, "%08x : %08x\n", i, mem[i / 4]);
kunmap(pages[page]); io_mapping_unmap(mem);
} }
} }
...@@ -436,16 +439,9 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data) ...@@ -436,16 +439,9 @@ static int i915_batchbuffer_info(struct seq_file *m, void *data)
list) { list) {
obj = &obj_priv->base; obj = &obj_priv->base;
if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) { if (obj->read_domains & I915_GEM_DOMAIN_COMMAND) {
ret = i915_gem_object_get_pages(obj, 0); seq_printf(m, "--- gtt_offset = 0x%08x\n",
if (ret) { obj_priv->gtt_offset);
mutex_unlock(&dev->struct_mutex); i915_dump_object(m, dev_priv->mm.gtt_mapping, obj_priv);
return ret;
}
seq_printf(m, "--- gtt_offset = 0x%08x\n", obj_priv->gtt_offset);
i915_dump_pages(m, obj_priv->pages, obj->size / PAGE_SIZE);
i915_gem_object_put_pages(obj);
} }
} }
......
...@@ -1055,8 +1055,6 @@ int i915_gem_attach_phys_object(struct drm_device *dev, ...@@ -1055,8 +1055,6 @@ int i915_gem_attach_phys_object(struct drm_device *dev,
void i915_gem_detach_phys_object(struct drm_device *dev, void i915_gem_detach_phys_object(struct drm_device *dev,
struct drm_gem_object *obj); struct drm_gem_object *obj);
void i915_gem_free_all_phys_object(struct drm_device *dev); void i915_gem_free_all_phys_object(struct drm_device *dev);
int i915_gem_object_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
void i915_gem_object_put_pages(struct drm_gem_object *obj);
void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv); void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv);
void i915_gem_shrinker_init(void); void i915_gem_shrinker_init(void);
......
...@@ -58,6 +58,13 @@ static int i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *o ...@@ -58,6 +58,13 @@ static int i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *o
struct drm_file *file_priv); struct drm_file *file_priv);
static void i915_gem_free_object_tail(struct drm_gem_object *obj); static void i915_gem_free_object_tail(struct drm_gem_object *obj);
static int
i915_gem_object_get_pages(struct drm_gem_object *obj,
gfp_t gfpmask);
static void
i915_gem_object_put_pages(struct drm_gem_object *obj);
static LIST_HEAD(shrink_list); static LIST_HEAD(shrink_list);
static DEFINE_SPINLOCK(shrink_list_lock); static DEFINE_SPINLOCK(shrink_list_lock);
...@@ -1021,7 +1028,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, ...@@ -1021,7 +1028,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
if (obj_priv->phys_obj) if (obj_priv->phys_obj)
ret = i915_gem_phys_pwrite(dev, obj, args, file_priv); ret = i915_gem_phys_pwrite(dev, obj, args, file_priv);
else if (obj_priv->tiling_mode == I915_TILING_NONE && else if (obj_priv->tiling_mode == I915_TILING_NONE &&
dev->gtt_total != 0 && obj_priv->gtt_space &&
obj->write_domain != I915_GEM_DOMAIN_CPU) { obj->write_domain != I915_GEM_DOMAIN_CPU) {
ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv); ret = i915_gem_gtt_pwrite_fast(dev, obj, args, file_priv);
if (ret == -EFAULT) { if (ret == -EFAULT) {
...@@ -1501,7 +1508,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data, ...@@ -1501,7 +1508,7 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
return 0; return 0;
} }
void static void
i915_gem_object_put_pages(struct drm_gem_object *obj) i915_gem_object_put_pages(struct drm_gem_object *obj)
{ {
struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); struct drm_i915_gem_object *obj_priv = to_intel_bo(obj);
...@@ -2174,7 +2181,7 @@ i915_gpu_idle(struct drm_device *dev) ...@@ -2174,7 +2181,7 @@ i915_gpu_idle(struct drm_device *dev)
return 0; return 0;
} }
int static int
i915_gem_object_get_pages(struct drm_gem_object *obj, i915_gem_object_get_pages(struct drm_gem_object *obj,
gfp_t gfpmask) gfp_t gfpmask)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment