[PATCH 3/5] drm/vgem: Add a drm_vgem_gem_object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



and use it

Signed-off-by: Ben Widawsky <ben@xxxxxxxxxxxx>
---
 drivers/gpu/drm/vgem/vgem_drv.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 3084389..d47bd71 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -40,6 +40,10 @@
 #define DRIVER_MAJOR	1
 #define DRIVER_MINOR	0
 
+struct drm_vgem_gem_object {
+	struct drm_gem_object base;
+};
+
 static int vgem_load(struct drm_device *dev, unsigned long flags)
 {
 	return 0;
@@ -90,15 +94,18 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
 					      unsigned int *handle,
 					      unsigned long size)
 {
-	int err;
+	struct drm_vgem_gem_object *obj;
 	struct drm_gem_object *gem_object;
+	int err;
 
 	size = roundup(size, PAGE_SIZE);
 
-	gem_object = kzalloc(sizeof(*gem_object), GFP_KERNEL);
-	if (!gem_object)
+	obj = kzalloc(sizeof(*obj), GFP_KERNEL);
+	if (!obj)
 		return ERR_PTR(-ENOMEM);
 
+	gem_object = &obj->base;
+
 	if ((err = drm_gem_object_init(dev, gem_object, size)))
 		goto out;
 
-- 
1.7.9

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux