Rebased ref, commits from common ancestor: commit b22b21f13f379e3de7d82ea45a4a69d085dc8ede Author: Kristian Høgsberg <k...@bitplanet.net> Date: Fri Jun 7 01:52:08 2013 -0400
configure.ac: Bump version to 1.1.1 diff --git a/configure.ac b/configure.ac index ed6d2ee..06d0b4a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ m4_define([weston_major_version], [1]) m4_define([weston_minor_version], [1]) -m4_define([weston_micro_version], [0]) +m4_define([weston_micro_version], [1]) m4_define([weston_version], [weston_major_version.weston_minor_version.weston_micro_version]) commit 747d4ee17e573766a0b46b60db9b2477b9286d27 Author: Sinclair Yeh <sinclair....@intel.com> Date: Thu Jun 6 16:41:30 2013 -0700 Avoid unnecessarily re-allocating texture buffer when the size hasn't changed. v4: Incorporated krh and anderco's comments. Now adding newly allocated buffer's dimensions to texture_damage v3: * Removed unnecessary parentheses * Added check for switching from EGL image to SHM buffer * Moved shader assignment out of IF condition v2: Fixed the wrong comparison v1: Depending on specific DRI driver implementation, glTexImage2D() with data set to NULL may or may not re-allocate the texture buffer each time it is called. Unintended consequences happen if later glTexSubImage2D() is called to only update a sub-region of the texture buffer. I've explored moving glTexImage2D() from gl_renderer_attach() and simply mark the texture dirty, but the current implemention seems cleaner because I won't have to worry about calling ensure_textures() and re-assigning gs->shader unnecessarily. diff --git a/src/gl-renderer.c b/src/gl-renderer.c index ea6631f..f6c7194 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -66,6 +66,7 @@ struct gl_surface_state { int num_images; struct weston_buffer_reference buffer_ref; + int height; int pitch; /* in pixels */ }; @@ -1192,14 +1193,28 @@ gl_renderer_attach(struct weston_surface *es, struct wl_buffer *buffer) } if (wl_buffer_is_shm(buffer)) { - gs->pitch = wl_shm_buffer_get_stride(buffer) / 4; - gs->target = GL_TEXTURE_2D; + /* Only allocate a texture if it doesn't match existing one. + * If gs->num_images is not 0, then a switch from DRM allocated + * buffer to a SHM buffer is happening, and we need to allocate + * a new texture buffer. */ + if (wl_shm_buffer_get_stride(buffer) / 4 != gs->pitch || + wl_shm_buffer_get_height(buffer) != gs->height || + gs->num_images > 0) { + gs->pitch = wl_shm_buffer_get_stride(buffer) / 4; + gs->height = wl_shm_buffer_get_height(buffer); + gs->target = GL_TEXTURE_2D; + + ensure_textures(gs, 1); + glBindTexture(GL_TEXTURE_2D, gs->textures[0]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, + gs->pitch, buffer->height, 0, + GL_BGRA_EXT, GL_UNSIGNED_BYTE, NULL); + pixman_region32_union_rect(&gs->texture_damage, + &gs->texture_damage, + 0, 0, + gs->pitch, gs->height); + } - ensure_textures(gs, 1); - glBindTexture(GL_TEXTURE_2D, gs->textures[0]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, - gs->pitch, buffer->height, 0, - GL_BGRA_EXT, GL_UNSIGNED_BYTE, NULL); if (wl_shm_buffer_get_format(buffer) == WL_SHM_FORMAT_XRGB8888) gs->shader = &gr->texture_shader_rgbx; else @@ -1258,6 +1273,7 @@ gl_renderer_attach(struct weston_surface *es, struct wl_buffer *buffer) } gs->pitch = buffer->width; + gs->height = wl_shm_buffer_get_height(buffer); } else { weston_log("unhandled buffer type!\n"); weston_buffer_reference(&gs->buffer_ref, NULL); commit 7583aff275ccbe0c4d6bb37ec9343773d119e18a Author: Ander Conselvan de Oliveira <ander.conselvan.de.olive...@intel.com> Date: Tue Jun 4 16:24:05 2013 +0300 compositor-drm: Force DPMS state to ON after drmModeSetCrtc() The kernel is supposed to set this when drmModeSetCrtc() is called but at least the i915 driver wouldn't do that in all cases. A fix for this should be released with kernel 3.10, but we work around the issue in older kernels by always forcing DPMS to ON when doing a mode set. https://bugs.freedesktop.org/show_bug.cgi?id=64873 diff --git a/src/compositor-drm.c b/src/compositor-drm.c index bc68a6b..b3cf9a9 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -568,6 +568,7 @@ drm_output_repaint(struct weston_output *output_base, weston_log("set mode failed: %m\n"); return; } + output_base->set_dpms(output_base, WESTON_DPMS_ON); } if (drmModePageFlip(compositor->drm.fd, output->crtc_id, commit ba4e929fc3cf4a726c41c756347e3f7ec95f2e31 Author: Ander Conselvan de Oliveira <ander.conselvan.de.olive...@intel.com> Date: Tue Jun 4 16:24:04 2013 +0300 compositor-drm: Cache the DPMS property on drm_output This avoids one drmModeGetConnector() call every time the DPMS mode is set. That call can take hundreds of milliseconds due to DDC. diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 8cb9649..bc68a6b 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -146,6 +146,7 @@ struct drm_output { int pipe; uint32_t connector_id; drmModeCrtcPtr original_crtc; + drmModePropertyPtr dpms_prop; int vblank_pending; int page_flip_pending; @@ -1029,6 +1030,8 @@ drm_output_destroy(struct weston_output *output_base) if (output->backlight) backlight_destroy(output->backlight); + drmModeFreeProperty(output->dpms_prop); + /* Turn off hardware cursor */ drmModeSetCursor(c->drm.fd, output->crtc_id, 0, 0, 0); @@ -1341,23 +1344,12 @@ drm_set_dpms(struct weston_output *output_base, enum dpms_enum level) struct drm_output *output = (struct drm_output *) output_base; struct weston_compositor *ec = output_base->compositor; struct drm_compositor *c = (struct drm_compositor *) ec; - drmModeConnectorPtr connector; - drmModePropertyPtr prop; - connector = drmModeGetConnector(c->drm.fd, output->connector_id); - if (!connector) + if (!output->dpms_prop) return; - prop = drm_get_prop(c->drm.fd, connector, "DPMS"); - if (!prop) { - drmModeFreeConnector(connector); - return; - } - - drmModeConnectorSetProperty(c->drm.fd, connector->connector_id, - prop->prop_id, level); - drmModeFreeProperty(prop); - drmModeFreeConnector(connector); + drmModeConnectorSetProperty(c->drm.fd, output->connector_id, + output->dpms_prop->prop_id, level); } static const char *connector_type_names[] = { @@ -1554,6 +1546,7 @@ create_output_for_connector(struct drm_compositor *ec, ec->connector_allocator |= (1 << output->connector_id); output->original_crtc = drmModeGetCrtc(ec->drm.fd, output->crtc_id); + output->dpms_prop = drm_get_prop(ec->drm.fd, connector, "DPMS"); /* Get the current mode on the crtc that's currently driving * this connector. */ commit 6737d1c0524bcb1ad1cb5d838b745ead5abb7bbf Author: Rob Bradford <r...@linux.intel.com> Date: Tue Jun 4 13:23:01 2013 +0100 build: Add declaration checks to check for required syscall flags The required flags are relatively new and some older enterprise distributions do not feature them. https://bugs.freedesktop.org/show_bug.cgi?id=63360 diff --git a/configure.ac b/configure.ac index d5fea9d..ed6d2ee 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,15 @@ AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) AC_SUBST(DLOPEN_LIBS) +AC_CHECK_DECL(SFD_CLOEXEC,[], + [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")], + [[#include <sys/signalfd.h>]]) +AC_CHECK_DECL(TFD_CLOEXEC,[], + [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")], + [[#include <sys/timerfd.h>]]) +AC_CHECK_DECL(CLOCK_MONOTONIC,[], + [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")], + [[#include <time.h>]]) AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_FUNCS([mkostemp strchrnul]) commit 98be20f0deedcc9173ebb2d709a9676680e030a8 Author: Eduardo Lima (Etrunko) <eduardo.l...@intel.com> Date: Mon Jun 3 12:24:09 2013 -0300 weston.pc: Added libexecdir and pkglibexecdir variables These can be used by external clients to check the installation path Signed-off-by: Eduardo Lima (Etrunko) <eduardo.l...@intel.com> diff --git a/src/weston.pc.in b/src/weston.pc.in index 537cc89..828cb1f 100644 --- a/src/weston.pc.in +++ b/src/weston.pc.in @@ -2,6 +2,8 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +libexecdir=@libexecdir@ +pkglibexecdir=${libexecdir}/@PACKAGE@ Name: Weston Plugin API Description: Header files for Weston plugin development commit 3331ee8d8e2c7f436c281f201226a50d5de96f42 Author: Rob Bradford <r...@linux.intel.com> Date: Mon Jun 3 18:46:13 2013 +0100 udev-seat: Fail input setup only if no devices are found Rather than failing if we cannot open any single device fail the input setup if there are no input devices added. https://bugs.freedesktop.org/show_bug.cgi?id=64506 diff --git a/src/udev-seat.c b/src/udev-seat.c index bdd3ef5..6992f8a 100644 --- a/src/udev-seat.c +++ b/src/udev-seat.c @@ -58,7 +58,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master) fd = weston_launcher_open(c, devnode, O_RDWR | O_NONBLOCK); if (fd < 0) { weston_log("opening input device '%s' failed.\n", devnode); - return -1; + return 0; } device = evdev_device_create(&master->base, devnode, fd); @@ -69,7 +69,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master) } else if (device == NULL) { close(fd); weston_log("failed to create input device '%s'.\n", devnode); - return -1; + return 0; } calibration_values = @@ -140,6 +140,7 @@ udev_seat_add_devices(struct udev_seat *seat, struct udev *udev) "\t- seats misconfigured " "(Weston backend option 'seat', " "udev device property ID_SEAT)\n"); + return -1; } return 0; commit 47ba3a0f117c3f32da674f630969736078b36ac1 Author: U. Artie Eoff <ullysses.a.e...@intel.com> Date: Mon Jun 3 16:22:31 2013 -0700 use _exit instead of exit if client fails to exec exit() calls atexit() handlers and C++ destructors (e.g. a C++ weston module) which could destroy state that the main process depends on (e.g. ioctl's, tmpfiles, sockets, etc...). If an exec fails, call _exit() instead of exit(). v2: prefer _exit over _Exit Signed-off-by: U. Artie Eoff <ullysses.a.e...@intel.com> diff --git a/src/compositor.c b/src/compositor.c index 693df2c..447a1c5 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -217,7 +217,7 @@ weston_client_launch(struct weston_compositor *compositor, if (pid == 0) { child_client_exec(sv[1], path); - exit(-1); + _exit(-1); } close(sv[1]); commit 8d7562e47b4e3710bae9378c0900df319850b916 Author: Alexander Larsson <al...@redhat.com> Date: Tue May 28 16:23:35 2013 +0200 compositor-x11: Set original mode after current Otherwise we're pointing the original mode on some uninitialized value. diff --git a/src/compositor-x11.c b/src/compositor-x11.c index eb6e58b..e893136 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -779,7 +779,6 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y, if (fullscreen) x11_output_wait_for_map(c, output); - output->base.origin = output->base.current; output->base.start_repaint_loop = x11_output_start_repaint_loop; if (c->use_pixman) output->base.repaint = x11_output_repaint_shm; @@ -791,6 +790,7 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y, output->base.set_dpms = NULL; output->base.switch_mode = NULL; output->base.current = &output->mode; + output->base.origin = output->base.current; output->base.make = "xwayland"; output->base.model = "none"; weston_output_init(&output->base, &c->base, commit 0d78b9aa87544f99c9e9a24455e7cd27436b787d Author: Kristian Høgsberg <k...@bitplanet.net> Date: Thu May 23 20:30:26 2013 -0400 compositor: Make backlight_current int32_t to avoid unsigned overflow Backlight brightness was wrapping around when decrementing from 0. diff --git a/src/compositor.h b/src/compositor.h index 1e999a6..2ab1e69 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -194,7 +194,7 @@ struct weston_output { int (*switch_mode)(struct weston_output *output, struct weston_mode *mode); /* backlight values are on 0-255 range, where higher is brighter */ - uint32_t backlight_current; + int32_t backlight_current; void (*set_backlight)(struct weston_output *output, uint32_t value); void (*set_dpms)(struct weston_output *output, enum dpms_enum level); }; commit 275481d59df2ab43218e29acfb7ddf3145c1c4a0 Author: Kristian Høgsberg <k...@bitplanet.net> Date: Thu May 23 20:29:40 2013 -0400 compositor-drm: Log failure and which backlight sysfs file we're using diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 8f263a1..8cb9649 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1657,8 +1657,12 @@ create_output_for_connector(struct drm_compositor *ec, output->backlight = backlight_init(drm_device, connector->connector_type); if (output->backlight) { + weston_log("Initialized backlight, device %s\n", + output->backlight->path); output->base.set_backlight = drm_set_backlight; output->base.backlight_current = drm_get_backlight(output); + } else { + weston_log("Failed to initialize backlight\n"); } wl_list_insert(ec->base.output_list.prev, &output->base.link); commit 698edf44ac9edbc0aca46f84e16676e9877a0980 Author: Rob Bradford <r...@linux.intel.com> Date: Mon May 20 16:55:10 2013 +0100 weston-launch: Print explanation of why we failed to open the device diff --git a/src/weston-launch.c b/src/weston-launch.c index 64d4a8a..d034c58 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -318,12 +318,17 @@ handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len) goto err0; fd = open(message->path, message->flags); - if (fd < 0) + if (fd < 0) { + fprintf(stderr, "Error opening device %s: %m\n", + message->path); goto err0; + } if (major(s.st_rdev) != INPUT_MAJOR) { close(fd); fd = -1; + fprintf(stderr, "Device %s is not an input device\n", + message->path); goto err0; } commit 186775c4da1c6bec83827a638f7128cd69d3883a Author: Dima Ryazanov <d...@gmail.com> Date: Mon May 13 23:51:11 2013 -0700 Fix missing corner resize cursors in Kubuntu (oxy-white theme) Looks like that theme uses different names. Also, add the correspoding horizontal and vertical resize cursors, just for consistency. diff --git a/clients/window.c b/clients/window.c index 2540cc9..33787fd 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1001,17 +1001,20 @@ shm_surface_create(struct display *display, struct wl_surface *wl_surface, static const char *bottom_left_corners[] = { "bottom_left_corner", - "sw-resize" + "sw-resize", + "size_bdiag" }; static const char *bottom_right_corners[] = { "bottom_right_corner", - "se-resize" + "se-resize", + "size_fdiag" }; static const char *bottom_sides[] = { "bottom_side", - "s-resize" + "s-resize", + "size_ver" }; static const char *grabbings[] = { @@ -1029,27 +1032,32 @@ static const char *left_ptrs[] = { static const char *left_sides[] = { "left_side", - "w-resize" + "w-resize", + "size_hor" }; static const char *right_sides[] = { "right_side", - "e-resize" + "e-resize", + "size_hor" }; static const char *top_left_corners[] = { "top_left_corner", - "nw-resize" + "nw-resize", + "size_fdiag" }; static const char *top_right_corners[] = { "top_right_corner", - "ne-resize" + "ne-resize", + "size_bdiag" }; static const char *top_sides[] = { "top_side", - "n-resize" + "n-resize", + "size_ver" }; static const char *xterms[] = { commit 9caf77bd921be3c7132f1cc958c93d704db10e9d Author: Eduardo Lima (Etrunko) <eduardo.l...@intel.com> Date: Tue May 14 13:09:31 2013 -0300 text: Respawn input method process if it exits Just the same as it is done in shell.c, if the input method process exits for any reason, we relaunch it automatically, as it is not possible to launch a standalone application outside of the weston process. In v2: - Proper error message when giving up. Signed-off-by: Eduardo Lima (Etrunko) <eduardo.l...@intel.com> Conflicts: src/text-backend.c diff --git a/src/text-backend.c b/src/text-backend.c index a92aebe..e5badc1 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -23,6 +23,8 @@ #include <stdlib.h> #include <string.h> +#include <unistd.h> +#include <time.h> #include "compositor.h" #include "text-server-protocol.h" @@ -89,6 +91,9 @@ struct text_backend { struct wl_resource *binding; struct weston_process process; struct wl_client *client; + + unsigned deathcount; + uint32_t deathstamp; } input_method; struct wl_listener seat_created_listener; @@ -761,14 +766,33 @@ input_method_init_seat(struct weston_seat *seat) seat->input_method->focus_listener_initialized = 1; } +static void launch_input_method(struct text_backend *text_backend); + static void handle_input_method_sigchld(struct weston_process *process, int status) { + uint32_t time; struct text_backend *text_backend = container_of(process, struct text_backend, input_method.process); text_backend->input_method.process.pid = 0; text_backend->input_method.client = NULL; + + /* if input_method dies more than 5 times in 10 seconds, give up */ + time = weston_compositor_get_time(); + if (time - text_backend->input_method.deathstamp > 10000) { + text_backend->input_method.deathstamp = time; + text_backend->input_method.deathcount = 0; + } + + text_backend->input_method.deathcount++; + if (text_backend->input_method.deathcount > 5) { + weston_log("input_method died, giving up.\n"); + return; + } + + weston_log("input_method died, respawning...\n"); + launch_input_method(text_backend); } static void commit 504a780b15b3d723ae9b55f4012d2b404e793a65 Author: Ander Conselvan de Oliveira <ander.conselvan.de.olive...@intel.com> Date: Tue May 7 14:16:59 2013 +0300 compositor-drm: Don't page flip before a mode is set The function drm_output_start_repaint_loop() unconditionally issues a page flip, even if the crtc for that output has not been enabled yet. That causes the page flip to fail, and drm_output_repaint() is never called. Solve this by bypassing the initial page flip if the output needs a mode set. This has the caveat of affecting latency predictability for that first frame and when a "driver" mode fullscreen surface causes a mode set. However, on both cases the mode set would take an unpredictable amount of time anyway. https://bugs.freedesktop.org/show_bug.cgi?id=63812 https://bugs.freedesktop.org/show_bug.cgi?id=64183 diff --git a/src/Makefile.am b/src/Makefile.am index d33ebc5..e391ecd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -127,7 +127,7 @@ if ENABLE_DRM_COMPOSITOR drm_backend = drm-backend.la drm_backend_la_LDFLAGS = -module -avoid-version drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS) \ - ../shared/libshared.la + ../shared/libshared.la -lrt drm_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(DRM_COMPOSITOR_CFLAGS) \ diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 1b9dcd0..8f263a1 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -31,6 +31,7 @@ #include <linux/input.h> #include <assert.h> #include <sys/mman.h> +#include <time.h> #include <xf86drm.h> #include <xf86drmMode.h> @@ -46,6 +47,10 @@ #include "udev-seat.h" #include "launcher-util.h" +#ifndef DRM_CAP_TIMESTAMP_MONOTONIC +#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 +#endif + static int option_current_mode = 0; static char *output_name; static char *output_mode; @@ -108,6 +113,8 @@ struct drm_compositor { int use_pixman; uint32_t prev_state; + + clockid_t clock; }; struct drm_mode { @@ -629,10 +636,19 @@ drm_output_start_repaint_loop(struct weston_output *output_base) output_base->compositor; uint32_t fb_id; - if (output->current) - fb_id = output->current->fb_id; - else - fb_id = output->original_crtc->buffer_id; + struct timespec ts; + + if (!output->current) { + /* We can't page flip if there's no mode set */ + uint32_t msec; + + clock_gettime(compositor->clock, &ts); + msec = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; + weston_output_finish_frame(output_base, msec); + return; + } + + fb_id = output->current->fb_id; if (drmModePageFlip(compositor->drm.fd, output->crtc_id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { @@ -1151,7 +1167,8 @@ static int init_drm(struct drm_compositor *ec, struct udev_device *device) { const char *filename, *sysnum; - int fd; + uint64_t cap; + int fd, ret; sysnum = udev_device_get_sysnum(device); if (sysnum) @@ -1174,6 +1191,11 @@ init_drm(struct drm_compositor *ec, struct udev_device *device) ec->drm.fd = fd; + ret = drmGetCap(fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap); + if (ret == 0 && cap == 1) + ec->clock = CLOCK_MONOTONIC; + else + ec->clock = CLOCK_REALTIME; return 0; } commit 5b65927f4f82504a424094dcae0bcaa1bccd7561 Author: Kristian Høgsberg <k...@bitplanet.net> Date: Fri May 10 12:36:04 2013 -0400 compositor-drm: Destroy sprites before destroying the outputs diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 890eba7..1b9dcd0 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1968,12 +1968,12 @@ drm_destroy(struct weston_compositor *ec) wl_event_source_remove(d->udev_drm_source); wl_event_source_remove(d->drm_source); + destroy_sprites(d); + weston_compositor_shutdown(ec); ec->renderer->destroy(ec); - destroy_sprites(d); - if (d->gbm) gbm_device_destroy(d->gbm); commit 310cee07ecdfa5ec8c3bd89a77becaea00f3b84c Author: Kristian Høgsberg <k...@bitplanet.net> Date: Thu May 2 13:43:24 2013 -0400 xwm: Reparent client windows into ARGB windows We used to rely on an ugly hack where the xwayland server would always report RGB X windows as having ARGB pixels, so that texturing from these would also sample the undefined alpha. We also relied on Xrender rendering to RGB X windows to write the alpha channel correctly, so that when we texture from the RGB X window as an ARGB surface we end up getting the alpha written by Xrender. That was obviously all broken. We can instead reparent client windows into ARGB frame windows. That way we can render the decorations using a ARGB render pictformat and sample back those alpha values in a well-defined way. We can also unbreak xwayland and let it report RGB pixel format for RGB windows. We still need the opaque region or the RGB-only client window but that's OK. diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index 8f0a377..ccce277 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -648,7 +648,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) xcb_map_request_event_t *map_request = (xcb_map_request_event_t *) event; struct weston_wm_window *window; - uint32_t values[1]; + uint32_t values[3]; int x, y, width, height; if (our_resource(wm, map_request->window)) { @@ -667,7 +667,8 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) weston_wm_window_get_frame_size(window, &width, &height); weston_wm_window_get_child_position(window, &x, &y); - values[0] = + values[0] = wm->screen->black_pixel; + values[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_BUTTON_PRESS | @@ -677,18 +678,22 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT; + values[2] = wm->colormap; window->frame_id = xcb_generate_id(wm->conn); xcb_create_window(wm->conn, - XCB_COPY_FROM_PARENT, + 32, window->frame_id, wm->screen->root, 0, 0, width, height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, - wm->screen->root_visual, - XCB_CW_EVENT_MASK, values); + wm->visual_id, + XCB_CW_BORDER_PIXEL | + XCB_CW_EVENT_MASK | + XCB_CW_COLORMAP, values); + xcb_reparent_window(wm->conn, window->id, window->frame_id, x, y); values[0] = 0; @@ -708,7 +713,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) cairo_xcb_surface_create_with_xrender_format(wm->conn, wm->screen, window->frame_id, - &wm->format_rgb, + &wm->format_rgba, width, height); hash_table_insert(wm->window_hash, window->frame_id, window); @@ -1387,6 +1392,36 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data) } static void +weston_wm_get_visual_and_colormap(struct weston_wm *wm) +{ + xcb_depth_iterator_t d_iter; + xcb_visualtype_iterator_t vt_iter; + xcb_visualtype_t *visualtype; + + d_iter = xcb_screen_allowed_depths_iterator(wm->screen); + visualtype = NULL; + while (d_iter.rem > 0) { + if (d_iter.data->depth == 32) { + vt_iter = xcb_depth_visuals_iterator(d_iter.data); + visualtype = vt_iter.data; + break; + } + + xcb_depth_next(&d_iter); + } + + if (visualtype == NULL) { + weston_log("no 32 bit visualtype\n"); + return; + } + + wm->visual_id = visualtype->visual_id; + wm->colormap = xcb_generate_id(wm->conn); + xcb_create_colormap(wm->conn, XCB_COLORMAP_ALLOC_NONE, + wm->colormap, wm->screen->root, wm->visual_id); +} + +static void weston_wm_get_resources(struct weston_wm *wm) { @@ -1610,6 +1645,7 @@ weston_wm_create(struct weston_xserver *wxs) wl_event_source_check(wm->source); weston_wm_get_resources(wm); + weston_wm_get_visual_and_colormap(wm); values[0] = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h index 2230b97..9151cce 100644 --- a/src/xwayland/xwayland.h +++ b/src/xwayland/xwayland.h @@ -58,6 +58,8 @@ struct weston_wm { xcb_cursor_t *cursors; int last_cursor; xcb_render_pictforminfo_t format_rgb, format_rgba; + xcb_visualid_t visual_id; + xcb_colormap_t colormap; struct wl_listener activate_listener; struct wl_listener kill_listener; commit 225a0ee18abd9f3a67e0b81e1b1c103fe82a97a8 Author: Chris Michael <cp.mich...@samsung.com> Date: Wed May 1 21:26:02 2013 -0400 Fix not checking return value of drmIoctl function call to map dumb buffer in drm_fb_create_dumb, the return value of the drmIoctl function call to map the dumb buffer was never checked, thus the following "if (ret)" check was invalid as it was checking the previous return value from the above drmModeAddFB call. Signed-off-by: Chris Michael <cp.mich...@samsung.com> diff --git a/src/compositor-drm.c b/src/compositor-drm.c index da1ba79..890eba7 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -255,8 +255,7 @@ drm_fb_create_dumb(struct drm_compositor *ec, unsigned width, unsigned height) memset(&map_arg, 0, sizeof(map_arg)); map_arg.handle = fb->handle; - drmIoctl(fb->fd, DRM_IOCTL_MODE_MAP_DUMB, &map_arg); - + ret = drmIoctl(fb->fd, DRM_IOCTL_MODE_MAP_DUMB, &map_arg); if (ret) goto err_add_fb; commit 85480fa8f8e5d5e1a1a395d254a761c389f8dcbd Author: Emilio Pozuelo Monfort <poch...@gmail.com> Date: Mon Apr 22 11:00:07 2013 +0200 weston.ini: document background-type diff --git a/man/weston.ini.man b/man/weston.ini.man index 8dde82c..2287730 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -109,6 +109,10 @@ The entries that can appear in this section are: .BI "background-image=" file sets the path for the background image file (string). .TP 7 +.BI "background-type=" tile +determines how the background image is drawn (string). Can be scale or +tile (default). +.TP 7 .BI "background-color=" 0xAARRGGBB sets the color of the background (unsigned integer). The hexadecimal digit pairs are in order alpha, red, green, and blue. diff --git a/weston.ini b/weston.ini index c6cff76..cd34044 100644 --- a/weston.ini +++ b/weston.ini @@ -4,6 +4,7 @@ [shell] background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-color=0xff002244 +background-type=tile panel-color=0x90ff0000 locking=true animation=zoom commit 6ab135319526a478a5eae891923a8b14ffd42657 Author: Yeh, Sinclair <sinclair....@intel.com> Date: Fri Apr 19 17:49:12 2013 +0000 Fix simple-egl tear-down order to prevent a crash on exit time wl_egl_window_destory() destroys the window handle that dri2_destroy_surface() later uses when eglTerminate() is called. Reordering the tear down order prevents such case from occuring. diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 26ebe5c..f4468b7 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -146,11 +146,6 @@ init_egl(struct display *display, int opaque) static void fini_egl(struct display *display) { - /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() - * on eglReleaseThread(). */ - eglMakeCurrent(display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, - EGL_NO_CONTEXT); - eglTerminate(display->egl.dpy); eglReleaseThread(); } @@ -330,6 +325,12 @@ create_surface(struct window *window) static void destroy_surface(struct window *window) { + /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() + * on eglReleaseThread(). */ + eglMakeCurrent(window->display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, + EGL_NO_CONTEXT); + + eglDestroySurface(window->display->egl.dpy, window->egl_surface); wl_egl_window_destroy(window->native); wl_shell_surface_destroy(window->shell_surface); commit 2e437207435a1b8720b5c623ccfc773e171ccf68 Author: Kristian Høgsberg <k...@bitplanet.net> Date: Tue Apr 16 11:21:48 2013 -0400 window: Add a log handler for window.c clients This way we can see what kind of error we get if we get an error. diff --git a/clients/window.c b/clients/window.c index 073ce53..2540cc9 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4383,11 +4383,19 @@ handle_display_data(struct task *task, uint32_t events) } } +static void +log_handler(const char *format, va_list args) +{ + vfprintf(stderr, format, args); +} + struct display * display_create(int *argc, char *argv[]) { struct display *d; + wl_log_set_handler_client(log_handler); + d = malloc(sizeof *d); if (d == NULL) return NULL; commit c08bc364fc2334806f06f79d9dd3023c772940bb Author: Kristian Høgsberg <k...@bitplanet.net> Date: Mon Apr 15 21:51:35 2013 -0400 -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1urbdk-0007qf...@vasks.debian.org