Commit Graph

16476 Commits

Author SHA1 Message Date
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
Adam Jackson
701f3a206d render: Simplify miCompositeRects
Make a solid-fill picture for this instead of a 1x1 pixmap. In principle
the backend can accelerate this directly, and we also get to preserve
all the bits of the fill color.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-26 10:02:24 -05:00
Adam Jackson
9339fa87d0 render: Cosmetic cleanup to default format creation
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-23 13:15:31 -05:00
Adam Jackson
ddf752eafe render: Remove some 24bpp handling
This can't happen anymore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-23 13:15:31 -05:00
Peter Harris
efd84bff23 composite: Fix use-after-free in compReparentWindow
If an implicitly redirected window is unredirected by the reparent
operation, cw will be a stale pointer.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-23 12:12:15 -05:00
Emil Velikov
ac13d740bf mi: Mention extension loading in verbose logs
Listing the extensions is useful, despite being annoying for normal
usecases. Print it only when extra (lvl 3) vebose is requested.

v2: Move the logging to InitExtensions(), as requested by Adam.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-02-21 13:24:29 -05:00
Emil Velikov
9237c5e287 docs: correct LoadExtensionList() documentation
Add the missing arguments to the function signature.

Fixes: e46820fb89 ("miinitext: introduce LoadExtensionList() to replace
over LoadExtension()")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-21 11:07:18 -05:00
Emil Velikov
089a1b0f9f glx: set the version we implement in GlxServerExports
Set the major/minor version it's currently implemented, not the one
provided by the GLXSERVER_VENDOR_ABI_{MAJOR,MINOR}_VERSION macros.

Those are identical for now, but can change in the future.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-21 11:07:15 -05:00
Emil Velikov
edc00e0203 glx: use C99 initializers for GlxServerExports
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-21 11:07:12 -05:00
Emil Velikov
7fc7579869 glx: NULL check the correct argument in dispatch_GLXVendorPriv
malloc can return NULL, unlike GetVendorDispatchFunc. The latter
provides DispatchBadRequest.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-21 11:07:08 -05:00
Emil Velikov
1310241e8d glx: keep glvnd_vendor a private [static] variable
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-21 11:07:03 -05:00
Jason Ekstrand
a054532668 xwayland: Fix backwards need_rotate logic (v2)
When xdg_output support was added to Xwayland, need_rotate parameter was
added to output_get_new_size where true gave you the old pre-xdg_output
behavior and false gave the new behavior.  Unfortunately, the two places
where this is called, need_rotate was set backwards.  This caused input
get clampped to the wrong dimensions.  Also, the logic for deciding
whether or not to flip was wrong because, if need_rotate was false, it
would always flip which is not what you want.

v2 (Daniel Stone):
 - Fix output_get_new_size so that it doesn't flip the dimensions when
   need_rotate is false.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2018-02-20 13:17:08 -05:00
Alexander Volkov
343ee7d075 Xephyr: Avoid calling xcb_shm_detach() twice
This call was forgotten to be removed in
90996f5909 in which
hostx_destroy_shm_segment() was introduced, which
itself does it.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-20 11:05:59 -05:00
Laurent Carlier
5ba0ba93e1 meson: Make DGA extension optional
Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:43 -05:00
Laurent Carlier
e790bc621b dga: #if XFreeXDGA → #ifdef XFreeXDGA
../include/events.h:32:14: error: #if with no expression

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:43 -05:00
Laurent Carlier
ce4e20f80f meson: Make Xv and XvMC extensions optional
Just mimic autoconf file, XvMC can't be enabled without Xv

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:43 -05:00
Laurent Carlier
82d9e99bf9 meson: Xephyr Requires xcb-shm version 1.9.3 or newer
Sync with commit 8510f542e5

Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
2018-02-19 13:14:42 -05:00
Jeffrey Smith
272fa18170 os: avoid uninitialized offsets in backtrace
When xorg_backtrace calls unw_get_proc_name and an error occurs, offset
might not be set for the current frame.

Initialize offset for each frame so that the offset from another frame
cannot be used inadvertently.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-19 13:12:18 -05:00
Jon Turney
6f9d29040c hw/xwin: Update for glxvnd
- Link with libglxvnd in meson.build
- Call xorgGlxCreateVendor() like all other DDX

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2018-02-19 12:44:04 -05:00
Adam Jackson
500cc4a029 dmx: warning fix
/home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c: In function ‘dmxInputInit’:
/home/ajax/git/xserver/at/../hw/dmx/input/dmxinputinit.c:1019:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
         int found;

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:21:43 -05:00
Adam Jackson
9bcddaf961 dri2: warning fix
/home/ajax/git/xserver/at/../glx/glxdri2.c: In function ‘create_driver_context’:
/home/ajax/git/xserver/at/../glx/glxdri2.c:444:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     const __DRIconfig *driConfig = config ? config->driConfig : NULL;

I don't know why autotools has decided not to be C99 but at least it's
trivial to fix.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:20:16 -05:00
Adam Jackson
133bd4443b glx: Large commands are context state, not client state
There's no reason a multithreaded client shouldn't be allowed to
interleave other requests (for other contexts) with a RenderLarge. Move
the check into __glXForceCurrent, and store the state in the context not
the client.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Adam Jackson
5d87e4f713 miinitext: Remove separate extension toggle list
This was only separate because GLX was loadable. The frontend is now
linked statically, so we can use the static extension list directly.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00