summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-04-10xserver 1.20 RC4xorg-server-1.19.99.904Adam Jackson2-4/+4
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-04-10dri3: rework format/modifier cachingEmil Velikov1-23/+27
Cut down the unnecessary malloc/memcpy/free by utilising the explicit copy provided by the client. But above all: do so, after ensuring we get valid data from the implementation. Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10glamor: zero num_formats from the startEmil Velikov1-10/+6
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10xwayland: zero num_formats from the startEmil Velikov1-6/+5
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: check for ::get_drawable_modifiers failureEmil Velikov1-4/+7
Currently if the function fails, we'll fall into two false assumptions: - the the count is zero - that the storage pointer is safe for free() I've just fixed the former (in glamor + xwayland) and have no plans on adding yet another workaround for the latter. Simply zero both variables. Regardless if the implementation is missing the callback or it foobars with output variables (normally a bad idea). Bonus points - this fixes a bug where we feed garbage to free() further down ;-) Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10glamor: zero num_modifiers from the startEmil Velikov1-10/+6
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10xwayland: zero num_modifiers from the startEmil Velikov1-10/+7
The caller may ignore the return value (will be addressed with later commit) so simply zero the count from the get-go. We're pretty much do so, in all cases but one :-\ Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: simplify dri3_open() implementationEmil Velikov1-17/+5
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: annotate fds/strides/offsets arrays as constEmil Velikov6-16/+18
It makes it perfectly clear that we should not be modifying them. Should help highlight issues like the one fixed with previous commit. Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10xwayland: don't close() fds we don't ownEmil Velikov1-2/+0
The glamor_pixmap_from_fds error path erroneously closes the fds. We don't own them, plus the caller closes them after the function in called. Fixes: cef12efc15c ("glamor: Implement GetSupportedModifiers") Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dri3: annotate the dri3_screen_info data as constEmil Velikov6-12/+12
dri3_screen_info is the user provide dispatch. Something that we do not and should not change. When using the _ptr typecast + const the compiler barfs at us (rightfully so), so use the _rec one. [Silence a new const mismatch warning too - ajax] Fixes: 56313829886 ("dri3: Add DRI3 extension") Cc: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-10dix: always send focus event on grab changeSamuel Thibault1-1/+1
Focus events are useless when 'from' and 'to' are the same. But when this is the result of a (Un)GrabKeyboard request, we should always send them, including when the window manager had previously used XSetInputFocus to specify the focus on a window which happens to be now taking a grab. This is notably needed for window manager using XI to always get keyboard events even during grabs, so they can determine exactly when grabbing is active. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-10Xext: Fix memory leaks in hashtable.Michal Srb1-0/+3
Do not forget to delete key and value of every item and the hashtable itself.
2018-04-10glx: Do not call into Composite if it is disabled.Michal Srb2-41/+55
Otherwise X server crashes if GLX is enabled and Composite disabled. For example the compIsAlternateVisual function will try to lookup CompScreenPtr using the CompScreenPrivateKey, but that was never initialized if Composite is disabled. Fixes: f84e59a4f4. ("glx: Duplicate relevant fbconfigs for compositing visuals") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104993 Signed-off-by: Michal Srb <msrb@suse.com>
2018-04-09hw/xwin/glx: Allocate fbconfigs correctlyJon Turney1-30/+40
4b0a3cba fixed leaking of GLX fbconfigs, so now xwin needs to allocate them correctly (individually, rather than all at once), so they can be freed successfully. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-04-09GLX: Fix a use after free error with the GLVND vendor handle.Kyle Brenneman1-6/+7
The GLVND layer will destroy all of the vendor handles at the end of each server generation, but the GLX module then tries to re-use the same (now-freed) handle in xorgGlxServerInit at the start of the next generation. In xorgGlxCloseExtension, explicitly destroy the vendor handle and set it to NULL so that the next call to xorgGlxServerInit will recreate it. Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-06xfree86: drop KDSKBMUTE handlingPeter Hutterer1-19/+9
This was never merged upstream. It was a Fedora kernel patch but dropped from Fedora in 2013 with kernel 3.12. The reason for the KDSKBMUTE proposal has been fixed in systemd in Feb 2013, systemd 198. https://lists.freedesktop.org/archives/systemd-devel/2013-February/008795.html Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-05xwayland: Silence a build warning if we canAdam Jackson3-8/+19
[735/786] Generating 'hw/xwayland/Xwayland@exe/relative-pointer-unstable-v1-protocol.c'. Using "code" is deprecated - use private-code or public-code. See the help page for details. Use private-code if wayland-scanner is new enough. Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-04-05dix: Hush an almost certainly bogus warningAdam Jackson1-1/+1
../dix/getevents.c: In function ‘transformAbsolute’: ../dix/getevents.c:1195:28: warning: ‘oy’ may be used uninitialized in this function [-Wmaybe-uninitialized] struct pixman_f_vector p = {.v = {*x, *y, 1} }; ^ ../dix/getevents.c:1234:22: note: ‘oy’ was declared here double x, y, ox, oy; ^~ This one is truly special. Even though both ox and oy are set and read along the same paths, only oy is marked for this warning! Initializing just oy = 0.0 fixes it entirely, but let's not make a weird thing weirder. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05mi: Hush an almost certainly bogus warningAdam Jackson1-1/+1
In file included from ../mi/miexpose.c:83: ../mi/miexpose.c: In function ‘miHandleExposures’: ../include/regionstr.h:174:22: warning: ‘expBox.y2’ may be used uninitialized in this function [-Wmaybe-uninitialized] (_pReg)->extents = *(_pBox); ~~~~~~~~~~~~~~~~~^~~~~~~~~~ ../mi/miexpose.c:139:12: note: ‘expBox.y2’ was declared here BoxRec expBox; ^~~~~~ etc. It's initialized if (extents), and then only read if (extents), but gcc doesn't seem to figure that out. Whatever, bzero it to be explicit. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05xkb: Silence some compiler warningsAdam Jackson1-5/+6
Of the form: ../xkb/XKBGAlloc.c: In function ‘SrvXkbAddGeomKeyAlias’: ../xkb/XKBGAlloc.c:591:13: warning: ‘strncpy’ specified bound 4 equals destination size [-Wstringop-truncation] strncpy(alias->real, realStr, XkbKeyNameLength); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is intentional; the code that reads from these fields never reads more than 4 bytes anyway. Rephrase things in terms of memcpy so that's clear. Obviously this is awful but in XKB awful is par. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05dmx: Silence a string truncation warning.Adam Jackson1-1/+1
../hw/dmx/config/dmxparse.c: In function ‘dmxConfigCreateOption’: ../hw/dmx/config/dmxparse.c:385:13: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(option->string + offset, p->string, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../hw/dmx/config/dmxparse.c:383:23: note: length computed here int len = strlen(p->string); ^~~~~~~~~~~~~~~~~ The thing it's warning about is intentional, the surrounding code does its own nul-termination. Make that obvious by using memcpy instead. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05dmx: Clean up some argument parsing codeAdam Jackson1-19/+6
This threw: ../hw/dmx/input/dmxarg.c: In function ‘dmxArgParse’: ../hw/dmx/input/dmxarg.c:128:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=] strncpy(tmp, string, len); ^~~~~~~~~~~~~~~~~~~~~~~~~ ../hw/dmx/input/dmxarg.c:126:11: note: length computed here len = strlen(string) + 2; ^~~~~~~~~~~~~~ This code predates xstrtokenize, but that's no excuse. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05dmx: Fix a read-from-uninitialized warningAdam Jackson1-1/+1
../hw/dmx/dmxpixmap.c: In function ‘dmxBitmapToRegion’: ../include/regionstr.h:174:22: warning: ‘Box.x1’ may be used uninitialized in this function [-Wmaybe-uninitialized] (_pReg)->extents = *(_pBox); ~~~~~~~~~~~~~~~~~^~~~~~~~~~ ../hw/dmx/dmxpixmap.c:208:12: note: ‘Box.x1’ was declared here BoxRec Box; ^~~ Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05dmx: Fix some snprintf warnings.Adam Jackson1-2/+2
snprintf doesn't terminate the string if it truncates, so things like this are lurking crashers: ../hw/dmx/dmxprop.c: In function ‘dmxPropertyIdentifier.part.0’: ../hw/dmx/dmxprop.c:94:36: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 123 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display); ^~ ~~~~~~~~ ../hw/dmx/dmxprop.c:94:5: note: ‘snprintf’ output 7 or more bytes (assuming 262) into a destination of size 128 snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../hw/dmx/dmxprop.c: In function ‘dmxPropertyWindow’: ../hw/dmx/dmxprop.c:372:36: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 127 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index); ^~ ../hw/dmx/dmxprop.c:372:5: note: ‘snprintf’ output between 3 and 140 bytes into a destination of size 128 snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We could be more precise about termination, but meh. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05gtf: Warning fixAdam Jackson1-1/+1
../hw/xfree86/utils/gtf/gtf.c: In function ‘print_fb_mode’: ../hw/xfree86/utils/gtf/gtf.c:241:50: warning: cast from function call of type ‘double’ to non-matching type ‘int’ [-Wbad-function-cast] printf(" timings %d %d %d %d %d %d %d\n", (int) rint(1000000.0 / m->pclk), /* pixclock in picoseconds */ That's pretty nitpicky of you, gcc, but at least it's easy to fix. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
2018-04-05modesetting: Actually get framebuffer IDDaniel Stone1-1/+1
We would fail to get the FB ID if it wasn't already imported, since we were checking to see if the pointer was NULL (it never was) rather than if the content of the pointer was 0. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Olivier Fourdan <ofourdan@redhat.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2018-04-05dri3: Set stride and size for old clientsDaniel Stone1-0/+2
For old clients using the fd_from_pixmap entrypoint, make sure we set stride and size correctly. Noticed by inspection. Signed-off-by: Daniel Stone <daniels@collabora.com>
2018-04-05modesetting: Don't reuse iterator in nested loopDaniel Stone1-2/+3
drmmode_crtc_set_mode has a loop nested inside another loop, where both of them were using 'i' as the loop iterator. Rename it to avoid an infinite loop. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04modesetting: Fix page flipping harder under DRI 3.2.Mario Kleiner1-1/+5
Non-atomic kms drivers like radeon-kms (or nouveau-kms with default setting of "atomic ioctl disabled") don't export any formats, so num_formats == 0. Some atomic drivers (nouveau-kms with boot param nouveau.atomic=1, or intel-kms on, e.g., Linux 4.13) expose num_formats == 0, or don't expose any modifiers, so num_modifiers == 0. Let the drmmode_is_format_supported() check pass in these cases to allow page flipping, as it works just fine. Tested on NV-96 for nouveau, HD-5770 for radeon, Intel Ivybridge with Linux 4.13 and drm-next to fix page flipping. Fixes: 9d147305b404 ("modesetting: Check if buffer format is supported when flipping") Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-04-04modesetting: Have consistent state when using atomic modesettingLouis-Francis Ratté-Boulianne2-3/+64
We need to make sure that the atomic commit are consistent or else the kernel will reject it. For example, when moving a CRTC from one output to another one, the first output CRTC_ID property needs to be reset. Also if the second output was using another CRTC beforehands, it needs to be disabled to avoid an inconsistent state. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Tested-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04modesetting: Use atomic modesetting to set DPMS modeLouis-Francis Ratté-Boulianne5-110/+299
CRTCs and outputs needs to be enabled/disabled when the current DPMS mode is changed. We also try to do it in an atomic commit when possible. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Tested-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04glamor: Add fd_from_pixmap hookDaniel Stone1-0/+27
Add a fd_from_pixmap (singular) hook to go with fds_from_pixmap, which will ensure that the pixmap is allocated without modifiers and is thus exportable to non-modifier-aware clients. This makes it possible to run a compositing manager on an old GLX/EGL stack on top of an X server which allocates internal buffer storage using exotic modifiers from modifier-aware GBM/EGL/KMS. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04glamor: Fall back to non-modifier allocationsDaniel Stone1-2/+3
If we try to allocate with particular modifiers but it fails, try to fall back to non-modifier allocations. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04glamor: Reallocate pixmap storage without modifiers if necessaryDaniel Stone1-5/+6
If we need a pixmap's storage to be exported to a context in which we aren't aware of modifiers, reallocate the buffer again without modifiers. This makes it possible to run a compositing manager on an old GLX/EGL stack on top of an X server which allocates internal buffer storage using exotic modifiers from modifier-aware GBM/EGL/KMS. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04glamor: Push make_exportable into callersDaniel Stone1-1/+4
Rather than calling make_exportable from the get_bo entrypoint, make sure that someone has already explicitly requested the pixmap be exportable. This is technically an ABI break in that it changes observable behaviour, but no driver other than modesetting has ever used get_bo. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04glamor: Track if BO allocation used modifiersDaniel Stone4-11/+25
Keep track of whether or not we fed modifiers into GBM when we allocated a BO. We'll use this later inside Glamor, to reallocate buffer storage if we allocate buffer storage using modifiers, and a non-modifier-aware client requests an export of that pixmap. This makes it possible to run a compositing manager on an old GLX/EGL stack on top of an X server which allocates internal buffer storage using exotic modifiers from modifier-aware GBM/EGL/KMS. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04drmmode: Track if BO allocation used modifiersDaniel Stone2-1/+5
Keep track of whether or not we fed modifiers into GBM when we allocated a BO. We'll use this later inside Glamor, to reallocate buffer storage if we allocate buffer storage using modifiers, and a non-modifier-aware client requests an export of that pixmap. This makes it possible to run a compositing manager on an old GLX/EGL stack on top of an X server which allocates internal buffer storage using exotic modifiers from modifier-aware GBM/EGL/KMS. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-04dri3: Use single-FD screen call for single-FD requestDaniel Stone3-11/+48
When importing client buffers into Pixmaps, we can use the fds_to_pixmap hook for both single-FD and multi-FD client requests without any harm. For the other direction of exporting Pixmap buffers to client FDs, create a new helper which calls the old pixmap_to_fd hook if available. This allows the implementation to ensure that the Pixmap storage is accessible to clients not aware of multiple planes or modifiers, e.g. by reallocating and copying. This makes it possible to run a compositing manager on an old GLX/EGL stack on top of an X server which allocates internal buffer storage using exotic modifiers from modifier-aware GBM/EGL/KMS. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-03xfree86: Restore newline before "X Protocol Version" stringAaron Plattner1-1/+1
The newline before the protocl version got lost in commit 6cbefc3e0a33b380c147c533914437c7798d9b93. Prior to that commit, the release date printed a newline at the end: X.Org X Server 1.19.6 Release Date: 2017-12-20 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.14.12-1-ARCH x86_64 Now, that string gets run together with the version: X.Org X Server 1.19.99.903 (1.20.0 RC 3)X Protocol Version 11, Revision 0 Build Operating System: Linux Since the version string printing has a variety of #ifdefs in it, just add the newline to the begining of the protocol version string. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-02xserver 1.20 RC3xorg-server-1.19.99.903Adam Jackson2-4/+4
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-04-02modesetting: Fix reported size when using atomic modesettingLouis-Francis Ratté-Boulianne1-4/+4
The framebuffer can include multiple CRTCs in multi-monitors setup. So we shouldn't use the buffer size but the CRTC size instead. Rotated displays are shadowed, so we don't need to worry about it there. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-04-02modesetting: Ignore alpha channel when importing BOs for modesettingLouis-Francis Ratté-Boulianne1-0/+20
Fixes a regression caused by modifiers support. For some hw to continue working even if not supporting ARGB8888 and ARGB2101010 formats, we assume that all imported BOs are opaque. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-04-02modesetting: Use actual crtc position for pageflipOlivier Fourdan1-1/+1
Otherwise the same content is shown on all outputs. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.comM>
2018-04-02docs: remove resource management referencesEmil Velikov1-168/+0
The code referenced was removed back in 2009. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-02docs: purge some ISA referencesEmil Velikov1-87/+2
The respective ISA functions were dropped back in 2008 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-04-02meson: Add pixman-1 to required modules in xorg-server.pcThierry Reding1-1/+5
pixman headers will be included for builds of external modules against the xorg-server SDK. Make sure pixman is listed as a required module so that the correct CFLAGS will be added. Note that the xorg-server.pc generated by the autotools-based build has many more modules listed, but this seems to be enough to build at least some of the external drivers against an X server built with Meson (I've tested with xf86-input-libinput, xf86-video-nouveau and xf86-video-ati). Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-04-02meson: Distribute more SDK headersThierry Reding15-1/+115
Install missing headers to the SDK directory to allow external modules to properly build against the SDK. After this commit, the list of files installed in the SDK include directory is the same as the list of files installed by the autotools-based build. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-04-02meson: Remove usage of pkg-config --variable=includedirThierry Reding2-1/+3
Querying a pkg-config variable using the --variable option produces the value of the given variable as stored in the pkg-config file and should not be used to add directories to the include search path. The reason for this is that it breaks cross-compilation, because header files are installed relative to the host sysroot. pkg-config supports a PKG_CONFIG_SYSROOT_DIR environment variable that points to this sysroot and will prepend that to the path of directories in -I or -L options in pkg-config's Cflags, Libs or Libs.private keywords. However, because no context can be inferred from variable names, as opposed to the keywords with fixed meaning, the sysroot path will not be prepended to them. The build system is responsible for doing so if necessary since it is aware of the context in which the variable is used. Adding the include directory returned by pkg-config to the include path leaks build system information into the cross-build and break with very confusing errors such as this: In file included from include/misc.h:82:0, from dix/atom.c:55: /usr/include/pthread.h:682:6: warning: '__regparm__' attribute directive ignored [-Wattributes] __cleanup_fct_attribute; ^~~~~~~~~~~~~~~~~~~~~~~ or this: In file included from include/misc.h:139:0, from dix/atom.c:55: /usr/include/stdlib.h:133:8: error: '_Float128' is not supported on this target extern _Float128 strtof128 (const char *__restrict __nptr, ^~~~~~~~~ Fix this by replacing the include directory with the appropriate xproto dependency required to add the correct include directory to the compile command for subdirectories that are missing the dependency. As detailed above, this gives pkg-config the opportunity to prepend the sysroot for all paths in -I compiler options. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-04-02modesetting/drmmode: add NULL pointer check in drmmode_output_dpmsTobias Klausmann1-2/+5
drmmode_output_dpms is called especially with !output->crtc found in xf86DisableUnusedFunctions so we have to guard for it, else the server segfaults: 0 0x00007fdc1706054b in drmmode_output_dpms (output=0x55e15243c210, mode=3) at drmmode_display.c:2243 1 0x000055e1500b6873 in xf86DisableUnusedFunctions (pScrn=0x55e152133f00) at xf86Crtc.c:3021 2 0x000055e1500be940 in xf86RandR12CrtcSet (pScreen=<optimized out>, randr_crtc=0x55e1524b2b90, randr_mode=0x0, x=0, y=0, rotation=<optimized out>, num_randr_outputs=0, randr_outputs=0x0) at xf86RandR12.c:1244 3 0x000055e1500fa1c2 in RRCrtcSet (crtc=<optimized out>, mode=0x0, x=0, y=0, rotation=rotation@entry=1, numOutputs=numOutputs@entry=0, outputs=0x0) at rrcrtc.c:763 4 0x000055e1500fba9e in ProcRRSetCrtcConfig (client=0x55e152bfae50) at rrcrtc.c:1390 5 0x000055e150044008 in Dispatch () at dispatch.c:478 6 0x000055e150047ff8 in dix_main (argc=13, argv=0x7ffc68561038, envp=<optimized out>) at main.c:276 7 0x00007fdc1a0c6a87 in __libc_start_main () at /lib64/libc.so.6 8 0x000055e150031d0a in _start () at ../sysdeps/x86_64/start.S:120 Fixes: ba0c75177 ("modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*") Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Reviewed-by: Adam Jackson <ajax@redhat.com>