summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-10-08 12:53:56 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-19 20:24:11 +0200
commit39eaff6773fc4f05fc95473b769b3a2f0301e12b (patch)
treebc2943a5000eab5c3a8e3d2a0b39f654ddbd7059 /src/plugins/platforms/xcb/qxcbconnection.cpp
parent9b2e4cd5a8cac007aa702ce5f822e78e54707a07 (diff)
Remove DRI2/OpenGL code paths from xcb plugin.
These were used to test QtWayland, but there are other options available for that now. The DRI2 code hasn't been maintained and doesn't even compile at the moment, so let's just remove it to de-clutter the source. Change-Id: I7db0f4db82348497b9f4d6c2dcf2e13f3ab14a76 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp108
1 files changed, 0 insertions, 108 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 3261bd189d..85f6fc9213 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -82,17 +82,6 @@
#include <EGL/egl.h>
#endif
-#ifdef XCB_USE_DRI2
-#include <xcb/dri2.h>
-extern "C" {
-#include <xf86drm.h>
-}
-#define MESA_EGL_NO_X11_HEADERS
-#define EGL_EGLEXT_PROTOTYPES
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#endif
-
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
#include <X11/extensions/XInput2.h>
#include <X11/extensions/XI2proto.h>
@@ -261,12 +250,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
#ifdef XCB_USE_XINPUT2_MAEMO
, m_xinputData(0)
#endif
-#ifdef XCB_USE_DRI2
- , m_dri2_major(0)
- , m_dri2_minor(0)
- , m_dri2_support_probed(false)
- , m_has_support_for_dri2(false)
-#endif
, xfixes_first_event(0)
, xrandr_first_event(0)
, has_glx_extension(false)
@@ -359,9 +342,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
m_drag = new QXcbDrag(this);
#endif
-#ifdef XCB_USE_DRI2
- initializeDri2();
-#endif
sync();
}
@@ -1410,94 +1390,6 @@ bool QXcbConnection::hasEgl() const
}
#endif // defined(XCB_USE_EGL)
-#ifdef XCB_USE_DRI2
-void QXcbConnection::initializeDri2()
-{
- xcb_dri2_connect_cookie_t connect_cookie = xcb_dri2_connect_unchecked (m_connection,
- m_screens[0]->root(),
- XCB_DRI2_DRIVER_TYPE_DRI);
-
- xcb_dri2_connect_reply_t *connect = xcb_dri2_connect_reply (m_connection,
- connect_cookie, NULL);
-
- if (! connect || connect->driver_name_length + connect->device_name_length == 0) {
- qWarning("QXcbConnection: Failed to connect to DRI2");
- return;
- }
-
- m_dri2_device_name = QByteArray(xcb_dri2_connect_device_name (connect),
- xcb_dri2_connect_device_name_length (connect));
- delete connect;
-
- int fd = open(m_dri2_device_name.constData(), O_RDWR);
- if (fd < 0) {
- qWarning() << "QXcbConnection: Couldn't open DRI2 device" << m_dri2_device_name;
- m_dri2_device_name = QByteArray();
- return;
- }
-
- drm_magic_t magic;
- if (drmGetMagic(fd, &magic)) {
- qWarning("QXcbConnection: Failed to get drmMagic");
- return;
- }
-
- xcb_dri2_authenticate_cookie_t authenticate_cookie = xcb_dri2_authenticate_unchecked(m_connection,
- m_screens[0]->root(), magic);
- xcb_dri2_authenticate_reply_t *authenticate = xcb_dri2_authenticate_reply(m_connection,
- authenticate_cookie, NULL);
- if (authenticate == NULL || !authenticate->authenticated) {
- qWarning("QXcbConnection: DRI2: failed to authenticate");
- free(authenticate);
- return;
- }
-
- delete authenticate;
-
- EGLDisplay display = eglGetDRMDisplayMESA(fd);
- if (!display) {
- qWarning("QXcbConnection: Failed to create EGL display using DRI2");
- return;
- }
-
- m_egl_display = display;
- EGLint major,minor;
- if (!eglInitialize(display, &major, &minor)) {
- qWarning("QXcbConnection: Failed to initialize EGL display using DRI2");
- return;
- }
-}
-
-bool QXcbConnection::hasSupportForDri2() const
-{
- if (!m_dri2_support_probed) {
- xcb_generic_error_t *error = 0;
-
- xcb_prefetch_extension_data (m_connection, &xcb_dri2_id);
-
- xcb_dri2_query_version_cookie_t dri2_query_cookie = xcb_dri2_query_version (m_connection,
- XCB_DRI2_MAJOR_VERSION,
- XCB_DRI2_MINOR_VERSION);
-
- xcb_dri2_query_version_reply_t *dri2_query = xcb_dri2_query_version_reply (m_connection,
- dri2_query_cookie, &error);
- if (!dri2_query || error) {
- delete error;
- delete dri2_query;
- return false;
- }
-
- QXcbConnection *that = const_cast<QXcbConnection *>(this);
- that->m_dri2_major = dri2_query->major_version;
- that->m_dri2_minor = dri2_query->minor_version;
-
- that->m_has_support_for_dri2 = true;
- that->m_dri2_support_probed = true;
- }
- return m_has_support_for_dri2;
-}
-#endif //XCB_USE_DRI2
-
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
// Borrowed from libXi.
int QXcbConnection::xi2CountBits(unsigned char *ptr, int len)