Home | History | Annotate | Download | only in dri2

Lines Matching refs:dri2_dpy

43 swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
52 dri2_surf->gc = xcb_generate_id(dri2_dpy->conn);
54 xcb_create_gc(dri2_dpy->conn, dri2_surf->gc, dri2_surf->drawable, mask, &function);
56 dri2_surf->swapgc = xcb_generate_id(dri2_dpy->conn);
60 xcb_create_gc(dri2_dpy->conn, dri2_surf->swapgc, dri2_surf->drawable, mask, valgc);
82 swrastDestroyDrawable(struct dri2_egl_display * dri2_dpy,
85 xcb_free_gc(dri2_dpy->conn, dri2_surf->gc);
86 xcb_free_gc(dri2_dpy->conn, dri2_surf->swapgc);
95 struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
102 cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);
103 reply = xcb_get_geometry_reply (dri2_dpy->conn, cookie, &error);
123 struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
138 xcb_put_image(dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP, dri2_surf->drawable,
149 struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display);
155 cookie = xcb_get_image (dri2_dpy->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
157 reply = xcb_get_image_reply (dri2_dpy->conn, cookie, &error);
181 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
202 dri2_surf->drawable = xcb_generate_id(dri2_dpy->conn);
203 s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
204 xcb_create_pixmap(dri2_dpy->conn, conf->BufferSize,
211 if (dri2_dpy->dri2) {
213 (*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
219 assert(dri2_dpy->swrast);
221 (*dri2_dpy->swrast->createNewDrawable) (dri2_dpy->dri_screen,
231 if (dri2_dpy->dri2) {
232 xcb_dri2_create_drawable (dri2_dpy->conn, dri2_surf->drawable);
234 swrastCreateDrawable(dri2_dpy, dri2_surf, _eglGetConfigKey(conf, EGL_BUFFER_SIZE));
238 cookie = xcb_get_geometry (dri2_dpy->conn, dri2_surf->drawable);
239 reply = xcb_get_geometry_reply (dri2_dpy->conn, cookie, &error);
257 dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
260 xcb_free_pixmap(dri2_dpy->conn, dri2_surf->drawable);
299 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
307 (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
309 if (dri2_dpy->dri2) {
310 xcb_dri2_destroy_drawable (dri2_dpy->conn, dri2_surf->drawable);
312 assert(dri2_dpy->swrast);
313 swrastDestroyDrawable(dri2_dpy, dri2_surf);
317 xcb_free_pixmap (dri2_dpy->conn, dri2_surf->drawable);
334 struct dri2_egl_display *dri2_dpy =
361 xcb_xfixes_destroy_region(dri2_dpy->conn, dri2_surf->region);
367 dri2_surf->region = xcb_generate_id(dri2_dpy->conn);
368 xcb_xfixes_create_region(dri2_dpy->conn, dri2_surf->region, 1, &rectangle);
378 struct dri2_egl_display *dri2_dpy =
386 cookie = xcb_dri2_get_buffers_unchecked (dri2_dpy->conn,
389 reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, cookie, NULL);
411 struct dri2_egl_display *dri2_dpy =
421 cookie = xcb_dri2_get_buffers_with_format_unchecked (dri2_dpy->conn,
426 reply = xcb_dri2_get_buffers_with_format_reply (dri2_dpy->conn,
474 dri2_connect(struct dri2_egl_display *dri2_dpy)
487 xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
488 xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
490 extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
494 extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
498 xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
502 dri2_query_cookie = xcb_dri2_query_version (dri2_dpy->conn,
506 s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
507 connect_cookie = xcb_dri2_connect_unchecked (dri2_dpy->conn,
512 xcb_xfixes_query_version_reply (dri2_dpy->conn,
523 xcb_dri2_query_version_reply (dri2_dpy->conn, dri2_query_cookie, &error);
529 dri2_dpy->dri2_major = dri2_query->major_version;
530 dri2_dpy->dri2_minor = dri2_query->minor_version;
533 connect = xcb_dri2_connect_reply (dri2_dpy->conn, connect_cookie, NULL);
541 dri2_dpy->driver_name =
551 dri2_dpy->device_name =
555 if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) {
556 free(dri2_dpy->device_name);
557 free(dri2_dpy->driver_name);
569 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
575 s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
577 xcb_dri2_authenticate_unchecked(dri2_dpy->conn, s.data->root, id);
579 xcb_dri2_authenticate_reply(dri2_dpy->conn, authenticate_cookie, NULL);
593 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
596 if (drmGetMagic(dri2_dpy->fd, &magic)) {
610 dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
624 s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
643 for (j = 0; dri2_dpy->driver_configs[j]; j++) {
647 dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
667 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
677 if (dri2_dpy->flush)
678 (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
686 cookie = xcb_dri2_copy_region_unchecked(dri2_dpy->conn,
691 free(xcb_dri2_copy_region_reply(dri2_dpy->conn, cookie, NULL));
701 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
717 if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available)
721 if (dri2_dpy->flush)
722 (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
725 cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn, dri2_surf->drawable,
728 reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL);
737 if (dri2_dpy->invalidate_available && dri2_dpy->flush &&
738 dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
739 (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
754 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
757 if (dri2_dpy->dri2) {
760 assert(dri2_dpy->swrast);
762 dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
771 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
788 region = xcb_generate_id(dri2_dpy->conn);
789 xcb_xfixes_create_region(dri2_dpy->conn, region, numRects, rectangles);
791 xcb_xfixes_destroy_region(dri2_dpy->conn, region);
812 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
824 if (interval != surf->SwapInterval && dri2_dpy->swap_available)
825 xcb_dri2_swap_interval(dri2_dpy->conn, dri2_surf->drawable, interval);
837 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
843 (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
845 gc = xcb_generate_id(dri2_dpy->conn);
846 xcb_create_gc(dri2_dpy->conn, gc, target, 0, NULL);
847 xcb_copy_area(dri2_dpy->conn,
855 xcb_free_gc(dri2_dpy->conn, gc);
864 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
879 xcb_dri2_create_drawable (dri2_dpy->conn, drawable);
882 xcb_dri2_get_buffers_unchecked (dri2_dpy->conn,
884 geometry_cookie = xcb_get_geometry (dri2_dpy->conn, drawable);
885 buffers_reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn,
892 geometry_reply = xcb_get_geometry_reply (dri2_dpy->conn,
936 dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
968 struct dri2_egl_display *dri2_dpy;
983 dri2_dpy = malloc(sizeof *dri2_dpy);
984 if (!dri2_dpy)
987 memset(dri2_dpy, 0, sizeof *dri2_dpy);
989 disp->DriverData = (void *) dri2_dpy;
991 dri2_dpy->conn = xcb_connect(0, 0);
993 dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
996 if (xcb_connection_has_error(dri2_dpy->conn)) {
1004 dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;
1005 dri2_dpy->swrast_loader_extension.base.version = __DRI_SWRAST_LOADER_VERSION;
1006 dri2_dpy->swrast_loader_extension.getDrawableInfo = swrastGetDrawableInfo;
1007 dri2_dpy->swrast_loader_extension.putImage = swrastPutImage;
1008 dri2_dpy->swrast_loader_extension.getImage = swrastGetImage;
1010 dri2_dpy->extensions[0] = &dri2_dpy->swrast_loader_extension.base;
1011 dri2_dpy->extensions[1] = NULL;
1012 dri2_dpy->extensions[2] = NULL;
1017 if (dri2_dpy->conn) {
1018 if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
1030 dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
1032 dlclose(dri2_dpy->driver);
1035 xcb_disconnect(dri2_dpy->conn);
1037 free(dri2_dpy);
1046 struct dri2_egl_display *dri2_dpy;
1059 dri2_dpy = malloc(sizeof *dri2_dpy);
1060 if (!dri2_dpy)
1063 memset(dri2_dpy, 0, sizeof *dri2_dpy);
1065 disp->DriverData = (void *) dri2_dpy;
1067 dri2_dpy->conn = xcb_connect(0, 0);
1069 dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
1072 if (xcb_connection_has_error(dri2_dpy->conn)) {
1077 if (dri2_dpy->conn) {
1078 if (!dri2_connect(dri2_dpy))
1086 dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR | O_CLOEXEC);
1087 if (dri2_dpy->fd == -1 && errno == EINVAL)
1090 dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
1091 if (dri2_dpy->fd != -1)
1092 dri2_dpy->fd, F_SETFD, fcntl(dri2_dpy->fd, F_GETFD) |
1095 if (dri2_dpy->fd == -1) {
1097 "DRI2: could not open %s (%s)", dri2_dpy->device_name,
1102 if (dri2_dpy->conn) {
1107 if (dri2_dpy->dri2_minor >= 1) {
1108 dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
1109 dri2_dpy->dri2_loader_extension.base.version = 3;
1110 dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
1111 dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
1112 dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
1115 dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
1116 dri2_dpy->dri2_loader_extension.base.version = 2;
1117 dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
1118 dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
1119 dri2_dpy->dri2_loader_extension.getBuffersWithFormat = NULL;
1122 dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
1123 dri2_dpy->extensions[1] = &image_lookup_extension.base;
1124 dri2_dpy->extensions[2] = NULL;
1127 dri2_dpy->swap_available = (dri2_dpy->dri2_minor >= 2);
1128 dri2_dpy->invalidate_available = (dri2_dpy->dri2_minor >= 3);
1134 if (dri2_dpy->conn) {
1135 if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
1147 dri2_dpy->authenticate = dri2_x11_authenticate;
1157 dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
1159 close(dri2_dpy->fd);
1161 dlclose(dri2_dpy->driver);
1164 xcb_disconnect(dri2_dpy->conn);
1166 free(dri2_dpy);