Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287415
b: refs/heads/master
c: c5b1247
h: refs/heads/master
i:
  287413: 41b786b
  287411: c167a86
  287407: 752ae62
v: v3
  • Loading branch information
Rob Clark authored and Greg Kroah-Hartman committed Feb 8, 2012
1 parent 226c5a0 commit b0f9c79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 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: a9e8d70c1ac6c9ccf6852c91e082e28249564e6e
refs/heads/master: c5b1247bd1c3ab6722acfa95213be9a16bfb664c
18 changes: 14 additions & 4 deletions trunk/drivers/staging/omapdrm/omap_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ struct omap_gem_object {
} *sync;
};

static int get_pages(struct drm_gem_object *obj, struct page ***pages);
static uint64_t mmap_offset(struct drm_gem_object *obj);

/* To deal with userspace mmap'ings of 2d tiled buffers, which (a) are
* not necessarily pinned in TILER all the time, and (b) when they are
* they are not necessarily page aligned, we reserve one or more small
Expand Down Expand Up @@ -149,7 +152,7 @@ static void evict_entry(struct drm_gem_object *obj,
{
if (obj->dev->dev_mapping) {
size_t size = PAGE_SIZE * usergart[fmt].height;
loff_t off = omap_gem_mmap_offset(obj) +
loff_t off = mmap_offset(obj) +
(entry->obj_pgoff << PAGE_SHIFT);
unmap_mapping_range(obj->dev->dev_mapping, off, size, 1);
}
Expand Down Expand Up @@ -189,8 +192,6 @@ static inline bool is_shmem(struct drm_gem_object *obj)
return obj->filp != NULL;
}

static int get_pages(struct drm_gem_object *obj, struct page ***pages);

static DEFINE_SPINLOCK(sync_lock);

/** ensure backing pages are allocated */
Expand Down Expand Up @@ -251,7 +252,7 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj)
}

/** get mmap offset */
uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj)
static uint64_t mmap_offset(struct drm_gem_object *obj)
{
if (!obj->map_list.map) {
/* Make it mmapable */
Expand All @@ -267,6 +268,15 @@ uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj)
return (uint64_t)obj->map_list.hash.key << PAGE_SHIFT;
}

uint64_t omap_gem_mmap_offset(struct drm_gem_object *obj)
{
uint64_t offset;
mutex_lock(&obj->dev->struct_mutex);
offset = mmap_offset(obj);
mutex_unlock(&obj->dev->struct_mutex);
return offset;
}

/** get mmap size */
size_t omap_gem_mmap_size(struct drm_gem_object *obj)
{
Expand Down

0 comments on commit b0f9c79

Please sign in to comment.