Commit Graph

83 Commits

Author SHA1 Message Date
Jacek Caban 10f38c0600 winex11: Move user driver to unixlib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban 6dd08c34dc winex11: Use wcsicmp for string comparison.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban bd721f0371 winex11: Directly use ntdll for utf8 conversion.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:24 +02:00
Jacek Caban ef8e4b7e3e winex11: Use libc for driver memory allocation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:34:55 +02:00
Jacek Caban 95825139b8 winex11: Use pthread for xrandr locking.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-18 20:59:19 +02:00
Jacek Caban 262831bc63 winex11: Directly use win32u in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:54:36 +02:00
Alexandre Julliard 8d6c33c3bf include: Remove wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Jacek Caban b502a3e3c6 winex11.drv: Use gdi driver types for display device handler.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-30 22:07:21 +01:00
Eduard Permyakov dedda40e5d winex11.drv: Add 'EDID' registry key to every monitor device.
Extended display identification data (EDID) is a set of data that
is provided by a display to describe its capabilities to a graphics
adapter. EDID data allows a computer to detect the type of monitor
that is connected to it. EDID data includes the manufacturer name,
the product type, the timings that are supported by the display, the
display size, as well as other display characteristics. EDID is
defined by a standard published by the Video Electronics Standards
Association (VESA).

In Windows, every display device has an associated 'EDID' registry
key containing this data. Applications can read and parse it to get
the display capabilities. In Linux, we can get each monitor's EDID
using the RANDR X extension.

This patch fixes, for example, monitor detection in the UE-based game
'Industries of Titan'.

Signed-off-by: Eduard Permyakov <epermyakov@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:35:34 +02:00
Henri Verbeet 218f70b134 winex11: Request VK_KHR_display in get_gpu_properties_from_vulkan().
Required by VK_EXT_direct_mode_display. VK_KHR_display in turn requires
VK_KHR_surface.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:50:58 +02:00
Henri Verbeet dd25789fb2 winex11: Request VK_KHR_external_memory_capabilities in get_gpu_properties_from_vulkan().
Required for VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:50:55 +02:00
Zhiyi Zhang 0f820e9c94 winex11.drv: Cache the current mode for detached outputs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:57 +02:00
Zhiyi Zhang 7fabcf6fed winex11.drv: Add a cache for querying XRandR 1.4 current modes.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51047
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 21:25:00 +02:00
Zhiyi Zhang 798137dbf6 winex11.drv: Check that there are connected outputs before using XRandR 1.4.
On headless systems, Wine can still run through a VNC connection even though no outputs are
connected. Fallback to using the Xinerama display device handler in this case to report at least
one monitor.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49500
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-02 14:37:17 +01:00
Zhiyi Zhang 4a330b2921 winex11.drv: Support display orientations for XRandR 1.4 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 12:29:05 +02:00
Georg Lehmann 586f68f414 winex11.drv: Use vkGetPhysicalDeviceProperties2KHR to get gpu properties.
vkGetPhysicalDeviceProperties2 is a Vulkan 1.1 function but wine uses
a 1.0 instance, so use the extension function instead.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Zhiyi Zhang 2b484b1ac7 winex11.drv: Initialize new display device registry display settings.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 21:38:48 +02:00
Zhiyi Zhang 5491e939bc winex11.drv: Migrate XRandR 1.0 display settings handler to a new interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:30 +02:00
Zhiyi Zhang d13b61b738 winex11.drv: Support detaching adapters.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:28 +02:00
Zhiyi Zhang 4a24816313 winex11.drv: Support automatic display position adjustment.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:26 +02:00
Zhiyi Zhang 7dd52f6d24 winex11.drv: Remove XRandR 1.2 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang 9905a5a81d winex11.drv: Add XRandR 1.4 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang 45d991d541 winex11.drv: Add set_screen_size() helper.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang f5e6c086f9 winex11.drv: Move broken NVIDIA driver detection into a function.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Brendan Shanks 3a3c7cbd20 winex11.drv: Retrieve PCI IDs and device name from Vulkan.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 19:24:27 +02:00
Zhiyi Zhang 5dd03cbc8f winex11.drv: Refactor query_work_area() to get intersected work area directly.
Refactor query_work_area() to pass in a monitor rectangle and check
if the resulting work area intersects with the monitor rectangle in
the function rather than doing it in the callers. Also move the function
to display.c and rename it to get_work_area().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 10:59:35 +02:00
André Hentschel 9f974579b6 winex11.drv: Change slave to a more neutral word.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 19:56:43 +02:00
Paul Gofman 6f9d20806e winex11.drv: Handle X error from vkGetRandROutputDisplayEXT().
Nvidia implementation of vkGetRandROutputDisplayEXT() generates X exception
when rrOutput is from different provider (or if rrOutput is just
invalid). That can happen on certain multiple GPU configurations, on which
Wine is currently unable to initialize display driver and thus create
any window.

According to Vulkan spec, vkGetRandROutputDisplayEXT is supposed to just
return VK_NULL_HANDLE if there is no corresponding VkDisplayKHR. But it is
probably better to workaround the problem to avoid long standing regression.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49407
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 19:56:43 +02:00
Zhiyi Zhang 145cfce113 winex11.drv: Add a Vulkan UUID property for GPUs.
A Vulkan UUID property is used to find the corresponding GPU in SetupAPI.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 20:14:04 +02:00
Zhiyi Zhang fd6f50c0d3 winex11.drv: Resize desktop upon display change events.
Otherwise, Wine still has the old desktop size after a user changed
display resolution using host system utilities.

X11DRV_DisplayDevices_Update() is introduced so that display devices
reinitialization is separated from desktop resizing. Otherwise,
X11DRV_DisplayDevices_Init() would have to be called twice to resize
the desktop with up-to-date primary monitor dimensions, wasting resources.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48441
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:10:18 +02:00
Zhiyi Zhang fb69b6aeb2 winex11.drv: Fix incorrect frequency for double scan and interlaced modes.
Double scan modes have double the dots to be scanned and interlaced
modes only have half the dots to be scanned.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 21:10:31 +02:00
Zhiyi Zhang 562702c69b winex11.drv: Ignore disconnected outputs when finding mirroring slaves.
Some graphics drivers keep CRTCs attached to disconnected outputs.
This could cause the XRandR 1.4 display device handler to incorrectly
mark outputs as mirrored. So enumerate outputs instead of CRTCs when
finding mirroring slaves.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48932
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 21:10:25 +02:00
Alexandre Julliard 7afa53c0f2 winex11: Use standard dlopen() instead of the libwine wrappers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-07 14:26:20 +02:00
Zhiyi Zhang 7347b442af winex11.drv: Get the minimum screen size from XRRGetScreenSizeRange().
RandR minimum screen size is not necessarily 0x0. Some drivers report
resolutions smaller than the minimum screen size. When Wine tries to
switch to these resolutions, a X error is generated and causes process
exit.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-31 15:53:54 +02:00
Francois Gouget aee91dc4ac winex11.drv: Fix the spelling of a WARN() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-11 09:28:55 +01:00
Zhiyi Zhang 99d047724e winex11.drv: Introduce is_virtual_desktop().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:48 +01:00
Zhiyi Zhang 413aad3913 winex11.drv: Handle display device events in the desktop thread.
This fixes a regression from 22795243b2,
which calls thread_init_display() and eventually XOpenIM() before
X11DRV_InitXIM() is called.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47821
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-01 17:13:40 +01:00
Zhiyi Zhang de94cfa775 winex11.drv: Use underscore style for struct x11drv_display_device_handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:30:10 +01:00
Zhiyi Zhang 6dbb153ede winex11.drv: Call XFlush() right after XUngrabServer().
XGrabServer() stops the processing of other display connections
until a XUngrabServer() call is actually processed by the X server.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:30:00 +01:00
Zhiyi Zhang ffd4caa5f0 winex11.drv: Handle XRandR not reporting any providers.
Some XRandR implementations, e.g., the QXL driver used on Debian 10
TestBots, don't report any providers. In this case, we can still
search in XRandR screen resources to get adapters.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-25 16:28:44 +02:00
Zhiyi Zhang 22795243b2 winex11.drv: Handle XRandR display device changes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Zhiyi Zhang be54adcffc winex11.drv: Support XRandR display device handler.
XRandR supports multiple GPUs and runtime device change
compared to Xinerama.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Zhiyi Zhang 95a0a5c755 winex11.drv: Add xrandr_get_screen_resources() helper.
Getting screen resources will be used in multiple places.
So put it in a function.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 14:18:49 +02:00
Zebediah Figura 70d842b106 winex11: Resize the screen when changing CRTC modes.
Based on a patch by Gabriel Corona.

According to the RandR spec for RRSetCrtcConfig:

"The entire area of the CRTC must fit within the screen size, else a Match
error results. As an example, rotating the screen so that a single CRTC fills
the entire screen before and after may necessitate disabling the CRTC,
resizing the screen, then re-enabling the CRTC at the new configuration to
avoid an invalid intermediate configuration."

This patch involves resizing the screen also when shrinking a CRTC, not just
when expanding it past the current screen size. This is partially because we
have no way to reliably determine the current display width (DisplayWidth() is
never updated past opening the connection, and RandR exposes no way to
retrieve the screen dimensions), and partially because it's probably what the
user wants anyway (e.g. it's what the `xrandr` configuration app does when the
screen size is not expliticly specified).

This patch fixes TestBot failures on the Debian machines for ddraw, d3d8, and
d3d9 device tests.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33290
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-11 09:15:32 +02:00
Henri Verbeet 8a348a4b99 winex11: Only warn when an RandR output has no modes.
This can legitimately happen when the output is disconnected.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-20 14:02:40 +09:00
Michael Stefaniuc f256e1476c winex11.drv: Remove an unused assignment (PVS-Studio). 2015-01-23 15:32:59 +01:00
Erich E. Hoover 8e9e4a657f winex11.drv: Update the check for broken nVidia RandR to test for the number of resolutions instead of the number of modes. 2015-01-22 21:35:22 +01:00
Sam Edwards 3a5eef4eed winex11: Cache XRandR 1.2 display mode. 2013-05-13 11:05:13 +02:00
Sam Edwards 3fc2bccac2 winex11: Cache XRandR 1.0 display mode. 2013-05-13 11:05:10 +02:00
Michael Stefaniuc abf4250c72 winex11.drv: The winediag debug channel is only used for HAVE_XRRGETSCREENRESOURCES. 2012-11-30 19:12:16 +01:00