-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add this temporarily so we can keep making progress and also bundle all the GEM bits we need together in our staging driver while we get them into GEM itself. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
- Loading branch information
Alan Cox
authored and
Greg Kroah-Hartman
committed
Jul 5, 2011
1 parent
f0017b1
commit 635816e
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|