From patchwork Thu Aug 7 12:32:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Mads_Dor=C3=A9_Hansen?= X-Patchwork-Id: 377828 X-Patchwork-Delegate: jacob.kjaergaard@prevas.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id C93B9140097 for ; Thu, 7 Aug 2014 22:32:40 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id 4F0FA3F876 for ; Thu, 7 Aug 2014 14:32:39 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from ispc7.dotserv.com (ssl7.dotserv.com [178.20.217.17]) by hugin.dotsrc.org (Postfix) with ESMTPS id BBC553F876 for ; Thu, 7 Aug 2014 14:32:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ispc7.dotserv.com (Postfix) with ESMTP id 771BE51400C for ; Thu, 7 Aug 2014 14:32:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at ispc7.dotserv.com Received: from ispc7.dotserv.com ([127.0.0.1]) by localhost (ispc7.dotserv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 72qcD90ij42E for ; Thu, 7 Aug 2014 14:32:34 +0200 (CEST) Received: from localhost.localdomain (unknown [195.215.105.114]) (Authenticated sender: dore@madsdore.dk) by ispc7.dotserv.com (Postfix) with ESMTPSA id 6DF70514011 for ; Thu, 7 Aug 2014 14:32:06 +0200 (CEST) From: =?UTF-8?q?Mads=20Dor=C3=A9?= To: dev@oe-lite.org Subject: [xorg 6/7] Added xf86-input-elographics Date: Thu, 7 Aug 2014 14:32:05 +0200 Message-Id: <1407414726-1710-6-git-send-email-dore@madsdore.dk> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407414726-1710-1-git-send-email-dore@madsdore.dk> References: <1407414726-1710-1-git-send-email-dore@madsdore.dk> X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org --- .../xf86-input-elographics/axis-inversion.patch | 80 ++++++++++++++++++++++ .../xorg-driver/xf86-input-elographics_1.4.1.oe | 5 ++ .../xf86-input-elographics_1.4.1.oe.sig | 1 + 3 files changed, 86 insertions(+) create mode 100644 recipes/xorg-driver/xf86-input-elographics/axis-inversion.patch create mode 100644 recipes/xorg-driver/xf86-input-elographics_1.4.1.oe create mode 100644 recipes/xorg-driver/xf86-input-elographics_1.4.1.oe.sig diff --git a/recipes/xorg-driver/xf86-input-elographics/axis-inversion.patch b/recipes/xorg-driver/xf86-input-elographics/axis-inversion.patch new file mode 100644 index 0000000..d572a73 --- /dev/null +++ b/recipes/xorg-driver/xf86-input-elographics/axis-inversion.patch @@ -0,0 +1,80 @@ +From 0d3ec2e97c99431cdbaea8e958a75ff2e748da41 Mon Sep 17 00:00:00 2001 +From: Jaska Kivela +Date: Wed, 16 Jan 2013 11:51:04 +0200 +Subject: Added axis inversion functionality. + +The module would previously log a message if min > max, but not do anything +about it. Keep the original min/max around, swap on-the-fly. + +Signed-off-by: Jaska Kivela +Reviewed-by: Peter Hutterer +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Elo.c b/src/xf86Elo.c +index cb1699e..c37cf9a 100644 +--- a/src/xf86Elo.c ++++ b/src/xf86Elo.c +@@ -360,6 +360,22 @@ xf86EloReadInput(InputInfoPtr pInfo) + cur_y = WORD_ASSEMBLY(priv->packet_buf[5], priv->packet_buf[6]); + state = priv->packet_buf[2] & 0x07; + ++ DBG(5, ErrorF("ELO got: x(%d), y(%d), %s\n", ++ cur_x, cur_y, ++ (state == ELO_PRESS) ? "Press" : ++ ((state == ELO_RELEASE) ? "Release" : "Stream"))); ++ ++ if (priv->min_y > priv->max_y) { ++ /* inverted y axis */ ++ cur_y = priv->max_y - cur_y + priv->min_y; ++ } ++ ++ if (priv->min_x > priv->max_x) { ++ /* inverted x axis */ ++ cur_x = priv->max_x - cur_x + priv->min_x; ++ } ++ ++ + /* + * Send events. + * +@@ -676,6 +692,7 @@ xf86EloControl(DeviceIntPtr dev, + unsigned char reply[ELO_PACKET_SIZE]; + Atom btn_label; + Atom axis_labels[2] = { 0, 0 }; ++ int x0, x1, y0, y1; + + switch(mode) { + +@@ -719,17 +736,27 @@ xf86EloControl(DeviceIntPtr dev, + return !Success; + } + else { ++ ++ /* Correct the coordinates for possibly inverted axis. ++ Leave priv->variables untouched so we can check for ++ inversion on incoming events. ++ */ ++ y0 = min(priv->min_y, priv->max_y); ++ y1 = max(priv->min_y, priv->max_y); ++ x0 = min(priv->min_x, priv->max_x); ++ x1 = max(priv->min_x, priv->max_x); ++ + /* I will map coordinates myself */ + InitValuatorAxisStruct(dev, 0, + axis_labels[0], +- priv->min_x, priv->max_x, ++ x0, x1, + 9500, + 0 /* min_res */, + 9500 /* max_res */, + Absolute); + InitValuatorAxisStruct(dev, 1, + axis_labels[1], +- priv->min_y, priv->max_y, ++ y0, y1, + 10500, + 0 /* min_res */, + 10500 /* max_res */, +-- +cgit v0.10.2 + diff --git a/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe b/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe new file mode 100644 index 0000000..645ddd9 --- /dev/null +++ b/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe @@ -0,0 +1,5 @@ +require xorg-driver-input.inc + +SUMMARY = "X.Org X server -- Elo Graphics input driver" + +SRC_URI += "file://axis-inversion.patch" diff --git a/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe.sig b/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe.sig new file mode 100644 index 0000000..d99a6d3 --- /dev/null +++ b/recipes/xorg-driver/xf86-input-elographics_1.4.1.oe.sig @@ -0,0 +1 @@ +78455583a34ccd209edc1aba5538926df4faf47f xf86-input-elographics-1.4.1.tar.bz2