summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-screen.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-14 12:46:26 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-14 12:46:26 +0100
commit507b8abcf6326bbbe8c188016043b21438256b71 (patch)
treef839bdd97fb80fde51c3f8749d279097a89f6338 /src/cairo-xcb-screen.c
parent5d9da3decff06015d03413713714552095dfa616 (diff)
downloadcairo-507b8abcf6326bbbe8c188016043b21438256b71.tar.gz
Excise xcb-drm
The experiment was at best a pyrrhic victory. Whilst it did show that you could successfully subvert cairo_xcb_surface_t and provide the rendering locally faster (than the xlib driver at that time), any performance benefits were lost in the synchronisation overheads and server-side buffer allocation. Once cairo-gl is mature, we need to look at how we can overcome these to improve client-side rendering In the meantime, cairo-xcb is no longer my playground for experimentation and is shaping up to become a stable backend... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xcb-screen.c')
-rw-r--r--src/cairo-xcb-screen.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/cairo-xcb-screen.c b/src/cairo-xcb-screen.c
index efe42cf93..209747560 100644
--- a/src/cairo-xcb-screen.c
+++ b/src/cairo-xcb-screen.c
@@ -84,9 +84,6 @@ _cairo_xcb_screen_finish (cairo_xcb_screen_t *screen)
_cairo_cache_fini (&screen->radial_pattern_cache);
_cairo_freelist_fini (&screen->pattern_cache_entry_freelist);
- cairo_device_finish (screen->device);
- cairo_device_destroy (screen->device);
-
free (screen);
}
@@ -124,85 +121,6 @@ _pattern_cache_entry_destroy (void *closure)
_cairo_freelist_free (&entry->screen->pattern_cache_entry_freelist, entry);
}
-#if CAIRO_HAS_DRM_SURFACE && CAIRO_HAS_XCB_DRM_FUNCTIONS
-#include "drm/cairo-drm-private.h"
-
-#include <drm/drm.h>
-#include <sys/ioctl.h>
-#include <xcb/dri2.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-static int drm_magic (int fd, uint32_t *magic)
-{
- drm_auth_t auth;
-
- if (ioctl (fd, DRM_IOCTL_GET_MAGIC, &auth))
- return -errno;
-
- *magic = auth.magic;
- return 0;
-}
-
-static cairo_device_t *
-_xcb_drm_device (xcb_connection_t *xcb_connection,
- xcb_screen_t *xcb_screen)
-{
- cairo_device_t *device = NULL;
- xcb_dri2_connect_reply_t *connect;
- drm_magic_t magic;
- int fd;
-
- connect = xcb_dri2_connect_reply (xcb_connection,
- xcb_dri2_connect (xcb_connection,
- xcb_screen->root,
- 0),
- 0);
- if (connect == NULL)
- return NULL;
-
- fd = open (xcb_dri2_connect_device_name (connect), O_RDWR);
- free (connect);
-
- if (fd < 0)
- return NULL;
-
- device = cairo_drm_device_get_for_fd (fd);
- close (fd);
-
- if (device != NULL) {
- xcb_dri2_authenticate_reply_t *authenticate;
-
- if (drm_magic (((cairo_drm_device_t *) device)->fd, &magic) < 0) {
- cairo_device_destroy (device);
- return NULL;
- }
-
- authenticate = xcb_dri2_authenticate_reply (xcb_connection,
- xcb_dri2_authenticate (xcb_connection,
- xcb_screen->root,
- magic),
- 0);
- if (authenticate == NULL) {
- cairo_device_destroy (device);
- return NULL;
- }
-
- free (authenticate);
- }
-
- return device;
-}
-#else
-static cairo_device_t *
-_xcb_drm_device (xcb_connection_t *xcb_connection,
- xcb_screen_t *xcb_screen)
-{
- return NULL;
-}
-#endif
-
cairo_xcb_screen_t *
_cairo_xcb_screen_get (xcb_connection_t *xcb_connection,
xcb_screen_t *xcb_screen)
@@ -245,11 +163,6 @@ _cairo_xcb_screen_get (xcb_connection_t *xcb_connection,
cairo_list_init (&screen->surfaces);
cairo_list_init (&screen->pictures);
- if (connection->flags & CAIRO_XCB_HAS_DRI2)
- screen->device = _xcb_drm_device (xcb_connection, xcb_screen);
- else
- screen->device = NULL;
-
screen->gc_depths = 0;
memset (screen->gc, 0, sizeof (screen->gc));
@@ -284,7 +197,6 @@ error_linear:
_cairo_cache_fini (&screen->linear_pattern_cache);
error_screen:
CAIRO_MUTEX_UNLOCK (connection->screens_mutex);
- cairo_device_destroy (screen->device);
free (screen);
return NULL;