summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyr.c
diff options
context:
space:
mode:
authorDaniel Martin <consume.noise@gmail.com>2012-12-20 13:50:17 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2013-03-04 10:01:08 +1000
commitbd58ebe4cf3b0ce60f87fb26a3715f774dabd349 (patch)
treeb061abe4a430e9ddbe76cb0915124021610a5e4f /hw/kdrive/ephyr/ephyr.c
parente21e183059df5975e7086850d1931edb2c1bbd06 (diff)
ephyr: Fix crash on 24bpp host framebuffer
Use bytes_per_line and bits_per_pixel from the created XImage to fix https://bugzilla.redhat.com/show_bug.cgi?id=518960 Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/kdrive/ephyr/ephyr.c')
-rw-r--r--hw/kdrive/ephyr/ephyr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index f32e43285..02d497073 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -238,13 +238,11 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height);
KdSetPointerMatrix(&m);
- priv->bytes_per_line =
- ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
-
buffer_height = ephyrBufferHeight(screen);
priv->base =
- hostx_screen_init(screen, screen->width, screen->height, buffer_height);
+ hostx_screen_init(screen, screen->width, screen->height, buffer_height,
+ &priv->bytes_per_line, &screen->fb.bitsPerPixel);
if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
scrpriv->shadow = FALSE;