glamor: Eliminate GLAMOR_USE_SCREEN and GLAMOR_USE_PICTURE_SCREEN
Remove these defines as we start to remove support for non-standard glamor layering as used by the intel driver. v2: Rebase on the blockhandler change and the Xephyr init failure change (by anholt), fix stray NO_DRI3 addition to xwayland. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
28ff815c4b
commit
697f8581e0
108
glamor/glamor.c
108
glamor/glamor.c
|
@ -309,10 +309,8 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
glamor_screen_private *glamor_priv;
|
glamor_screen_private *glamor_priv;
|
||||||
int gl_version;
|
int gl_version;
|
||||||
int max_viewport_size[2];
|
int max_viewport_size[2];
|
||||||
|
|
||||||
#ifdef RENDER
|
|
||||||
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
|
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
|
||||||
#endif
|
|
||||||
if (flags & ~GLAMOR_VALID_FLAGS) {
|
if (flags & ~GLAMOR_VALID_FLAGS) {
|
||||||
ErrorF("glamor_init: Invalid flags %x\n", flags);
|
ErrorF("glamor_init: Invalid flags %x\n", flags);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -447,51 +445,45 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
if (!glamor_font_init(screen))
|
if (!glamor_font_init(screen))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (flags & GLAMOR_USE_SCREEN) {
|
glamor_priv->saved_procs.block_handler = screen->BlockHandler;
|
||||||
|
screen->BlockHandler = _glamor_block_handler;
|
||||||
|
|
||||||
glamor_priv->saved_procs.block_handler = screen->BlockHandler;
|
glamor_priv->saved_procs.create_gc = screen->CreateGC;
|
||||||
screen->BlockHandler = _glamor_block_handler;
|
screen->CreateGC = glamor_create_gc;
|
||||||
|
|
||||||
glamor_priv->saved_procs.create_gc = screen->CreateGC;
|
glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap;
|
||||||
screen->CreateGC = glamor_create_gc;
|
screen->CreatePixmap = glamor_create_pixmap;
|
||||||
|
|
||||||
glamor_priv->saved_procs.create_pixmap = screen->CreatePixmap;
|
glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap;
|
||||||
screen->CreatePixmap = glamor_create_pixmap;
|
screen->DestroyPixmap = glamor_destroy_pixmap;
|
||||||
|
|
||||||
glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap;
|
glamor_priv->saved_procs.get_spans = screen->GetSpans;
|
||||||
screen->DestroyPixmap = glamor_destroy_pixmap;
|
screen->GetSpans = glamor_get_spans;
|
||||||
|
|
||||||
glamor_priv->saved_procs.get_spans = screen->GetSpans;
|
glamor_priv->saved_procs.get_image = screen->GetImage;
|
||||||
screen->GetSpans = glamor_get_spans;
|
screen->GetImage = glamor_get_image;
|
||||||
|
|
||||||
glamor_priv->saved_procs.get_image = screen->GetImage;
|
glamor_priv->saved_procs.change_window_attributes =
|
||||||
screen->GetImage = glamor_get_image;
|
screen->ChangeWindowAttributes;
|
||||||
|
screen->ChangeWindowAttributes = glamor_change_window_attributes;
|
||||||
|
|
||||||
glamor_priv->saved_procs.change_window_attributes =
|
glamor_priv->saved_procs.copy_window = screen->CopyWindow;
|
||||||
screen->ChangeWindowAttributes;
|
screen->CopyWindow = glamor_copy_window;
|
||||||
screen->ChangeWindowAttributes = glamor_change_window_attributes;
|
|
||||||
|
|
||||||
glamor_priv->saved_procs.copy_window = screen->CopyWindow;
|
glamor_priv->saved_procs.bitmap_to_region = screen->BitmapToRegion;
|
||||||
screen->CopyWindow = glamor_copy_window;
|
screen->BitmapToRegion = glamor_bitmap_to_region;
|
||||||
|
|
||||||
glamor_priv->saved_procs.bitmap_to_region = screen->BitmapToRegion;
|
glamor_priv->saved_procs.composite = ps->Composite;
|
||||||
screen->BitmapToRegion = glamor_bitmap_to_region;
|
ps->Composite = glamor_composite;
|
||||||
}
|
|
||||||
#ifdef RENDER
|
|
||||||
if (flags & GLAMOR_USE_PICTURE_SCREEN) {
|
|
||||||
glamor_priv->saved_procs.composite = ps->Composite;
|
|
||||||
ps->Composite = glamor_composite;
|
|
||||||
|
|
||||||
glamor_priv->saved_procs.trapezoids = ps->Trapezoids;
|
glamor_priv->saved_procs.trapezoids = ps->Trapezoids;
|
||||||
ps->Trapezoids = glamor_trapezoids;
|
ps->Trapezoids = glamor_trapezoids;
|
||||||
|
|
||||||
glamor_priv->saved_procs.triangles = ps->Triangles;
|
glamor_priv->saved_procs.triangles = ps->Triangles;
|
||||||
ps->Triangles = glamor_triangles;
|
ps->Triangles = glamor_triangles;
|
||||||
|
|
||||||
glamor_priv->saved_procs.addtraps = ps->AddTraps;
|
glamor_priv->saved_procs.addtraps = ps->AddTraps;
|
||||||
ps->AddTraps = glamor_add_traps;
|
ps->AddTraps = glamor_add_traps;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
glamor_priv->saved_procs.composite_rects = ps->CompositeRects;
|
glamor_priv->saved_procs.composite_rects = ps->CompositeRects;
|
||||||
ps->CompositeRects = glamor_composite_rectangles;
|
ps->CompositeRects = glamor_composite_rectangles;
|
||||||
|
@ -508,13 +500,14 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture;
|
glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture;
|
||||||
ps->DestroyPicture = glamor_destroy_picture;
|
ps->DestroyPicture = glamor_destroy_picture;
|
||||||
glamor_init_composite_shaders(screen);
|
glamor_init_composite_shaders(screen);
|
||||||
#endif
|
|
||||||
glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
|
glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
|
||||||
screen->SetWindowPixmap = glamor_set_window_pixmap;
|
screen->SetWindowPixmap = glamor_set_window_pixmap;
|
||||||
|
|
||||||
glamor_init_vbo(screen);
|
glamor_init_vbo(screen);
|
||||||
glamor_init_pixmap_fbo(screen);
|
glamor_init_pixmap_fbo(screen);
|
||||||
glamor_init_finish_access_shaders(screen);
|
glamor_init_finish_access_shaders(screen);
|
||||||
|
|
||||||
#ifdef GLAMOR_GRADIENT_SHADER
|
#ifdef GLAMOR_GRADIENT_SHADER
|
||||||
glamor_init_gradient_shader(screen);
|
glamor_init_gradient_shader(screen);
|
||||||
#endif
|
#endif
|
||||||
|
@ -537,9 +530,7 @@ glamor_release_screen_priv(ScreenPtr screen)
|
||||||
glamor_screen_private *glamor_priv;
|
glamor_screen_private *glamor_priv;
|
||||||
|
|
||||||
glamor_priv = glamor_get_screen_private(screen);
|
glamor_priv = glamor_get_screen_private(screen);
|
||||||
#ifdef RENDER
|
|
||||||
glamor_fini_composite_shaders(screen);
|
glamor_fini_composite_shaders(screen);
|
||||||
#endif
|
|
||||||
glamor_fini_vbo(screen);
|
glamor_fini_vbo(screen);
|
||||||
glamor_fini_pixmap_fbo(screen);
|
glamor_fini_pixmap_fbo(screen);
|
||||||
glamor_fini_finish_access_shaders(screen);
|
glamor_fini_finish_access_shaders(screen);
|
||||||
|
@ -578,43 +569,34 @@ glamor_close_screen(ScreenPtr screen)
|
||||||
{
|
{
|
||||||
glamor_screen_private *glamor_priv;
|
glamor_screen_private *glamor_priv;
|
||||||
PixmapPtr screen_pixmap;
|
PixmapPtr screen_pixmap;
|
||||||
int flags;
|
|
||||||
|
|
||||||
#ifdef RENDER
|
|
||||||
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
|
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
|
||||||
#endif
|
|
||||||
glamor_priv = glamor_get_screen_private(screen);
|
glamor_priv = glamor_get_screen_private(screen);
|
||||||
flags = glamor_priv->flags;
|
|
||||||
glamor_sync_close(screen);
|
glamor_sync_close(screen);
|
||||||
glamor_glyphs_fini(screen);
|
glamor_glyphs_fini(screen);
|
||||||
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
|
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
|
||||||
screen->CreateScreenResources =
|
screen->CreateScreenResources =
|
||||||
glamor_priv->saved_procs.create_screen_resources;
|
glamor_priv->saved_procs.create_screen_resources;
|
||||||
if (flags & GLAMOR_USE_SCREEN) {
|
|
||||||
|
|
||||||
screen->CreateGC = glamor_priv->saved_procs.create_gc;
|
screen->CreateGC = glamor_priv->saved_procs.create_gc;
|
||||||
screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
|
screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
|
||||||
screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
|
screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
|
||||||
screen->GetSpans = glamor_priv->saved_procs.get_spans;
|
screen->GetSpans = glamor_priv->saved_procs.get_spans;
|
||||||
screen->ChangeWindowAttributes =
|
screen->ChangeWindowAttributes =
|
||||||
glamor_priv->saved_procs.change_window_attributes;
|
glamor_priv->saved_procs.change_window_attributes;
|
||||||
screen->CopyWindow = glamor_priv->saved_procs.copy_window;
|
screen->CopyWindow = glamor_priv->saved_procs.copy_window;
|
||||||
screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
|
screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
|
||||||
screen->BlockHandler = glamor_priv->saved_procs.block_handler;
|
screen->BlockHandler = glamor_priv->saved_procs.block_handler;
|
||||||
}
|
|
||||||
#ifdef RENDER
|
|
||||||
if (ps && (flags & GLAMOR_USE_PICTURE_SCREEN)) {
|
|
||||||
|
|
||||||
ps->Composite = glamor_priv->saved_procs.composite;
|
ps->Composite = glamor_priv->saved_procs.composite;
|
||||||
ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
|
ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
|
||||||
ps->Triangles = glamor_priv->saved_procs.triangles;
|
ps->Triangles = glamor_priv->saved_procs.triangles;
|
||||||
ps->CreatePicture = glamor_priv->saved_procs.create_picture;
|
ps->CreatePicture = glamor_priv->saved_procs.create_picture;
|
||||||
}
|
|
||||||
ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
|
ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
|
||||||
ps->Glyphs = glamor_priv->saved_procs.glyphs;
|
ps->Glyphs = glamor_priv->saved_procs.glyphs;
|
||||||
ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph;
|
ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph;
|
||||||
screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
|
screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
|
||||||
#endif
|
|
||||||
screen_pixmap = screen->GetScreenPixmap(screen);
|
screen_pixmap = screen->GetScreenPixmap(screen);
|
||||||
glamor_set_pixmap_private(screen_pixmap, NULL);
|
glamor_set_pixmap_private(screen_pixmap, NULL);
|
||||||
|
|
||||||
|
|
|
@ -62,15 +62,9 @@ typedef enum glamor_pixmap_type {
|
||||||
} glamor_pixmap_type_t;
|
} glamor_pixmap_type_t;
|
||||||
|
|
||||||
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
|
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
|
||||||
#define GLAMOR_INVERTED_Y_AXIS 1 /* compat stub */
|
#define GLAMOR_USE_EGL_SCREEN (1 << 0)
|
||||||
#define GLAMOR_USE_SCREEN (1 << 1)
|
#define GLAMOR_NO_DRI3 (1 << 1)
|
||||||
#define GLAMOR_USE_PICTURE_SCREEN (1 << 2)
|
#define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \
|
||||||
#define GLAMOR_USE_EGL_SCREEN (1 << 3)
|
|
||||||
#define GLAMOR_NO_DRI3 (1 << 4)
|
|
||||||
#define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS \
|
|
||||||
| GLAMOR_USE_SCREEN \
|
|
||||||
| GLAMOR_USE_PICTURE_SCREEN \
|
|
||||||
| GLAMOR_USE_EGL_SCREEN \
|
|
||||||
| GLAMOR_NO_DRI3)
|
| GLAMOR_NO_DRI3)
|
||||||
|
|
||||||
/* @glamor_init: Initialize glamor internal data structure.
|
/* @glamor_init: Initialize glamor internal data structure.
|
||||||
|
@ -78,23 +72,13 @@ typedef enum glamor_pixmap_type {
|
||||||
* @screen: Current screen pointer.
|
* @screen: Current screen pointer.
|
||||||
* @flags: Please refer the flags description above.
|
* @flags: Please refer the flags description above.
|
||||||
*
|
*
|
||||||
* @GLAMOR_USE_SCREEN:
|
|
||||||
* If running in an pre-existing X environment, and the
|
|
||||||
* gl context is GLX, then you should set this bit and
|
|
||||||
* let the glamor to handle all the screen related
|
|
||||||
* functions such as GC ops and CreatePixmap/DestroyPixmap.
|
|
||||||
*
|
|
||||||
* @GLAMOR_USE_PICTURE_SCREEN:
|
|
||||||
* If don't use any other underlying DDX driver to handle
|
|
||||||
* the picture related rendering functions, please set this
|
|
||||||
* bit on. Otherwise, clear this bit. And then it is the DDX
|
|
||||||
* driver's responsibility to determine how/when to jump to
|
|
||||||
* glamor's picture compositing path.
|
|
||||||
*
|
|
||||||
* @GLAMOR_USE_EGL_SCREEN:
|
* @GLAMOR_USE_EGL_SCREEN:
|
||||||
* If you are using EGL layer, then please set this bit
|
* If you are using EGL layer, then please set this bit
|
||||||
* on, otherwise, clear it.
|
* on, otherwise, clear it.
|
||||||
*
|
*
|
||||||
|
* @GLAMOR_NO_DRI3
|
||||||
|
* Disable the built-in DRI3 support
|
||||||
|
*
|
||||||
* This function initializes necessary internal data structure
|
* This function initializes necessary internal data structure
|
||||||
* for glamor. And before calling into this function, the OpenGL
|
* for glamor. And before calling into this function, the OpenGL
|
||||||
* environment should be ready. Should be called before any real
|
* environment should be ready. Should be called before any real
|
||||||
|
|
|
@ -1407,9 +1407,7 @@ ephyr_glamor_init(ScreenPtr screen)
|
||||||
ephyr_glamor_set_window_size(scrpriv->glamor,
|
ephyr_glamor_set_window_size(scrpriv->glamor,
|
||||||
scrpriv->win_width, scrpriv->win_height);
|
scrpriv->win_width, scrpriv->win_height);
|
||||||
|
|
||||||
if (!glamor_init(screen,
|
if (!glamor_init(screen, 0)) {
|
||||||
GLAMOR_USE_SCREEN |
|
|
||||||
GLAMOR_USE_PICTURE_SCREEN)) {
|
|
||||||
FatalError("Failed to initialize glamor\n");
|
FatalError("Failed to initialize glamor\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1049,10 +1049,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||||
|
|
||||||
#ifdef GLAMOR
|
#ifdef GLAMOR
|
||||||
if (ms->drmmode.glamor) {
|
if (ms->drmmode.glamor) {
|
||||||
if (!glamor_init(pScreen,
|
if (!glamor_init(pScreen, GLAMOR_USE_EGL_SCREEN)) {
|
||||||
GLAMOR_USE_EGL_SCREEN |
|
|
||||||
GLAMOR_USE_SCREEN |
|
|
||||||
GLAMOR_USE_PICTURE_SCREEN)) {
|
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"Failed to initialize glamor at ScreenInit() time.\n");
|
"Failed to initialize glamor at ScreenInit() time.\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -549,11 +549,7 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!glamor_init(xwl_screen->screen,
|
if (!glamor_init(xwl_screen->screen, GLAMOR_USE_EGL_SCREEN)) {
|
||||||
GLAMOR_INVERTED_Y_AXIS |
|
|
||||||
GLAMOR_USE_EGL_SCREEN |
|
|
||||||
GLAMOR_USE_SCREEN |
|
|
||||||
GLAMOR_USE_PICTURE_SCREEN)) {
|
|
||||||
ErrorF("Failed to initialize glamor\n");
|
ErrorF("Failed to initialize glamor\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user