From ae38bd7c459982d3e05f6f672ee68d187e97421c Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Thu, 25 Aug 2011 10:05:11 +0800 Subject: [PATCH] glamor: Change glamor_egl_init API. Slightly change the API glamor_egl_init, as this initialization is to initialize the display not the screen, we should call it in xxx_preinit rather than xxxScreenInit(). we change the input parameter as below, as in preInit, the screen may not be allocated at all. And in glamor_egl_init, it will not call glamor_init. Driver should call glamor_init at screen_init stage. Signed-off-by: Zhigang Gong --- glamor/glamor.h | 3 ++- glamor/glamor_egl.c | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/glamor/glamor.h b/glamor/glamor.h index ef13b7a66..3c74c723e 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -29,6 +29,7 @@ #define GLAMOR_H #include "scrnintstr.h" +#include "xf86str.h" #include "pixmapstr.h" #include "windowstr.h" #include "gcstruct.h" @@ -49,7 +50,7 @@ extern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags); extern _X_EXPORT void glamor_fini(ScreenPtr screen); extern _X_EXPORT void glamor_set_screen_pixmap_texture(ScreenPtr screen, int w, int h, unsigned int tex); -extern _X_EXPORT Bool glamor_egl_init(ScreenPtr screen, int fd); +extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd); extern _X_EXPORT Bool glamor_create_egl_screen_image(ScreenPtr screen, int handle, int stride); extern _X_EXPORT Bool glamor_close_egl_screen(ScreenPtr screen); extern _X_EXPORT void glamor_free_egl_screen(int scrnIndex, int flags); diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 7848c51ef..293e8dea9 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -195,9 +195,8 @@ glamor_egl_has_extension(struct glamor_screen_private *glamor, char *extension) } -Bool glamor_egl_init(ScreenPtr screen, int fd) +Bool glamor_egl_init(ScrnInfoPtr scrn, int fd) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; struct glamor_screen_private *glamor; const char *version; EGLint config_attribs[] = { @@ -275,11 +274,6 @@ Bool glamor_egl_init(ScreenPtr screen, int fd) return FALSE; } - if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to initialize glamor\n"); - return FALSE; - } return TRUE; }