diff options
author | Dodji Seketeli <dodji@openedhand.com> | 2007-10-03 16:13:16 +0200 |
---|---|---|
committer | Dodji Seketeli <dodji@openedhand.com> | 2007-10-03 16:14:08 +0200 |
commit | 604ebb5a6de372e6a8a96e0ee997db7929126860 (patch) | |
tree | 72523d93657c444198a044282fe342edb9492d9e /hw/kdrive/ephyr/ephyr.c | |
parent | 1365aeff5499a051375e43a9fcbf54733ac93929 (diff) | |
parent | 4ba76a7e2b62d26f43c0e670de571afb75ec92f4 (diff) |
Merge Xephyr-XV/GL stuff into master
Diffstat (limited to 'hw/kdrive/ephyr/ephyr.c')
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 68 |
1 files changed, 47 insertions, 21 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index c5cb21a64..85aab280f 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -23,11 +23,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* TODO: - * - * o Support multiple screens, shouldn't be hard just alot of rejigging. - */ - #ifdef HAVE_CONFIG_H #include <kdrive-config.h> #endif @@ -35,11 +30,21 @@ #include "inputstr.h" #include "scrnintstr.h" +#include "ephyrlog.h" + +#ifdef XEPHYR_DRI +#include "ephyrdri.h" +#include "ephyrdriext.h" +#include "ephyrglxext.h" +#include "ephyrproxyext.h" +#endif /*XEPHYR_DRI*/ extern int KdTsPhyScreen; KdKeyboardInfo *ephyrKbd; KdPointerInfo *ephyrMouse; EphyrKeySyms ephyrKeySyms; +Bool ephyrNoDRI=FALSE ; +Bool ephyrNoXV=FALSE ; static int mouseState = 0; @@ -49,6 +54,7 @@ typedef struct _EphyrInputPrivate { Bool EphyrWantGrayScale = 0; + Bool ephyrInitialize (KdCardInfo *card, EphyrPriv *priv) { @@ -209,7 +215,7 @@ ephyrMapFramebuffer (KdScreenInfo *screen) KdPointerMatrix m; int buffer_height; - EPHYR_DBG("screen->width: %d, screen->height: %d index=%d", + EPHYR_LOG("screen->width: %d, screen->height: %d index=%d", screen->width, screen->height, screen->mynum); KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height); @@ -245,7 +251,7 @@ ephyrMapFramebuffer (KdScreenInfo *screen) /* Rotated/Reflected so we need to use shadow fb */ scrpriv->shadow = TRUE; - EPHYR_DBG("allocing shadow"); + EPHYR_LOG("allocing shadow"); KdShadowFbAlloc (screen, 0, scrpriv->randr & (RR_Rotate_90|RR_Rotate_270)); @@ -296,7 +302,7 @@ ephyrShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf) KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; - EPHYR_DBG("slow paint"); + EPHYR_LOG("slow paint"); /* FIXME: Slow Rotated/Reflected updates could be much * much faster efficiently updating via tranforming @@ -410,7 +416,7 @@ ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) Rotation randr; int n = 0; - EPHYR_DBG("mark"); + EPHYR_LOG("mark"); struct { int width, height; } sizes[] = { @@ -563,7 +569,7 @@ ephyrRandRSetConfig (ScreenPtr pScreen, return TRUE; bail4: - EPHYR_DBG("bailed"); + EPHYR_LOG("bailed"); ephyrUnmapFramebuffer (screen); *scrpriv = oldscr; @@ -606,10 +612,29 @@ ephyrInitScreen (ScreenPtr pScreen) KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; - EPHYR_DBG ("pScreen->myNum:%d\n", pScreen->myNum) ; + EPHYR_LOG ("pScreen->myNum:%d\n", pScreen->myNum) ; hostx_set_screen_number (screen, pScreen->myNum); hostx_set_win_title (screen, "(ctrl+shift grabs mouse and keyboard)") ; pScreen->CreateColormap = ephyrCreateColormap; + +#ifdef XV + if (!ephyrNoXV) { + if (!ephyrInitVideo (pScreen)) { + EPHYR_LOG_ERROR ("failed to initialize xvideo\n") ; + } else { + EPHYR_LOG ("initialized xvideo okay\n") ; + } + } +#endif /*XV*/ + +#ifdef XEPHYR_DRI + if (!ephyrNoDRI) { + ephyrDRIExtensionInit (pScreen) ; + ephyrHijackGLXExtension () ; + ephyrProxyExtensionInit ("ATIFGLRXDRI") ; + } +#endif + return TRUE; } @@ -621,12 +646,12 @@ ephyrFinishInitScreen (ScreenPtr pScreen) */ if (!shadowSetup (pScreen)) return FALSE; - + #ifdef RANDR if (!ephyrRandRInit (pScreen)) return FALSE; #endif - + return TRUE; } @@ -637,7 +662,7 @@ ephyrCreateResources (ScreenPtr pScreen) KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; - EPHYR_DBG("mark pScreen=%p mynum=%d shadow=%d", + EPHYR_LOG("mark pScreen=%p mynum=%d shadow=%d", pScreen, pScreen->myNum, scrpriv->shadow); if (scrpriv->shadow) @@ -809,20 +834,20 @@ ephyrPoll(void) case EPHYR_EV_MOUSE_MOTION: if (!ephyrMouse || !((EphyrPointerPrivate *)ephyrMouse->driverPrivate)->enabled) { - EPHYR_DBG ("skipping mouse motion:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("skipping mouse motion:%d\n", ephyrCurScreen) ; continue; } { if (ephyrCurScreen != ev.data.mouse_motion.screen) { - EPHYR_DBG ("warping mouse cursor:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("warping mouse cursor:%d\n", ephyrCurScreen) ; ephyrWarpCursor(screenInfo.screens[ev.data.mouse_motion.screen], ev.data.mouse_motion.x, ev.data.mouse_motion.y ); } else { - EPHYR_DBG ("enqueuing mouse motion:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("enqueuing mouse motion:%d\n", ephyrCurScreen) ; KdEnqueuePointerEvent(ephyrMouse, mouseState, ev.data.mouse_motion.x, ev.data.mouse_motion.y, @@ -834,10 +859,10 @@ ephyrPoll(void) case EPHYR_EV_MOUSE_PRESS: if (!ephyrMouse || !((EphyrPointerPrivate *)ephyrMouse->driverPrivate)->enabled) { - EPHYR_DBG ("skipping mouse press:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("skipping mouse press:%d\n", ephyrCurScreen) ; continue; } - EPHYR_DBG ("enqueuing mouse press:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("enqueuing mouse press:%d\n", ephyrCurScreen) ; ephyrUpdateModifierState(ev.key_state); mouseState |= ev.data.mouse_down.button_num; KdEnqueuePointerEvent(ephyrMouse, mouseState|KD_MOUSE_DELTA, 0, 0, 0); @@ -849,7 +874,7 @@ ephyrPoll(void) continue; ephyrUpdateModifierState(ev.key_state); mouseState &= ~ev.data.mouse_up.button_num; - EPHYR_DBG ("enqueuing mouse release:%d\n", ephyrCurScreen) ; + EPHYR_LOG ("enqueuing mouse release:%d\n", ephyrCurScreen) ; KdEnqueuePointerEvent(ephyrMouse, mouseState|KD_MOUSE_DELTA, 0, 0, 0); break; @@ -886,7 +911,7 @@ ephyrGetColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs) { /* XXX Not sure if this is right */ - EPHYR_DBG("mark"); + EPHYR_LOG("mark"); while (n--) { @@ -1025,6 +1050,7 @@ EphyrKeyboardBell (KdKeyboardInfo *ki, int volume, int frequency, int duration) { } + KdKeyboardDriver EphyrKeyboardDriver = { "ephyr", EphyrKeyboardInit, |