[PATCH 2/2] udev-seat: break early when output is found and log the mapping

U. Artie Eoff ullysses.a.eoff at intel.com
Fri Dec 20 12:31:47 PST 2013


From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>

When an input device has a WL_OUTPUT udev property specified and
that output is found, log it... also break from the loop immediately.

Log a warning if the requested output is not found.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
 src/udev-seat.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/udev-seat.c b/src/udev-seat.c
index deceb50..52b6697 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -105,13 +105,14 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
 					 &device->abs.calibration[4],
 					 &device->abs.calibration[5]) == 6) {
 		device->abs.apply_calibration = 1;
-		weston_log ("Applying calibration: %f %f %f %f %f %f\n",
-			    device->abs.calibration[0],
-			    device->abs.calibration[1],
-			    device->abs.calibration[2],
-			    device->abs.calibration[3],
-			    device->abs.calibration[4],
-			    device->abs.calibration[5]);
+		weston_log_continue(STAMP_SPACE
+				    "applying calibration: %f %f %f %f %f %f\n",
+				    device->abs.calibration[0],
+				    device->abs.calibration[1],
+				    device->abs.calibration[2],
+				    device->abs.calibration[3],
+				    device->abs.calibration[4],
+				    device->abs.calibration[5]);
 	}
 
 	wl_list_insert(seat->devices_list.prev, &device->link);
@@ -124,8 +125,20 @@ device_added(struct udev_device *udev_device, struct udev_input *input)
 	output_name = udev_device_get_property_value(udev_device, "WL_OUTPUT");
 	if (output_name) {
 		wl_list_for_each(output, &c->output_list, link)
-			if (strcmp(output->name, output_name) == 0)
+			if (strcmp(output->name, output_name) == 0) {
 				device->output = output;
+				weston_log_continue(
+					STAMP_SPACE
+					"mapping to output: %s\n",
+					device->output->name);
+				break;
+			}
+		if (!device->output || strcmp(device->output->name, output_name) != 0) {
+			weston_log_continue(
+				STAMP_SPACE
+				"warning: map to output %s failed... output not found\n",
+				output_name);
+		}
 	}
 
 	if (input->enabled == 1)
-- 
1.8.3.1



More information about the wayland-devel mailing list