diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 16959d74b..1aacc5fe8 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -395,9 +395,6 @@ ephyrSetInternalDamage (ScreenPtr pScreen) EphyrScrPriv *scrpriv = screen->driver; PixmapPtr pPixmap = NULL; - if (ephyrFuncs.initAccel == ephyr_glamor_init) - return TRUE; - scrpriv->pDamage = DamageCreate ((DamageReportFunc) 0, (DamageDestroyFunc) 0, DamageReportNone, diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h index cd1521209..9dcde8d56 100644 --- a/hw/kdrive/ephyr/ephyr.h +++ b/hw/kdrive/ephyr/ephyr.h @@ -201,6 +201,7 @@ Bool ephyr_glamor_init(ScreenPtr pScreen); void ephyr_glamor_enable(ScreenPtr pScreen); void ephyr_glamor_disable(ScreenPtr pScreen); void ephyr_glamor_fini(ScreenPtr pScreen); +void ephyr_glamor_host_paint_rect(ScreenPtr pScreen); /*ephyvideo.c*/ diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index c7c792984..15dfc70ae 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -767,6 +767,11 @@ hostx_screen_init (EphyrScreenInfo screen, static void hostx_paint_debug_rect (struct EphyrHostScreen *host_screen, int x, int y, int width, int height); +static void +ephyr_glamor_paint_rect (EphyrScreenInfo screen, + int sx, int sy, + int dx, int dy, + int width, int height); void hostx_paint_rect (EphyrScreenInfo screen, @@ -778,6 +783,11 @@ hostx_paint_rect (EphyrScreenInfo screen, EPHYR_DBG ("painting in screen %d\n", host_screen->mynum) ; + if (ephyr_glamor) { + ephyr_glamor_paint_rect(screen, sx, sy, dx, dy, width, height); + return; + } + /* * Copy the image data updated by the shadow layer * on to the window @@ -1464,6 +1474,7 @@ ephyr_glamor_get_visual(void) GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, 1, None}; XVisualInfo *visual_info; int event_base = 0, error_base = 0; @@ -1495,3 +1506,29 @@ ephyr_glamor_host_create_context(EphyrScreenInfo ephyr_screen) if (!glXMakeCurrent(dpy, host_screen->win, ctx)) errx(1, "glXMakeCurrent failed\n"); } + +static void +ephyr_glamor_paint_rect (EphyrScreenInfo screen, + int sx, int sy, + int dx, int dy, + int width, int height) +{ + struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen); + static PFNGLXCOPYSUBBUFFERMESAPROC pglXCopySubBufferMESA = NULL; + + if (!pglXCopySubBufferMESA) { + pglXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC) + glXGetProcAddressARB((const GLubyte*)"glXCopySubBufferMESA"); + assert(pglXCopySubBufferMESA); + } + + /* Always copy the full screen until we get things rendering correctly. */ +#if 0 + pglXCopySubBufferMESA(HostX.dpy, host_screen->win, + sx, sy, width, height); +#else + pglXCopySubBufferMESA(HostX.dpy, host_screen->win, + 0, 0, + host_screen->win_width, host_screen->win_height); +#endif +}