summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-04-01 20:54:19 -0700
committerKeith Packard <keithp@keithp.com>2014-04-03 13:07:51 -0700
commit6aac97198f60de9d4e415fb4fa2fc11cac6c6790 (patch)
treeaf6b992ae1143d171202e51ddf0ebb97618d7806
parent1707faf36d49a63efc462dfef133a555fe093832 (diff)
glamor: Initialize XV shaders from glamor_xv_init instead of glamor_init
The glamor_init calls to glamor_init_xv_shader were never getting run because GLAMOR_XV was never defined. Instead of trying to make that work, fix glamor_xv_init to make the call instead. Further, just get rid of the glamor_fini_xv_shader function entirely as the shader program will be destroyed when the context is destroyed at server reset time. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--glamor/glamor.c6
-rw-r--r--glamor/glamor_xv.c14
2 files changed, 2 insertions, 18 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 971dbf891..a7d981cd8 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -494,9 +494,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
#ifdef GLAMOR_GRADIENT_SHADER
glamor_init_gradient_shader(screen);
#endif
-#ifdef GLAMOR_XV
- glamor_init_xv_shader(screen);
-#endif
glamor_pixmap_init(screen);
glamor_glyphs_init(screen);
@@ -516,9 +513,6 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_screen_private *glamor_priv;
glamor_priv = glamor_get_screen_private(screen);
-#ifdef GLAMOR_XV
- glamor_fini_xv_shader(screen);
-#endif
#ifdef RENDER
glamor_fini_composite_shaders(screen);
#endif
diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c
index 17745a4e8..4e60fa3a4 100644
--- a/glamor/glamor_xv.c
+++ b/glamor/glamor_xv.c
@@ -114,18 +114,6 @@ glamor_init_xv_shader(ScreenPtr screen)
glamor_put_context(glamor_priv);
}
-void
-glamor_fini_xv_shader(ScreenPtr screen)
-{
- glamor_screen_private *glamor_priv;
-
- glamor_priv = glamor_get_screen_private(screen);
- glamor_get_context(glamor_priv);
-
- glDeleteProgram(glamor_priv->xv_prog);
- glamor_put_context(glamor_priv);
-}
-
#define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v))
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -559,6 +547,8 @@ glamor_xv_init(ScreenPtr screen, int num_texture_ports)
XF86VideoAdaptorPtr adapt;
int i;
+ glamor_init_xv_shader(screen);
+
adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + num_texture_ports *
(sizeof(glamor_port_private) + sizeof(DevUnion)));
if (adapt == NULL)