Commit Graph

16448 Commits

Author SHA1 Message Date
Adam Jackson
1ca092f990 travis: Switch linux build from stretch to rawhide
Stretch's Mesa is too far behind, and building Mesa to build xserver is
not the sort of problem we're trying to solve here. But our Travis
scripts run inside a docker image, and that image can be whatever, so
since I have to keep rawhide building anyway let's switch to that for
now. The dockerfile can be found at:

https://github.com/nwnk/xserver-travis

The $DISTRO part of the change is foreshadowing for the day we readd a
(probably sid-based) debian image; patches for other environments are
welcome.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-14 15:08:34 -04:00
Michel Dänzer
17d30369f4 randr: Initialize RROuptutRec::nonDesktop
Flagged by valgrind:

==13695== Conditional jump or move depends on uninitialised value(s)
==13695==    at 0x22461C: RRNoticePropertyChange (rrproperty.c:150)
==13695==    by 0x22461C: RRChangeOutputProperty (rrproperty.c:263)
==13695==    by 0x222FC4: RROutputSetNonDesktop (rroutput.c:333)
==13695==    by 0x22319C: RROutputCreate (rroutput.c:122)
==13695==    by 0x1E1CE9: xf86RandR12CreateObjects12 (xf86RandR12.c:1734)
==13695==    by 0x1E1CE9: xf86RandR12Init12 (xf86RandR12.c:2375)
==13695==    by 0x1E1CE9: xf86RandR12Init (xf86RandR12.c:895)
==13695==    by 0x1D469B: xf86CrtcScreenInit (xf86Crtc.c:778)
==13695==    by 0xC095A54: RADEONScreenInit_KMS (radeon_kms.c:2436)
==13695==    by 0x161444: AddGPUScreen (dispatch.c:3966)
==13695==    by 0x1A3E46: InitOutput (xf86Init.c:763)
==13695==    by 0x1654A7: dix_main (main.c:193)
==13695==    by 0x7041A86: (below main) (libc-start.c:310)
==13695==  Uninitialised value was created by a heap allocation
==13695==    at 0x4C2CB8F: malloc (vg_replace_malloc.c:299)
==13695==    by 0x223083: RROutputCreate (rroutput.c:83)
==13695==    by 0x1E1CE9: xf86RandR12CreateObjects12 (xf86RandR12.c:1734)
==13695==    by 0x1E1CE9: xf86RandR12Init12 (xf86RandR12.c:2375)
==13695==    by 0x1E1CE9: xf86RandR12Init (xf86RandR12.c:895)
==13695==    by 0x1D469B: xf86CrtcScreenInit (xf86Crtc.c:778)
==13695==    by 0xC095A54: RADEONScreenInit_KMS (radeon_kms.c:2436)
==13695==    by 0x161444: AddGPUScreen (dispatch.c:3966)
==13695==    by 0x1A3E46: InitOutput (xf86Init.c:763)
==13695==    by 0x1654A7: dix_main (main.c:193)
==13695==    by 0x7041A86: (below main) (libc-start.c:310)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2018-03-14 10:20:47 -07:00
Keith Packard
52048ce29f Xext/saver: Swap ScreenSaverSuspend 'suspend' field. Handle old XCB clients.
This field was defined as a Bool in the protocol headers and BOOL in
xcb. Bool is not a valid type for protocol fields. It is defined as
'int' by Xdefs.h, which we expect to be 32-bits on all machines.

The protocol headers and xcb have patches posted to switch to CARD32,
which is at least well defined.

This change adds the necessary byte swapping to handle other-endian
clients with this 32-bit field, and then changes the request
processing to compare all 32-bits against zero so that it works with
both new and old clients.

On MSB machines, Xlib will continue to work properly, but old XCB will
not interoperate with the X server (either before or after this patch).

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Mihai Moldovan <ionic@ionic.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-14 10:14:04 -07:00
Mario Kleiner
beda6afb3c glamor/xwayland: Add depth 30 format mapping for DRI 3.2 as well.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-03-09 13:11:12 -05:00
Jon Turney
07c369e05a meson: Require libdrm for dri1/2/3 when configured 'auto' as well as 'true'
If dri1/2/3 are configured for auto-detection, libdrm is required, as well
as the corresponding proto.  (Practically we will always have the
corresponding protos now, as they are part of xorgproto).

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-09 13:08:30 -05:00
Adam Jackson
f69cd2024e os: Define {ReadFdFrom,WriteFdTo}Client unconditionally
Otherwise this is broken on cygwin:

    rrlease.c: In function ‘ProcRRCreateLease’:
    rrlease.c:305:9: error: implicit declaration of function ‘WriteFdToClient’ [-Werror=implicit-function-declaration]
         if (WriteFdToClient(client, fd, TRUE) < 0) {

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-08 14:12:36 -05:00
Rodrigo Vivi
90e0cdd42d dri2: Sync i965_pci_ids.h from Mesa.
Copied from Mesa with no modifications.

Gives us Geminilake and Kaby Lake platform names updates and
sync on Coffee Lake PCI IDs.

Cc: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-07 15:58:31 -05:00
Michel Dänzer
43576b9011 glamor: Restore glamor_fd_from_pixmap and glamor_pixmap_from_fd
They're part of the 1.20 RC1 ABI, and actually used by external drivers.
Also, requiring drivers which don't support the new functionality in
DRI3 1.2 to switch to the new interfaces seems unreasonable.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-03-06 10:53:39 -05:00
Samir Benmendil
5d3fd3856b xkb: XkbSetMap on the lastSlave needs to change the master
The layout needs to be set on the master too if the layout is changed on
the device that was last used by the master.

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

Signed-off-by: Samir Benmendil <me@rmz.io>
Acked-by: Daniel Stone <daniels@collabora.com>
2018-03-05 13:41:29 -05:00
Louis-Francis Ratté-Boulianne
ce8da93646 dri3: Enable DRI3 version 1.2
Enable DRI3 v1.2 now that all functions have been implemented and
that there is at least one backend implementing the driver hooks
(modesetting/glamor).

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:28:01 -05:00
Louis-Francis Ratté-Boulianne
8d0d897159 glamor: Use gbm_bo_create_with_modifiers for internal pixmap allocation
Using modifier might allow the driver to use a more optimal format
(e.g. tiled/compressed). Let's try to use those if possible.

v2: Don't filter out multi-plane modifiers

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:57 -05:00
Louis-Francis Ratté-Boulianne
cef12efc15 glamor: Implement GetSupportedModifiers
Implement function added in DRI3 v1.1.

A newest version of libepoxy (>= 1.4.4) is required as earlier
versions use a problematic version of Khronos
EXT_image_dma_buf_import_modifiers spec.

v4: Only send scanout-supported modifiers if flipping is possible
v5: Fix memory corruption in XWayland (uninitialized pointer)

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:55 -05:00
Louis-Francis Ratté-Boulianne
c8c276c956 glamor: Implement PixmapFromBuffers and BuffersFromPixmap
It relies on GBM >= 17.1.0 where we can import BO with multiple
planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER).

v2: Properly free fds in Xwayland

[Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax]

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:49 -05:00
Louis-Francis Ratté-Boulianne
9d147305b4 modesetting: Check if buffer format is supported when flipping
Add support for 'check_flip2' so that the present core can know
why it is impossible to flip in that scenario. The core can then
let know the client that the buffer format/modifier is suboptimal.

v2: No longer need to implement 'check_flip'

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:47 -05:00
Louis-Francis Ratté-Boulianne
e375f29662 modesetting: Create scanout buffers using supported modifiers
Use most optimal buffer format (e.g. tiled/compressed) available
for scanout.

v2: Don't use multi-plane modifier to create scanout buffer

v3: Add flag to retrieve modifiers set from enabled CRTCs only

v4: Fix uses when GBM/EGL driver doesn't support modifiers

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:44 -05:00
Louis-Francis Ratté-Boulianne
ca1c390ec7 modesetting: Get supported formats/modifiers for scanout
Retrieve IN_FORMATS property from the plane. It gives the
allowed formats and modifiers for BO allocation.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:42 -05:00
Louis-Francis Ratté-Boulianne
9817c14f6a modesetting: Use atomic modesetting to configure output/CRTCs
To make sure we also use the same primary plane and to avoid
mixing uses of two APIs, it is better to always use the atomic
modesetting API when possible.

v2: Don't use mode_output->connector_id

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:40 -05:00
Louis-Francis Ratté-Boulianne
2f807c2324 modesetting: Add support for multi-plane pixmaps when page-flipping
This allows the uses of CCS compressed or tiled pixmaps as BOs when
page-flipping.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:36 -05:00
Louis-Francis Ratté-Boulianne
4023d53734 modesetting: Use atomic modesetting API for pageflip if available
In order to flip between compressed and uncompressed buffers -
something drmModePageFlip explicitly bans us from doing - we need
to port use the atomic modesetting API. It's only 'fake' atomic
though given we still commit for each CRTC separately and
CRTC and connector properties are not set with the atomic API.

The helper functions to retrieve DRM properties have been borrowed
from Weston.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:34 -05:00
Louis-Francis Ratté-Boulianne
e2ef3b44fa present: Send PresentCompleteModeSuboptimalCopy appropriately
Add 'check_flip2' hook for driver to let know the core
about why flipping is not possible ('reason').
If it is because of unsupported buffer format/modifier,
a PresentCompleteNotify event is sent to the client with
the PresentCompleteModeSuboptimalCopy mode.

v2: Check for PresentOptionSuboptimal and check driver version
    before using 'check_flip2'.

v3: Only require one of 'check_flip' or 'check_flip2' to be
    implemented by the driver.
    Refactor reasons list to enum

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:32 -05:00
Louis-Francis Ratté-Boulianne
6e7c40f62d dri3: Add multi-planar/modifier buffer requests
Initial implementation for DRI3 v1.1. Only the DRI3 implementation
is there, backends need to implement the proper hooks.

Version is still set to 1.0 so clients shouldn't use the new
requests yet.

v2: Use depth/bpp instead of DRM formats in requests

v3: Remove DMA fence requests from v1.1
    Add screen/drawable modifier sets

v4: Free array returned by 'get_drawable_modifiers()'

v5: Fix FD leak

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:20 -05:00
Keith Packard
0ff4074224 Require libdrm 2.4.89 or newer
Both autotools and meson build systems had complicated logic around
what version of libdrm to require for various options. Remove that and
just check for a new enough version to support all of the options
which need libdrm.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 11:45:57 -05:00
Laurent Carlier
43ffd57259 meson: Make SHM extension optional
v2: check for header 'sys/shm.h'

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02 12:05:49 -05:00
Laurent Carlier
de4565727a meson: get rid of useless HAVE_SYSV_IPC
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02 12:05:46 -05:00
Laurent Carlier
e02afb9478 meson: Make ACPI support optional
v2: Define HAVE_ACPI in dix-config.h

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02 12:05:45 -05:00
Laurent Carlier
238219e731 meson: Make APM support optional
v2: Define HAVE_APM in dix-config.h

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-02 12:05:42 -05:00
Adam Jackson
2af0a50a4b randr: Fix a crash on initialization with GPU screens
RRSetChanged (immediately above) was immune to screens with no master,
but RRTellChanged was not:

    Thread 1 "X" received signal SIGSEGV, Segmentation fault.
    RRTellChanged (pScreen=<optimized out>) at ../../randr/randr.c:576
    576             mastersp = rrGetScrPriv(master);
    (gdb) bt
    #0  RRTellChanged (pScreen=<optimized out>) at ../../randr/randr.c:576
    #1  0x000055555566f1e9 in RRNoticePropertyChange (value=0x555555bfbf28, property=70, output=0x555555bfef10) at ../../randr/rrproperty.c:153
    #2  RRChangeOutputProperty (output=output@entry=0x555555bfef10, property=<optimized out>, type=type@entry=19, format=format@entry=32, mode=<optimized out>, mode@entry=0, len=len@entry=1, value=0x7fffffffe77c, sendevent=1, pending=0)
        at ../../randr/rrproperty.c:263
    #3  0x000055555566dba5 in RROutputSetNonDesktop (output=output@entry=0x555555bfef10, nonDesktop=nonDesktop@entry=0) at ../../randr/rroutput.c:333
    ...

Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-03-01 11:33:29 -05:00
Adam Jackson
cf485c659d xserver 1.20 RC 1
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-28 12:56:48 -05:00
Adam Jackson
afccb266ed glx: Add vndserver.h to the SDK
Also unbreak 'make distcheck', sigh autotools.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-28 12:56:36 -05:00
Emil Velikov
85ff1cdbd3 protocol.txt: add GLX req. 35 - SetClientInfo2ARB
Noticed while skimming for the typo'd version ;-)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-27 13:08:35 -05:00
Keith Packard
e4e3447603 Add RandR leases with modesetting driver support [v6]
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

[Also bumped libdrm requirement - ajax]

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-27 12:39:50 -05:00
Keith Packard
023d4aba8d xf86-video-modesetting: Create CONNECTOR_ID properties for outputs [v2]
This lets a DRM client map between X outputs and kernel connectors.

v2:
	Change CONNECTOR_ID to enum -- Adam Jackson <ajax@nwnk.net>

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
2018-02-27 12:38:48 -05:00
Keith Packard
3957360505 randr: Support "non-desktop" property
Tracks changes to the non-desktop property so that when non-zero,
outputs will always appear to be disconnected.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
2018-02-27 12:34:26 -05:00
Keith Packard
b91c787c4c xf86-video-modesetting: Record non-desktop kernel property at PreInit time
Save any value of the kernel non-desktop property in the xf86Output
structure to avoid non-desktop outputs in the default configuration.

[Also bump randrproto requirement to a version that defines
RR_PROPERTY_NON_DESKTOP - ajax]

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
2018-02-27 12:33:36 -05:00
Keith Packard
fabbaa8d62 xfree86/modes: Check for non-desktop monitors during PreInit [v2]
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 <michel@daenzer.net>

  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 <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@nwnk.net>
2018-02-27 12:03:55 -05:00
Mario Kleiner
80d4f4b6c2 modesetting: Enable screen color depth 30 support.
glamor now supports depth 30, so allow use of it.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
2018-02-27 10:18:07 -05:00
Mario Kleiner
7bc86c7d23 modesetting: Adapt xf86HandleColorMaps() for > 24 color depth. (v2)
This retains old behavior for depths <= 24, but allows gamma
table and colormap updates to work properly at depth 30.

This needs the xf86Randr12CrtcComputeGamma() fix for depth 30
from a previous commit to work. Otherwise the server will work,
but gamma table updates will silently fail, iow. the server
would always run with a default identity gamma lut.

v2: Simplify as proposed by Michel.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk> (v1)
2018-02-27 10:18:07 -05:00
Mario Kleiner
b5f9fcd50a xfree86/modes: Adapt xf86Randr12CrtcComputeGamma() for depth 30. (v2)
At screen depths > 24 bit, the color palettes passed into
xf86Randr12CrtcComputeGamma() can have a larger number of slots
than the crtc's hardware lut. E.g., at depth 30, 1024 palette
slots vs. 256 hw lut slots. This palette size > crtc gamma size
case is not handled yet and leads to silent failure, so gamma
table updates do not happen.

Add a new subsampling path for this case.

This makes lut updates work again, as tested with the xgamma
utility (uses XF86VidMode extension) and some RandR based
gamma ramp animation.

v2: Better resampling when subsampling the palette, as
    proposed by Ville. Now reaches the max index of the
    palette and deals with non-power-of-two sizes. Thanks.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk> (v1)
Cc: <ville.syrjala@linux.intel.com>
2018-02-27 10:18:07 -05:00
Mario Kleiner
125201408d glamor: Bump version to 1.0.1 to signal depth 30 support.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
2018-02-27 10:18:07 -05:00
Mario Kleiner
7a687da24c glamor: Enable composite acceleration for rgb10 formats. (v2)
Specifically for xrgb2101010 format.

Tested on KDE Plasma-5 with XRender based composite
acceleration backend. Much smoother and faster.

(v2) Dropped argb2101010, because of depth 32 confusion with
     argb8888, as pointed out by Eric. Thanks!
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
2018-02-27 10:18:06 -05:00
Mario Kleiner
c326c717c8 glamor: Fix loose ends in color depth 30 support.
This makes it work properly with OpenGL based desktop
compositing, as tested with EGL and GLX based compositing
under OpenGL-2/3, and also artifact free with XRender
based 2D compositing.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
2018-02-27 10:18:06 -05:00
Mario Kleiner
9ab5d91c6c glamor: Make Xv extension initialize at depth 30.
Support x-screens of depth 30, so init doesn't fail.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
2018-02-27 10:18:06 -05:00
Mario Kleiner
efe9e3e9ff modesetting: Fix fallback for lack of new vblank kernel API.
Turns out that the kernel DRM ioctl handling returns EINVAL
instead of ENOTTY if one tries to call the new drmCrtcGetSequence()
or drmCrtcQueueSequence() ioctl's introduced in Linux 4.15 on an
older kernel where they are missing. This causes the fallback code
not to fall back to the old drmWaitVblank() ioctl and thereby
failure of vblank stuff.

E.g., on Linux 4.13, glxgears -info runs unthrottled at 10000 fps
instead of 60 fps. Also breakage of OML_sync_control extension.

Check for errno != EINVAL before setting has_queue_sequence = TRUE.

Additionally in case of supported drmCrtcQueueSequence(), set
has_queue_sequence = TRUE on success, or we might get at
least a temporary failure in ms_queue_vblank().

One slight ambiguity is that we can also get EINVAL if
drm_crtc_vblank_get() fails in the kernel, so if that
happened at first invocation of the new api, we'd fall
back to drmWaitVblank() and then fail there, instead of
failing in the new api, but the end result would be the
same.

Fixes: 44d5f2eb8a ("xf86-video-modesetting: Support new vblank kernel API [v2]")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-27 10:02:05 -05:00
Adam Jackson
8171d4c2d6 render: Store and use all 16bpc of precision for solid pixels (v2.1)
This plumbs the full width color for solid pictures through to fb, exa,
and glamor. External drivers and acceleration code may wish to make a
similar change for sufficiently new servers.

v2: Don't break ABI (Michel Dänzer)
v2.1: Use the (correct) full color in fb too (Michel Dänzer)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-26 16:46:34 -05:00
Jeffrey Smith
9227237806 modesetting: Do not close uninitialized dri2 screen
If a dri2 screen is not successfully initialized, attempting to close it
results in a null dereference.

Maintain a flag indicating whether the dri2 screen was successfully
initialized, and check it before attempting to close the dri2 screen.

https://bugzilla.redhat.com/show_bug.cgi?id=1485811
https://bugzilla.redhat.com/show_bug.cgi?id=1493805
https://bugzilla.redhat.com/show_bug.cgi?id=1534459
https://bugzilla.redhat.com/show_bug.cgi?id=1541745
https://bugs.freedesktop.org/show_bug.cgi?id=101282

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
2018-02-26 16:41:42 -05:00
Adam Jackson
aa29298416 glamor: unifdef XORG_VERSION_CURRENT
This is always true now that glamor is in-tree.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-02-26 16:38:36 -05:00
Adam Jackson
059879b3ed xquartz: Fix linking with glxvnd
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-26 14:13:40 -05:00
Michel Dänzer
22a3ffe68c glx: Don't pass NULL to glxGetClient
These guards were dropped by the commit below, but it turns out they're
needed. Fixes crash on VT switch.

Fixes: d8ec33fe05 ("glx: Use vnd layer for dispatch (v4)")
Bugzilla: https://bugs.freedesktop.org/105233
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-26 12:28:55 -05:00
Adam Jackson
528c94c650 glx: Fix indirect no-config contexts
We would throw BadValue here for the GLX_SCREEN attribute. The upper
dispatch layer already checks this, we can ignore it here.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-26 10:18:58 -05:00
Adam Jackson
a63ab81f6b glx: Enable GLX_ARB_create_context_no_error (v2)
This is mostly for the client library's convenience, if this extension
is listed then it can know the attribute won't be rejected. Note that we
don't honor this attribute for indirect contexts. That's fine, we don't
want to introduce undefined behavior into a potentially privileged
process.

v2: Remember to ignore the attribute (Eric Anholt)

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-26 10:18:58 -05:00