Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259665
b: refs/heads/master
c: 635816e
h: refs/heads/master
i:
  259663: a177ff4
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent d05b15d commit 71a96ff
Show file tree
Hide file tree
Showing 4 changed files with 54 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: f0017b10499f1074d3b3c9a438bc9150940d9dc9
refs/heads/master: 635816e1b87923f6715b8eec412c5eb32506805f
3 changes: 2 additions & 1 deletion trunk/drivers/staging/gma500/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
ccflags-y += -Iinclude/drm

psb_gfx-y += psb_bl.o \
psb_gfx-y += gem_glue.o \
psb_bl.o \
psb_drv.o \
psb_gem.o \
psb_fb.o \
Expand Down
47 changes: 47 additions & 0 deletions trunk/drivers/staging/gma500/gem_glue.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**************************************************************************
* Copyright (c) 2011, Intel Corporation.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*
**************************************************************************/

#include <drm/drmP.h>
#include <drm/drm.h>

/**
* Initialize an already allocated GEM object of the specified size with
* no GEM provided backing store. Instead the caller is responsible for
* backing the object and handling it.
*/
int drm_gem_private_object_init(struct drm_device *dev,
struct drm_gem_object *obj, size_t size)
{
BUG_ON((size & (PAGE_SIZE - 1)) != 0);

obj->dev = dev;
obj->filp = NULL;

kref_init(&obj->refcount);
atomic_set(&obj->handle_count, 0);
obj->size = size;

return 0;
}

void drm_gem_object_release_wrap(struct drm_gem_object *obj)
{
if (obj->filp)
drm_gem_object_release(obj);
}
4 changes: 4 additions & 0 deletions trunk/drivers/staging/gma500/gem_glue.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extern void drm_gem_object_release_wrap(struct drm_gem_object *obj);
extern int drm_gem_private_object_init(struct drm_device *dev,
struct drm_gem_object *obj, size_t size);

0 comments on commit 71a96ff

Please sign in to comment.