Re: wsmoused broken since 9.1

2020-12-23 Thread RVP

On Wed, 23 Dec 2020, Martin Husemann wrote:


Can you narrow down the pullup that broke it?


I can only tell you when I noticed it. It was OK in 
9.0 RELEASE; then I tried one of the final 9.0-STABLE

images (the last or next-to-last) before 9.1 and found
the bug.


Is it still broken in -current?


Yes.

-RVP


Re: EDID from multiple displays using ioctl(WSDISPLAYIO_GET_EDID)

2020-12-23 Thread RVP

On Wed, 23 Dec 2020, Michael van Elst wrote:


If you had multiple wsdisplay* instances, there would be some
corresponding ttyE* that you could send the ioctl to.


Hmm: wsdisplay0 at intelfb0; wsdisplay1 at nouveaufb0 ?
What about multiple multiple monitors connected to
the same card?

-RVP


Re: wsmoused broken since 9.1

2020-12-23 Thread Martin Husemann
On Wed, Dec 23, 2020 at 06:56:31AM +, RVP wrote:
> /usr/sbin/wsmoused has been non-working since slightly
> before 9.1 was released. Specifically, any button click
> or release generates:

Can you narrow down the pullup that broke it? Is it still broken in -current?
I see nothing obvious in CHANGES-9.1.

Martin


wsmoused broken since 9.1

2020-12-23 Thread RVP

/usr/sbin/wsmoused has been non-working since slightly
before 9.1 was released. Specifically, any button click
or release generates:

wsmoused: ioctl(WSDISPLAYIO_GETWSCHAR) failed: Invalid argument

and click+drags produce a torrent of the same. Here is a patch
which fixes this problem:

---START---
diff -urN a/wsmoused/selection.c b/wsmoused/selection.c
--- a/wsmoused/selection.c  2007-05-27 15:05:00.0 +
+++ b/wsmoused/selection.c  2020-10-21 06:17:38.666544347 +
@@ -144,6 +144,7 @@
 static void selarea_start(void);
 static void selarea_end(void);
 static void selarea_calculate(void);
+static void selarea_getrowcol(size_t, size_t*, size_t*);
 static void selarea_hide(void);
 static void selarea_show(void);
 static void selarea_paste(void);
@@ -624,14 +625,29 @@

 /* -- */

+/* Turns selection absolute position in the screen buffer back into
+   row, col co-ordinates */
+static void
+selarea_getrowcol(size_t pos, size_t* row, size_t* col)
+{
+   size_t xres = Selmouse.sm_max_x + 1;
+
+   *row = pos / xres;
+   *col = pos - (*row * xres);
+}
+
+/* -- */
+
 /* Hides the highlighted region, returning it to normal colors. */
 static void
 selarea_hide(void)
 {
-   size_t i;
+   size_t i, row, col;

-   for (i = Selarea.sa_startoff; i <= Selarea.sa_endoff; i++)
-   char_invert(0, i);
+   for (i = Selarea.sa_startoff; i <= Selarea.sa_endoff; i++) {
+   selarea_getrowcol(i, &row, &col);
+   char_invert(row, col);
+   }
 }

 /* -- */
@@ -640,11 +656,13 @@
 static void
 selarea_show(void)
 {
-   size_t i;
+   size_t i, row, col;

selarea_calculate();
-   for (i = Selarea.sa_startoff; i <= Selarea.sa_endoff; i++)
-   char_invert(0, i);
+   for (i = Selarea.sa_startoff; i <= Selarea.sa_endoff; i++) {
+   selarea_getrowcol(i, &row, &col);
+   char_invert(row, col);
+   }
 }

 /* -- */
diff -urN a/wsmoused/wsmoused.c b/wsmoused/wsmoused.c
--- a/wsmoused/wsmoused.c   2011-05-31 03:37:02.0 +
+++ b/wsmoused/wsmoused.c   2020-10-21 06:17:38.666544347 +
@@ -71,7 +71,7 @@
 static int X_Console = -1;
 static int X_Console_Delay = 5;

-#ifdef WSMOUSED_SELECTION_MODE
+#ifdef WSMOUSED_ACTION_MODE
 extern struct mode_bootstrap Action_Mode;
 #endif
 #ifdef WSMOUSED_SELECTION_MODE
---END---

Thanks,
-RVP


EDID from multiple displays using ioctl(WSDISPLAYIO_GET_EDID)

2020-12-23 Thread RVP

Is there a way to retrieve EDID data from displays other than
the default one using ioctl(WSDISPLAYIO_GET_EDID) ?

On my Asus X202E laptop with 3 physical outputs (LVDS, VGA, HDMI)
the ioctl gets the EDID only of the LVDS panel. This is for
situations where X is not running/can't run and xrandr unavailable.

-RVP


Re: EDID from multiple displays using ioctl(WSDISPLAYIO_GET_EDID)

2020-12-23 Thread Michael van Elst
On Wed, Dec 23, 2020 at 07:36:10AM +, RVP wrote:
> On Wed, 23 Dec 2020, Michael van Elst wrote:
> 
> > If you had multiple wsdisplay* instances, there would be some
> > corresponding ttyE* that you could send the ioctl to.
> 
> Hmm: wsdisplay0 at intelfb0; wsdisplay1 at nouveaufb0 ?
> What about multiple multiple monitors connected to
> the same card?

The driver would need to create multiple instances, and I doubt
that this works with the current code base.


Greetings,
-- 
Michael van Elst
Internet: mlel...@serpens.de
"A potential Snark may lurk in every tree."