/*
 * Function: XvMCDestroyContext
 * Description: Destorys the specified context.
 *
 * Arguments:
 *   display - Specifies the connection to the server.
 *   context - The context to be destroyed.
 *
 */
_X_EXPORT Status XvMCDestroyContext(Display * display, XvMCContext * context)
{
	Status ret;
	int screen;

	if (!display || !context)
		return XvMCBadContext;
	screen = DefaultScreen(display);
	ret = (xvmc_driver->destroy_context) (display, context);
	if (ret) {
		XVMC_ERR("destroy context fail\n");
		return ret;
	}

	intelFiniBatchBuffer();

	dri_bufmgr_destroy(xvmc_driver->bufmgr);

	ret = _xvmc_destroy_context(display, context);
	if (ret != Success) {
		XVMC_ERR("_xvmc_destroy_context fail\n");
		return ret;
	}

	if (xvmc_driver->num_ctx == 0) {
		pthread_mutex_destroy(&xvmc_driver->ctxmutex);

		if (xvmc_driver->fd >= 0)
			close(xvmc_driver->fd);

		xvmc_driver->fd = -1;
		intel_xvmc_dump_close();
	}
	return Success;
}
Пример #2
0
static void
intelDestroyScreen(__DRIscreen * sPriv)
{
   struct intel_screen *intelScreen = sPriv->driverPrivate;

   dri_bufmgr_destroy(intelScreen->bufmgr);
   driDestroyOptionInfo(&intelScreen->optionCache);

   free(intelScreen);
   sPriv->driverPrivate = NULL;
}
Пример #3
0
static void
intelDestroyScreen(__DRIscreen * sPriv)
{
   struct intel_screen *intelScreen = sPriv->driverPrivate;

   dri_bufmgr_destroy(intelScreen->bufmgr);
   driDestroyOptionInfo(&intelScreen->optionCache);

   /* Some regions may still have references to them at this point, so
    * flush the hash table to prevent _mesa_DeleteHashTable() from
    * complaining about the hash not being empty; */
   _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
   _mesa_DeleteHashTable(intelScreen->named_regions);

   free(intelScreen);
   sPriv->driverPrivate = NULL;
}