aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/ephyr
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr')
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyr.c7
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrinit.c6
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrvideo.c24
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.c43
-rw-r--r--xorg-server/hw/kdrive/ephyr/hostx.h3
5 files changed, 40 insertions, 43 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyr.c b/xorg-server/hw/kdrive/ephyr/ephyr.c
index e6520d035..02d497073 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyr.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyr.c
@@ -56,6 +56,7 @@ typedef struct _EphyrInputPrivate {
} EphyrKbdPrivate, EphyrPointerPrivate;
Bool EphyrWantGrayScale = 0;
+Bool EphyrWantResize = 0;
Bool
ephyrInitialize(KdCardInfo * card, EphyrPriv * priv)
@@ -237,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;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
index 5e2eb672f..adacac949 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c
@@ -31,6 +31,7 @@
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
+extern Bool EphyrWantResize;
extern Bool kdHasPointer;
extern Bool kdHasKbd;
@@ -116,6 +117,7 @@ ddxUseMsg(void)
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
+ ErrorF("-resizeable Make Xephyr windows resizeable\n");
ErrorF
("-fakexa Simulate acceleration using software rendering\n");
ErrorF("-verbosity <level> Set log verbosity level\n");
@@ -210,6 +212,10 @@ ddxProcessArgument(int argc, char **argv, int i)
EphyrWantGrayScale = 1;
return 1;
}
+ else if (!strcmp(argv[i], "-resizeable")) {
+ EphyrWantResize = 1;
+ return 1;
+ }
else if (!strcmp(argv[i], "-fakexa")) {
ephyrFuncs.initAccel = ephyrDrawInit;
ephyrFuncs.enableAccel = ephyrDrawEnable;
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
index 55dbd2e3a..dfc29f533 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrvideo.c
@@ -1006,7 +1006,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1024,11 +1023,6 @@ ephyrPutVideo(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVPutVideo(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1055,7 +1049,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1073,11 +1066,6 @@ ephyrGetVideo(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVGetVideo(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1104,7 +1092,6 @@ ephyrPutStill(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1122,11 +1109,6 @@ ephyrPutStill(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVPutStill(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
@@ -1153,7 +1135,6 @@ ephyrGetStill(KdScreenInfo * a_info,
EphyrPortPriv *port_priv = a_port_priv;
BoxRec clipped_area, dst_box;
int result = BadImplementation;
- int drw_x = 0, drw_y = 0, drw_w = 0, drw_h = 0;
EPHYR_RETURN_VAL_IF_FAIL(a_info && a_info->pScreen, BadValue);
EPHYR_RETURN_VAL_IF_FAIL(a_drawable && port_priv, BadValue);
@@ -1171,11 +1152,6 @@ ephyrGetStill(KdScreenInfo * a_info,
goto out;
}
- drw_x = clipped_area.x1;
- drw_y = clipped_area.y1;
- drw_w = clipped_area.x2 - clipped_area.x1;
- drw_h = clipped_area.y2 - clipped_area.y1;
-
if (!ephyrHostXVGetStill(a_info->pScreen->myNum,
port_priv->port_number,
a_vid_x, a_vid_y, a_vid_w, a_vid_h,
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c
index 157ac36b2..f2b458d90 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.c
+++ b/xorg-server/hw/kdrive/ephyr/hostx.c
@@ -117,6 +117,8 @@ extern EphyrKeySyms ephyrKeySyms;
extern int monitorResolution;
+extern Bool EphyrWantResize;
+
char *ephyrResName = NULL;
int ephyrResNameFromCmd = 0;
char *ephyrTitle = NULL;
@@ -617,7 +619,8 @@ hostx_set_cmap_entry(unsigned char idx,
*/
void *
hostx_screen_init(EphyrScreenInfo screen,
- int width, int height, int buffer_height)
+ int width, int height, int buffer_height,
+ int *bytes_per_line, int *bits_per_pixel)
{
int bitmap_pad;
Bool shm_success = False;
@@ -694,10 +697,13 @@ hostx_screen_init(EphyrScreenInfo screen,
malloc(host_screen->ximg->bytes_per_line * buffer_height);
}
+ *bytes_per_line = host_screen->ximg->bytes_per_line;
+ *bits_per_pixel = host_screen->ximg->bits_per_pixel;
+
XResizeWindow(HostX.dpy, host_screen->win, width, height);
/* Ask the WM to keep our size static */
- if (host_screen->win_pre_existing == None) {
+ if (host_screen->win_pre_existing == None && !EphyrWantResize) {
size_hints = XAllocSizeHints();
size_hints->max_width = size_hints->min_width = width;
size_hints->max_height = size_hints->min_height = height;
@@ -858,7 +864,7 @@ hostx_load_keymap(void)
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
- return;
+ goto out;
for (i = 0; i < (max_keycode - min_keycode + 1); i++)
for (j = 0; j < width; j++)
@@ -871,6 +877,7 @@ hostx_load_keymap(void)
ephyrKeySyms.maxKeyCode = max_keycode;
ephyrKeySyms.mapWidth = width;
+ out:
XFree(keymap);
}
@@ -1011,19 +1018,27 @@ hostx_get_event(EphyrHostXEvent * ev)
case ConfigureNotify:
{
- struct EphyrHostScreen *host_screen =
- host_screen_from_window(xev.xconfigure.window);
-
- if (host_screen && host_screen->win_pre_existing != None) {
- ev->type = EPHYR_EV_CONFIGURE;
- ev->data.configure.width = xev.xconfigure.width;
- ev->data.configure.height = xev.xconfigure.height;
- ev->data.configure.window = xev.xconfigure.window;
- ev->data.configure.screen = host_screen->mynum;
- return 1;
+ struct EphyrHostScreen *host_screen;
+
+ /* event compression as for Expose events, cause
+ * we don't want to resize the framebuffer for
+ * every single change */
+ while (XCheckTypedWindowEvent(HostX.dpy, xev.xconfigure.window,
+ ConfigureNotify, &xev));
+ host_screen = host_screen_from_window(xev.xconfigure.window);
+
+ if (!host_screen ||
+ (host_screen->win_pre_existing == None && !EphyrWantResize)) {
+ return 0;
}
- return 0;
+ ev->type = EPHYR_EV_CONFIGURE;
+ ev->data.configure.width = xev.xconfigure.width;
+ ev->data.configure.height = xev.xconfigure.height;
+ ev->data.configure.window = xev.xconfigure.window;
+ ev->data.configure.screen = host_screen->mynum;
+
+ return 1;
}
default:
break;
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h
index 31c4053aa..38b7b3768 100644
--- a/xorg-server/hw/kdrive/ephyr/hostx.h
+++ b/xorg-server/hw/kdrive/ephyr/hostx.h
@@ -193,7 +193,8 @@ hostx_set_cmap_entry(unsigned char idx,
unsigned char r, unsigned char g, unsigned char b);
void *hostx_screen_init(EphyrScreenInfo screen,
- int width, int height, int buffer_height);
+ int width, int height, int buffer_height,
+ int *bytes_per_line, int *bits_per_pixel);
void