#include #include #include #include "screen.h" #include "fifo.h" #include "object.h" #include "nouveau_class.h" static int object_create(int handle, int num_class) { int ret; struct drm_nouveau_grobj_alloc o_ctx; o_ctx.channel = init.channel; o_ctx.handle = handle; o_ctx.class = num_class; ret = drmCommandWrite(drm_fd, DRM_NOUVEAU_GROBJ_ALLOC, &o_ctx, sizeof(o_ctx)); if (ret) { fprintf(stderr, "Failed to create object, handle 0x%08x, class 0x%08x\n", handle, num_class); return 1; } return 0; } int object_list_create(int class_3d) { if (object_create(Nv3D, class_3d)!=0) { return 1; } if (object_create(NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D)!=0) { return 1; } if (object_create(NvImageBlit, NV12_IMAGE_BLIT)!=0) { return 1; } return 0; }