Skip to contentSkip to conversation

xen,input: xen-kbdfront pointing device resolution support

PATCH Superseded Juergen Gross 2 participants 21 messages Mar 21, 2017 – Apr 11, 2017

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover xen,input: xen-kbdfront pointing device resolution support

As my patch tying the resolution of the xen pointing device to that of the framebuffer wasn't accepted add support for different resolutions via a module parameter.

Another possibility would be to set parameters via Xenstore, but this is broken (patch 2 fixes that) and not yet supported by Xen tools.

Juergen Gross (2):
xen,input: add xen-kbdfront module parameter for setting resolution xen,input: repair xen-kbdfront resolution setting via xenstore

 drivers/input/misc/xen-kbdfront.c | 42 ++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 14 deletions(-)
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 1/2 xen,input: add xen-kbdfront module parameter for setting resolution

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
 drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/input/misc/xen-kbdfront.c +8 -2
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
 	char phys[32];
 };
 
+enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);
+MODULE_PARM_DESC(size,
+	"Pointing device width, height in pixels (default 800,600)");
+
 static int xenkbd_remove(struct xenbus_device *);
 static int xenkbd_connect_backend(struct xenbus_device *, struct xenkbd_info *);
 static void xenkbd_disconnect_backend(struct xenkbd_info *);
@@ -174,8 +180,8 @@ static int xenkbd_probe(struct xenbus_device *dev,
 
 	if (abs) {
 		__set_bit(EV_ABS, ptr->evbit);
-		input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-		input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+		input_set_abs_params(ptr, ABS_X, 0, size[KPARAM_WIDTH], 0, 0);
+		input_set_abs_params(ptr, ABS_Y, 0, size[KPARAM_HEIGHT], 0, 0);
 	} else {
 		input_set_capability(ptr, EV_REL, REL_X);
 		input_set_capability(ptr, EV_REL, REL_Y);
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#14 lore raw

PATCH 2/2 xen,input: repair xen-kbdfront resolution setting via xenstore

In reply to Juergen Gross

Setting the pointing device resolution via Xenstore isn't working
reliably: in case XenbusStateInitWait has been missed the resolution settings won't be read. Correct this.

---
 drivers/input/misc/xen-kbdfront.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)
drivers/input/misc/xen-kbdfront.c +20 -12
index 2df5678..7585fa4 100644
@@ -312,11 +312,27 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info)
 	info->gref = -1;
 }
 
+static void xenkbd_set_connected(struct xenbus_device *dev)
+{
+	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
+	int ret;
+
+	if (xenbus_read_unsigned(info->xbdev->otherend,
+				 "feature-abs-pointer", 0)) {
+		ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
+				   "request-abs-pointer", "1");
+		if (ret)
+			pr_warn("xenkbd: can't request abs-pointer");
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+}
+
 static void xenkbd_backend_changed(struct xenbus_device *dev,
 				   enum xenbus_state backend_state)
 {
 	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
-	int ret, val;
+	int val;
 
 	switch (backend_state) {
 	case XenbusStateInitialising:
@@ -327,16 +343,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
 		break;
 
 	case XenbusStateInitWait:
-InitWait:
-		if (xenbus_read_unsigned(info->xbdev->otherend,
-					 "feature-abs-pointer", 0)) {
-			ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
-					   "request-abs-pointer", "1");
-			if (ret)
-				pr_warning("xenkbd: can't request abs-pointer");
-		}
-
-		xenbus_switch_state(dev, XenbusStateConnected);
+		xenkbd_set_connected(dev);
 		break;
 
 	case XenbusStateConnected:
@@ -346,7 +353,8 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
 		 * get Connected twice here.
 		 */
 		if (dev->state != XenbusStateConnected)
-			goto InitWait; /* no InitWait seen yet, fudge it */
+			/* No InitWait seen yet, fudge it. */
+			xenkbd_set_connected(dev);
 
 		/* Set input abs params to match backend screen res */
 		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#17 lore raw
In reply to Juergen Gross
Quoted 7 lines · Juergen Gross

As my patch tying the resolution of the xen pointing device to that of the framebuffer wasn't accepted add support for different resolutions via a module parameter.

Another possibility would be to set parameters via Xenstore, but this is broken (patch 2 fixes that) and not yet supported by Xen tools.

Quoted 7 lines

Juergen Gross (2):
xen,input: add xen-kbdfront module parameter for setting resolution xen,input: repair xen-kbdfront resolution setting via xenstore

 drivers/input/misc/xen-kbdfront.c | 42 ++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 14 deletions(-)

Ping?

Juergen

#20 lore raw

Re: [PATCH 0/2] xen, input: xen-kbdfront pointing device resolution support

In reply to Juergen Gross
Quoted 7 lines · Juergen Gross

As my patch tying the resolution of the xen pointing device to that of the framebuffer wasn't accepted add support for different resolutions via a module parameter.

Another possibility would be to set parameters via Xenstore, but this is broken (patch 2 fixes that) and not yet supported by Xen tools.

Quoted 7 lines

Juergen Gross (2):
xen,input: add xen-kbdfront module parameter for setting resolution xen,input: repair xen-kbdfront resolution setting via xenstore

 drivers/input/misc/xen-kbdfront.c | 42 ++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 14 deletions(-)

Ping?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#18 lore raw

Re: [Xen-devel] [PATCH 0/2] xen, input: xen-kbdfront pointing device resolution support

In reply to Juergen Gross

Hi, all and ping2

I am also interested in the destiny of this patch

as I am planning to base multi-touch support on it

Dmitry, I would appreciate if you could review the patch

as it is hanging around for quite a while now

Thank you,
Oleksandr

Quoted 24 lines · Juergen Gross
Quoted 7 lines · Juergen Gross

As my patch tying the resolution of the xen pointing device to that of the framebuffer wasn't accepted add support for different resolutions via a module parameter.

Another possibility would be to set parameters via Xenstore, but this is broken (patch 2 fixes that) and not yet supported by Xen tools.

Quoted 7 lines

Juergen Gross (2):
xen,input: add xen-kbdfront module parameter for setting resolution xen,input: repair xen-kbdfront resolution setting via xenstore

  drivers/input/misc/xen-kbdfront.c | 42 ++++++++++++++++++++++++++-------------
  1 file changed, 28 insertions(+), 14 deletions(-)

Ping?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#19 lore raw

Re: [PATCH 0/2] xen, input: xen-kbdfront pointing device resolution support

In reply to Juergen Gross

Hi, all and ping2

I am also interested in the destiny of this patch

as I am planning to base multi-touch support on it

Dmitry, I would appreciate if you could review the patch

as it is hanging around for quite a while now

Thank you,
Oleksandr

Quoted 18 lines · Juergen Gross
Quoted 7 lines · Juergen Gross

As my patch tying the resolution of the xen pointing device to that of the framebuffer wasn't accepted add support for different resolutions via a module parameter.

Another possibility would be to set parameters via Xenstore, but this is broken (patch 2 fixes that) and not yet supported by Xen tools.

Quoted 7 lines

Juergen Gross (2):
xen,input: add xen-kbdfront module parameter for setting resolution xen,input: repair xen-kbdfront resolution setting via xenstore

  drivers/input/misc/xen-kbdfront.c | 42 ++++++++++++++++++++++++++-------------
  1 file changed, 28 insertions(+), 14 deletions(-)

Ping?

Quoted 6 lines

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Juergen Gross

Hi, Juergen!

Quoted 13 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
  drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/input/misc/xen-kbdfront.c +0 -0
index 3900875..2df5678 100644

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 46

Quoted 6 lines
drivers/input/misc/xen-kbdfront.c +3 -0
@@ -41,6 +41,12 @@ struct xenkbd_info {
  	char phys[32];
  };
 
+enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 7 lines
drivers/input/misc/xen-kbdfront.c +3 -0
+MODULE_PARM_DESC(size,
+	"Pointing device width, height in pixels (default 800,600)");
+
  static int xenkbd_remove(struct xenbus_device *);
  static int xenkbd_connect_backend(struct xenbus_device *, struct xenkbd_info *);
  static void xenkbd_disconnect_backend(struct xenkbd_info *);

drivers/input/misc/xen-kbdfront.c static int xenkbd_probe(struct xenbus_device *dev, · line 187

Quoted 10 lines
drivers/input/misc/xen-kbdfront.c +2 -2
@@ -174,8 +180,8 @@ static int xenkbd_probe(struct xenbus_device *dev,
 
  	if (abs) {
  		__set_bit(EV_ABS, ptr->evbit);
-		input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-		input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+		input_set_abs_params(ptr, ABS_X, 0, size[KPARAM_WIDTH], 0, 0);
+		input_set_abs_params(ptr, ABS_Y, 0, size[KPARAM_HEIGHT], 0, 0);
  	} else {
  		input_set_capability(ptr, EV_REL, REL_X);
  		input_set_capability(ptr, EV_REL, REL_Y);

Thank you,
Oleksandr

#13 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Juergen Gross

Hi, Juergen!

Quoted 13 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
  drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/input/misc/xen-kbdfront.c +0 -0
index 3900875..2df5678 100644

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 46

Quoted 6 lines
drivers/input/misc/xen-kbdfront.c +3 -0
@@ -41,6 +41,12 @@ struct xenkbd_info {
  	char phys[32];
  };
 
+enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 7 lines
drivers/input/misc/xen-kbdfront.c +3 -0
+MODULE_PARM_DESC(size,
+	"Pointing device width, height in pixels (default 800,600)");
+
  static int xenkbd_remove(struct xenbus_device *);
  static int xenkbd_connect_backend(struct xenbus_device *, struct xenkbd_info *);
  static void xenkbd_disconnect_backend(struct xenkbd_info *);

drivers/input/misc/xen-kbdfront.c static int xenkbd_probe(struct xenbus_device *dev, · line 187

Quoted 10 lines
drivers/input/misc/xen-kbdfront.c +2 -2
@@ -174,8 +180,8 @@ static int xenkbd_probe(struct xenbus_device *dev,
 
  	if (abs) {
  		__set_bit(EV_ABS, ptr->evbit);
-		input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-		input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+		input_set_abs_params(ptr, ABS_X, 0, size[KPARAM_WIDTH], 0, 0);
+		input_set_abs_params(ptr, ABS_Y, 0, size[KPARAM_HEIGHT], 0, 0);
  	} else {
  		input_set_capability(ptr, EV_REL, REL_X);
  		input_set_capability(ptr, EV_REL, REL_Y);

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Oleksandr Andrushchenko
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
  drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
      char phys[32];
  };
  +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

You can see the settings in sysfs.

The values are settable via boot parameter.

Juergen

#12 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Oleksandr Andrushchenko
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
  drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
      char phys[32];
  };
  +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

You can see the settings in sysfs.

The values are settable via boot parameter.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Juergen Gross
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
   drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
   1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
       char phys[32];
   };
   +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 2 lines

Juergen

Thank you,
Oleksandr

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Juergen Gross
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
   drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
   1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
       char phys[32];
   };
   +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 2 lines

Juergen

Thank you,
Oleksandr

#6 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

Quoted 33 lines · Oleksandr Andrushchenko
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
   drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
   1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
       char phys[32];
   };
   +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

Quoted 8 lines

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10. Up to then we need a workaround.

But you are right: The module parameters should be updated with the values read from Xenstore.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#7 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Oleksandr Andrushchenko
Quoted 33 lines · Oleksandr Andrushchenko
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
   drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
   1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
       char phys[32];
   };
   +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

Quoted 8 lines

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10. Up to then we need a workaround.

But you are right: The module parameters should be updated with the values read from Xenstore.

Juergen

#8 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

Quoted 41 lines · Juergen Gross
Quoted 32 lines · Oleksandr Andrushchenko
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
    drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
        char phys[32];
    };
    +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

Quoted 8 lines

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 2 lines

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10.

ah, good to know. btw, if you are about to add width/height for the pointer device will you also add the same for multi-touch?

Quoted 8 lines

Up to then we need a
workaround.

But you are right: The module parameters should be updated with the values read from Xenstore.

Juergen

#11 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Juergen Gross
Quoted 41 lines · Juergen Gross
Quoted 32 lines · Oleksandr Andrushchenko
Quoted 26 lines · Juergen Gross
Quoted 11 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 8 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
    drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
        char phys[32];
    };
    +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

Quoted 8 lines

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 2 lines

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10.

ah, good to know. btw, if you are about to add width/height for the pointer device will you also add the same for multi-touch?

Quoted 8 lines

Up to then we need a
workaround.

But you are right: The module parameters should be updated with the values read from Xenstore.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v1 2/2
#15 lore raw

Re: [Xen-devel] [PATCH 2/2] xen, input: repair xen-kbdfront resolution setting via xenstore

In reply to Juergen Gross
Quoted 62 lines · Juergen Gross

Setting the pointing device resolution via Xenstore isn't working
reliably: in case XenbusStateInitWait has been missed the resolution settings won't be read. Correct this.

---
  drivers/input/misc/xen-kbdfront.c | 32 ++++++++++++++++++++------------
  1 file changed, 20 insertions(+), 12 deletions(-)
drivers/input/misc/xen-kbdfront.c +18 -11
index 2df5678..7585fa4 100644
@@ -312,11 +312,27 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info)
  	info->gref = -1;
  }
 
+static void xenkbd_set_connected(struct xenbus_device *dev)
+{
+	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
+	int ret;
+
+	if (xenbus_read_unsigned(info->xbdev->otherend,
+				 "feature-abs-pointer", 0)) {
+		ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
+				   "request-abs-pointer", "1");
+		if (ret)
+			pr_warn("xenkbd: can't request abs-pointer");
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+}
+
  static void xenkbd_backend_changed(struct xenbus_device *dev,
  				   enum xenbus_state backend_state)
  {
  	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
-	int ret, val;
+	int val;
 
  	switch (backend_state) {
  	case XenbusStateInitialising:
@@ -327,16 +343,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
  		break;
 
  	case XenbusStateInitWait:
-InitWait:
-		if (xenbus_read_unsigned(info->xbdev->otherend,
-					 "feature-abs-pointer", 0)) {
-			ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
-					   "request-abs-pointer", "1");
-			if (ret)
-				pr_warning("xenkbd: can't request abs-pointer");
-		}
-
-		xenbus_switch_state(dev, XenbusStateConnected);
+		xenkbd_set_connected(dev);
  		break;
 
  	case XenbusStateConnected:

drivers/input/misc/xen-kbdfront.c static void xenkbd_backend_changed(struct xenbus_device *dev, · line 360

Quoted 9 lines
drivers/input/misc/xen-kbdfront.c +2 -1
@@ -346,7 +353,8 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
  		 * get Connected twice here.
  		 */
  		if (dev->state != XenbusStateConnected)
-			goto InitWait; /* no InitWait seen yet, fudge it */
+			/* No InitWait seen yet, fudge it. */
+			xenkbd_set_connected(dev);
 
  		/* Set input abs params to match backend screen res */
  		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
Reviewed-by on v1 2/2
#16 lore raw

Re: [PATCH 2/2] xen, input: repair xen-kbdfront resolution setting via xenstore

In reply to Juergen Gross
Quoted 62 lines · Juergen Gross

Setting the pointing device resolution via Xenstore isn't working
reliably: in case XenbusStateInitWait has been missed the resolution settings won't be read. Correct this.

---
  drivers/input/misc/xen-kbdfront.c | 32 ++++++++++++++++++++------------
  1 file changed, 20 insertions(+), 12 deletions(-)
drivers/input/misc/xen-kbdfront.c +18 -11
index 2df5678..7585fa4 100644
@@ -312,11 +312,27 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info)
  	info->gref = -1;
  }
 
+static void xenkbd_set_connected(struct xenbus_device *dev)
+{
+	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
+	int ret;
+
+	if (xenbus_read_unsigned(info->xbdev->otherend,
+				 "feature-abs-pointer", 0)) {
+		ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
+				   "request-abs-pointer", "1");
+		if (ret)
+			pr_warn("xenkbd: can't request abs-pointer");
+	}
+
+	xenbus_switch_state(dev, XenbusStateConnected);
+}
+
  static void xenkbd_backend_changed(struct xenbus_device *dev,
  				   enum xenbus_state backend_state)
  {
  	struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
-	int ret, val;
+	int val;
 
  	switch (backend_state) {
  	case XenbusStateInitialising:
@@ -327,16 +343,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
  		break;
 
  	case XenbusStateInitWait:
-InitWait:
-		if (xenbus_read_unsigned(info->xbdev->otherend,
-					 "feature-abs-pointer", 0)) {
-			ret = xenbus_write(XBT_NIL, info->xbdev->nodename,
-					   "request-abs-pointer", "1");
-			if (ret)
-				pr_warning("xenkbd: can't request abs-pointer");
-		}
-
-		xenbus_switch_state(dev, XenbusStateConnected);
+		xenkbd_set_connected(dev);
  		break;
 
  	case XenbusStateConnected:

drivers/input/misc/xen-kbdfront.c static void xenkbd_backend_changed(struct xenbus_device *dev, · line 360

Quoted 9 lines
drivers/input/misc/xen-kbdfront.c +2 -1
@@ -346,7 +353,8 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
  		 * get Connected twice here.
  		 */
  		if (dev->state != XenbusStateConnected)
-			goto InitWait; /* no InitWait seen yet, fudge it */
+			/* No InitWait seen yet, fudge it. */
+			xenkbd_set_connected(dev);
 
  		/* Set input abs params to match backend screen res */
  		if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#9 lore raw

Re: [Xen-devel] [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Oleksandr Andrushchenko
Quoted 44 lines · Oleksandr Andrushchenko
Quoted 43 lines · Juergen Gross
Quoted 42 lines · Oleksandr Andrushchenko
Quoted 28 lines · Juergen Gross
Quoted 13 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 10 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to
be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
    drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
        char phys[32];
    };
    +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 5 lines
Quoted 2 lines

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10.

ah, good to know. btw, if you are about to add width/height for the pointer device will you also add the same for multi-touch?

My plan is to add a way to set the resolution of the graphical console. This will set framebuffer and pointing device resolution in Xenstore. In case the pointing device is multi-touch the setting should be done for that device, too.

Juergen

#10 lore raw

Re: [PATCH 1/2] xen, input: add xen-kbdfront module parameter for setting resolution

In reply to Oleksandr Andrushchenko
Quoted 44 lines · Oleksandr Andrushchenko
Quoted 43 lines · Juergen Gross
Quoted 42 lines · Oleksandr Andrushchenko
Quoted 28 lines · Juergen Gross
Quoted 13 lines · Oleksandr Andrushchenko

Hi, Juergen!

Quoted 10 lines · Juergen Gross

Add a parameter for setting the resolution of xen-kbdfront in order to
be able to cope with a (virtual) frame buffer of arbitrary resolution.

---
    drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 14 lines

drivers/input/misc/xen-kbdfront.c struct xenkbd_info { · line 45

Quoted 11 lines
drivers/input/misc/xen-kbdfront.c +2 -0
index 3900875..2df5678 100644
@@ -41,6 +41,12 @@ struct xenkbd_info {
        char phys[32];
    };
    +enum { KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT };
+static int size[KPARAM_CNT] = { XENFB_WIDTH, XENFB_HEIGHT };
+module_param_array(size, int, NULL, 0444);

is this by intention that you use 0444 here? It means read-only, thus one cannot change these, so what is the point of the module parameters then?

Quoted 1 line

You can see the settings in sysfs.

this is good so we can see actual width/height used by the pv driver

Quoted 1 line

The values are settable via boot parameter.

but then, if one has other values set in XenStore, these will/may be overridden, making it inconsistent, e.g. values loaded at start as module parameters (*size* array) is not going to be updated on XenbusStateInitWait/XenbusStateConnected. So, we'll end up with wrong parameters shown via sysfs one more question is why do we need module parameters if the same can be read from XenStore?

Quoted 5 lines
Quoted 2 lines

Because up to now nobody is setting the Xenstore values. This is something I'm planning to do for Xen 4.10.

ah, good to know. btw, if you are about to add width/height for the pointer device will you also add the same for multi-touch?

My plan is to add a way to set the resolution of the graphical console. This will set framebuffer and pointing device resolution in Xenstore. In case the pointing device is multi-touch the setting should be done for that device, too.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel