Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260057
b: refs/heads/master
c: 7d7b7ad
h: refs/heads/master
i:
  260055: 80b867c
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 15, 2011
1 parent c6c4ea4 commit df72234
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 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: 7dfe43c52d2cd595964c38281499c5361a0a8e85
refs/heads/master: 7d7b7adf6bf934064c8fdc4031e75f1a20aaac92
24 changes: 24 additions & 0 deletions trunk/drivers/staging/gma500/gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,37 @@ int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
}
}

static int psb_gem_create_stolen(struct drm_file *file, struct drm_device *dev,
int size, u32 *handle)
{
struct gtt_range *gtt = psb_gtt_alloc_range(dev, size, "gem", 1);
if (gtt == NULL)
return -ENOMEM;
if (drm_gem_private_object_init(dev, &gtt->gem, size) != 0)
goto free_gtt;
if (drm_gem_handle_create(file, &gtt->gem, handle) == 0)
return 0;
free_gtt:
psb_gtt_free_range(dev, gtt);
return -ENOMEM;
}

/*
* GEM interfaces for our specific client
*/
int psb_gem_create_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_psb_gem_create *args = data;
int ret;
if (args->flags & PSB_GEM_CREATE_STOLEN) {
ret = psb_gem_create_stolen(file, dev, args->size,
&args->handle);
if (ret == 0)
return 0;
/* Fall throguh */
args->flags &= ~PSB_GEM_CREATE_STOLEN;
}
return psb_gem_create(file, dev, args->size, &args->handle);
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/staging/gma500/psb_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ struct psb_drm_dpu_rect {
struct drm_psb_gem_create {
__u64 size;
__u32 handle;
__u32 pad;
__u32 flags;
#define PSB_GEM_CREATE_STOLEN 1 /* Stolen memory can be used */
};

#define PSB_2D_OP_BUFLEN 16
Expand Down

0 comments on commit df72234

Please sign in to comment.