Commit bf4cbbd4 authored by Zhigang Gong's avatar Zhigang Gong

glamor: Move glamor_glyphs_init to create screen resources stage.

As in glamor_glyphs_init, we may need to create pixmap. Thus it must
be called after the pixmap resources allocation. Just move it to
screen resource creation stage is good enough for mow.

Also introduce a macro GLAMOR_FOR_XORG to glamor.h. As glamor may
be used by Xephyr which doesn't don't have those xorg header files
and also don't need the egl extension.
Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
parent ae38bd7c
......@@ -364,7 +364,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_init_tile_shader(screen);
glamor_init_putimage_shaders(screen);
glamor_init_finish_access_shaders(screen);
glamor_glyphs_init(screen);
glamor_pixmap_init(screen);
#ifdef GLAMOR_GLES2
......
......@@ -29,7 +29,9 @@
#define GLAMOR_H
#include "scrnintstr.h"
#ifdef GLAMOR_FOR_XORG
#include "xf86str.h"
#endif
#include "pixmapstr.h"
#include "windowstr.h"
#include "gcstruct.h"
......@@ -49,9 +51,11 @@
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_glyphs_init (ScreenPtr pScreen);
#ifdef GLAMOR_FOR_XORG
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);
#endif
......@@ -51,6 +51,8 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#define GLAMOR_FOR_XORG
#include <glamor.h>
#define GLAMOR_VERSION_MAJOR 0
......
......@@ -684,6 +684,7 @@ ephyrInitScreen (ScreenPtr pScreen)
return TRUE;
}
Bool
ephyrFinishInitScreen (ScreenPtr pScreen)
{
......@@ -700,6 +701,7 @@ ephyrFinishInitScreen (ScreenPtr pScreen)
return TRUE;
}
extern Bool ephyr_glamor;
Bool
ephyrCreateResources (ScreenPtr pScreen)
......@@ -710,14 +712,16 @@ ephyrCreateResources (ScreenPtr pScreen)
EPHYR_LOG("mark pScreen=%p mynum=%d shadow=%d",
pScreen, pScreen->myNum, scrpriv->shadow);
if (scrpriv->shadow)
return KdShadowSet (pScreen,
scrpriv->randr,
ephyrShadowUpdate,
ephyrWindowLinear);
else
else {
if (ephyr_glamor)
if (!glamor_glyphs_init(pScreen)) return FALSE;
return ephyrSetInternalDamage(pScreen);
}
}
void
......
......@@ -233,7 +233,8 @@ glamor_create_screen_resources_ddx(ScreenPtr screen)
screen->CreateScreenResources = glamor->CreateScreenResources;
if (!(*screen->CreateScreenResources) (screen))
return FALSE;
if (!glamor_glyphs_init(screen))
return FALSE;
if (!xf86SetDesiredModes(scrn))
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment