Lines Matching refs:dri

70 static int import_into_minigbm(struct dri_driver *dri, struct bo *bo)  in import_into_minigbm()  argument
75 if (!dri->image_extension->queryImage(bo->priv, __DRI_IMAGE_ATTRIB_FD, &prime_fd)) in import_into_minigbm()
98 struct dri_driver *dri = drv->priv; in dri_init() local
99 dri->driver_handle = dlopen(dri_so_path, RTLD_NOW | RTLD_GLOBAL); in dri_init()
100 if (!dri->driver_handle) in dri_init()
104 get_extensions = dlsym(dri->driver_handle, fname); in dri_init()
108 dri->extensions = get_extensions(); in dri_init()
109 if (!dri->extensions) in dri_init()
112 if (!lookup_extension(dri->extensions, __DRI_CORE, 2, in dri_init()
113 (const __DRIextension **)&dri->core_extension)) in dri_init()
117 if (!lookup_extension(dri->extensions, __DRI_DRI2, 4, in dri_init()
118 (const __DRIextension **)&dri->dri2_extension)) in dri_init()
121 dri->device = dri->dri2_extension->createNewScreen2(0, drv_get_fd(drv), loader_extensions, in dri_init()
122 dri->extensions, &dri->configs, NULL); in dri_init()
123 if (!dri->device) in dri_init()
126 dri->context = in dri_init()
127 dri->dri2_extension->createNewContext(dri->device, *dri->configs, NULL, NULL); in dri_init()
129 if (!dri->context) in dri_init()
132 if (!lookup_extension(dri->core_extension->getExtensions(dri->device), __DRI_IMAGE, 12, in dri_init()
133 (const __DRIextension **)&dri->image_extension)) in dri_init()
136 if (!lookup_extension(dri->core_extension->getExtensions(dri->device), __DRI2_FLUSH, 4, in dri_init()
137 (const __DRIextension **)&dri->flush_extension)) in dri_init()
143 dri->core_extension->destroyContext(dri->context); in dri_init()
145 dri->core_extension->destroyScreen(dri->device); in dri_init()
147 dlclose(dri->driver_handle); in dri_init()
148 dri->driver_handle = NULL; in dri_init()
157 struct dri_driver *dri = drv->priv; in dri_close() local
159 dri->core_extension->destroyContext(dri->context); in dri_close()
160 dri->core_extension->destroyScreen(dri->device); in dri_close()
161 dlclose(dri->driver_handle); in dri_close()
162 dri->driver_handle = NULL; in dri_close()
170 struct dri_driver *dri = bo->drv->priv; in dri_bo_create() local
184 bo->priv = dri->image_extension->createImage(dri->device, width, height, dri_format, in dri_bo_create()
191 ret = import_into_minigbm(dri, bo); in dri_bo_create()
195 if (!dri->image_extension->queryImage(bo->priv, __DRI_IMAGE_ATTRIB_STRIDE, &stride)) { in dri_bo_create()
200 if (!dri->image_extension->queryImage(bo->priv, __DRI_IMAGE_ATTRIB_OFFSET, &offset)) { in dri_bo_create()
212 dri->image_extension->destroyImage(bo->priv); in dri_bo_create()
219 struct dri_driver *dri = bo->drv->priv; in dri_bo_import() local
224 bo->priv = dri->image_extension->createImageFromFds(dri->device, data->width, data->height, in dri_bo_import()
232 ret = import_into_minigbm(dri, bo); in dri_bo_import()
234 dri->image_extension->destroyImage(bo->priv); in dri_bo_import()
243 struct dri_driver *dri = bo->drv->priv; in dri_bo_destroy() local
246 dri->image_extension->destroyImage(bo->priv); in dri_bo_destroy()
262 struct dri_driver *dri = bo->drv->priv; in dri_bo_map() local
266 dri->image_extension->mapImage(dri->context, bo->priv, 0, 0, bo->width, bo->height, in dri_bo_map()
276 struct dri_driver *dri = bo->drv->priv; in dri_bo_unmap() local
279 dri->image_extension->unmapImage(dri->context, bo->priv, vma->priv); in dri_bo_unmap()
289 dri->flush_extension->flush_with_flags(dri->context, NULL, __DRI2_FLUSH_CONTEXT, 0); in dri_bo_unmap()