summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-03-17 17:29:56 -0700
committerKeith Packard <keithp@keithp.com>2014-03-17 17:29:56 -0700
commitd18d3f6d18aa7827748f7ba14efd405b525883d0 (patch)
tree4356afb63e46a3848f6c607a3512a3acb48b021e /hw
parent81a4952d3dcab9ca3a1ee399c773f5ac352036c4 (diff)
parent6649d0059e1bc136b84a9e457ae81c07521fadc0 (diff)
Merge remote-tracking branch 'anholt/glamor-megaseries'
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/ephyr_glamor_glx.c16
-rw-r--r--hw/kdrive/ephyr/ephyr_glamor_glx.h10
-rw-r--r--hw/kdrive/ephyr/hostx.c7
3 files changed, 30 insertions, 3 deletions
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index d56907fe7..9903cc772 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.c
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c
@@ -67,6 +67,9 @@ struct ephyr_glamor {
GLuint texture_shader;
GLuint texture_shader_position_loc;
GLuint texture_shader_texcoord_loc;
+
+ /* Size of the window that we're rendering to. */
+ unsigned width, height;
};
static GLint
@@ -205,6 +208,7 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glUseProgram(glamor->texture_shader);
+ glViewport(0, 0, glamor->width, glamor->height);
glVertexAttribPointer(glamor->texture_shader_position_loc,
2, GL_FLOAT, FALSE, 0, position);
@@ -309,6 +313,7 @@ ephyr_glamor_get_visual(void)
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER, 1,
+ GLX_VISUAL_ID, DefaultVisual(dpy, DefaultScreen(dpy)),
None
};
int event_base = 0, error_base = 0, nelements;
@@ -329,3 +334,14 @@ ephyr_glamor_get_visual(void)
return xcb_aux_find_visual_by_id(xscreen, visual_info->visualid);
}
+
+void
+ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
+ unsigned width, unsigned height)
+{
+ if (!glamor)
+ return;
+
+ glamor->width = width;
+ glamor->height = height;
+}
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.h b/hw/kdrive/ephyr/ephyr_glamor_glx.h
index 8995e1eca..0c238cf5b 100644
--- a/hw/kdrive/ephyr/ephyr_glamor_glx.h
+++ b/hw/kdrive/ephyr/ephyr_glamor_glx.h
@@ -51,6 +51,10 @@ ephyr_glamor_glx_screen_fini(struct ephyr_glamor *glamor);
#ifdef GLAMOR
void
+ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
+ unsigned width, unsigned height);
+
+void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage);
@@ -60,6 +64,12 @@ ephyr_glamor_process_event(xcb_generic_event_t *xev);
#else /* !GLAMOR */
static inline void
+ephyr_glamor_set_window_size(struct ephyr_glamor *glamor,
+ unsigned width, unsigned height)
+{
+}
+
+static inline void
ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor,
struct pixman_region16 *damage)
{
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 859becaa6..3260d9527 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -731,6 +731,8 @@ hostx_screen_init(KdScreenInfo *screen,
if (ephyr_glamor) {
*bytes_per_line = 0;
*bits_per_pixel = 0;
+ ephyr_glamor_set_window_size(scrpriv->glamor,
+ scrpriv->win_width, scrpriv->win_height);
return NULL;
} else if (host_depth_matches_server(scrpriv)) {
*bytes_per_line = scrpriv->ximg->stride;
@@ -1218,6 +1220,8 @@ ephyr_glamor_init(ScreenPtr screen)
EphyrScrPriv *scrpriv = kd_screen->driver;
scrpriv->glamor = ephyr_glamor_glx_screen_init(scrpriv->win);
+ ephyr_glamor_set_window_size(scrpriv->glamor,
+ scrpriv->win_width, scrpriv->win_height);
glamor_init(screen,
GLAMOR_USE_SCREEN |
@@ -1239,9 +1243,6 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen)
if (!ephyr_glamor)
return TRUE;
- if (!glamor_glyphs_init(pScreen))
- return FALSE;
-
/* kdrive's fbSetupScreen() told mi to have
* miCreateScreenResources() (which is called before this) make a
* scratch pixmap wrapping ephyr-glamor's NULL