aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr/ephyr.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
commit2553bdd7c359cd87525d367761c86932cec5adff (patch)
treeae71245933c98474a699d3e392de5820879b2018 /xorg-server/hw/kdrive/ephyr/ephyr.c
parente2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff)
parent4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff)
downloadvcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/ephyr.c')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index 7c825a3fd..d0f02a16d 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -32,11 +32,11 @@
#include "scrnintstr.h"
#include "ephyrlog.h"
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
#include "ephyrdri.h"
#include "ephyrdriext.h"
#include "ephyrglxext.h"
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
extern int KdTsPhyScreen;
#ifdef GLXEXT
@@ -94,7 +94,7 @@ Bool
ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
{
int width = 640, height = 480;
- unsigned long redMask, greenMask, blueMask;
+ CARD32 redMask, greenMask, blueMask;
if (hostx_want_screen_size(screen, &width, &height)
|| !screen->width || !screen->height)
@@ -153,11 +153,22 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
screen->fb[0].depth = 16;
screen->fb[0].bitsPerPixel = 16;
}
- else
+ else if (screen->fb[0].depth <= 24)
{
screen->fb[0].depth = 24;
screen->fb[0].bitsPerPixel = 32;
}
+ else if (screen->fb[0].depth <= 30)
+ {
+ screen->fb[0].depth = 30;
+ screen->fb[0].bitsPerPixel = 32;
+ }
+ else
+ {
+ ErrorF("\nXephyr: Unsupported screen depth %d\n",
+ screen->fb[0].depth);
+ return FALSE;
+ }
hostx_get_visual_masks (screen, &redMask, &greenMask, &blueMask);
@@ -177,12 +188,11 @@ ephyrScreenInit (KdScreenInfo *screen)
{
EphyrScrPriv *scrpriv;
- scrpriv = xalloc (sizeof (EphyrScrPriv));
+ scrpriv = xcalloc (1, sizeof (EphyrScrPriv));
if (!scrpriv)
return FALSE;
- memset (scrpriv, 0, sizeof (EphyrScrPriv));
screen->driver = scrpriv;
if (!ephyrScreenInitialize (screen, scrpriv))
@@ -518,8 +528,6 @@ ephyrRandRSetConfig (ScreenPtr pScreen,
scrpriv->randr = KdAddRotation (screen->randr, randr);
- KdOffscreenSwapOut (screen->pScreen);
-
ephyrUnmapFramebuffer (screen);
screen->width = newwidth;
@@ -634,7 +642,7 @@ ephyrInitScreen (ScreenPtr pScreen)
}
#endif /*XV*/
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
if (!ephyrNoDRI && !hostx_has_dri ()) {
EPHYR_LOG ("host x does not support DRI. Disabling DRI forwarding\n") ;
ephyrNoDRI = TRUE ;
@@ -837,11 +845,11 @@ ephyrCrossScreen (ScreenPtr pScreen, Bool entering)
int ephyrCurScreen; /*current event screen*/
static void
-ephyrWarpCursor (ScreenPtr pScreen, int x, int y)
+ephyrWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
ephyrBlockSigio ();
ephyrCurScreen = pScreen->myNum;
- miPointerWarpCursor (pScreen, x, y);
+ miPointerWarpCursor (inputInfo.pointer, pScreen, x, y);
ephyrUnblockSigio ();
}
@@ -849,10 +857,12 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs =
{
ephyrCursorOffScreen,
ephyrCrossScreen,
- ephyrWarpCursor
+ ephyrWarpCursor,
+ NULL,
+ NULL
};
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
/**
* find if the remote window denoted by a_remote
* is paired with an internal Window within the Xephyr server.
@@ -884,7 +894,7 @@ ephyrExposePairedWindow (int a_remote)
screen->WindowExposures (pair->local, &reg, NullRegion);
REGION_UNINIT (screen, &reg);
}
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
void
ephyrPoll(void)
@@ -911,7 +921,7 @@ ephyrPoll(void)
if (ev.data.mouse_motion.screen >= 0)
{
ephyrWarpCursor
- (screenInfo.screens[ev.data.mouse_motion.screen],
+ (inputInfo.pointer, screenInfo.screens[ev.data.mouse_motion.screen],
ev.data.mouse_motion.x,
ev.data.mouse_motion.y );
}
@@ -919,14 +929,14 @@ ephyrPoll(void)
else
{
int x=0, y=0;
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
EphyrWindowPair *pair = NULL;
#endif
EPHYR_LOG ("enqueuing mouse motion:%d\n", ephyrCurScreen) ;
x = ev.data.mouse_motion.x;
y = ev.data.mouse_motion.y;
EPHYR_LOG ("initial (x,y):(%d,%d)\n", x, y) ;
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
EPHYR_LOG ("is this window peered by a gl drawable ?\n") ;
if (findWindowPairFromRemote (ev.data.mouse_motion.window,
&pair))
@@ -983,7 +993,7 @@ ephyrPoll(void)
KdEnqueueKeyboardEvent (ephyrKbd, ev.data.key_up.scancode, TRUE);
break;
-#ifdef XEPHYR_DRI
+#ifdef XF86DRI
case EPHYR_EV_EXPOSE:
/*
* We only receive expose events when the expose event have
@@ -993,7 +1003,7 @@ ephyrPoll(void)
*/
ephyrExposePairedWindow (ev.data.expose.window);
break;
-#endif /*XEPHYR_DRI*/
+#endif /* XF86DRI */
default:
break;