fb: Fix invalid bpp for 24bit depth window

We have a hack in fb layer for a 24bpp screen to use 32bpp images, and
fbCreateWindow() replaces its drawable.bitsPerPixel field
appropriately.  But, the problem is that it always replaces when 32bpp
is passed.  If the depth is 32, this results in bpp < depth, which is
actually invalid.

Meanwhile, fbCreatePixmap() has a more check and it creates with 24bpp
only when the passed depth <= 24 for avoiding such a problem.

This oneliner patch just adds the similar check in fbCreateWindow().
This (hopefully) fixes the long-standing broken graphics mess of
cirrus KMS with 24bpp.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fe5018e0564118a7a8198fa286186fdb9ed818c7)
Signed-off-by: Julien Cristau <jcristau@debian.org>
xkb: ignore floating slave devices when updating from master (#81885)

Introduced in 45fb3a934dc0db51584aba37c2f9d73deff9191d. When a device is
enabled, the master's locked state is pushed to the slave. If the device is
floating, no master exists and we triggered a NULL-pointer dereference
in XkbPushLockedStateToSlaves.

X.Org Bug 81885 <http://bugs.freedesktop.org/show_bug.cgi?id=81885>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1e30fc1b99bda040038e4fd56d1b27c686b44c75)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Fix present_pixmap when using present_notify_msc

Calling present_notify_msc could cancel a pending pixmap presentation.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9bc01dfc7070a40f5948588895b3a11dd1636d0e)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Fix present_notify to return right away when querying current or past msc.

When the target msc is past or is the current one, we want to get immediate
feedback. This patch fixes this behaviour.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 882f2d10d99a04a96afc0ce0c8937e16bec3afb5)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Xext/shm: Detach SHM segment after Pixmap is released

The GPU may still have a reference to the SHM segment which would only
be finally released when the Pixmap is destroy. So we can only detach
the SHM segment (and thereby making the memory unaccessible) after the
backend has had a chance to flush any remaining references.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85058
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: gedgon@gmail.com
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 9b29fa957a397664463c7c78fbcc2f34d1993271)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Bump to 1.16.1.901
Bump to 1.16.2

Signed-off-by: Julien Cristau <jcristau@debian.org>
fb: Fix Bresenham algorithms for commonly used small segments.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168

Fix errors introducted in 863d528a9f76d0e8f122aebf19f8564a4c67a938. Said
patch does indeed remove the problematic writes to bad memory, however
it also introduces errors in the algoritm. This patch has the effect of
reverting said patch and adding an if in the proper location to catch
the out of bounds memory write without causing problems to the overall
algorithm.

Signed-off-by: Alex Orange <crazycasta@gmail.com>
Reviewed-by: Peter Harris <pharris@opentext.com>
Tested-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 1b94fd77792310c80b0a2bcf4bf6d4e4c4c23bca)
Add -iglx & +iglx to Xserver.man

Covers the current state after commits 99f0365b1fbdfd9238b9f,
d0da0e9c3bb8fe0cd4879, & e3aa13b8d63ea2fba6eb4 were all applied.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b09d59342804db7dbb8056dca43dd39f54e290aa)

[alanc: Modified for server-1.16-branch to show +iglx as default instead of
        -iglx, to match code in os/utils.c in server-1.16-branch.]
Signed-off-by: Julien Cristau <jcristau@debian.org>