Lines Matching defs:xa
85 xa_get_pipe_format(struct xa_tracker *xa, enum xa_formats xa_format)
93 if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
150 if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
167 struct xa_tracker *xa = calloc(1, sizeof(struct xa_tracker));
171 if (!xa)
174 if (pipe_loader_drm_probe_fd(&xa->dev, drm_fd))
175 xa->screen = pipe_loader_create_screen(xa->dev);
177 if (!xa->screen)
180 xa->default_ctx = xa_context_create(xa);
181 if (!xa->default_ctx)
189 xa->supported_formats = calloc(num_formats, sizeof(*xa->supported_formats));
190 if (!xa->supported_formats)
193 xa->supported_formats[0] = xa_format_unknown;
195 memset(xa->format_map, 0, sizeof(xa->format_map));
206 xa_get_pipe_format(xa, xa_format);
208 if (xa->screen->is_format_supported(xa->screen, fdesc.format,
210 if (xa->format_map[stype][0] == 0)
211 xa->format_map[stype][0] = num_formats;
212 xa->format_map[stype][1] = num_formats;
213 xa->supported_formats[num_formats++] = xa_format;
217 return xa;
220 xa_context_destroy(xa->default_ctx);
222 xa->screen->destroy(xa->screen);
224 if (xa->dev)
225 pipe_loader_release(&xa->dev, 1);
227 free(xa);
232 xa_tracker_destroy(struct xa_tracker *xa)
234 free(xa->supported_formats);
235 xa_context_destroy(xa->default_ctx);
236 xa->screen->destroy(xa->screen);
237 pipe_loader_release(&xa->dev, 1);
239 free(xa);
271 xa_get_format_stype_depth(struct xa_tracker *xa,
278 for (i = xa->format_map[stype][0]; i <= xa->format_map[stype][1]; ++i) {
279 fdesc = xa_get_pipe_format(xa, xa->supported_formats[i]);
294 xa_format_check_supported(struct xa_tracker *xa,
297 struct xa_format_descriptor fdesc = xa_get_pipe_format(xa, xa_format);
311 if (!xa->screen->is_format_supported(xa->screen, fdesc.format,
333 surface_create(struct xa_tracker *xa,
346 fdesc = xa_get_format_stype_depth(xa, stype, depth);
348 fdesc = xa_get_pipe_format(xa, xa_format);
375 srf->tex = xa->screen->resource_from_handle(xa->screen, template, whandle,
378 srf->tex = xa->screen->resource_create(xa->screen, template);
383 srf->xa = xa;
395 xa_surface_create(struct xa_tracker *xa,
402 return surface_create(xa, width, height, depth, stype, xa_format, flags, NULL);
407 xa_surface_from_handle(struct xa_tracker *xa,
415 return xa_surface_from_handle2(xa, width, height, depth, stype, xa_format,
421 xa_surface_from_handle2(struct xa_tracker *xa,
435 return surface_create(xa, width, height, depth, stype, xa_format, flags, &whandle);
451 struct xa_tracker *xa = srf->xa;
459 fdesc = xa_get_format_stype_depth(xa, stype, depth);
461 fdesc = xa_get_pipe_format(xa, xa_format);
481 if (!xa->screen->is_format_supported(xa->screen, fdesc.format,
496 texture = xa->screen->resource_create(xa->screen, template);
505 struct pipe_context *pipe = xa->default_ctx->pipe;
511 xa_context_flush(xa->default_ctx);
557 struct pipe_screen *screen = srf->xa->screen;
562 res = screen->resource_get_handle(screen, srf->xa->default_ctx->pipe,