Lines Matching refs:resource
168 struct tegra_resource *resource) in tegra_screen_import_resource() argument
178 status = screen->gpu->resource_get_handle(screen->gpu, NULL, resource->gpu, in tegra_screen_import_resource()
190 resource->modifier = handle.modifier; in tegra_screen_import_resource()
191 resource->stride = handle.stride; in tegra_screen_import_resource()
194 err = drmPrimeFDToHandle(screen->fd, fd, &resource->handle); in tegra_screen_import_resource()
209 struct tegra_resource *resource; in tegra_screen_resource_create() local
212 resource = calloc(1, sizeof(*resource)); in tegra_screen_resource_create()
213 if (!resource) in tegra_screen_resource_create()
230 resource->gpu = screen->gpu->resource_create_with_modifiers(screen->gpu, in tegra_screen_resource_create()
233 if (!resource->gpu) in tegra_screen_resource_create()
238 err = tegra_screen_import_resource(screen, resource); in tegra_screen_resource_create()
243 memcpy(&resource->base, resource->gpu, sizeof(*resource->gpu)); in tegra_screen_resource_create()
244 pipe_reference_init(&resource->base.reference, 1); in tegra_screen_resource_create()
245 resource->base.screen = &screen->base; in tegra_screen_resource_create()
247 return &resource->base; in tegra_screen_resource_create()
250 screen->gpu->resource_destroy(screen->gpu, resource->gpu); in tegra_screen_resource_create()
252 free(resource); in tegra_screen_resource_create()
263 struct pipe_resource *resource; in tegra_screen_resource_create_front() local
265 resource = screen->gpu->resource_create_front(screen->gpu, template, in tegra_screen_resource_create_front()
267 if (resource) in tegra_screen_resource_create_front()
268 resource->screen = pscreen; in tegra_screen_resource_create_front()
270 return resource; in tegra_screen_resource_create_front()
280 struct tegra_resource *resource; in tegra_screen_resource_from_handle() local
282 resource = calloc(1, sizeof(*resource)); in tegra_screen_resource_from_handle()
283 if (!resource) in tegra_screen_resource_from_handle()
286 resource->gpu = screen->gpu->resource_from_handle(screen->gpu, template, in tegra_screen_resource_from_handle()
288 if (!resource->gpu) { in tegra_screen_resource_from_handle()
289 free(resource); in tegra_screen_resource_from_handle()
293 memcpy(&resource->base, resource->gpu, sizeof(*resource->gpu)); in tegra_screen_resource_from_handle()
294 pipe_reference_init(&resource->base.reference, 1); in tegra_screen_resource_from_handle()
295 resource->base.screen = &screen->base; in tegra_screen_resource_from_handle()
297 return &resource->base; in tegra_screen_resource_from_handle()
307 struct pipe_resource *resource; in tegra_screen_resource_from_user_memory() local
309 resource = screen->gpu->resource_from_user_memory(screen->gpu, template, in tegra_screen_resource_from_user_memory()
311 if (resource) in tegra_screen_resource_from_user_memory()
312 resource->screen = pscreen; in tegra_screen_resource_from_user_memory()
314 return resource; in tegra_screen_resource_from_user_memory()
324 struct tegra_resource *resource = to_tegra_resource(presource); in tegra_screen_resource_get_handle() local
336 handle->modifier = resource->modifier; in tegra_screen_resource_get_handle()
337 handle->handle = resource->handle; in tegra_screen_resource_get_handle()
338 handle->stride = resource->stride; in tegra_screen_resource_get_handle()
342 resource->gpu, handle, usage); in tegra_screen_resource_get_handle()
352 struct tegra_resource *resource = to_tegra_resource(presource); in tegra_screen_resource_destroy() local
354 pipe_resource_reference(&resource->gpu, NULL); in tegra_screen_resource_destroy()
355 free(resource); in tegra_screen_resource_destroy()
360 struct pipe_resource *resource, in tegra_screen_flush_frontbuffer() argument
368 screen->gpu->flush_frontbuffer(screen->gpu, resource, level, layer, in tegra_screen_flush_frontbuffer()
464 struct tegra_resource *resource; in tegra_screen_resource_create_with_modifiers() local
467 resource = calloc(1, sizeof(*resource)); in tegra_screen_resource_create_with_modifiers()
468 if (!resource) in tegra_screen_resource_create_with_modifiers()
481 resource->gpu = screen->gpu->resource_create_with_modifiers(screen->gpu, in tegra_screen_resource_create_with_modifiers()
485 if (!resource->gpu) in tegra_screen_resource_create_with_modifiers()
488 err = tegra_screen_import_resource(screen, resource); in tegra_screen_resource_create_with_modifiers()
492 memcpy(&resource->base, resource->gpu, sizeof(*resource->gpu)); in tegra_screen_resource_create_with_modifiers()
493 pipe_reference_init(&resource->base.reference, 1); in tegra_screen_resource_create_with_modifiers()
494 resource->base.screen = &screen->base; in tegra_screen_resource_create_with_modifiers()
496 return &resource->base; in tegra_screen_resource_create_with_modifiers()
499 screen->gpu->resource_destroy(screen->gpu, resource->gpu); in tegra_screen_resource_create_with_modifiers()
501 free(resource); in tegra_screen_resource_create_with_modifiers()