glamor: Fix direct call for glEGLImageTargetTexture2DOES
Follow extension call rule to call glEGLImageTargetTexture2DOES.
This commit is contained in:
parent
54c91079d2
commit
3854409e9a
|
@ -35,19 +35,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
|
|
||||||
#define GL_GLEXT_PROTOTYPES
|
|
||||||
#define EGL_EGLEXT_PROTOTYPES
|
|
||||||
#define EGL_DISPLAY_NO_X_MESA
|
|
||||||
|
|
||||||
#if GLAMOR_GLES2
|
|
||||||
#include <GLES2/gl2.h>
|
|
||||||
#else
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MESA_EGL_NO_X11_HEADERS
|
|
||||||
#include <EGL/egl.h>
|
|
||||||
#include <EGL/eglext.h>
|
|
||||||
|
|
||||||
#include "../../../mi/micmap.h"
|
#include "../../../mi/micmap.h"
|
||||||
#include <xf86Crtc.h>
|
#include <xf86Crtc.h>
|
||||||
|
@ -70,27 +57,6 @@ glamor_identify(int flags)
|
||||||
xf86Msg(X_INFO, "%s: OpenGL accelerated X.org driver\n", glamor_name);
|
xf86Msg(X_INFO, "%s: OpenGL accelerated X.org driver\n", glamor_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct glamor_screen_private {
|
|
||||||
EGLDisplay display;
|
|
||||||
EGLContext context;
|
|
||||||
EGLImageKHR root;
|
|
||||||
EGLint major, minor;
|
|
||||||
|
|
||||||
CreateScreenResourcesProcPtr CreateScreenResources;
|
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
int fd;
|
|
||||||
int cpp;
|
|
||||||
|
|
||||||
PFNEGLCREATEDRMIMAGEMESA egl_create_drm_image_mesa;
|
|
||||||
PFNEGLEXPORTDRMIMAGEMESA egl_export_drm_image_mesa;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline struct glamor_screen_private *
|
|
||||||
glamor_get_screen_private(ScrnInfoPtr scrn)
|
|
||||||
{
|
|
||||||
return (struct glamor_screen_private *) (scrn->driverPrivate);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
glamor_resize(ScrnInfoPtr scrn, int width, int height)
|
glamor_resize(ScrnInfoPtr scrn, int width, int height)
|
||||||
|
@ -122,7 +88,7 @@ glamor_resize(ScrnInfoPtr scrn, int width, int height)
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
|
(glamor->egl_image_target_texture2d_oes)(GL_TEXTURE_2D, image);
|
||||||
|
|
||||||
glamor_set_screen_pixmap_texture(screen, width, height, texture);
|
glamor_set_screen_pixmap_texture(screen, width, height, texture);
|
||||||
glamor->root = image;
|
glamor->root = image;
|
||||||
|
@ -394,8 +360,10 @@ glamor_screen_init_ddx(int scrnIndex, ScreenPtr screen, int argc, char **argv)
|
||||||
|
|
||||||
glamor->egl_create_drm_image_mesa = (PFNEGLCREATEDRMIMAGEMESA)eglGetProcAddress("eglCreateDRMImageMESA");
|
glamor->egl_create_drm_image_mesa = (PFNEGLCREATEDRMIMAGEMESA)eglGetProcAddress("eglCreateDRMImageMESA");
|
||||||
glamor->egl_export_drm_image_mesa = (PFNEGLEXPORTDRMIMAGEMESA)eglGetProcAddress("eglExportDRMImageMESA");
|
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) {
|
if (!glamor->egl_create_drm_image_mesa || !glamor->egl_export_drm_image_mesa ||
|
||||||
|
!glamor->egl_image_target_texture2d_oes) {
|
||||||
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
|
||||||
"eglGetProcAddress() failed\n");
|
"eglGetProcAddress() failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -478,6 +478,7 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image)
|
||||||
{
|
{
|
||||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||||
ScrnInfoPtr scrn = crtc->scrn;
|
ScrnInfoPtr scrn = crtc->scrn;
|
||||||
|
struct glamor_screen_private *glamor = glamor_get_screen_private(scrn);
|
||||||
|
|
||||||
if (drmmode_crtc->cursor == NULL)
|
if (drmmode_crtc->cursor == NULL)
|
||||||
{
|
{
|
||||||
|
@ -490,7 +491,7 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image)
|
||||||
GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D,
|
glTexParameteri(GL_TEXTURE_2D,
|
||||||
GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, drmmode_crtc->cursor);
|
(glamor->egl_image_target_texture2d_oes)(GL_TEXTURE_2D, drmmode_crtc->cursor);
|
||||||
}
|
}
|
||||||
glBindTexture(GL_TEXTURE_2D, drmmode_crtc->cursor_tex);
|
glBindTexture(GL_TEXTURE_2D, drmmode_crtc->cursor_tex);
|
||||||
#ifdef GLAMOR_GLES2
|
#ifdef GLAMOR_GLES2
|
||||||
|
|
|
@ -1,6 +1,43 @@
|
||||||
#ifndef GLAMOR_DDX_H
|
#ifndef GLAMOR_DDX_H
|
||||||
#define 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 <GLES2/gl2.h>
|
||||||
|
#include <GLES2/gl2ext.h>
|
||||||
|
#else
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MESA_EGL_NO_X11_HEADERS
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
#include <EGL/eglext.h>
|
||||||
|
|
||||||
|
struct glamor_screen_private {
|
||||||
|
EGLDisplay display;
|
||||||
|
EGLContext context;
|
||||||
|
EGLImageKHR root;
|
||||||
|
EGLint major, minor;
|
||||||
|
|
||||||
|
CreateScreenResourcesProcPtr CreateScreenResources;
|
||||||
|
CloseScreenProcPtr CloseScreen;
|
||||||
|
int fd;
|
||||||
|
int cpp;
|
||||||
|
|
||||||
|
PFNEGLCREATEDRMIMAGEMESA egl_create_drm_image_mesa;
|
||||||
|
PFNEGLEXPORTDRMIMAGEMESA egl_export_drm_image_mesa;
|
||||||
|
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC egl_image_target_texture2d_oes;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline struct glamor_screen_private *
|
||||||
|
glamor_get_screen_private(ScrnInfoPtr scrn)
|
||||||
|
{
|
||||||
|
return (struct glamor_screen_private *) (scrn->driverPrivate);
|
||||||
|
}
|
||||||
|
|
||||||
Bool glamor_resize(ScrnInfoPtr scrn, int width, int height);
|
Bool glamor_resize(ScrnInfoPtr scrn, int width, int height);
|
||||||
void glamor_frontbuffer_handle(ScrnInfoPtr scrn,
|
void glamor_frontbuffer_handle(ScrnInfoPtr scrn,
|
||||||
uint32_t *handle, uint32_t *pitch);
|
uint32_t *handle, uint32_t *pitch);
|
||||||
|
|
Loading…
Reference in New Issue