xserver: Branch 'master' - 4 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Dec 18 03:44:45 UTC 2020
hw/xfree86/drivers/inputtest/inputtestdrv.man | 11 +-
hw/xfree86/drivers/inputtest/xf86-input-inputtest.c | 83 +++++++++++++-------
2 files changed, 65 insertions(+), 29 deletions(-)
New commits:
commit 5e3900904ddc27f3d5580ce3a07929469d82fb5e
Author: Povilas Kanapickas <povilas at radix.lt>
Date: Fri Dec 18 04:39:07 2020 +0200
xfree86: Use different scroll increment than libinput in inputtest drv
Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
diff --git a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
index 02fbba142..8f4c75721 100644
--- a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
+++ b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
@@ -331,8 +331,8 @@ init_pointer(InputInfoPtr pInfo)
xf86InitValuatorAxisStruct(dev, 1, XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y),
min, max, res * 1000, 0, res * 1000, Relative);
- SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
- SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+ SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 120, 0);
+ SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 120, 0);
if (has_pressure) {
xf86InitValuatorAxisStruct(dev, 4,
@@ -385,8 +385,8 @@ init_pointer_absolute(InputInfoPtr pInfo)
xf86InitValuatorAxisStruct(dev, 1, XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
min, max, res * 1000, 0, res * 1000, Absolute);
- SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
- SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+ SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 120, 0);
+ SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 120, 0);
if (has_pressure) {
xf86InitValuatorAxisStruct(dev, 4,
@@ -462,8 +462,8 @@ init_touch(InputInfoPtr pInfo)
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
min, max, res * 1000, 0, res * 1000, Absolute);
- SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
- SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+ SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 120, 0);
+ SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 120, 0);
xf86InitValuatorAxisStruct(dev, 4,
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_PRESSURE),
commit 58465a3dd90c3bc698ba9ebb2c4a516df6ff7dfd
Author: Povilas Kanapickas <povilas at radix.lt>
Date: Thu Dec 17 03:08:06 2020 +0200
xfree86: Add scroll axes to touch devices in inputtest driver
Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
diff --git a/hw/xfree86/drivers/inputtest/inputtestdrv.man b/hw/xfree86/drivers/inputtest/inputtestdrv.man
index 4741783d5..566e4f35a 100644
--- a/hw/xfree86/drivers/inputtest/inputtestdrv.man
+++ b/hw/xfree86/drivers/inputtest/inputtestdrv.man
@@ -61,9 +61,11 @@ The valuators are initialized in the same way as for \fBPointerAbsolute\fR type.
.IP
.BI Touch
Initializes a touch device.
-It will have 3 valuators: an "Abs MT Position X" at axis 0,
-an "Abs MT Position Y" valuator at axis 1 and an "Abs MT Pressure" valuator
-at axis 2.
+It will have 5 valuators: an "Abs MT Position X" at axis 0,
+an "Abs MT Position Y" valuator at axis 1,
+a horizontal scroll valuator on axis 2,
+a vertical scroll valuator on axis 3 and an "Abs MT Pressure" valuator
+at axis 4.
.TP 7
.BI "Option \*qTouchCount\*q \*q" int \*q
Sets the maximum number of simultaneous touches for touch devices.
diff --git a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
index b2cc14e8c..02fbba142 100644
--- a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
+++ b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
@@ -48,7 +48,7 @@
#include "xf86-input-inputtest-protocol.h"
#define MAX_POINTER_NUM_AXES 5 /* x, y, hscroll, vscroll, [pressure] */
-#define TOUCH_NUM_AXES 4 /* x, y, hscroll, vscroll */
+#define MAX_TOUCH_NUM_AXES 5 /* x, y, hscroll, vscroll, pressure */
#define TOUCH_MAX_SLOTS 15
#define TOUCH_AXIS_MAX 0xffff
@@ -287,16 +287,6 @@ init_button_labels(Atom *labels, size_t size)
labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_BACK);
}
-static void
-init_axis_labels(Atom *labels, size_t size)
-{
- memset(labels, 0, size * sizeof(Atom));
- labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
- labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
- labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
- labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
-}
-
static void
init_pointer(InputInfoPtr pInfo)
{
@@ -439,13 +429,19 @@ init_touch(InputInfoPtr pInfo)
int min, max, res;
unsigned char btnmap[MAX_BUTTONS + 1];
Atom btnlabels[MAX_BUTTONS];
- Atom axislabels[TOUCH_NUM_AXES];
+ Atom axislabels[MAX_TOUCH_NUM_AXES];
+ int num_axes = 0;
int nbuttons = 7;
int ntouches = TOUCH_MAX_SLOTS;
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
- init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
+
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_X);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_PRESSURE);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
@@ -453,7 +449,7 @@ init_touch(InputInfoPtr pInfo)
btnlabels,
ptr_ctl,
GetMotionHistorySize(),
- TOUCH_NUM_AXES,
+ num_axes,
axislabels);
min = 0;
max = TOUCH_AXIS_MAX;
@@ -465,7 +461,11 @@ init_touch(InputInfoPtr pInfo)
xf86InitValuatorAxisStruct(dev, 1,
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y),
min, max, res * 1000, 0, res * 1000, Absolute);
- xf86InitValuatorAxisStruct(dev, 2,
+
+ SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
+ SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+
+ xf86InitValuatorAxisStruct(dev, 4,
XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_PRESSURE),
min, TABLET_PRESSURE_AXIS_MAX, res * 1000, 0, res * 1000, Absolute);
commit 91a8013990a967bfd8c4145c4a79b86cc495a205
Author: Povilas Kanapickas <povilas at radix.lt>
Date: Thu Dec 17 03:08:05 2020 +0200
xfree86: Add support for pressure valuator axis in inputtest driver
Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
diff --git a/hw/xfree86/drivers/inputtest/inputtestdrv.man b/hw/xfree86/drivers/inputtest/inputtestdrv.man
index 4ec872c6d..4741783d5 100644
--- a/hw/xfree86/drivers/inputtest/inputtestdrv.man
+++ b/hw/xfree86/drivers/inputtest/inputtestdrv.man
@@ -70,6 +70,9 @@ Sets the maximum number of simultaneous touches for touch devices.
.TP 7
.BI "Option \*qPointerButtonCount\*q \*q" int \*q
Sets the maximum number of buttons in pointer devices.
+.TP 7
+.BI "Option \*qPointerHasPressure\*q \*q" bool \*q
+Selects whether "Abs Pressure" is available at the axis 4 in pointer devices.
.SH INTERFACE WITH THE DRIVER
The communication with the driver is a binary protocol defined in
diff --git a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
index 099770b2b..b2cc14e8c 100644
--- a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
+++ b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
@@ -47,7 +47,7 @@
#include "xf86-input-inputtest-protocol.h"
-#define MAX_POINTER_NUM_AXES 4 /* x, y, hscroll, vscroll */
+#define MAX_POINTER_NUM_AXES 5 /* x, y, hscroll, vscroll, [pressure] */
#define TOUCH_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_MAX_SLOTS 15
@@ -303,6 +303,7 @@ init_pointer(InputInfoPtr pInfo)
DeviceIntPtr dev= pInfo->dev;
int min, max, res;
int nbuttons = 7;
+ bool has_pressure = false;
int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
@@ -310,6 +311,8 @@ init_pointer(InputInfoPtr pInfo)
Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
+ has_pressure = xf86SetBoolOption(pInfo->options, "PointerHasPressure",
+ false);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
@@ -318,6 +321,8 @@ init_pointer(InputInfoPtr pInfo)
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
+ if (has_pressure)
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
@@ -338,6 +343,12 @@ init_pointer(InputInfoPtr pInfo)
SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+
+ if (has_pressure) {
+ xf86InitValuatorAxisStruct(dev, 4,
+ XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
+ 0, 1000, 1, 1, 1, Absolute);
+ }
}
static void
@@ -346,6 +357,7 @@ init_pointer_absolute(InputInfoPtr pInfo)
DeviceIntPtr dev = pInfo->dev;
int min, max, res;
int nbuttons = 7;
+ bool has_pressure = false;
int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
@@ -353,6 +365,8 @@ init_pointer_absolute(InputInfoPtr pInfo)
Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
+ has_pressure = xf86SetBoolOption(pInfo->options, "PointerHasPressure",
+ false);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
@@ -361,6 +375,8 @@ init_pointer_absolute(InputInfoPtr pInfo)
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
+ if (has_pressure)
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
@@ -382,6 +398,11 @@ init_pointer_absolute(InputInfoPtr pInfo)
SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, 15, 0);
SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, 15, 0);
+ if (has_pressure) {
+ xf86InitValuatorAxisStruct(dev, 4,
+ XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
+ 0, 1000, 1, 1, 1, Absolute);
+ }
}
static void
commit 742b87f7ee5abd1406a77ac1baacbc43759bd275
Author: Povilas Kanapickas <povilas at radix.lt>
Date: Thu Dec 17 03:08:04 2020 +0200
xfree86: Fix axis labels for PointerAbsolute input of inputtest driver
Signed-off-by: Povilas Kanapickas <povilas at radix.lt>
diff --git a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
index 0859c0768..099770b2b 100644
--- a/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
+++ b/hw/xfree86/drivers/inputtest/xf86-input-inputtest.c
@@ -47,7 +47,7 @@
#include "xf86-input-inputtest-protocol.h"
-#define POINTER_NUM_AXES 4 /* x, y, hscroll, vscroll */
+#define MAX_POINTER_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_MAX_SLOTS 15
@@ -303,16 +303,21 @@ init_pointer(InputInfoPtr pInfo)
DeviceIntPtr dev= pInfo->dev;
int min, max, res;
int nbuttons = 7;
+ int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
Atom btnlabels[MAX_BUTTONS];
- Atom axislabels[POINTER_NUM_AXES];
+ Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
- init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
+
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
@@ -320,7 +325,7 @@ init_pointer(InputInfoPtr pInfo)
btnlabels,
ptr_ctl,
GetMotionHistorySize(),
- POINTER_NUM_AXES,
+ num_axes,
axislabels);
min = -1;
max = -1;
@@ -341,16 +346,21 @@ init_pointer_absolute(InputInfoPtr pInfo)
DeviceIntPtr dev = pInfo->dev;
int min, max, res;
int nbuttons = 7;
+ int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
Atom btnlabels[MAX_BUTTONS];
- Atom axislabels[POINTER_NUM_AXES];
+ Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
- init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
+
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
+ axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
@@ -358,7 +368,7 @@ init_pointer_absolute(InputInfoPtr pInfo)
btnlabels,
ptr_ctl,
GetMotionHistorySize(),
- POINTER_NUM_AXES,
+ num_axes ,
axislabels);
min = 0;
max = TOUCH_AXIS_MAX;
More information about the xorg-commit
mailing list