From 09c63d320112fbb4995696d813c488e82915c2f5 Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Tue, 20 Sep 2011 15:19:13 +0800 Subject: [PATCH] glamor-ddx: Reuse glamor_dix module to handle egl platform. We already have a glamor egl module at glamor directory which could initialize and create egl context and also can attach a gbm buffer to a specified pixmap or to the screen pixmap. This commit remove all the duplicated code here and use the glamor_dix module directly. As we don't want to handle egl stuffs in this layer, we have to change the way to handle hardware cursor. Previous method is to call egl functions to create a egl image and then bind the image to a texutre then call gl functions to load texture image to the cursor bo. Now we can bind the cursor bo to a cursor pixmap and then use putimage to load new image to the cursor bo. Then we can completely avoid to call egl or gl functions directly in this ddx driver. Signed-off-by: Zhigang Gong --- hw/xfree86/glamor/Makefile.am | 3 +- hw/xfree86/glamor/glamor.c | 263 ++++++++++---------------------- hw/xfree86/glamor/glamor_crtc.c | 72 +++------ hw/xfree86/glamor/glamor_ddx.h | 44 ++---- 4 files changed, 121 insertions(+), 261 deletions(-) diff --git a/hw/xfree86/glamor/Makefile.am b/hw/xfree86/glamor/Makefile.am index 8432645ca..fbd561cd1 100644 --- a/hw/xfree86/glamor/Makefile.am +++ b/hw/xfree86/glamor/Makefile.am @@ -9,14 +9,13 @@ glamor_la_CFLAGS = \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/ramdac \ -I$(top_srcdir)/hw/xfree86/i2c \ - -I$(top_srcdir)/glamor + -I$(top_srcdir)/glamor if GLAMOR_GLES2 glamor_la_CFLAGS+=-DGLAMOR_GLES2 endif glamor_la_LDFLAGS = -module -avoid-version \ - $(top_builddir)/glamor/libglamor.la \ $(EGL_LIBS) glamor_ladir = $(moduledir)/drivers diff --git a/hw/xfree86/glamor/glamor.c b/hw/xfree86/glamor/glamor.c index 1bb5835db..0dbee1806 100644 --- a/hw/xfree86/glamor/glamor.c +++ b/hw/xfree86/glamor/glamor.c @@ -41,9 +41,9 @@ #include "../../../mi/micmap.h" #include #include -#define GC XORG_GC +//#define GC XORG_GC #include -#undef GC +//#undef GC #include "glamor_ddx.h" @@ -59,50 +59,50 @@ glamor_ddx_identify(int flags) xf86Msg(X_INFO, "Standalone %s: OpenGL accelerated X.org driver\n", glamor_ddx_name); } -Bool -glamor_resize(ScrnInfoPtr scrn, int width, int height) +static Bool +glamor_ddx_init_front_buffer(ScrnInfoPtr scrn, int width, int height) { struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; - EGLImageKHR image; - GLuint texture; - if (glamor->root != EGL_NO_IMAGE_KHR && - scrn->virtualX == width && scrn->virtualY == height) - return TRUE; - else if (scrn->virtualX != width || scrn->virtualY != height) { - - if (glamor->root != EGL_NO_IMAGE_KHR) { - eglDestroyImageKHR(glamor->display, glamor->root); - gbm_bo_destroy(glamor->root_bo); - glamor->root = EGL_NO_IMAGE_KHR; - } - glamor->root_bo = gbm_bo_create(glamor->gbm, width, height, + glamor->root_bo = gbm_bo_create(glamor->gbm, width, height, GBM_BO_FORMAT_ARGB8888, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); - } - + if (glamor->root_bo == NULL) return FALSE; - image = glamor->egl_create_image_khr(glamor->display, NULL, EGL_NATIVE_PIXMAP_KHR, glamor->root_bo, NULL); + scrn->virtualX = width; + scrn->virtualY = height; + /* XXX shall we update displayWidth here ? */ + return TRUE; +} - if (image == EGL_NO_IMAGE_KHR) { - gbm_bo_destroy(glamor->root_bo); - return FALSE; - } +static Bool +glamor_create_screen_image(ScrnInfoPtr scrn) +{ + struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); + ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; + unsigned int handle, stride; + handle = gbm_bo_get_handle(glamor->root_bo).u32; + stride = gbm_bo_get_pitch(glamor->root_bo); + return glamor_create_egl_screen_image(screen, handle, stride); +} - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - (glamor->egl_image_target_texture2d_oes)(GL_TEXTURE_2D, image); +Bool +glamor_front_buffer_resize(ScrnInfoPtr scrn, int width, int height) +{ + struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); + ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; - glamor_set_screen_pixmap_texture(screen, width, height, texture); - glamor->root = image; - scrn->virtualX = width; - scrn->virtualY = height; - return TRUE; + if (glamor->root_bo != NULL) { + glamor_close_egl_screen(screen); + gbm_bo_destroy(glamor->root_bo); + glamor->root_bo = NULL; + } + + if (!glamor_ddx_init_front_buffer(scrn, width, height)) + return FALSE; + return glamor_create_screen_image(scrn); } void @@ -113,32 +113,56 @@ glamor_frontbuffer_handle(ScrnInfoPtr scrn, uint32_t *handle, uint32_t *pitch) *pitch = gbm_bo_get_pitch(glamor->root_bo); } -EGLImageKHR glamor_create_cursor_argb(ScrnInfoPtr scrn, int width, int height) +Bool +glamor_create_cursor(ScrnInfoPtr scrn, struct glamor_gbm_cursor *cursor, int width, int height) { struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - glamor->cursor_bo = gbm_bo_create(glamor->gbm, width, height, + ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; + unsigned int handle, stride; + + + if (cursor->cursor_pixmap) + glamor_destroy_cursor(scrn, cursor); + + cursor->cursor_pixmap = screen->CreatePixmap(screen, 0, 0, 32, 0); + if (cursor->cursor_pixmap == NULL) + return FALSE; + screen->ModifyPixmapHeader(cursor->cursor_pixmap, width, height, 0, 0, 0, 0); + cursor->cursor_bo = gbm_bo_create(glamor->gbm, width, height, GBM_BO_FORMAT_ARGB8888, - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING | GBM_BO_USE_CURSOR_64X64); + GBM_BO_USE_SCANOUT + | GBM_BO_USE_RENDERING + | GBM_BO_USE_CURSOR_64X64); - if (glamor->cursor_bo == NULL) - return EGL_NO_IMAGE_KHR; + if (cursor->cursor_bo == NULL) + goto fail; + glamor_cursor_handle(cursor, &handle, &stride); + if (!glamor_create_egl_pixmap_image(cursor->cursor_pixmap, handle, stride)) + goto fail; - return glamor->egl_create_image_khr(glamor->display, NULL, EGL_NATIVE_PIXMAP_KHR, glamor->cursor_bo, NULL); + return TRUE; + +fail: + glamor_destroy_cursor(scrn, cursor); + return FALSE; } -void glamor_destroy_cursor(ScrnInfoPtr scrn, EGLImageKHR cursor) +void glamor_destroy_cursor(ScrnInfoPtr scrn, struct glamor_gbm_cursor *cursor) { - struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - eglDestroyImageKHR(glamor->display, cursor); - gbm_bo_destroy(glamor->cursor_bo); + ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; + if (cursor->cursor_pixmap) + screen->DestroyPixmap(cursor->cursor_pixmap); + if (cursor->cursor_bo) + gbm_bo_destroy(cursor->cursor_bo); + cursor->cursor_bo = NULL; + cursor->cursor_pixmap = NULL; } void -glamor_cursor_handle(ScrnInfoPtr scrn, EGLImageKHR cursor, uint32_t *handle, uint32_t *pitch) +glamor_cursor_handle(struct glamor_gbm_cursor *cursor, uint32_t *handle, uint32_t *pitch) { - struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - *handle = gbm_bo_get_handle(glamor->cursor_bo).u32; - *pitch = gbm_bo_get_pitch(glamor->cursor_bo); + *handle = gbm_bo_get_handle(cursor->cursor_bo).u32; + *pitch = gbm_bo_get_pitch(cursor->cursor_bo); ErrorF("cursor stride: %d\n", *pitch); } @@ -189,6 +213,9 @@ glamor_ddx_pre_init(ScrnInfoPtr scrn, int flags) if (!xf86LoadSubModule(scrn, "fb")) goto fail; + if (!xf86LoadSubModule(scrn, "glamor_dix")) + goto fail; + return TRUE; fail: @@ -232,16 +259,16 @@ glamor_ddx_create_screen_resources(ScreenPtr screen) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - int width = scrn->virtualX; - int height = scrn->virtualY; screen->CreateScreenResources = glamor->CreateScreenResources; if (!(*screen->CreateScreenResources) (screen)) return FALSE; if (!glamor_glyphs_init(screen)) return FALSE; - glamor_resize(scrn, width, height); - + if (glamor->root_bo == NULL) + return FALSE; + if (!glamor_create_screen_image(scrn)) + return FALSE; return TRUE; } @@ -258,79 +285,22 @@ glamor_ddx_close_screen(int scrnIndex, ScreenPtr screen) glamor_ddx_leave_vt(scrnIndex, 0); glamor_fini(screen); - - eglDestroyImageKHR(glamor->display, glamor->root); + glamor_close_egl_screen(screen); gbm_bo_destroy(glamor->root_bo); - eglMakeCurrent(glamor->display, - EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - eglTerminate(glamor->display); - drmmode_closefb(scrn); glamor->fd = -1; - glamor->root = EGL_NO_IMAGE_KHR; - return TRUE; } - - -static Bool -glamor_egl_has_extension(struct glamor_ddx_screen_private *glamor, char *extension) -{ - const char *egl_extensions; - char *pext; - int ext_len; - ext_len = strlen(extension); - - egl_extensions = (const char*)eglQueryString(glamor->display, EGL_EXTENSIONS); - pext = (char*)egl_extensions; - - if (pext == NULL || extension == NULL) - return FALSE; - while((pext = strstr(pext, extension)) != NULL) { - if (pext[ext_len] == ' ' || pext[ext_len] == '\0') - return TRUE; - pext += ext_len; - } - return FALSE; -} - -static Bool -glamor_ddx_init_front_buffer(ScrnInfoPtr scrn) -{ - struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - int width = scrn->virtualX; - int height = scrn->virtualY; - - glamor->root_bo = gbm_bo_create(glamor->gbm, width, height, - GBM_BO_FORMAT_ARGB8888, - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); - - if (glamor->root_bo == NULL) - return FALSE; - - /* XXX shall we update displayWidth here ? */ - return TRUE; -} - static Bool glamor_ddx_screen_init(int scrnIndex, ScreenPtr screen, int argc, char **argv) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); - const char *version; VisualPtr visual; - EGLint config_attribs[] = { -#ifdef GLAMOR_GLES2 - EGL_CONTEXT_CLIENT_VERSION, 2, -#endif - EGL_NONE - }; - - /* If serverGeneration != 1 then fd was closed during the last time closing screen, actually in eglTerminate(). */ @@ -354,62 +324,7 @@ glamor_ddx_screen_init(int scrnIndex, ScreenPtr screen, int argc, char **argv) return FALSE; } - glamor->display = eglGetDisplay(glamor->gbm); -#ifndef GLAMOR_GLES2 - eglBindAPI(EGL_OPENGL_API); -#else - eglBindAPI(EGL_OPENGL_ES_API); -#endif - if (!eglInitialize(glamor->display, &glamor->major, &glamor->minor)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "eglInitialize() failed\n"); - return FALSE; - } - - version = eglQueryString(glamor->display, EGL_VERSION); - xf86Msg(X_INFO, "%s: EGL version %s:\n", glamor_ddx_name, version); - -#define GLAMOR_CHECK_EGL_EXTENSION(EXT) \ - if (!glamor_egl_has_extension(glamor, "EGL_" #EXT)) { \ - ErrorF("EGL_" #EXT "required.\n"); \ - return FALSE; \ - } - - GLAMOR_CHECK_EGL_EXTENSION(MESA_drm_image); - GLAMOR_CHECK_EGL_EXTENSION(KHR_gl_renderbuffer_image); -#ifdef GLAMOR_GLES2 - GLAMOR_CHECK_EGL_EXTENSION(KHR_surfaceless_gles2); -#else - GLAMOR_CHECK_EGL_EXTENSION(KHR_surfaceless_opengl); -#endif - - glamor->egl_create_drm_image_mesa = (PFNEGLCREATEDRMIMAGEMESA)eglGetProcAddress("eglCreateDRMImageMESA"); - glamor->egl_create_image_khr = (PFNEGLCREATEIMAGEKHRPROC) - eglGetProcAddress("eglCreateImageKHR"); - glamor->egl_export_drm_image_mesa = (PFNEGLEXPORTDRMIMAGEMESA)eglGetProcAddress("eglExportDRMImageMESA"); - glamor->egl_image_target_texture2d_oes = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); - - if (!glamor->egl_create_drm_image_mesa || !glamor->egl_export_drm_image_mesa || - !glamor->egl_image_target_texture2d_oes) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "eglGetProcAddress() failed\n"); - return FALSE; - } - - glamor->context = eglCreateContext(glamor->display, - NULL, EGL_NO_CONTEXT, config_attribs); - if (glamor->context == EGL_NO_CONTEXT) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to create EGL context\n"); - return FALSE; - } - - if (!eglMakeCurrent(glamor->display, - EGL_NO_SURFACE, EGL_NO_SURFACE, glamor->context)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to make EGL context current\n"); - return FALSE; - } + glamor_egl_init(scrn, glamor->fd); miClearVisualTypes(); if (!miSetVisualTypes(scrn->depth, @@ -419,7 +334,7 @@ glamor_ddx_screen_init(int scrnIndex, ScreenPtr screen, int argc, char **argv) if (!miSetPixmapDepths()) return FALSE; - if (!glamor_ddx_init_front_buffer(scrn)) + if (!glamor_ddx_init_front_buffer(scrn, scrn->virtualX, scrn->virtualY)) return FALSE; if (!fbScreenInit(screen, NULL, @@ -613,18 +528,6 @@ glamor_ddx_setup(pointer module, pointer opts, int *errmaj, int *errmin) } } -Bool -glamor_gl_dispatch_init(ScreenPtr screen, struct glamor_gl_dispatch *dispatch, int gl_version) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - struct glamor_ddx_screen_private *glamor_egl = glamor_ddx_get_screen_private(scrn); - if (!glamor_gl_dispatch_init_impl(dispatch, gl_version, eglGetProcAddress)) - return FALSE; - glamor_egl->dispatch = dispatch; - return TRUE; -} - - static XF86ModuleVersionInfo glamor_ddx_version_info = { glamor_ddx_name, MODULEVENDORSTRING, diff --git a/hw/xfree86/glamor/glamor_crtc.c b/hw/xfree86/glamor/glamor_crtc.c index 4cb378058..854e81645 100644 --- a/hw/xfree86/glamor/glamor_crtc.c +++ b/hw/xfree86/glamor/glamor_crtc.c @@ -50,23 +50,6 @@ #include #include -#define GL_GLEXT_PROTOTYPES -#define EGL_EGLEXT_PROTOTYPES -#define EGL_DISPLAY_NO_X_MESA - -#if GLAMOR_GLES2 -#include -#include -#ifndef GL_BGRA -#define GL_BGRA GL_BGRA_EXT -#endif -#else -#include -#endif - -#include -#include - #include "glamor_ddx.h" typedef struct { @@ -85,8 +68,7 @@ typedef struct { drmmode_ptr drmmode; drmModeCrtcPtr mode_crtc; uint32_t rotate_fb_id; - EGLImageKHR cursor; - unsigned int cursor_tex; + struct glamor_gbm_cursor *cursor; } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; typedef struct { @@ -341,7 +323,7 @@ drmmode_update_fb (ScrnInfoPtr scrn, int width, int height) if (drmmode->fb_id != 0 && scrn->virtualX == width && scrn->virtualY == height) return TRUE; - if (!glamor_resize(scrn, width, height)) + if (!glamor_front_buffer_resize(scrn, width, height)) return FALSE; if (drmmode->fb_id != 0) drmModeRmFB(drmmode->fd, drmmode->fb_id); @@ -490,37 +472,33 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; ScrnInfoPtr scrn = crtc->scrn; + ScreenPtr screen = screenInfo.screens[scrn->scrnIndex]; struct glamor_ddx_screen_private *glamor = glamor_ddx_get_screen_private(scrn); + GCPtr gc; if (drmmode_crtc->cursor == NULL) { - drmmode_crtc->cursor = glamor_create_cursor_argb(scrn, 64, 64); - if (drmmode_crtc->cursor == EGL_NO_IMAGE_KHR) + drmmode_crtc->cursor = calloc(1, sizeof(*drmmode_crtc->cursor)); + if (drmmode_crtc->cursor == NULL) { + ErrorF("Failed to allocate cursor.\n"); + return; + } + if (!glamor_create_cursor(scrn, drmmode_crtc->cursor, 64, 64)) { + free(drmmode_crtc->cursor); + drmmode_crtc->cursor = NULL; + ErrorF("Failed to create glamor cursor.\n"); return; - glGenTextures(1, &drmmode_crtc->cursor_tex); - glBindTexture(GL_TEXTURE_2D, drmmode_crtc->cursor_tex); - glTexParameteri(GL_TEXTURE_2D, - GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, - GL_TEXTURE_MAG_FILTER, GL_NEAREST); - (glamor->egl_image_target_texture2d_oes)(GL_TEXTURE_2D, drmmode_crtc->cursor); + } } - glBindTexture(GL_TEXTURE_2D, drmmode_crtc->cursor_tex); -#ifdef GLAMOR_GLES2 - /* XXX Actually, the image is BGRA not RGBA, so the r and b - * should be swapped. But as normally, they are the same value - * ignore this currently, don't want to let CPU to do the swizzle. - * considering to put this function to the glamor rendering directory. - * Thus we can reuse the shader to do this.*/ - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, - GL_RGBA, GL_UNSIGNED_BYTE, image); -#else - glPixelStorei(GL_UNPACK_ROW_LENGTH, 64); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, - GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, image); -#endif + gc = GetScratchGC (drmmode_crtc->cursor->cursor_pixmap->drawable.depth, screen); + if (!gc) + return; + + ValidateGC (&drmmode_crtc->cursor->cursor_pixmap->drawable, gc); + (*gc->ops->PutImage)(&drmmode_crtc->cursor->cursor_pixmap->drawable, gc, + 32, 0, 0, 64, 64, 0, ZPixmap, (char*)image); + FreeScratchGC (gc); } @@ -537,13 +515,12 @@ drmmode_hide_cursor (xf86CrtcPtr crtc) static void drmmode_show_cursor (xf86CrtcPtr crtc) { - ScrnInfoPtr scrn = crtc->scrn; drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle, stride; ErrorF("show cursor\n"); - glamor_cursor_handle(scrn, drmmode_crtc->cursor, &handle, &stride); + glamor_cursor_handle(drmmode_crtc->cursor, &handle, &stride); drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, 64, 64); @@ -654,8 +631,9 @@ drmmode_crtc_destroy(xf86CrtcPtr crtc) ScrnInfoPtr scrn = crtc->scrn; if (drmmode_crtc->cursor) { drmmode_hide_cursor(crtc); - glDeleteTextures(1, &drmmode_crtc->cursor_tex); glamor_destroy_cursor(scrn, drmmode_crtc->cursor); + free(drmmode_crtc->cursor); + drmmode_crtc->cursor = NULL; } free(drmmode_crtc->cursor); crtc->driver_private = NULL; diff --git a/hw/xfree86/glamor/glamor_ddx.h b/hw/xfree86/glamor/glamor_ddx.h index bed7bb921..3ffd48852 100644 --- a/hw/xfree86/glamor/glamor_ddx.h +++ b/hw/xfree86/glamor/glamor_ddx.h @@ -1,43 +1,23 @@ #ifndef GLAMOR_DDX_H #define GLAMOR_DDX_H -#define GL_GLEXT_PROTOTYPES -#define EGL_EGLEXT_PROTOTYPES -#define EGL_DISPLAY_NO_X_MESA - -#if GLAMOR_GLES2 -#include -#include -#else -#include -#endif - -#define MESA_EGL_NO_X11_HEADERS -#include -#include - #include -#include "glamor_gl_dispatch.h" +#define GLAMOR_FOR_XORG 1 +#include struct glamor_ddx_screen_private { - EGLDisplay display; - EGLContext context; - EGLImageKHR root; struct gbm_bo *root_bo; struct gbm_bo *cursor_bo; - - EGLint major, minor; + struct gbm_device *gbm; CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; int fd; int cpp; - struct gbm_device *gbm; +}; - PFNEGLCREATEDRMIMAGEMESA egl_create_drm_image_mesa; - PFNEGLEXPORTDRMIMAGEMESA egl_export_drm_image_mesa; - PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr; - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC egl_image_target_texture2d_oes; - struct glamor_gl_dispatch *dispatch; +struct glamor_gbm_cursor { + struct gbm_bo *cursor_bo; + PixmapPtr cursor_pixmap; }; inline static struct glamor_ddx_screen_private * @@ -46,15 +26,15 @@ glamor_ddx_get_screen_private(ScrnInfoPtr scrn) return (struct glamor_ddx_screen_private *) (scrn->driverPrivate); } -Bool glamor_resize(ScrnInfoPtr scrn, int width, int height); +Bool glamor_front_buffer_resize(ScrnInfoPtr scrn, int width, int height); void glamor_frontbuffer_handle(ScrnInfoPtr scrn, uint32_t *handle, uint32_t *pitch); Bool glamor_load_cursor(ScrnInfoPtr scrn, - CARD32 *image, int width, int height); + int width, int height); -void glamor_cursor_handle(ScrnInfoPtr scrn, EGLImageKHR image, uint32_t *handle, uint32_t *pitch); -EGLImageKHR glamor_create_cursor_argb(ScrnInfoPtr scrn, int width, int height); -void glamor_destroy_cursor(ScrnInfoPtr scrn, EGLImageKHR cursor); +void glamor_cursor_handle(struct glamor_gbm_cursor *cursor, uint32_t *handle, uint32_t *pitch); +Bool glamor_create_cursor(ScrnInfoPtr scrn, struct glamor_gbm_cursor *cursor, int width, int height); +void glamor_destroy_cursor(ScrnInfoPtr scrn, struct glamor_gbm_cursor *cursor) ; Bool drmmode_pre_init(ScrnInfoPtr scrn, int fd, int cpp); void drmmode_closefb(ScrnInfoPtr scrn);