diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-12-12 15:07:01 +0100 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-12-12 16:51:16 +0100 |
commit | c21e49339cf02dd50d88bb0bbdd486bc2acaf224 (patch) | |
tree | efcb0ec39686ecefcda6898f81d731f22ef56198 /src/compositor/hardware_integration | |
parent | d417c29a30b39c07bddb65e80abb87cc871073b4 (diff) |
Remove the dri2_xcb hardware integration
EGL has bind_display instead
Change-Id: I643f06e7412bae9513d8b30eef655cd0a60cb57d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/compositor/hardware_integration')
7 files changed, 0 insertions, 258 deletions
diff --git a/src/compositor/hardware_integration/dri2_xcb/README b/src/compositor/hardware_integration/dri2_xcb/README deleted file mode 100644 index e99500df7..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/README +++ /dev/null @@ -1,3 +0,0 @@ -This backend requires that you compile the xcb lighthouse plugin with the -defined: XCB_USE_DRI2. Please see in the xcb.pro file for an easy way to -enable it. diff --git a/src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri b/src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri deleted file mode 100644 index 641c7a91a..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/dri2_xcb.pri +++ /dev/null @@ -1,14 +0,0 @@ -INCLUDEPATH += $$PWD/../private -LIBS += -lxcb -lxcb-dri2 -lEGL - -DEFINES += QT_COMPOSITOR_DRI2_XCB - -SOURCES += \ - $$PWD/dri2xcbhwintegration.cpp \ - $$PWD/dri2xcbbuffer.cpp \ - $$PWD/../../../3rdparty/wayland/wayland-drm-protocol.c \ - -HEADERS += \ - $$PWD/dri2xcbhwintegration.h \ - $$PWD/dri2xcbbuffer.h \ - $$PWD/../../../3rdparty/wayland/wayland-drm-server-protocol.h \ diff --git a/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp b/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp deleted file mode 100644 index eb516d1d2..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "dri2xcbbuffer.h" - -#include "waylandobject.h" - -#define EGL_EGLEXT_PROTOTYPES -#include <EGL/egl.h> -#include <EGL/eglext.h> - -Dri2XcbBuffer::Dri2XcbBuffer(uint32_t id, uint32_t name, const QSize &size, uint32_t stride, wl_visual *visual, EGLDisplay eglDisplay, Wayland::Compositor *compositor) - :m_egl_display(eglDisplay) -{ - base()->compositor = compositor->base(); - base()->visual = visual; - base()->height = size.height(); - base()->width = size.width(); - base()->attach = 0; - base()->damage = 0; - - EGLint attribs[] = { - EGL_WIDTH, size.width(), - EGL_HEIGHT, size.height(), - EGL_DRM_BUFFER_STRIDE_MESA, stride /4, - EGL_DRM_BUFFER_FORMAT_MESA, EGL_DRM_BUFFER_FORMAT_ARGB32_MESA, - EGL_NONE - }; - - m_image = eglCreateImageKHR(m_egl_display, - EGL_NO_CONTEXT, - EGL_DRM_BUFFER_MESA, - (EGLClientBuffer) name, attribs); -} - -Dri2XcbBuffer::~Dri2XcbBuffer() -{ - eglDestroyImageKHR (m_egl_display, m_image); -} - -void dri2XcbBufferDestroy(struct wl_client *client, struct wl_buffer *buffer) -{ - delete Wayland::wayland_cast<Dri2XcbBuffer *>(buffer); -} - -EGLImageKHR Dri2XcbBuffer::image() const -{ - return m_image; -} diff --git a/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h b/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h deleted file mode 100644 index 61d431ded..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/dri2xcbbuffer.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef DRI2XCBBUFFER_H -#define DRI2XCBBUFFER_H - -#include "waylandobject.h" -#include "wayland_wrapper/wlcompositor.h" - -#include <wayland-server.h> - -#include <QtCore/QSize> -#include <QtWidgets/QApplication> -#include <QtCore/QTextStream> -#include <QtGui/QPlatformNativeInterface> - -#define EGL_EGLEXT_PROTOTYPES -#include <EGL/egl.h> -#include <EGL/eglext.h> - -class Dri2XcbBuffer : public Wayland::Object<struct wl_buffer> -{ -public: - Dri2XcbBuffer(uint32_t id, uint32_t name, const QSize &size, uint32_t stride, - wl_visual *visual, EGLDisplay eglDisplay, Wayland::Compositor *compositor); - ~Dri2XcbBuffer(); - - EGLImageKHR image() const; - -private: - EGLImageKHR m_image; - EGLDisplay m_egl_display; -}; - -void dri2XcbBufferDestroy(struct wl_client *client, struct wl_buffer *buffer); - -const static struct wl_buffer_interface dri2_xcb_buffer_interface = { - dri2XcbBufferDestroy -}; - -#endif // DRI2XCBBUFFER_H diff --git a/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp b/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp deleted file mode 100644 index 0d16f78c6..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "dri2xcbhwintegration.h" - -#include "dri2xcbbuffer.h" - -#include "waylandobject.h" -#include "wayland_wrapper/wldisplay.h" -#include "wayland_wrapper/wlcompositor.h" - -#include "wayland-server.h" -#include "wayland-drm-server-protocol.h" - -#include <QtCore/QDebug> - -#include <xcb/xcb.h> -#include <xcb/dri2.h> - -GraphicsHardwareIntegration * GraphicsHardwareIntegration::createGraphicsHardwareIntegration(WaylandCompositor *compositor) -{ - return new Dri2XcbHWIntegration(compositor); -} - -class DrmObject : public Wayland::Object<struct wl_object> -{ -public: - DrmObject(Wayland::Compositor *compositor, QWidget *window) - :m_compositor(compositor) - { - QPlatformNativeInterface *nativeInterface = QApplicationPrivate::platformIntegration()->nativeInterface(); - char *deviceName = static_cast<char *>(nativeInterface->nativeResourceForWidget("GraphicsDevice",window)); - m_device_name = QByteArray(deviceName); - - m_connection = static_cast<xcb_connection_t *>(nativeInterface->nativeResourceForWidget("Connection",window)); - m_egl_display = static_cast<EGLDisplay>(nativeInterface->nativeResourceForWidget("EglDisplay",window)); - } - QByteArray deviceName() - { - return m_device_name; - } - - void authenticate(struct wl_client *client, uint32_t id) - { - - xcb_screen_iterator_t screenIterator = xcb_setup_roots_iterator(xcb_get_setup(m_connection)); - xcb_dri2_authenticate_cookie_t authenticateCoockie = xcb_dri2_authenticate_unchecked(m_connection,screenIterator.data->root,id); - xcb_dri2_authenticate_reply_t *authenticate = xcb_dri2_authenticate_reply(m_connection,authenticateCoockie,NULL); - - if (authenticate && authenticate->authenticated) { - wl_client_post_event(client, base(), WL_DRM_AUTHENTICATED); - } else { - qDebug() << "Failed to authenticate drm :("; - } - - delete authenticate; - } - - void createBuffer(wl_client *client, uint32_t id, uint32_t name, const QSize &size, uint32_t stride, wl_visual *visual) - { - Dri2XcbBuffer *buffer = new Dri2XcbBuffer(id,name,size,stride,visual,m_egl_display, m_compositor); - Wayland::addClientResource(client,&buffer->base()->resource,id,&wl_buffer_interface,&dri2_xcb_buffer_interface,0); - } - -private: - QByteArray m_device_name; - xcb_connection_t *m_connection; - xcb_screen_t *m_screen; - EGLDisplay m_egl_display; - Wayland::Compositor *m_compositor; -}; - -void authenticate(struct wl_client *client, - struct wl_drm *drm, - uint32_t id) -{ - reinterpret_cast<DrmObject *>(drm)->authenticate(client,id); -} - -void create_buffer(struct wl_client *client, - struct wl_drm *drm, - uint32_t id, - uint32_t name, - int width, - int height, - uint32_t stride, - struct wl_visual *visual) -{ - DrmObject *drmObject = reinterpret_cast<DrmObject *>(drm); - drmObject->createBuffer(client,id,name,QSize(width,height),stride,visual); -} - -const static struct wl_drm_interface drm_interface = { - authenticate, - create_buffer -}; - -void post_drm_device(struct wl_client *client, struct wl_object *global) -{ - DrmObject *drmObject = Wayland::wayland_cast<DrmObject *>(global); - qDebug() << drmObject->deviceName().constData(); - wl_client_post_event(client, global, WL_DRM_DEVICE, drmObject->deviceName().constData()); -} - -Dri2XcbHWIntegration::Dri2XcbHWIntegration(WaylandCompositor *compositor) - : GraphicsHardwareIntegration(compositor) - , m_drm_object(0) -{ -} - -void Dri2XcbHWIntegration::initializeHardware(Wayland::Display *waylandDisplay) -{ - //we need a winId now. - m_compositor->window()->winId(); - - - m_drm_object = new DrmObject(m_compositor->handle(),m_compositor->window()); - - waylandDisplay->addGlobalObject(m_drm_object->base(),&wl_drm_interface,&drm_interface,post_drm_device); -} - -GLuint Dri2XcbHWIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *) -{ - Dri2XcbBuffer *dri2Buffer = Wayland::wayland_cast<Dri2XcbBuffer *>(buffer); - - GLuint textureId = 0; - glGenTextures(1,&textureId); - glBindTexture(GL_TEXTURE_2D, textureId); - - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, dri2Buffer->image()); - - return textureId; -} diff --git a/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h b/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h deleted file mode 100644 index 9ed355815..000000000 --- a/src/compositor/hardware_integration/dri2_xcb/dri2xcbhwintegration.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef DRI2XCBHWINTEGRATION_H -#define DRI2XCBHWINTEGRATION_H - -#include "hardware_integration/graphicshardwareintegration.h" - -class DrmObject; - -class Dri2XcbHWIntegration : public GraphicsHardwareIntegration -{ -public: - Dri2XcbHWIntegration(WaylandCompositor *compositor); - - void initializeHardware(Wayland::Display *waylandDisplay); - - GLuint createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *context); - -private: - DrmObject *m_drm_object; -}; - -#endif // DRI2XCBHWINTEGRATION_H diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri index da9075dc7..d50402fe4 100644 --- a/src/compositor/hardware_integration/hardware_integration.pri +++ b/src/compositor/hardware_integration/hardware_integration.pri @@ -16,9 +16,6 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG) isEqual(QT_WAYLAND_GL_CONFIG, xcomposite_egl) { QT_WAYLAND_GL_INTEGRATION = xcomposite_egl CONFIG += xcomposite_egl - } else:isEqual(QT_WAYLAND_GL_CONFIG,dri2_xcb) { - QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG - CONFIG += dri2_xcb } else { QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG CONFIG += wayland_egl @@ -37,9 +34,6 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG) wayland_egl { include (wayland_egl/wayland_egl.pri) } -dri2_xcb { - include (dri2_xcb/dri2_xcb.pri) -} xcomposite_egl { include (xcomposite_egl/xcomposite_egl.pri) } |