#include #include #include #include "nouveau_class.h" #include #include #include "screen.h" #include "fifo.h" #include "object.h" struct nouveau_notifier *notifier = NULL; struct nouveau_grobj *grobj[6]={ NULL, NULL, NULL, NULL, NULL, NULL }; 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, ¬ifier)!=0) { object_list_close(); return 1; } return 0; } void object_list_close(void) { int i; for (i=0; i<6; i++) { if (grobj[i]) { nouveau_grobj_free(&grobj[i]); grobj[i] = NULL; } } if (notifier) { nouveau_notifier_free(¬ifier); notifier = NULL; } }