Re: [PATCH app/xkbcomp] pkgconfig: Add our bindir to xkbcomp.pc

2018-02-12 Thread Peter Hutterer
On Sat, Feb 10, 2018 at 03:51:05PM +, Jon Turney wrote:
> On 07/11/2017 05:16, Peter Hutterer wrote:
> > On Mon, Nov 06, 2017 at 12:55:20PM -0500, Adam Jackson wrote:
> > > Signed-off-by: Adam Jackson 
> > > ---
> > >   xkbcomp.pc.in | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/xkbcomp.pc.in b/xkbcomp.pc.in
> > > index b8d6023..4d138c8 100644
> > > --- a/xkbcomp.pc.in
> > > +++ b/xkbcomp.pc.in
> > > @@ -1,4 +1,5 @@
> > >   prefix=@prefix@
> > > +bindir=@bindir@
> > >   datarootdir=@datarootdir@
> > >   datadir=@datadir@
> > >   xkbconfigdir=@XKBCONFIGROOT@
> > > -- 
> > > 2.14.3
> > for some reason this doesn't work here. It gets replaced with:
> > bindir=${exec_prefix}/bin
> > 
> > but exec_prefix isn't set. With a --prefix=/opt/xorg, I still get:
> > $> pkg-config --variable bindir xkbcomp
> > /bin
> > 
> > Adding this fixed it:
> > 
> > diff --git a/xkbcomp.pc.in b/xkbcomp.pc.in
> > index 4d138c8..a4791a9 100644
> > --- a/xkbcomp.pc.in
> > +++ b/xkbcomp.pc.in
> > @@ -1,4 +1,5 @@
> >   prefix=@prefix@
> > +exec_prefix=@exec_prefix@
> >   bindir=@bindir@
> >   datarootdir=@datarootdir@
> >   datadir=@datadir@
> > 
> 
> Yes, I found this necessary also, and I think it's correct, as bindir may be
> expressed in terms of exec_prefix.
> 
> Reviewed-by: Jon Turney 

oh, I forgot about that one. Pushed as 3e2a6ad..993d491  master -> master
now, thanks.

Cheers,
   Peter

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 5/7] Add RandR leases with modesetting driver support [v6]

2018-02-12 Thread Keith Packard
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.

v2: Restore CRTC mode when leases terminate

When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.

v3: Report RR_Rotate_0 rotations for leased crtcs.

Ignore leased CRTCs when selecting screen size.

Stop leasing encoders, the kernel doesn't do that anymore.

Turn off crtc->enabled while leased so that modesetting
ignores them.

Check lease status before calling any driver mode functions

When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.

When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.

This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).

v4: Report RR_Rotate_0 rotation for leased crtcs.

v5: Terminate all leases on server reset.

Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.

Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.

Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that

   modesetting: Validate leases on VT enter

The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.

   xfree86: hide disabled cursors when resetting after lease termination

The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.

v6: Add meson build infrastructure

Signed-off-by: Keith Packard 
---
 configure.ac |   2 +-
 hw/xfree86/drivers/modesetting/driver.c  |   3 +
 hw/xfree86/drivers/modesetting/drmmode_display.c | 153 +-
 hw/xfree86/drivers/modesetting/drmmode_display.h |   6 +
 hw/xfree86/modes/xf86Crtc.c  |  24 +-
 hw/xfree86/modes/xf86Crtc.h  |  76 +
 hw/xfree86/modes/xf86Cursors.c   |   6 +-
 hw/xfree86/modes/xf86RandR12.c   | 128 +
 include/protocol-versions.h  |   2 +-
 meson.build  |   2 +-
 randr/Makefile.am|   1 +
 randr/meson.build|   1 +
 randr/randr.c|  29 ++
 randr/randrstr.h |  68 -
 randr/rrcrtc.c   | 147 ++
 randr/rrdispatch.c   |   4 +
 randr/rrlease.c  | 351 +++
 randr/rrmode.c   |   6 +
 randr/rroutput.c | 138 +
 randr/rrproperty.c   |   6 +
 randr/rrscreen.c |   2 +-
 randr/rrsdispatch.c  |  27 ++
 22 files changed, 1064 insertions(+), 118 deletions(-)
 create mode 100644 randr/rrlease.c

diff --git a/configure.ac b/configure.ac
index 98b8ea2ed..32ea31948 100644
--- a/configure.ac
+++ b/configure.ac
@@ -742,7 +742,7 @@ LIBXSHMFENCE="xshmfence >= 1.1"
 
 dnl Required modules
 XPROTO="xproto >= 7.0.31"
-RANDRPROTO="randrproto >= 1.5.0"
+RANDRPROTO="randrproto >= 1.6.0"
 RENDERPROTO="renderproto >= 0.11"
 XEXTPROTO="xextproto >= 7.2.99.901"
 INPUTPROTO="inputproto >= 2.3"
diff --git a/hw/xfree86/drivers/modesetting/driver.c 
b/hw/xfree86/drivers/modesetting/driver.c
index e057970a6..577559ea6 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1803,6 +1803,9 @@ CloseScreen(ScreenPtr pScreen)
 free(ms->drmmode.shadow_fb2);
 ms->drmmode.shadow_fb2 = NULL;
 }
+
+

[PATCH xserver 6/7] test: Add randr lease tests [v2]

2018-02-12 Thread Keith Packard
Tests for RRCreateLease and RRFreeLease

v2: Add meson build infrastructure

meson build enables warnings and -Werror when building tests,
and this test case had a lot of warnings...

Signed-off-by: Keith Packard 
---
 configure.ac |8 +
 test/Makefile.am |2 +-
 test/meson.build |1 +
 test/randr/Makefile.am   |   14 +
 test/randr/meson.build   |8 +
 test/randr/randr_lease.c | 1063 ++
 6 files changed, 1095 insertions(+), 1 deletion(-)
 create mode 100644 test/randr/Makefile.am
 create mode 100644 test/randr/meson.build
 create mode 100644 test/randr/randr_lease.c

diff --git a/configure.ac b/configure.ac
index 32ea31948..05e2dc65e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1290,6 +1290,13 @@ if test "x$DRI" = xyes || test "x$DRI2" = xyes || test 
"x$DRI3" = xyes || test "
fi
 fi
 
+AM_CONDITIONAL(DRM, test  "x$DRM" = xyes)
+
+TEST_RANDR_REQUIRED_LIBS="xcb xcb-randr"
+PKG_CHECK_MODULES([TEST_RANDR], $TEST_RANDR_REQUIRED_LIBS)
+AC_SUBST(TEST_RANDR_CFLAGS)
+AC_SUBST(TEST_RANDR_LIBS)
+
 if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
@@ -2543,6 +2550,7 @@ hw/kdrive/ephyr/man/Makefile
 hw/kdrive/src/Makefile
 hw/xwayland/Makefile
 test/Makefile
+test/randr/Makefile
 xserver.ent
 xorg-server.pc
 ])
diff --git a/test/Makefile.am b/test/Makefile.am
index 2dbb2df03..f42b50f5e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,5 @@
 if ENABLE_UNIT_TESTS
-SUBDIRS= .
+SUBDIRS= . randr
 AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 AM_CPPFLAGS = $(XORG_INCS)
 
diff --git a/test/meson.build b/test/meson.build
index d413e9da5..c0016690f 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -25,3 +25,4 @@ endif
 
 subdir('bigreq')
 subdir('sync')
+subdir('randr')
diff --git a/test/randr/Makefile.am b/test/randr/Makefile.am
new file mode 100644
index 0..abaf8e6ac
--- /dev/null
+++ b/test/randr/Makefile.am
@@ -0,0 +1,14 @@
+randr_lease_SOURCES = \
+   randr_lease.c
+
+if DRM
+RANDR_LEASE=randr_lease
+endif
+
+noinst_PROGRAMS = $(RANDR_LEASE)
+
+TESTS = $(RANDR_LEASE)
+
+AM_CFLAGS=$(XORG_CFLAGS) $(TEST_RANDR_CFLAGS) $(LIBDRM_CFLAGS)
+
+randr_lease_LDADD = $(TEST_RANDR_LIBS) $(LIBDRM_LIBS)
diff --git a/test/randr/meson.build b/test/randr/meson.build
new file mode 100644
index 0..3193cb5c3
--- /dev/null
+++ b/test/randr/meson.build
@@ -0,0 +1,8 @@
+xcb_dep = dependency('xcb', required: false)
+xcb_randr_dep = dependency('xcb-randr', required: false)
+libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)
+
+if xcb_dep.found() and xcb_randr_dep.found() and libdrm_dep.found()
+randr_lease = executable('randr_lease', 'randr_lease.c', dependencies: 
[xcb_dep, xcb_randr_dep, libdrm_dep])
+test('randr_lease', randr_lease)
+endif
diff --git a/test/randr/randr_lease.c b/test/randr/randr_lease.c
new file mode 100644
index 0..49f204050
--- /dev/null
+++ b/test/randr/randr_lease.c
@@ -0,0 +1,1063 @@
+/*
+ * Copyright © 2017 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Test X Leases */
+
+/* Information about one lease */
+typedef struct {
+int fd;
+
+/* X resources */
+xcb_randr_output_t randr_output;
+xcb_randr_crtc_t randr_crtc;
+xcb_randr_lease_t randr_lease;
+xcb_randr_mode_info_t randr_mode;
+
+/* DRM resources */
+uint32_t crtc_id;
+uint32_t connector_id;
+drmModeModeInfo drm_mode;
+uint32_t bo_handle;
+uint32_t fb_handle;
+
+/* Frame buffer */
+uint32_t *fb;
+uint32_t size;
+uint32_t width, height, stride;
+} lease_t;
+

[PATCH xserver 7/7] modesetting: Allow a DRM fd to be passed through XF86_VIDEO_MODESETTING_FD

2018-02-12 Thread Keith Packard
This lets an application open a suitable DRM device and pass the file
descriptor to the mode setting driver through an environment variable.

There's a companion application, xlease, which creates a DRM master by
leasing an output from another X server. That is available at

git clone git://people.freedesktop.org/~keithp/xlease

Signed-off-by: Keith Packard 
---
 hw/xfree86/drivers/modesetting/driver.c | 29 -
 hw/xfree86/drivers/modesetting/driver.h |  1 +
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c 
b/hw/xfree86/drivers/modesetting/driver.c
index 577559ea6..074872e97 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -194,11 +194,28 @@ modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn)
 return pPriv->ptr;
 }
 
+static int
+get_passed_fd(void)
+{
+char *fdstr = getenv("XF86_VIDEO_MODESETTING_FD");
+
+if (fdstr) {
+char *endptr;
+int fd = strtol(fdstr, , 10);
+if (endptr != fdstr && *endptr == '\0')
+return dup(fd);
+}
+return -1;
+}
+
 static int
 open_hw(const char *dev)
 {
 int fd;
 
+if ((fd = get_passed_fd()) >= 0)
+return fd;
+
 if (dev)
 fd = open(dev, O_RDWR, 0);
 else {
@@ -822,6 +839,12 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
 return TRUE;
 }
 
+ms->fd_passed = FALSE;
+if ((ms->fd = get_passed_fd()) >= 0) {
+ms->fd_passed = TRUE;
+return TRUE;
+}
+
 #ifdef XSERVER_PLATFORM_BUS
 if (pEnt->location.type == BUS_PLATFORM) {
 if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)
@@ -1494,6 +1517,9 @@ SetMaster(ScrnInfoPtr pScrn)
 (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
 return TRUE;
 
+if (ms->fd_passed)
+return TRUE;
+
 ret = drmSetMaster(ms->fd);
 if (ret)
 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n",
@@ -1745,7 +1771,8 @@ LeaveVT(ScrnInfoPtr pScrn)
 (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))
 return;
 
-drmDropMaster(ms->fd);
+if (!ms->fd_passed)
+drmDropMaster(ms->fd);
 }
 
 /*
diff --git a/hw/xfree86/drivers/modesetting/driver.h 
b/hw/xfree86/drivers/modesetting/driver.h
index fe835918b..6be51e01b 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -84,6 +84,7 @@ struct ms_drm_queue {
 
 typedef struct _modesettingRec {
 int fd;
+Bool fd_passed;
 
 int Chipset;
 EntityInfoPtr pEnt;
-- 
2.15.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 1/7] xfree86/modes: Check for non-desktop monitors during PreInit [v2]

2018-02-12 Thread Keith Packard
At startup, we want to ignore non-desktop monitors unless we don't
find any desktop monitors. Because there are no DIX RandR resources
allocated, let the driver store this information in a new field in the
xf86Output structure and then use that value to help decide whether to
include an output as part of the default configuration.

v2:
  Suggested-by: Michel Dänzer 

  Bump XF86_CRTC_VERSION from 7 to 8. This will let out-of-tree
  drivers know whether this field is available.

Signed-off-by: Keith Packard 
Reviewed-by: Adam Jackson 
---
 hw/xfree86/modes/xf86Crtc.c | 4 ++--
 hw/xfree86/modes/xf86Crtc.h | 7 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 80aebce8a..3ed7347df 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -538,9 +538,9 @@ xf86OutputEnabled(xf86OutputPtr output, Bool strict)
 return FALSE;
 }
 
-/* If not, try to only light up the ones we know are connected */
+/* If not, try to only light up the ones we know are connected which are 
supposed to be on the desktop */
 if (strict) {
-enable = output->status == XF86OutputStatusConnected;
+enable = output->status == XF86OutputStatusConnected && 
!output->non_desktop;
 }
 /* But if that fails, try to light up even outputs we're unsure of */
 else {
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index e6ae9cc4d..ae81417f6 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -247,7 +247,7 @@ typedef struct _xf86CrtcFuncs {
 
 } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
 
-#define XF86_CRTC_VERSION 7
+#define XF86_CRTC_VERSION 8
 
 struct _xf86Crtc {
 /**
@@ -627,6 +627,11 @@ struct _xf86Output {
 /** Whether to use the old per-screen Monitor config section */
 Bool use_screen_monitor;
 
+/** For pre-init, whether the output should be excluded from the
+ * desktop when there are other viable outputs to use
+ */
+Bool non_desktop;
+
 #ifdef RANDR_12_INTERFACE
 /**
  * RandR 1.2 output structure.
-- 
2.15.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 4/7] xf86-video-modesetting: Create CONNECTOR_ID properties for outputs [v2]

2018-02-12 Thread Keith Packard
This lets a DRM client map between X outputs and kernel connectors.

v2:
Change CONNECTOR_ID to enum -- Adam Jackson 

Signed-off-by: Keith Packard 
Reviewed-by: Adam Jackson 
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 1ec232f70..775dd37b8 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1509,6 +1509,29 @@ drmmode_output_create_resources(xf86OutputPtr output)
 j++;
 }
 
+/* Create CONNECTOR_ID property */
+{
+Atomname = MakeAtom("CONNECTOR_ID", 12, TRUE);
+INT32   value = mode_output->connector_id;
+
+if (name != BAD_RESOURCE) {
+err = RRConfigureOutputProperty(output->randr_output, name,
+FALSE, FALSE, TRUE,
+1, );
+if (err != 0) {
+xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+   "RRConfigureOutputProperty error, %d\n", err);
+}
+err = RRChangeOutputProperty(output->randr_output, name,
+ XA_INTEGER, 32, PropModeReplace, 1,
+ , FALSE, FALSE);
+if (err != 0) {
+xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+   "RRChangeOutputProperty error, %d\n", err);
+}
+}
+}
+
 for (i = 0; i < drmmode_output->num_props; i++) {
 drmmode_prop_ptr p = _output->props[i];
 
-- 
2.15.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 2/7] xf86-video-modesetting: Record non-desktop kernel property at PreInit time

2018-02-12 Thread Keith Packard
Save any value of the kernel non-desktop property in the xf86Output
structure to avoid non-desktop outputs in the default configuration.

Signed-off-by: Keith Packard 
Reviewed-by: Adam Jackson 
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 9c3856378..1ec232f70 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1768,6 +1768,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, drmModeResPtr mode_r
 drmmode_output_private_ptr drmmode_output;
 char name[32];
 int i;
+Bool nonDesktop = FALSE;
 drmModePropertyBlobPtr path_blob = NULL;
 const char *s;
 koutput =
@@ -1776,6 +1777,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, drmModeResPtr mode_r
 return 0;
 
 path_blob = koutput_get_prop_blob(drmmode->fd, koutput, "PATH");
+i = koutput_get_prop_idx(drmmode->fd, koutput, DRM_MODE_PROP_RANGE, 
RR_PROPERTY_NON_DESKTOP);
+if (i >= 0)
+nonDesktop = koutput->prop_values[i] != 0;
 
 drmmode_create_name(pScrn, koutput, name, path_blob);
 
@@ -1794,6 +1798,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, drmModeResPtr mode_r
 drmmode_output = output->driver_private;
 drmmode_output->output_id = mode_res->connectors[num];
 drmmode_output->mode_output = koutput;
+output->non_desktop = nonDesktop;
 return 1;
 }
 }
@@ -1844,6 +1849,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr 
drmmode, drmModeResPtr mode_r
 output->interlaceAllowed = TRUE;
 output->doubleScanAllowed = TRUE;
 output->driver_private = drmmode_output;
+output->non_desktop = nonDesktop;
 
 output->possible_crtcs = 0x7f;
 for (i = 0; i < koutput->count_encoders; i++) {
-- 
2.15.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-12 Thread Keith Packard
Tracks changes to the non-desktop property so that when non-zero,
outputs will always appear to be disconnected.

Signed-off-by: Keith Packard 
Reviewed-by: Adam Jackson 
---
 randr/randrstr.h   |  3 +++
 randr/rroutput.c   | 26 +-
 randr/rrproperty.c | 27 +++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/randr/randrstr.h b/randr/randrstr.h
index 3f218009d..b4fe833d9 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -153,6 +153,7 @@ struct _rrOutput {
 int numUserModes;
 RRModePtr *userModes;
 Bool changed;
+Bool nonDesktop;
 RRPropertyPtr properties;
 Bool pendingProperties;
 void *devPrivate;
@@ -551,6 +552,8 @@ extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
 
 extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
 
+extern _X_EXPORT Bool RROutputSetNonDesktop(RROutputPtr output, Bool 
non_desktop);
+
 extern _X_EXPORT CARD16
  RRVerticalRefresh(xRRModeInfo * mode);
 
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 90fe4e6c1..d5c30aded 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -22,6 +22,7 @@
  */
 
 #include "randrstr.h"
+#include 
 
 RESTYPE RROutputType;
 
@@ -65,6 +66,7 @@ RROutputCreate(ScreenPtr pScreen,
 RROutputPtr output;
 RROutputPtr *outputs;
 rrScrPrivPtr pScrPriv;
+Atom nonDesktopAtom;
 
 if (!RRInit())
 return NULL;
@@ -111,6 +113,13 @@ RROutputCreate(ScreenPtr pScreen,
 
 pScrPriv->outputs[pScrPriv->numOutputs++] = output;
 
+nonDesktopAtom = MakeAtom(RR_PROPERTY_NON_DESKTOP, 
strlen(RR_PROPERTY_NON_DESKTOP), TRUE);
+if (nonDesktopAtom != BAD_RESOURCE) {
+static const INT32 values[2] = { 0, 1 };
+(void) RRConfigureOutputProperty(output, nonDesktopAtom, FALSE, FALSE, 
FALSE,
+2, values);
+}
+RROutputSetNonDesktop(output, FALSE);
 RRResourcesChanged(pScreen);
 
 return output;
@@ -311,6 +320,20 @@ RROutputSetPhysicalSize(RROutputPtr output, int mmWidth, 
int mmHeight)
 return TRUE;
 }
 
+Bool
+RROutputSetNonDesktop(RROutputPtr output, Bool nonDesktop)
+{
+const char *nonDesktopStr = RR_PROPERTY_NON_DESKTOP;
+Atom nonDesktopProp = MakeAtom(nonDesktopStr, strlen(nonDesktopStr), TRUE);
+uint32_t value = nonDesktop ? 1 : 0;
+
+if (nonDesktopProp == None || nonDesktopProp == BAD_RESOURCE)
+return FALSE;
+
+return RRChangeOutputProperty(output, nonDesktopProp, XA_INTEGER, 32,
+  PropModeReplace, 1, , TRUE, FALSE) == 
Success;
+}
+
 void
 RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
 {
@@ -330,7 +353,7 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, 
RROutputPtr output)
 .crtc = crtc ? crtc->id : None,
 .mode = mode ? mode->mode.id : None,
 .rotation = crtc ? crtc->rotation : RR_Rotate_0,
-.connection = output->connection,
+.connection = output->nonDesktop ? RR_Disconnected : 
output->connection,
 .subpixelOrder = output->subpixelOrder
 };
 WriteEventsToClient(client, 1, (xEvent *) );
@@ -442,6 +465,7 @@ ProcRRGetOutputInfo(ClientPtr client)
 .crtc = output->crtc ? output->crtc->id : None,
 .mmWidth = output->mmWidth,
 .mmHeight = output->mmHeight,
+.connection = output->nonDesktop ? RR_Disconnected : 
output->connection,
 .connection = output->connection,
 .subpixelOrder = output->subpixelOrder,
 .nCrtcs = output->numCrtcs,
diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 6ffe91a47..6598f6259 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -23,6 +23,7 @@
 #include "randrstr.h"
 #include "propertyst.h"
 #include "swaprep.h"
+#include 
 
 static int
 DeliverPropertyEvent(WindowPtr pWin, void *value)
@@ -132,6 +133,29 @@ RRDeleteOutputProperty(RROutputPtr output, Atom property)
 }
 }
 
+static void
+RRNoticePropertyChange(RROutputPtr output, Atom property, RRPropertyValuePtr 
value)
+{
+const char *non_desktop_str = RR_PROPERTY_NON_DESKTOP;
+Atom non_desktop_prop = MakeAtom(non_desktop_str, strlen(non_desktop_str), 
FALSE);
+
+if (property == non_desktop_prop) {
+if (value->type == XA_INTEGER && value->format == 32 && value->size >= 
1) {
+uint32_t nonDesktopData;
+BoolnonDesktop;
+
+memcpy(, value->data, sizeof (nonDesktopData));
+nonDesktop = nonDesktopData != 0;
+
+if (nonDesktop != output->nonDesktop) {
+output->nonDesktop = nonDesktop;
+RROutputChanged(output, 0);
+RRTellChanged(output->pScreen);
+}
+}
+}
+}
+
 int
 RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len,
@@ -235,6 +259,9 @@ RRChangeOutputProperty(RROutputPtr output, 

[PATCH xserver 0/7] non-desktop and lease series

2018-02-12 Thread Keith Packard
Here's a rebased version of the current non-desktop and RandR lease
patches, including support for both in the xf86-video-modesetting
driver.

-keith

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver] glx: Only assign 8 bpc fbconfigs for composite visuals.

2018-02-12 Thread Adam Jackson
On Fri, 2018-02-09 at 15:20 +0200, Timo Aaltonen wrote:
> On 07.02.2018 16:18, Mario Kleiner wrote:
> 
> > Thanks for the review and merge. This also needs to get picked into the
> > server 1.19 branch. Are there plans to tag a new 1.19.7 release soon?
> > I'm worried that if spring distro updates like Ubuntu 18.04 LTS would
> > ship with Mesa 18.0 + server 1.19.6, instead of a 1.19.7 with these
> > fixes, the 10 bpc related issues and the new sRGB Intel DRI stuff could
> > cause quite a bit of pain for distro users without the fixes in the 1.19
> > branch, e.g., disappering menus in firefox and GNU/Octave under desktop
> > composition, depending on the ddx in use and the phase of the moon.
> 
> 1.19.7 would be nice, my wishlist would also include the OutputClass
> commits from last year, but that might be pushing too far..

If you give me a branch I can merge with the OutputClass bits
backported, that'd be great. I don't have a particularly pressing need
for it so I'm not likely to get to that one myself.

I've merged this change to 1.19.x. I'd like to fix the animated cursor
regression (see "Restore monitoring of animated cursors" patch series)
and then release .7, so any review or additional cherry pick
suggestions would be appreciated.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 1/2] animcur: Change which CursorPtr we save in external state

2018-02-12 Thread Adam Jackson
On Mon, 2018-02-12 at 15:35 -0500, Adam Jackson wrote:
> Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
> NULL if not animated). That value would also be available in
> spriteInfo->sprite->current, so instead lets use anim.pCursor to point
> to the current animation element.

Note that this is arguably an ABI change, but I strongly doubt there's
any driver that would notice. I mention it because this series is
intended to fix a regression for 1.19.7's sake; if we actually consider
this an ABI change then I'd need to fix this another way in 1.19.x.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 2/2] xfixes: Restore monitoring of animated cursors

2018-02-12 Thread Adam Jackson
This was broken by:

commit aa6651f83c698e8cc40de61aad36c73ca7a6adcf
Author: Adam Jackson 
Date:   Thu Jun 8 16:23:12 2017 -0400

xfixes: Remove the CursorCurrent array

As of that change we look up the current cursor dynamically instead of
trying to track every time it's set through ->DisplayCursor. That would
work, except the 'bits' of an animated cursor is a transparent 1x1
pixel. So now, look up whether there's an animated cursor, and use its
current frame if so.

Signed-off-by: Adam Jackson 
---
 xfixes/cursor.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index cb38796c0..d4b68f3af 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -134,8 +134,11 @@ Bool EnableCursor = TRUE;
 static CursorPtr
 CursorForDevice(DeviceIntPtr pDev)
 {
-if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite)
+if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) {
+if (pDev->spriteInfo->anim.pCursor)
+return pDev->spriteInfo->anim.pCursor;
 return pDev->spriteInfo->sprite->current;
+}
 
 return NULL;
 }
-- 
2.14.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 1/2] animcur: Change which CursorPtr we save in external state

2018-02-12 Thread Adam Jackson
Formerly spriteInfo->anim.pCursor would point to the animated cursor (or
NULL if not animated). That value would also be available in
spriteInfo->sprite->current, so instead lets use anim.pCursor to point
to the current animation element.

Signed-off-by: Adam Jackson 
---
 render/animcur.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/render/animcur.c b/render/animcur.c
index b5d222bc6..65327df65 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
 ScreenPtr pScreen = dev->spriteInfo->anim.pScreen;
 AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
 
-AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor);
+AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current);
 int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt;
 DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor;
 
@@ -147,6 +147,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
 pScreen->DisplayCursor = DisplayCursor;
 
 dev->spriteInfo->anim.elt = elt;
+dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor;
 
 return ac->elts[elt].delay;
 }
@@ -154,7 +155,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg)
 static void
 AnimCurCancelTimer(DeviceIntPtr pDev)
 {
-CursorPtr cur = pDev->spriteInfo->anim.pCursor;
+CursorPtr cur = pDev->spriteInfo->sprite->current;
 
 if (IsAnimCur(cur))
 TimerCancel(GetAnimCur(cur)->timer);
@@ -171,7 +172,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, 
CursorPtr pCursor)
 
 Unwrap(as, pScreen, DisplayCursor);
 if (IsAnimCur(pCursor)) {
-if (pCursor != pDev->spriteInfo->anim.pCursor) {
+if (pCursor != pDev->spriteInfo->sprite->current) {
 AnimCurPtr ac = GetAnimCur(pCursor);
 
 AnimCurCancelTimer(pDev);
-- 
2.14.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xorgproto 0/2] randr: Add leases and non-desktop property

2018-02-12 Thread Adam Jackson
On Mon, 2018-02-05 at 12:39 -0800, Keith Packard wrote:
> I've just taken my randrproto patches and cherry-picked them into
> xorgproto, then cleaned up the bits for the randrproto version
> number.

Merged:

To ssh://git.freedesktop.org/git/xorg/proto/xorgproto
   0da7778..e681f8d  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[ANNOUNCE] xorgproto 2018.2

2018-02-12 Thread Adam Jackson
This release fixes various version numbers and include paths, corrects
an error in the RANDR specification, and adds the meson build system
which was erroneously left out of 2018.1.

Adam Jackson (6):
  meson: Fix xf86driproto.pc
  presentproto: Fix version number (1.1 not 1.0)
  kbproto: Fix version number (1.0.7 not 1.0.6)
  xproto: Bump to 7.0.32
  autotools: Distribute the meson build system
  xorgproto 2018.2

Giuseppe Bilotta (1):
  randr: MONITORINFO has outputs, not crtcs

git tag: xorgproto-2018.2

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.bz2
MD5:  490677ddbc649b177eda7ddb8d3e2074  xorgproto-2018.2.tar.bz2
SHA1: 71e3c4d94266e6022963f7be32a9160e41d4800e  xorgproto-2018.2.tar.bz2
SHA256: 9709c08b65d8371637605db97247782d1f0fa0bfd2111e37999088bb11996e64  
xorgproto-2018.2.tar.bz2
SHA512: 
29ac0479de321eb921b1d902e4670e9e856f8b50c95c07a855aea122e5c9762ff34d01dbda9c795e4c652b09e21151f024aa7ba54bd463e14263db5240418862
  xorgproto-2018.2.tar.bz2
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.bz2.sig

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.gz
MD5:  f3232d78ceaf7e9d108fe61f7fd53156  xorgproto-2018.2.tar.gz
SHA1: 976dd33c436de05ea11c49e7dcb96e3ff31ea6bd  xorgproto-2018.2.tar.gz
SHA256: 2ea043125faad276e3529cff871e835929fe28f7e2009517ff1aae8f6fc84663  
xorgproto-2018.2.tar.gz
SHA512: 
31bff77c54e4832dbd55534b90606e49b2face0356245edd7d6028f26b06fa9e95dab63aed23d55f8552291fa384f65dde2f223b96cc705e98c425a1d0dd3d4b
  xorgproto-2018.2.tar.gz
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.gz.sig

- ajax
___
xorg-announce mailing list
xorg-announce@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-announce


[ANNOUNCE] xorgproto 2018.2

2018-02-12 Thread Adam Jackson
This release fixes various version numbers and include paths, corrects
an error in the RANDR specification, and adds the meson build system
which was erroneously left out of 2018.1.

Adam Jackson (6):
  meson: Fix xf86driproto.pc
  presentproto: Fix version number (1.1 not 1.0)
  kbproto: Fix version number (1.0.7 not 1.0.6)
  xproto: Bump to 7.0.32
  autotools: Distribute the meson build system
  xorgproto 2018.2

Giuseppe Bilotta (1):
  randr: MONITORINFO has outputs, not crtcs

git tag: xorgproto-2018.2

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.bz2
MD5:  490677ddbc649b177eda7ddb8d3e2074  xorgproto-2018.2.tar.bz2
SHA1: 71e3c4d94266e6022963f7be32a9160e41d4800e  xorgproto-2018.2.tar.bz2
SHA256: 9709c08b65d8371637605db97247782d1f0fa0bfd2111e37999088bb11996e64  
xorgproto-2018.2.tar.bz2
SHA512: 
29ac0479de321eb921b1d902e4670e9e856f8b50c95c07a855aea122e5c9762ff34d01dbda9c795e4c652b09e21151f024aa7ba54bd463e14263db5240418862
  xorgproto-2018.2.tar.bz2
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.bz2.sig

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.gz
MD5:  f3232d78ceaf7e9d108fe61f7fd53156  xorgproto-2018.2.tar.gz
SHA1: 976dd33c436de05ea11c49e7dcb96e3ff31ea6bd  xorgproto-2018.2.tar.gz
SHA256: 2ea043125faad276e3529cff871e835929fe28f7e2009517ff1aae8f6fc84663  
xorgproto-2018.2.tar.gz
SHA512: 
31bff77c54e4832dbd55534b90606e49b2face0356245edd7d6028f26b06fa9e95dab63aed23d55f8552291fa384f65dde2f223b96cc705e98c425a1d0dd3d4b
  xorgproto-2018.2.tar.gz
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.2.tar.gz.sig

- ajax
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: Slow Window Drag Causes Transparent Window And Locks GUI

2018-02-12 Thread Thomas Lübking
Am Fri, 9 Feb 2018 14:19:07 -0600
schrieb Nathan Royce :

> [stuff]
> The short of it is this...

KWin skips a button release, maybe it's indeed not generated by the
server.
Check your xorg log on whether you use libinput or evdev and try the
other to see whether it's a problem with one driver exclusively.
Just to be sure: this isn't a touchpad, is it?
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s