[PATCH weston] compositor-drm: cast surface to EGLNativeWindowType

2015-08-17 Thread Dawid Gajownik
gl_renderer_output_create expects `window_for_legacy' variable to be of
type EGLNativeWindowType, not EGLNativeDisplayType. This variable is
used later in eglCreateWindowSurface().

Signed-off-by: Dawid Gajownik gajow...@gmail.com
---
 src/compositor-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 26f0012..c647fcd 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1828,7 +1828,7 @@ drm_output_init_egl(struct drm_output *output, struct 
drm_backend *b)
if (format[1])
n_formats = 2;
if (gl_renderer-output_create(output-base,
-  (EGLNativeDisplayType)output-surface,
+  (EGLNativeWindowType)output-surface,
   output-surface,
   gl_renderer-opaque_attribs,
   format,
-- 
2.4.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 2/2] scanner: wrap few long lines

2015-08-17 Thread Pekka Paalanen
On Thu, 23 Jul 2015 11:19:00 -0700
Bryce Harrington br...@osg.samsung.com wrote:

 On Thu, Jul 16, 2015 at 01:59:05PM +0200, Marek Chalupa wrote:
  Wrap few long lines to the length around 80 chars
  
  Signed-off-by: Marek Chalupa mchqwe...@gmail.com
 
 How hard core are we about maintaining the 80-column rule?  Frankly I
 think the original code with the logging message on one line is more
 readable.

Eh, case by case... my personal feeling is that breaking a string
literal into pieces is not worth it if it's just a little too long.
Breaking it might hinder grep-ability. If there is a natural point to
split, like a newline, then of course split.

Let's try to do the best for readability. *pq waves hands*

I think I'd still split the other arguments from a function call,
though, at the comma.


Thanks,
pq


pgpjpictrvwaj.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput] tablet: Do not create a tablet device for Wacom touchscreens

2015-08-17 Thread Jason Gerecke
Similar to the issue mentioned in the commit message of 2365f7d, libwacom
assigns both ID_INPUT_TABLET and ID_INPUT_TOUCHSCREEN to touchscreens like
the Cintiq 24HDT. This patch ensures that neither touchpads nor touchscreens
will accidentally be handled by the tablet code.

Signed-off-by: Jason Gerecke jason.gere...@wacom.com
---
 src/evdev.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index bbc3dce..a4bdb9a 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1495,8 +1495,10 @@ evdev_configure_device(struct evdev_device *device)
/* libwacom assigns touchpad _and_ tablet to the tablet touch bits,
   so make sure we don't initialize the tablet interface for the
   touch device */
-   if ((udev_tags  (EVDEV_UDEV_TAG_TABLET|EVDEV_UDEV_TAG_TOUCHPAD)) ==
-EVDEV_UDEV_TAG_TABLET) {
+   if ((udev_tags  (EVDEV_UDEV_TAG_TABLET |
+ EVDEV_UDEV_TAG_TOUCHPAD |
+ EVDEV_UDEV_TAG_TOUCHSCREEN)) ==
+   EVDEV_UDEV_TAG_TABLET) {
device-dispatch = evdev_tablet_create(device);
device-seat_caps |= EVDEV_DEVICE_TABLET;
log_info(libinput,
-- 
2.5.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput] tablet: Do not create a tablet device for Wacom touchscreens

2015-08-17 Thread Peter Hutterer
On Mon, Aug 17, 2015 at 05:29:14PM -0700, Jason Gerecke wrote:
 Similar to the issue mentioned in the commit message of 2365f7d, libwacom
 assigns both ID_INPUT_TABLET and ID_INPUT_TOUCHSCREEN to touchscreens like
 the Cintiq 24HDT. This patch ensures that neither touchpads nor touchscreens
 will accidentally be handled by the tablet code.

I'm confused, isnt this the same as 10ca39cf80698cedf92?

Cheers,
   Peter

 
 Signed-off-by: Jason Gerecke jason.gere...@wacom.com
 ---
  src/evdev.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/src/evdev.c b/src/evdev.c
 index bbc3dce..a4bdb9a 100644
 --- a/src/evdev.c
 +++ b/src/evdev.c
 @@ -1495,8 +1495,10 @@ evdev_configure_device(struct evdev_device *device)
   /* libwacom assigns touchpad _and_ tablet to the tablet touch bits,
  so make sure we don't initialize the tablet interface for the
  touch device */
 - if ((udev_tags  (EVDEV_UDEV_TAG_TABLET|EVDEV_UDEV_TAG_TOUCHPAD)) ==
 -  EVDEV_UDEV_TAG_TABLET) {
 + if ((udev_tags  (EVDEV_UDEV_TAG_TABLET |
 +   EVDEV_UDEV_TAG_TOUCHPAD |
 +   EVDEV_UDEV_TAG_TOUCHSCREEN)) ==
 + EVDEV_UDEV_TAG_TABLET) {
   device-dispatch = evdev_tablet_create(device);
   device-seat_caps |= EVDEV_DEVICE_TABLET;
   log_info(libinput,
 -- 
 2.5.0
 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 3/6] filter: use named initalizers for the accelerator interface

2015-08-17 Thread Peter Hutterer
Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/filter.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/filter.c b/src/filter.c
index 7054faf..d05b53a 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -672,10 +672,10 @@ trackpoint_accel_profile(struct motion_filter *filter,
 }
 
 struct motion_filter_interface accelerator_interface = {
-   accelerator_filter,
-   accelerator_restart,
-   accelerator_destroy,
-   accelerator_set_speed,
+   .filter = accelerator_filter,
+   .restart = accelerator_restart,
+   .destroy = accelerator_destroy,
+   .set_speed = accelerator_set_speed,
 };
 
 static struct pointer_accelerator *
@@ -718,10 +718,10 @@ create_pointer_accelerator_filter_linear(int dpi)
 }
 
 struct motion_filter_interface accelerator_interface_low_dpi = {
-   accelerator_filter_low_dpi,
-   accelerator_restart,
-   accelerator_destroy,
-   accelerator_set_speed,
+   .filter = accelerator_filter_low_dpi,
+   .restart = accelerator_restart,
+   .destroy = accelerator_destroy,
+   .set_speed = accelerator_set_speed,
 };
 
 struct motion_filter *
@@ -755,10 +755,10 @@ create_pointer_accelerator_filter_touchpad(int dpi)
 }
 
 struct motion_filter_interface accelerator_interface_x230 = {
-   accelerator_filter_x230,
-   accelerator_restart,
-   accelerator_destroy,
-   accelerator_set_speed,
+   .filter = accelerator_filter_x230,
+   .restart = accelerator_restart,
+   .destroy = accelerator_destroy,
+   .set_speed = accelerator_set_speed,
 };
 
 /* The Lenovo x230 has a bad touchpad. This accel method has been
@@ -792,10 +792,10 @@ create_pointer_accelerator_filter_lenovo_x230(int dpi)
 }
 
 struct motion_filter_interface accelerator_interface_trackpoint = {
-   accelerator_filter_trackpoint,
-   accelerator_restart,
-   accelerator_destroy,
-   accelerator_set_speed,
+   .filter = accelerator_filter_trackpoint,
+   .restart = accelerator_restart,
+   .destroy = accelerator_destroy,
+   .set_speed = accelerator_set_speed,
 };
 
 struct motion_filter *
-- 
2.4.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 2/6] test: fix edge scroll timeout test

2015-08-17 Thread Peter Hutterer
This test is supposed to test for the timeout kicking in on edge scrolling -
if the finger is in the edge for longer than the timeout, we switch to
scrolling without requiring the motion threshold to be met first.

To emulate this, move the finger ever so slightly first to load up the motion
history, then timeout, then move. We expect a bunch of motion events with a
small delta.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 test/touchpad.c | 64 +++--
 1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/test/touchpad.c b/test/touchpad.c
index ef262f9..8bff5a9 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -463,54 +463,60 @@ START_TEST(touchpad_edge_scroll_timeout)
struct libinput_event *event;
struct libinput_event_pointer *ptrev;
double width = 0, height = 0;
-   int y_movement = 30; /* in percent of height */
+   int nevents = 0;
+   double mm; /* one mm in percent of the device */
 
-   /* account for different touchpad heights, let's move 100% on a 15mm
-  high touchpad, less on anything else. This number is picked at
-  random, we just want deltas less than 5.
-  */
-   if (libinput_device_get_size(dev-libinput_device,
-width,
-height) != -1) {
-   y_movement = 100 * 15/height;
-   }
+   ck_assert_int_eq(libinput_device_get_size(dev-libinput_device,
+ width,
+ height), 0);
+   mm = 100.0/height;
+
+   /* timeout-based scrolling is disabled when software buttons are
+* active, so switch to clickfinger. Not all test devices support
+* that, hence the extra check. */
+   if (libinput_device_config_click_get_methods(dev-libinput_device) 
+   LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER)
+   litest_enable_clickfinger(dev);
 
litest_drain_events(li);
litest_enable_edge_scroll(dev);
 
+   /* move 0.5mm, enough to load up the motion history, but less than
+* the scroll threshold of 2mm */
litest_touch_down(dev, 0, 99, 20);
+   litest_touch_move_to(dev, 0, 99, 20, 99, 20 + mm/2, 8, 0);
libinput_dispatch(li);
+   litest_assert_empty_queue(li);
+
litest_timeout_edgescroll();
libinput_dispatch(li);
 
-   litest_touch_move_to(dev, 0, 99, 20, 99, 20 + y_movement, 100, 10);
+   litest_assert_empty_queue(li);
+
+   /* now move slowly up to the 2mm scroll threshold. we expect events */
+   litest_touch_move_to(dev, 0, 99, 20 + mm/2, 99, 20 + mm * 2, 20, 0);
litest_touch_up(dev, 0);
libinput_dispatch(li);
 
-   event = libinput_get_event(li);
-   ck_assert_notnull(event);
-
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_POINTER_AXIS, -1);
 
-   while (libinput_next_event_type(li) != LIBINPUT_EVENT_NONE) {
-   double axisval;
-   ck_assert_int_eq(libinput_event_get_type(event),
-LIBINPUT_EVENT_POINTER_AXIS);
-   ptrev = libinput_event_get_pointer_event(event);
-
-   axisval = libinput_event_pointer_get_axis_value(ptrev,
-LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
-   ck_assert(axisval  0.0);
-
-   /* this is to verify we test the right thing, if the value
-  is greater than scroll.threshold we triggered the wrong
-  condition */
-   ck_assert(axisval  5.0);
+   while ((event = libinput_get_event(li))) {
+   double value;
 
+   ptrev = litest_is_axis_event(event,
+
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
+0);
+   value = libinput_event_pointer_get_axis_value(ptrev,
+ 
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
+   ck_assert_double_lt(value, 5.0);
libinput_event_destroy(event);
-   event = libinput_get_event(li);
+   nevents++;
}
 
+   /* we sent 20 events but allow for some to be swallowed by rounding
+* errors, the hysteresis, etc. */
+   ck_assert_int_ge(nevents, 10);
+
litest_assert_empty_queue(li);
libinput_event_destroy(event);
 }
-- 
2.4.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 6/6] touchpad: use unaccelerated motion data for scrolling

2015-08-17 Thread Peter Hutterer
For short and quick scroll gestures, those that should only trigger a few
lines of scroll the pointer acceleration is wildly unpredictable. Since we
average the motion of both fingers it's hard enough to intuitively predict
what the motion will be like. On top of that is the small threshold before we
start scrolling, so some of the initial motion gets swallowed before we
accelerate, making the next motion even more unpredictable.

The end result is that multiple seemingly identical finger motions cause
wildly different scroll motion.

Drop pointer acceleration for two-finger and edge scrolling. This makes short
scroll motions much more predictable and doesn't seem to have much effect on
long scroll motions. Plus, in natural scroll mode it really feels like the
content is stuck to your fingers now. Go wash your hands.

https://bugzilla.redhat.com/show_bug.cgi?id=1249365

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/evdev-mt-touchpad-edge-scroll.c |  3 ++-
 src/evdev-mt-touchpad-gestures.c|  3 ++-
 src/evdev-mt-touchpad.c | 12 
 src/evdev-mt-touchpad.h |  4 
 src/filter.c| 23 ++-
 5 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/evdev-mt-touchpad-edge-scroll.c 
b/src/evdev-mt-touchpad-edge-scroll.c
index eda62e4..b572a9f 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -390,7 +390,8 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t 
time)
}
 
normalized = tp_get_delta(t);
-   normalized = tp_filter_motion(tp, normalized, time);
+   /* scroll is not accelerated */
+   normalized = tp_filter_motion_unaccelerated(tp, normalized, 
time);
 
switch (t-scroll.edge_state) {
case EDGE_SCROLL_TOUCH_STATE_NONE:
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index d82a6fb..cc26e2a 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -328,7 +328,8 @@ tp_gesture_twofinger_handle_state_scroll(struct tp_dispatch 
*tp, uint64_t time)
delta = tp_get_average_touches_delta(tp);
}
 
-   delta = tp_filter_motion(tp, delta, time);
+   /* scroll is not accelerated */
+   delta = tp_filter_motion_unaccelerated(tp, delta, time);
 
if (normalized_is_zero(delta))
return GESTURE_2FG_STATE_SCROLL;
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a32a771..aeb6c31 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -71,6 +71,18 @@ tp_filter_motion(struct tp_dispatch *tp,
   unaccelerated, tp, time);
 }
 
+struct normalized_coords
+tp_filter_motion_unaccelerated(struct tp_dispatch *tp,
+  const struct normalized_coords *unaccelerated,
+  uint64_t time)
+{
+   if (normalized_is_zero(*unaccelerated))
+   return *unaccelerated;
+
+   return filter_dispatch_constant(tp-device-pointer.filter,
+   unaccelerated, tp, time);
+}
+
 static inline void
 tp_motion_history_push(struct tp_touch *t)
 {
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index 3bd8425..5f87c3f 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -395,6 +395,10 @@ struct normalized_coords
 tp_filter_motion(struct tp_dispatch *tp,
 const struct normalized_coords *unaccelerated,
 uint64_t time);
+struct normalized_coords
+tp_filter_motion_unaccelerated(struct tp_dispatch *tp,
+  const struct normalized_coords *unaccelerated,
+  uint64_t time);
 
 int
 tp_touch_active(struct tp_dispatch *tp, struct tp_touch *t);
diff --git a/src/filter.c b/src/filter.c
index 674b439..5df50d3 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -420,6 +420,19 @@ accelerator_filter_x230(struct motion_filter *filter,
return accelerated;
 }
 
+static struct normalized_coords
+touchpad_constant_filter(struct motion_filter *filter,
+const struct normalized_coords *unaccelerated,
+void *data, uint64_t time)
+{
+   struct normalized_coords normalized;
+
+   normalized.x = TP_MAGIC_SLOWDOWN * unaccelerated-x;
+   normalized.y = TP_MAGIC_SLOWDOWN * unaccelerated-y;
+
+   return normalized;
+}
+
 static void
 accelerator_restart(struct motion_filter *filter,
void *data,
@@ -757,6 +770,14 @@ create_pointer_accelerator_filter_linear_low_dpi(int dpi)
return filter-base;
 }
 
+struct motion_filter_interface accelerator_interface_touchpad = {
+   .filter = accelerator_filter,
+   .filter_constant = touchpad_constant_filter,
+   .restart = accelerator_restart,
+   .destroy = accelerator_destroy,
+   

[PATCH libinput 5/6] filter: add a filter_constant hook to the filter interface

2015-08-17 Thread Peter Hutterer
For when we need to apply some transformation to the data but it shouldn't be
acceleration. Example use are touchpad coordinates, even when not
accelerating, we still want to apply the magic slowdown.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
Not happy with this but the only other option here was to move the magic
slowdown into the touch code before the acceleration filters. That would
'break' the unaccelerated motion delta otherwise.

 src/filter-private.h |  4 
 src/filter.c | 20 
 src/filter.h | 22 ++
 3 files changed, 46 insertions(+)

diff --git a/src/filter-private.h b/src/filter-private.h
index f5e8b7f..eaf84ed 100644
--- a/src/filter-private.h
+++ b/src/filter-private.h
@@ -33,6 +33,10 @@ struct motion_filter_interface {
   struct motion_filter *filter,
   const struct normalized_coords *unaccelerated,
   void *data, uint64_t time);
+   struct normalized_coords (*filter_constant)(
+  struct motion_filter *filter,
+  const struct normalized_coords *unaccelerated,
+  void *data, uint64_t time);
void (*restart)(struct motion_filter *filter,
void *data,
uint64_t time);
diff --git a/src/filter.c b/src/filter.c
index f92b9fd..674b439 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -64,6 +64,14 @@ filter_dispatch(struct motion_filter *filter,
return filter-interface-filter(filter, unaccelerated, data, time);
 }
 
+struct normalized_coords
+filter_dispatch_constant(struct motion_filter *filter,
+const struct normalized_coords *unaccelerated,
+void *data, uint64_t time)
+{
+   return filter-interface-filter_constant(filter, unaccelerated, data, 
time);
+}
+
 void
 filter_restart(struct motion_filter *filter,
   void *data, uint64_t time)
@@ -320,6 +328,14 @@ accelerator_filter(struct motion_filter *filter,
 }
 
 static struct normalized_coords
+accelerator_filter_noop(struct motion_filter *filter,
+   const struct normalized_coords *unaccelerated,
+   void *data, uint64_t time)
+{
+   return *unaccelerated;
+}
+
+static struct normalized_coords
 accelerator_filter_low_dpi(struct motion_filter *filter,
   const struct normalized_coords *unaccelerated,
   void *data, uint64_t time)
@@ -673,6 +689,7 @@ trackpoint_accel_profile(struct motion_filter *filter,
 
 struct motion_filter_interface accelerator_interface = {
.filter = accelerator_filter,
+   .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
@@ -719,6 +736,7 @@ create_pointer_accelerator_filter_linear(int dpi)
 
 struct motion_filter_interface accelerator_interface_low_dpi = {
.filter = accelerator_filter_low_dpi,
+   .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
@@ -756,6 +774,7 @@ create_pointer_accelerator_filter_touchpad(int dpi)
 
 struct motion_filter_interface accelerator_interface_x230 = {
.filter = accelerator_filter_x230,
+   .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
@@ -793,6 +812,7 @@ create_pointer_accelerator_filter_lenovo_x230(int dpi)
 
 struct motion_filter_interface accelerator_interface_trackpoint = {
.filter = accelerator_filter_trackpoint,
+   .filter_constant = accelerator_filter_noop,
.restart = accelerator_restart,
.destroy = accelerator_destroy,
.set_speed = accelerator_set_speed,
diff --git a/src/filter.h b/src/filter.h
index fd36da4..c8ade07 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -34,11 +34,33 @@
 
 struct motion_filter;
 
+/**
+ * Accelerate the given coordinates.
+ * Takes a set of unaccelerated deltas and accelerates them based on the
+ * current and previous motion.
+ *
+ * This is a superset of filter_dispatch_constant()
+ *
+ * @see filter_dispatch_constant
+ */
 struct normalized_coords
 filter_dispatch(struct motion_filter *filter,
const struct normalized_coords *unaccelerated,
void *data, uint64_t time);
 
+/**
+ * Apply constant motion filters, but no acceleration.
+ *
+ * Takes a set of unaccelerated deltas and applies any constant filters to
+ * it but does not accelerate the delta in the conventional sense.
+ *
+ * @see filter_dispatch
+ */
+struct normalized_coords
+filter_dispatch_constant(struct motion_filter *filter,
+const struct normalized_coords *unaccelerated,
+   

[PATCH libinput 4/6] filter: move the TP_MAGIC_SLOWDOWN to a single definition

2015-08-17 Thread Peter Hutterer
Requires splitting out the X230 one so we don't accidentally break things if
we ever change this.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/filter.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/filter.c b/src/filter.c
index d05b53a..f92b9fd 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -36,6 +36,12 @@
 #include libinput-util.h
 #include filter-private.h
 
+/* Once normalized, touchpads see the same acceleration as mice. that is
+ * technically correct but subjectively wrong, we expect a touchpad to be a
+ * lot slower than a mouse. Apply a magic factor to slow down all movements
+ */
+#define TP_MAGIC_SLOWDOWN 0.4 /* unitless factor */
+
 /* Convert speed/velocity from units/us to units/ms */
 static inline double
 v_us2ms(double units_per_us)
@@ -581,12 +587,6 @@ touchpad_accel_profile_linear(struct motion_filter *filter,
   double speed_in, /* units/us */
   uint64_t time)
 {
-   /* Once normalized, touchpads see the same
-  acceleration as mice. that is technically correct but
-  subjectively wrong, we expect a touchpad to be a lot
-  slower than a mouse. Apply a magic factor here and proceed
-  as normal.  */
-   const double TP_MAGIC_SLOWDOWN = 0.4; /* unitless */
double factor; /* unitless */
 
speed_in *= TP_MAGIC_SLOWDOWN;
@@ -603,7 +603,7 @@ touchpad_lenovo_x230_accel_profile(struct motion_filter 
*filter,
  uint64_t time)
 {
/* Keep the magic factor from touchpad_accel_profile_linear.  */
-   const double TP_MAGIC_SLOWDOWN = 0.4; /* unitless */
+   const double X230_MAGIC_SLOWDOWN = 0.4; /* unitless */
 
/* Those touchpads presents an actual lower resolution that what is
 * advertised. We see some jumps from the cursor due to the big steps
@@ -629,14 +629,14 @@ touchpad_lenovo_x230_accel_profile(struct motion_filter 
*filter,
 * pointer_accel_profile_linear(), look at the git history of that
 * function for an explaination of what the min/max/etc. does.
 */
-   speed_in *= TP_MAGIC_SLOWDOWN / TP_MAGIC_LOW_RES_FACTOR;
+   speed_in *= X230_MAGIC_SLOWDOWN / TP_MAGIC_LOW_RES_FACTOR;
 
f1 = min(1, v_us2ms(speed_in) * 5);
f2 = 1 + (v_us2ms(speed_in) - v_us2ms(threshold)) * incline;
 
factor = min(max_accel, f2  1 ? f2 : f1);
 
-   return factor * TP_MAGIC_SLOWDOWN / TP_MAGIC_LOW_RES_FACTOR;
+   return factor * X230_MAGIC_SLOWDOWN / TP_MAGIC_LOW_RES_FACTOR;
 }
 
 double
-- 
2.4.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput 1/6] test: use the touchpad size for the 7mm movement

2015-08-17 Thread Peter Hutterer
Makes the code more straightforward, and we now require the devices to
have a height/width anyway.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 test/touchpad.c | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/test/touchpad.c b/test/touchpad.c
index bbdbc21..ef262f9 100644
--- a/test/touchpad.c
+++ b/test/touchpad.c
@@ -150,20 +150,17 @@ START_TEST(touchpad_2fg_scroll_slow_distance)
struct libinput *li = dev-libinput;
struct libinput_event *event;
struct libinput_event_pointer *ptrev;
-   const struct input_absinfo *y;
-   double y_move;
+   double width, height;
+   double y_move = 100;
 
if (!litest_has_2fg_scroll(dev))
return;
 
/* We want to move  5 mm. */
-   y = libevdev_get_abs_info(dev-evdev, ABS_Y);
-   if (y-resolution) {
-   y_move = 7.0 * y-resolution /
-   (y-maximum - y-minimum) * 100;
-   } else {
-   y_move = 20.0;
-   }
+   ck_assert_int_eq(libinput_device_get_size(dev-libinput_device,
+ width,
+ height), 0);
+   y_move = 100.0/height * 7;
 
litest_enable_2fg_scroll(dev);
litest_drain_events(li);
-- 
2.4.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] configure: fix enable_simple_intel_dmabuf_client=auto

2015-08-17 Thread Pekka Paalanen
On Mon, 17 Aug 2015 13:54:55 +0100
Daniel Stone dan...@fooishbar.org wrote:

 Hi,
 
 On 17 August 2015 at 08:27, Pekka Paalanen ppaala...@gmail.com wrote:
  When the user does not specify --enable nor
  --disable-simple-intel-dmabuf-client, we want to autodetect based on
  dependencies. cb512c018e8db66574b4e0d1263c52a05267918c implemented this,
  but forgot to actually enable it if the autodetect comes positive.
 
  Cc: Daniel Stone dan...@fooishbar.org
  Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 Perfect, thanks Pekka.
 
 Reviewed-by: Daniel Stone dani...@collabora.com

And pushed:
   f2bf50e..8358305  master - master


Thanks,
pq


pgpYD_jmGiIql.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Pekka Paalanen
From: Pekka Paalanen pekka.paala...@collabora.co.uk

This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

Developers have been trying to reduce the number of by default required
environment variables, and the mentioned commit is a step backwards in
that sense. The fundamental assumption is that a user has only one main
(Wayland) display server where all programs should connect to by
default, and do so with an a priori known socket name.

The commit also broke various use cases in the wild, some accidentally
due to other causes, some intentionally. This revert allows those use
cases to continue.

The original problem of running Weston in a window in an existing GNOME
X11 session and getting applications unintentionally launched into
Weston can be circumvented by letting Weston use a non-default socket
name, leaving wayland-0 unused.

Discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023927.html
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023937.html

Cc: Dima Ryazanov d...@gmail.com
Cc: Giulio Camuffo giuliocamu...@gmail.com
Cc: Daniel Stone dan...@fooishbar.org
Cc: Jasper St. Pierre jstpie...@mecheye.net
Cc: Ryo Munakata ryomnk...@gmail.com
Cc: Ray Strode halfl...@gmail.com
Cc: Peter Hutterer peter.hutte...@who-t.net
Cc: Matthias Clasen mcla...@redhat.com
Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
---
 doc/man/wl_display_connect.xml|  5 +++--
 doc/publican/sources/Protocol.xml |  8 
 src/wayland-client.c  | 10 --
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/doc/man/wl_display_connect.xml b/doc/man/wl_display_connect.xml
index ded3cbd..7e6e05c 100644
--- a/doc/man/wl_display_connect.xml
+++ b/doc/man/wl_display_connect.xml
@@ -57,8 +57,9 @@
   that was previously opened by a Wayland server. The server socket 
must
   be placed in envarXDG_RUNTIME_DIR/envar for this function to
   find it. The varnamename/varname argument specifies the name of
-  the socket or constantNULL/constant to use the default
-  (which is the value of envarWAYLAND_DISPLAY/envar). If
+  the socket or constantNULL/constant to use the default (which is
+  constantwayland-0/constant). The environment variable
+  envarWAYLAND_DISPLAY/envar replaces the default value. If
   envarWAYLAND_SOCKET/envar is set, this function behaves like
   functionwl_display_connect_to_fd/function with the 
file-descriptor
   number taken from the environment variable./para
diff --git a/doc/publican/sources/Protocol.xml 
b/doc/publican/sources/Protocol.xml
index 9464953..477063b 100644
--- a/doc/publican/sources/Protocol.xml
+++ b/doc/publican/sources/Protocol.xml
@@ -60,10 +60,10 @@
 titleWire Format/title
 para
   The protocol is sent over a UNIX domain stream socket, where the endpoint
-  name is determined by the emphasisWAYLAND_DISPLAY/emphasis
-  environment variable.  Its value will usually be
-  systemitem class=servicewayland-0/systemitem.  The protocol is 
message-based.
-  A message sent by a client to the server is called request.  A message
+  usually is named systemitem class=servicewayland-0/systemitem
+  (although it can be changed via emphasisWAYLAND_DISPLAY/emphasis
+  in the environment).  The protocol is message-based.  A
+  message sent by a client to the server is called request.  A message
   from the server to a client is called event.  Every message is
   structured as 32-bit words, values are represented in the host's
   byte-order.
diff --git a/src/wayland-client.c b/src/wayland-client.c
index ffbca4b..09c594a 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -764,11 +764,8 @@ connect_to_socket(const char *name)
 
if (name == NULL)
name = getenv(WAYLAND_DISPLAY);
-   if (name == NULL) {
-   wl_log(error: WAYLAND_DISPLAY not set in the environment.\n);
-   errno = ENOENT;
-   return -1;
-   }
+   if (name == NULL)
+   name = wayland-0;
 
fd = wl_os_socket_cloexec(PF_LOCAL, SOCK_STREAM, 0);
if (fd  0)
@@ -872,7 +869,8 @@ wl_display_connect_to_fd(int fd)
  * \return A \ref wl_display object or \c NULL on failure
  *
  * Connect to the Wayland display named \c name. If \c name is \c NULL,
- * its value will be replaced with the WAYLAND_DISPLAY environment variable.
+ * its value will be replaced with the WAYLAND_DISPLAY environment
+ * variable if it is set, otherwise display wayland-0 will be used.
  *
  * \memberof wl_display
  */
-- 
2.4.6

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Ray Strode
Hi,

 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

thanks, you've got my vote.

Acked-by: Ray Strode rstr...@redhat.com

--Ray
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] configure: fix enable_simple_intel_dmabuf_client=auto

2015-08-17 Thread Daniel Stone
Hi,

On 17 August 2015 at 08:27, Pekka Paalanen ppaala...@gmail.com wrote:
 When the user does not specify --enable nor
 --disable-simple-intel-dmabuf-client, we want to autodetect based on
 dependencies. cb512c018e8db66574b4e0d1263c52a05267918c implemented this,
 but forgot to actually enable it if the autodetect comes positive.

 Cc: Daniel Stone dan...@fooishbar.org
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk

Perfect, thanks Pekka.

Reviewed-by: Daniel Stone dani...@collabora.com

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput] evdev: drop relative x/y motion from a device not marked as pointer

2015-08-17 Thread Peter Hutterer
A device with REL_X/Y and keys gets marked only as ID_INPUT_KEY, initializes
as keyboard and then segfaults when we send x/y coordinates - pointer
acceleration never initializes.

Ignore the events and log a bug instead. This intentionally only papers over
the underlying issue, let's wait for a real device to trigger this and then
look at the correct solution.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 src/evdev.c   |  35 +
 src/evdev.h   |   1 +
 test/device.c | 155 ++
 test/litest.c |   2 +
 4 files changed, 193 insertions(+)

diff --git a/src/evdev.c b/src/evdev.c
index 9414d9d..97c007c 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -638,6 +638,36 @@ evdev_notify_axis(struct evdev_device *device,
discrete);
 }
 
+static inline bool
+evdev_reject_relative(struct evdev_device *device,
+ const struct input_event *e,
+ uint64_t time)
+{
+   struct libinput *libinput = device-base.seat-libinput;
+
+   if ((e-code == REL_X || e-code == REL_Y) 
+   (device-seat_caps  EVDEV_DEVICE_POINTER) == 0) {
+   switch (ratelimit_test(device-nonpointer_rel_limit)) {
+   case RATELIMIT_PASS:
+   log_bug_libinput(libinput,
+REL_X/Y from device '%s', but this 
device is not a pointer\n,
+device-devname);
+   break;
+   case RATELIMIT_THRESHOLD:
+   log_bug_libinput(libinput,
+REL_X/Y event flood from '%s'\n,
+device-devname);
+   break;
+   case RATELIMIT_EXCEEDED:
+   break;
+   }
+
+   return true;
+   }
+
+   return false;
+}
+
 static inline void
 evdev_process_relative(struct evdev_device *device,
   struct input_event *e, uint64_t time)
@@ -645,6 +675,9 @@ evdev_process_relative(struct evdev_device *device,
struct normalized_coords wheel_degrees = { 0.0, 0.0 };
struct discrete_coords discrete = { 0.0, 0.0 };
 
+   if (evdev_reject_relative(device, e, time))
+   return;
+
switch (e-code) {
case REL_X:
if (device-pending_event != EVDEV_RELATIVE_MOTION)
@@ -2157,6 +2190,8 @@ evdev_device_create(struct libinput_seat *seat,
 
/* at most 5 SYN_DROPPED log-messages per 30s */
ratelimit_init(device-syn_drop_limit, s2us(30), 5);
+   /* at most 5 log-messages per 5s */
+   ratelimit_init(device-nonpointer_rel_limit, s2us(5), 5);
 
matrix_init_identity(device-abs.calibration);
matrix_init_identity(device-abs.usermatrix);
diff --git a/src/evdev.h b/src/evdev.h
index 9f026b8..e44a65d 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -223,6 +223,7 @@ struct evdev_device {
 
int dpi; /* HW resolution */
struct ratelimit syn_drop_limit; /* ratelimit for SYN_DROPPED logging */
+   struct ratelimit nonpointer_rel_limit; /* ratelimit for REL_* events 
from non-pointer devices */
 
uint32_t model_flags;
 };
diff --git a/test/device.c b/test/device.c
index 59939d6..aff5ee2 100644
--- a/test/device.c
+++ b/test/device.c
@@ -1030,6 +1030,156 @@ START_TEST(device_udev_tag_synaptics_serial)
 }
 END_TEST
 
+START_TEST(device_nonpointer_rel)
+{
+   struct libevdev_uinput *uinput;
+   struct libinput *li;
+   struct libinput_device *device;
+   int i;
+
+   uinput = litest_create_uinput_device(test device,
+NULL,
+EV_KEY, KEY_A,
+EV_KEY, KEY_B,
+EV_REL, REL_X,
+EV_REL, REL_Y,
+-1);
+   li = litest_create_context();
+   device = libinput_path_add_device(li,
+ libevdev_uinput_get_devnode(uinput));
+   ck_assert(device != NULL);
+
+   litest_disable_log_handler(li);
+   for (i = 0; i  100; i++) {
+   libevdev_uinput_write_event(uinput, EV_REL, REL_X, 1);
+   libevdev_uinput_write_event(uinput, EV_REL, REL_Y, -1);
+   libevdev_uinput_write_event(uinput, EV_SYN, SYN_REPORT, 0);
+   libinput_dispatch(li);
+   }
+   litest_restore_log_handler(li);
+
+   libinput_unref(li);
+   libevdev_uinput_destroy(uinput);
+}
+END_TEST
+
+START_TEST(device_touchpad_rel)
+{
+   struct libevdev_uinput *uinput;
+   struct libinput *li;
+   struct libinput_device *device;
+   const struct input_absinfo abs[] = {
+   { ABS_X, 0, 10, 0, 0, 10 },
+   { ABS_Y, 0, 10, 0, 0, 10 },
+   

Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Bill Spitzak
On Mon, Aug 17, 2015 at 7:48 AM, Ray Strode halfl...@gmail.com wrote:

 Hi,

  This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

 thanks, you've got my vote.

 Acked-by: Ray Strode rstr...@redhat.com

 --Ray


Seems right to me question about the method of nesting Wayland in X and X
in wayland;

 The original problem of running Weston in a window in an existing GNOME
 X11 session and getting applications unintentionally launched into
 Weston can be circumvented by letting Weston use a non-default socket
 name, leaving wayland-0 unused.

If Wayland is already running and using wayland-0 this would prevent these
programs from using the X11 api. For instance if you wished to test the X11
api inside a Wayland session.

Would it make sense that if DISPLAY is set and WAYLAND_DISPLAY is not set,
that a program capable of doing both should prefer the X11 api? This would
mean that I could force use of the X11 api by unsetting WAYLAND_DISPLAY.

This will require changes to the client (unless the wayland connect was
changed to fail in this case, which I suspect is not a good idea) which
probably explains why the idea of renaming the socket was suggested.

As for the patch, I agree. The Foundry software would check if DISPLAY was
not set, and set it directly to :0, so that X would work always (it did
not open the display by name because it wanted to fix child programs as
well). This was commercial software and this was demanded by qc. So
effectively they wanted X11 to work without an environment variable.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[ANNOUNCE] weston 1.8.91

2015-08-17 Thread Bryce Harrington
This is the slightly delayed alpha release for Weston 1.9.  The delay
was due to a last minute feature landing that broke builds on with older
dependencies and ARM.  The former issue is fixed in this release; the
ARM breakage is fixed in trunk and will be available in the next
release.

This release of Weston updates the license text, just as is done for
Wayland 1.9.  MIT has released software under several slightly different
licenses, including the old 'X11 License' or 'MIT License'.  X.org used
the X11 License originally but now prefers the MIT Expat License as the
standard.  Wayland has been using the MIT X11 license, but Wayland's
licensing intent is to be compatible with X.org, so this release
switches to the Expat-style licensing.  In practical terms, the most
notable change is the dropping of the no-advertising clause.

Some of the preliminary infrastructure is now in place for libweston,
which repackages Weston's internals into a library interface.  This will
provide much of the basic core functionality needed to create simple
compositors, such as needed by lightweight desktop environments.  The
support provided in this release is quite minimal, more for review and
experimentation, and is not yet in a usable form.  We also intend to
keep the API experimental and subject to change for some time to come.

Input device hotplug is better polished, so it misbehaves less
frequently when adding and removing keyboards and mice.  This in
particular benefits multi-seat for adding and removing seats.

In the shell, we've switched the middle and right mouse bindings, so
that the more useful window resize functionality is accessed via the
right button, and the less useful rotate-windows functionality is on the
middle.

Weston's unit/integration test framework is reimplemented in this
release.  This new code, 'zuctest', is heavily inspired by Google Test,
Boost Test, etc. but is implemented in C and under the MIT Expat license
for better compatibility with Weston.

The DRM compositor is now able to handle triple-head graphics cards, and
other hardware with more than two output CRTCs per card.  Various
mode-setting improvements and fixes are also included.

ivi-shell adds an interface to get the screen ID, and methods to remove
callbacks for certain notifications.

The weston-screensaver client is removed, in favor of just using simpler
DPMS.  The lessons that this example taught are now out of date, and
dropping it allows us to drop dependency on GLU, and reduces our
dependence on cairo-gl (now only gears depends on cairo-gl).  Some
screensaver support stubs still exist in desktop-shell, so external
projects can still have screensavers if they wish.

A new linux_dmabuf extension.  This enables a zero-copy pipeline from
video source to display.  It's hoped this will be a powerful and
flexible solution for a variety of accelerated video handling such as
media appliances and smart TVs, but there are still many open questions
about how to best tie everything together.  This Weston release
implements this protocol as an experimental extension enabling creation
of dmabuf-based wl_buffers in a generic manner.


Bill Spitzak (1):
  test/ivi: include protocol headers for all used protocols

Bryce Harrington (39):
  configure.ac: bump version to 1.8.90
  COPYING: Update to MIT Expat License rather than MIT X License
  COPYING: Drop special license callout for libbacklight.c
  data: Update boilerplate from MIT X11 license to MIT Expat license
  clients: Update boilerplate from MIT X11 license to MIT Expat licenses
  *-shell: Update boilerplate from MIT X11 license to MIT Expat licenses
  protocol: whitespace cleanup
  protocol: Update boilerplate from MIT X11 license to MIT Expat license
  shared: Update boilerplate from MIT X11 license to MIT Expat license
  src: Update boilerplate from MIT X11 license to MIT Expat license
  libbacklight: Add missing boilerplate to header
  weston-egl-ext.h: Reformat license text
  vaapi-recorder: Drop redundant license
  tests: Update boilerplate from MIT X11 license to MIT Expat license
  wcap: Update boilerplate from MIT X11 license to MIT Expat license
  wcap: Prefer quote form of include for config.h
  xwayland: Update boilerplate from MIT X11 license to MIT Expat license
  xwayland: Fix a couple whitespace errors
  COPYING: Specify origin of the library
  protocol/text: Update boilerplate from MIT X11 license to MIT Expat 
license
  compositor-x11: More verbose logging
  compositor-drm: Add comment for newly added drm_waitvblank_pipe()
  weston-launch: Drop redundant exit()
  clients: Simplify memory allocation with xzalloc()
  xwayland: Always free reply from xcb_get_property_reply()
  xwayland: Check return of xcb_get_property_reply() before deref
  xwayland: Allow dump_property when selection fails
  screen-share: Use the correct list pointer when freeing 

[PATCH weston] configure: fix enable_simple_intel_dmabuf_client=auto

2015-08-17 Thread Pekka Paalanen
From: Pekka Paalanen pekka.paala...@collabora.co.uk

When the user does not specify --enable nor
--disable-simple-intel-dmabuf-client, we want to autodetect based on
dependencies. cb512c018e8db66574b4e0d1263c52a05267918c implemented this,
but forgot to actually enable it if the autodetect comes positive.

Cc: Daniel Stone dan...@fooishbar.org
Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index aa29862..425f071 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,6 +348,7 @@ if ! test x$enable_simple_intel_dmabuf_client = xno; 
then
   if test x$have_simple_dmabuf_client = xno -a 
x$enable_simple_intel_dmabuf_client = xyes; then
 AC_MSG_ERROR([Intel dmabuf client explicitly enabled, but libdrm_intel 
couldn't be found])
   fi
+  enable_simple_intel_dmabuf_client=$have_simple_dmabuf_client
 fi
 AM_CONDITIONAL(BUILD_SIMPLE_INTEL_DMABUF_CLIENT, test 
x$enable_simple_intel_dmabuf_client = xyes)
 
-- 
2.4.6

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


RE: [PATCH weston v2] ivi-shell: bugfix, an ivi_surface is not removed from list of ivi_layer when the ivi_surface is removed from the compositor.

2015-08-17 Thread Tanibata, Nobuhiko (ADITJ/SWG)


 -Original Message-
 From: wayland-devel
 [mailto:wayland-devel-boun...@lists.freedesktop.org] On Behalf Of Pekka
 Paalanen
 Sent: Thursday, August 13, 2015 10:21 PM
 To: Nobuhiko Tanibata
 Cc: securitych...@denso.co.jp; wayland-devel@lists.freedesktop.org
 Subject: Re: [PATCH weston v2] ivi-shell: bugfix, an ivi_surface is not
 removed from list of ivi_layer when the ivi_surface is removed from the
 compositor.
 
 On Fri,  7 Aug 2015 09:47:02 +0900
 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote:
 
  The api, ivi_layout_layer_remove_surface, shall remove a ivi_surface
  from a list of ivi_layer. In previous code, there is no trigger to
  refresh order of list, removing the ivi_surface, in commit_layer_list.
 
  To fix this bug, set a mask; IVI_NOTIFICATION_REMOVE in order to
  trigger refresh list of surface in commit_layer_list.
 
  In commit_layer_list, this patch also removes duplicated code in two
  conditions for IVI_NOTIFICATION_ADD/REMOVE.
 
  Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp
  ---
  v2 changes:
   - fix 8 spaces to tab.
   - clean up duplicate code in commit_layer_list.
   - improve commit message.
 
   ivi-shell/ivi-layout.c | 28 +---
   1 file changed, 9 insertions(+), 19 deletions(-)
 
  diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index
  2974bb7..1b45003 100644
  --- a/ivi-shell/ivi-layout.c
  +++ b/ivi-shell/ivi-layout.c
  @@ -812,25 +812,7 @@ commit_layer_list(struct ivi_layout *layout)
  if (!(ivilayer-event_mask 
(IVI_NOTIFICATION_ADD |
 IVI_NOTIFICATION_REMOVE)) ) {
  continue;
 
 Hi Tanibata-san,
 
 using 'continue', there is no need to have an else-branch. This would save
 one level of indent in the remaining code.
 
  -   }
  -
  -   if (ivilayer-event_mask  IVI_NOTIFICATION_REMOVE) {
  -   wl_list_for_each_safe(ivisurf, next,
  -   ivilayer-order.surface_list,
 order.link) {
  -
   remove_ordersurface_from_layer(ivisurf);
  -
  -   if
 (!wl_list_empty(ivisurf-order.link)) {
  -
   wl_list_remove(ivisurf-order.link);
  -   }
  -
  -   wl_list_init(ivisurf-order.link);
  -   ivisurf-event_mask |=
 IVI_NOTIFICATION_REMOVE;
 
 You are removing this setting of the flag IVI_NOTIFICATION_REMOVE, but in
 the code that remains I do not see that happening anymore in
 commit_layer_list().
 
 However, I see it being set by ivi_layout_layer_remove_surface(). At which
 time should the flag be set? Should the ADD flag not work the same way?
 
 Would it be essential to flag ivi-surfaces that get removed from
 ivilayer-order.surface_list with IVI_NOTIFICATION_REMOVE, and surfaces
 that are added to flag with IVI_NOTIFICATION_ADD, and all remaining surfaces
 even if they are reordered not be flagged at all?
 
 Or is it intended that all surfaces that are originally in the
 ivilayer-order.surface_list are flagged as REMOVE, and all surfaces in
 the pending list are flagged as ADD? That would imply that surfaces that
 were and still remain in the order list are flagged as both REMOVE and ADD.
 
  -   }
  -
  -   wl_list_init(ivilayer-order.surface_list);
  -   }
  -
  -   if (ivilayer-event_mask  IVI_NOTIFICATION_ADD) {
  +   } else {
  wl_list_for_each_safe(ivisurf, next,
 
 ivilayer-order.surface_list, order.link) {
 
   remove_ordersurface_from_layer(ivisurf);
  @@ -843,6 +825,13 @@ commit_layer_list(struct ivi_layout *layout)
  }
 
  wl_list_init(ivilayer-order.surface_list);
  +
  +   /**
  +* Following ivilayer-pending.surface_list must
 be maintained by
  +* a function who will set these masks. Order of
 surfaces in a
  +* layer is restructured here. if there is no
 surface in
  +* surface_list, the following code is skipped.
  +*/
  wl_list_for_each(ivisurf,
 ivilayer-pending.surface_list,
   pending.link) {
 
   if(!wl_list_empty(ivisurf-order.link)){
  @@ -2565,6 +2554,7 @@ ivi_layout_layer_remove_surface(struct
 ivi_layout_layer *ivilayer,
  }
 
  remsurf-event_mask |= IVI_NOTIFICATION_REMOVE;
  +   ivilayer-event_mask |= IVI_NOTIFICATION_REMOVE;
   }
 
   static int32_t
 
 All the flagging issues aside, I see what this patch does.
 
 Previously removing a ivi-surface didn't work at all. With this patch,
 whether ivi-surfaces are added or removed from the ivi-layer, the code will
 always completely reconstruct the ivilayer-order.surface_list from the
 pending list. In that sense:
 
 Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 Do you want me to push this patch as is?

Re: [PATCH weston 2/2] Fix armhf configure breakage due to missing libdrm_intel package

2015-08-17 Thread Pekka Paalanen
On Sat, 15 Aug 2015 19:20:59 -0700
Bryce Harrington br...@osg.samsung.com wrote:

 On Fri, Aug 14, 2015 at 12:53:25PM -0700, Bryce Harrington wrote:
  The buildbots discovered that recent changes break on Ubuntu 15.04's
  armhf images:
  
configure:16137: checking for SIMPLE_DMABUF_CLIENT
configure:16144: $PKG_CONFIG --exists --print-errors wayland-client 
  libdrm libdrm_intel
Package libdrm_intel was not found in the pkg-config search path.
...
configure:16194: error: Package requirements (wayland-client libdrm 
  libdrm_intel) were not met:
  
No package 'libdrm_intel' found
  
  This patch was provided by Daniel Stone.  I've not tested it other than
  verifying it does not cause build problems on x86_64.
  
  Acked-by: Bryce Harrington br...@osg.samsung.com
  Signed-off-by: Bryce Harrington br...@osg.samsung.com
 
 I went ahead and landed both of these.

Hi Bryce,

I would've given R-b for both. Only after seeing the comments in irc of
something breaking here I actually tried these and noticed that the
auto case for simple-dmabuf never ends up building the program. :-)
Really hard to spot the issue from reading the configure.ac, combined
with 'make clean' not removing the old built binary, if configure later
disabled it.

Fix coming soon from me or Daniel.


Thanks,
pq


pgp_glyXWaFxq.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel