summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/object.c b/object.c
index c650e0e..a69290e 100644
--- a/object.c
+++ b/object.c
@@ -1,5 +1,5 @@
#include <stdio.h>
-#include <xf86drm.h>
+#include <stdint.h>
#include <nouveau_drm.h>
#include <nouveau_class.h>
#include <nouveau_notifier.h>
@@ -19,25 +19,32 @@ struct nouveau_grobj *grobj[6]={
int object_list_create(int class_3d)
{
if (nouveau_grobj_alloc(chan, Nv3D, class_3d, &grobj[NvSub3D])) {
+ object_list_close();
return 1;
}
if (nouveau_grobj_alloc(chan, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D, &grobj[NvSubCtxSurf2D])) {
+ object_list_close();
return 1;
}
if (nouveau_grobj_alloc(chan, NvImageBlit, NV12_IMAGE_BLIT, &grobj[NvSubImageBlit])) {
+ object_list_close();
return 1;
}
if (nouveau_grobj_alloc(chan, NvImagePattern, NV04_IMAGE_PATTERN, &grobj[NvSubImagePattern])) {
+ object_list_close();
return 1;
}
if (nouveau_grobj_alloc(chan, NvRasterOp, NV03_CONTEXT_ROP, &grobj[NvSubRasterOp])) {
+ object_list_close();
return 1;
}
if (nouveau_grobj_alloc(chan, NvClipRect, NV01_CONTEXT_CLIP_RECTANGLE, &grobj[NvSubClipRect])) {
+ object_list_close();
return 1;
}
if (nouveau_notifier_alloc(chan, NvSyncNotify, 1, &notifier)!=0) {
+ object_list_close();
return 1;
}
@@ -51,10 +58,12 @@ void object_list_close(void)
for (i=0; i<6; i++) {
if (grobj[i]) {
nouveau_grobj_free(&grobj[i]);
+ grobj[i] = NULL;
}
}
if (notifier) {
nouveau_notifier_free(&notifier);
+ notifier = NULL;
}
}