Windows 10 [received support](https://devblogs.microsoft.com/commandline/af_unix-comes-to-window… for AF_UNIX sockets in Insider Build 17063. This merge request adds basic support for AF_UNIX sockets to ws2_32 and wineserver.
Of particular note is the difficulty in handling `sun_path`. Most of the functions that allow for translating Windows paths to Unix paths are not accessible from ws2_32. I considered the following options:
* Pass the Windows path to wineserver and do the conversion there.
* This is, as far as I can tell, not possible without major rearchitecting. wineserver does not have functions to translate Windows paths to Unix paths, for obvious reasons.
* Obtain the current working directory of the requesting process and temporarily change directories to there.
* This only handles relative paths and fails for absolute paths, UNC paths, etc.
* Conditionally change directories based on whether the path is relative or not.
* This is error-prone and wineserver does not have the requisite functions to do this cleanly.
I ultimately decided to pass the translated Unix path to wineserver, which changes directories to `dirname(path)`. It then provides `bind` and `connect` with `basename(path)`. This is not threadsafe, but wineserver is not (currently) multithreaded.
Abstract sockets are not fully supported by this patch, matching the behavior of Windows.
--
v67: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
ws2_32: Add support for AF_UNIX sockets.
ws2_32: Add afunix.h header.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786
At least Doom 64 calls ClipCursor() with identical parameters
repeatedly, which seems to cause a considerable overhead. Together with
high polling rate mouse input this causes the game to almost freeze
while the mouse is being moved. So if the clipping did not change we can
bail out early because it will not cause any observable difference
anyway.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46976
Signed-off-by: Jan Klötzke <jan(a)kloetzke.net>
--
v2: winex11.drv: optimize repeated ClipCursor calls
winex11.drv: create win32 clipping window only once
https://gitlab.winehq.org/wine/wine/-/merge_requests/825
This simplifies future tests that check for object name of devices.
--
v2: server: Fix object name resolution of \Device\Null.
server: Make explicit the ownership of the unix_name buffer.
https://gitlab.winehq.org/wine/wine/-/merge_requests/475
Recent changes allowed the Wayland driver to properly deal with numpad keys depending on numlock status. This MR ensures that numlock and other lock state is properly synced, and concludes the fix for https://bugs.winehq.org/show_bug.cgi?id=56397.
This MR also syncs the key press state when a window gains keyboard focus, including any modifier press state. Note that we currently ignore the modifier press information from the `modifier` event, since: 1. it doesn't differentiate between left-right keys, 2. mod press state changes will be normally preceded by a matching key event, so we are able to sync properly. However, if we find that we need to handle mod press state changes without corresponding key events, we will need to implement some sensible way to sync these, too.
Although I would like for the driver work exclusively in terms of scancodes, I still needed to use vkeys in this case, since this is how wineserver expresses keyboard state at the moment. This means that I had to introduce/duplicate some extra scan->vkey logic in the driver (e.g., numpad keys based on numlock state) to get things right.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5712
--
v2: d2d1: Implement nodes connection for ID2D1TransformGraph.
d2d1: Implement nodes adding and removal for ID2D1TransformGraph.
d2d1/tests: Add more tests for ID2D1TransformGraph.
https://gitlab.winehq.org/wine/wine/-/merge_requests/698
--
v2: jscript: Implement Uint8ClampedArray.
jscript: Implement 'set' for Typed Arrays.
jscript: Implement 'subarray' for Typed Arrays.
jscript: Implement Typed Array construction from objects.
jscript: Implement ArrayBuffer.isView.
jscript: Implement Typed Array construction on ArrayBuffers.
jscript: Add initial implementation of Typed Arrays.
jscript: Use DISP_E_UNKNOWNNAME when looking up a prop that doesn't exist.
jscript: Avoid allocating props for indexed props unless necessary.
jscript: Move the indexed prop idx lookup into a helper.
mshtml/tests: Test redefining a writable indexed prop.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5085
Every other use of `EDIT_EM_SetSel` updates caret position by calling `EDIT_EM_ScrollCaret` or `EDIT_SetCaretPos`.
Fixes caret blinking in the middle when selecting all text.
![changes](/uploads/019bce6c12e0378d391e1253ecbaf9c6/changes.png)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3226
The reference count of host is supposed to go up by one in netconn_create.
The missing ref increment causes error handling paths
where netconn_close or release_host is called
to prematurely decrement the ref count of host to zero.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1121
This MR implements `NtContinueEx(PCONTEXT, PCONTINUE_OPTIONS)` which was added in Windows 10 20H1.
Also added basic test reusing existing `test_continue()` (included from !4720)
League of Legends game hooks `NtContinue()` and `NtContinueEx()` by putting `jmp` instruction in front of it.
Note that LoL doesn't actually use `NtContinueEx()` itself and game will work fine without it but if game doesn't find `NtContinueEx()` it will permanently ban your account due to detecting "scripting program"
--
v6: ntdll/tests: Implement APC test for NtContinue()
ntdll/tests: Add basic test for NtContinueEx()
ntdll: Implement NtContinueEx()
https://gitlab.winehq.org/wine/wine/-/merge_requests/4761
The "GdiInterop" is a sample application (source code is avaiable in [Github][source_code], relative guide in [MSDN][msdn_guide]) that demostracts how to display DirectWrite text on a GDI surface. After set dpi to 168 in `winecfg`, and run sample application with wine, the font size is normal, but the position of glyph is incorrect.
| Dpi: 96 | Dpi: 168 |
|:----------------:|:-----------------:|
| ![ss1][sc_96dpi] | ![ss2][sc_168dpi] |
There is the sample application after compile: [Release_x64.tar.gz](/uploads/c70e32824efcaa5d16ab39bbb4b86e30/Release_x64.tar.gz)
After change transform matrix that pass to `IDWriteFactory7_CreateGlyphRunAnalysis`, it can display glyph correctly.
[source_code]: https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7…
[msdn_guide]: https://learn.microsoft.com/en-us/windows/win32/directwrite/render-to-a-gdi…
[sc_96dpi]: /uploads/59cc343cfaa025f4ff4c32a84ab8cfeb/图片.png
[sc_168dpi]: /uploads/938be653362bb6ac58471b69ab66099a/图片.png
--
v5: dwrite: Fix incorrect position of glyph when rendering with BitmapRenderTarget in HiDPI
dwrite: Return render bounds if text not intersect to BitmapRenderTarget
https://gitlab.winehq.org/wine/wine/-/merge_requests/3718
The cast there seems safe from looking at the struct definitions, and is also used elsewhere in the codebase (dlls/kernelbase/locale.c:5682).
It's obviously not a full implementation, but works well enough for my usecase and maybe others as well.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4851
Fixes balloon tooltips so that they can be drawn outside of the work area (required for system tray icons) and improves the shape of the tooltips so that they resemble their shape on Windows.
--
v4: Diff reduce
https://gitlab.winehq.org/wine/wine/-/merge_requests/3547
This MR uses the existing compositor side surface scaling in the driver (through wp_viewporter, currently used for Hi-DPI scaling) to emulate display mode changes. This works wonderfully in coordination with fullscreen since the compositor is required non only to scale the surface, but also to position it properly and provide opaque surroundings (note: some compositors don't implement the last two features properly!).
Since: 1. Wayland doesn't allow clients to change the actual display configuration, and 2. there is no queryable service that holds the display information in a consistent manner (à la xrandr), the MR uses the win32 device settings as the source of truth for the current display mode. We let win32u handle the display mode change in the default manner (i.e., just updating the registry settings), and provide access to the current mode when updating the display devices through a new `gdi_display_manager.get_adapter()` function.
In order to be able to consistently (across all processes) associate an adapter device with its corresponding `wl_output` the MR introduces per-adapter driver data.
Note for people trying this out: many modern games don't change the hardware display settings, but rather scale themselves in right way to achieve the visual effect of a mode change (similarly to how this MR works, but they do it on the application side). To exercise most of the functionality in this MR you need an application that actually uses the `ChangeDisplaySettings` win32 API.
Thanks!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4947
Added suppot for DXGI_FORMAT_R8G8B8A8_UNORM to d2d_wic_render_target_init. For further testing i can provide and .exe that renders a red circle over a blue background.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5925
I haven't seen any software that uses this, but some older software out there might use it, so it's good idea to export it.
--
v5: ntoskrnl.exe: add KeNumberProcessors export.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1139
Some games with support for the haptic feedback and speaker features of the Sony DualSense controller select the controller's audio output by filtering on the ContainerId IMMDevice property to find one that matches the controller's HID's. This MR allows this information to be accessible from the IMMDevice's property store when the audio driver provides it (none for now, but I intend to add that feature to `winepulse.drv` and maybe `winealsa.drv`)
This is made specific to containerId rather than supporting VT_CLSID on every property because Wine currently stores VT_BLOBs directly in the registry value, which does not allow us to safely disambiguate between VT_CLSID and VT_BLOB values when reading from registry.
--
v7: mmdevapi: Invalidate ContainerID of unavailable audio devices.
https://gitlab.winehq.org/wine/wine/-/merge_requests/359
I've tried implementing this before but importing user32 from ntdll isn't a reliable
thing (so I recently rewrote it using the ntdll equivalents of LoadLibrary() and GetProcAddress())
Note: This is a weird way to implement this function (Windows implements this
in ntdll instead) but that would probably require a user32/ntdll rewrite (so this
is the next best tning to get the application working)
--
v4: ntdll: Implement NtdllDefWindowProc_A().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5236
Overwatch 2 verifies that every kernel callback that is run, lives in user32. Introduce a callback in user32 that just forwards to the other modules' callbacks.
--
v19: include: Add a comment explaining why all kernel callbacks must be in user32.
user32: Remove NtUserDriverCallback* kernel callbacks.
winex11.drv: Route kernel callbacks through user32.
winex11.drv: Pass a struct to x11drv_ime_set_result.
winex11.drv: Pass a struct to x11drv_dnd_post_drop.
winemac.drv: Route kernel callbacks through user32.
wineandroid.drv: Route kernel callbacks through user32.
opengl32: Route kernel callbacks through user32.
winevulkan: Route kernel callbacks through user32.
user32: Add NtUserDispatchCallback kernel callback.
user.exe16: Move kernel callbacks to wow_callbacks.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1180
wow64: Add TokenIntegrityLevel surpport to wow64_NtSetInformationToken as NtSetInformationToken does.
Description: synchronize wow64_NtSetInformationToken and
NtSetInformationToken.Avoid crash of some application due
to TokenIntegrityLevel failure in wow64 mode.
Signed-off-by: chenjiangyi <chenjiangyi(a)uniontech.com>
Change-Id: I556ab5cc6531dfab2c404e6769e053f42ada70a7
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5440
Wayland has 3 types of scrolling events:
- axis. Used for e.g., touchpad 2 finger smooth scrolling
- axis_discrete. Used for mouse scroll wheels (i.e., notches)
- axis_value120. Used for high resolution input devices
Wine currently only supports axis_discrete, meaning that
2 finger scroll events get ignored.
This commit tries to add basic support for axis scrolling events,
by translating the smooth motion in scroll increments using some
primitive assumptions about line height and number of lines to scroll.
--
v11: wip! winewayland.drv: Try to support smooth scroll events
https://gitlab.winehq.org/wine/wine/-/merge_requests/4809
My hardware is Ryzen 7 4700u with the integrated graphics
Flatout (Direct3D 9): 20 fps (renders correctly)
Unigine Heaven (OpenGL): ~40-60 fps (renders correctly)
Unigine Heaven (Direct3D 9): 20-30 fps (renders correctly)
Unigine Heaven (Direct3D 11): 20-30 fps as well (renders correctly)
Elder Scrolls IV (Direct3D 9): 20 fps (renders correctly)
BeamNG Tech Demo 0.3 (Direct3D 9): 2 fps (renders correctly, but still runs poorly)
Massive step up from getting 2 fps across many wined3d games, but it's still pretty bad, ~~and sometimes runs worse than the original code~~. Now with a combination of using the new and old code dynamically you can get the best of both worlds!
Unfortunately, we lose the ability to get lucky with the mapping just happening to be in the 32 bit range.
--
v7: opengl32: speed up wow64 mapping.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5145
musl itself expects to be configured to compile with either
-ffloat-store or -fexcess-precision=standard - but when imported
into Wine, those flags aren't used.
This seems to be essential for getting reasonable precision
from some math functions such as exp2() - without the expected
precision truncation, the output value of exp2() can be off by
as much as 0.2% in some cases.
As Wine doesn't build the musl sources with those flags, use
volatile to force storing/reloading floats in order to limit
their intermediate precision, as musl expects. Only do this on
i386 where this is known be required.
This fixes https://bugs.winehq.org/show_bug.cgi?id=56372.
Apparently this issue only appears when compiled with GCC; with
Clang, this already works as expected.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5276
The problem is that registry save is a very heavy operation (scheduled each 30sec in wineserver) during which server doesn't process any requests and the whole prefix is stalled for the duration of the operation.
For some reference, the process takes from 50-100ms here up to 1-1.5sec with default initial registry (after some registry modifications which trigger actual registry flush), depending on the filesystem type and state (as huge time may be spent in file close / rename). With the same registry after this patchset the server part (flush_key returning the whole registry data) is taking ~4-5mcs, measured from the client side so that already includes data transfer.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3124
Some cleanup for expressions, sanitizing the structure a bit especially for abstract operations with multiple args.
I also found out about named bison variables, implicit (as `$token` referring to `token`), or explicit (as `$name` referring to `token[name]`). I think it would make the rules much more readable so I started using them here. My plan is to add them progressively to the rules, unless there's some good reason not to (like idk how portable they are, if that's something we should be worried about).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4201
I'm not completely sure about the mechanism, but I think it's simple enough to consider having that upstream now. This shows at least how we can leverage win32u surface changes to decide to switch surfaces on/off-screen and fallback to manual blitting.
Having the surfaces on-screen makes sure they are presented as efficiently as possible, having them off-screen we use GDI blit to indirectly call XCopyArea and this will be suboptimal, probably with visible tearing, but hopefully not too common.
--
v4: win32u: Use GDI blit to implement partial or other process presentation.
winex11: Return an offscreen HDC from vulkan_surface_detach.
win32u: Pass a HDC parameter to vulkan_surface_detach.
winex11: Create a window surface even when there is client window.
winex11: Also attach child client windows to their toplevel window.
win32u: Make sure vulkan windows have a pixel format selected.
win32u: Detach vulkan surfaces that aren't fully visible.
win32u: Detach offscreen, child or vulkan surfaces for another process.
win32u: Move vulkan surfaces to their new parent when reparenting.
win32u: Introduce a new vulkan offscreen surfaces list.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5573
Signed-off-by: Joel Holdsworth <joel(a)airwebreathe.org.uk>
--
v2: ntdll: Add support for FILE_{RENAME,LINK}_POSIX_SEMANTICS.
ntdll: Factor out get_inode_open_sharing.
ntdll/test: Add tests for FILE_LINK_POSIX_SEMANTICS.
ntdll/test: Add tests for FILE_RENAME_POSIX_SEMANTICS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4457
Adds the tray icons implementation based on org.kde.StatusNotifierItem interface usage. Does allow restarting StatusNotifierWatcher object, but will fallback to XEMBED or internal tray, if wine gets initialized when there is no StatusNotifierWatcher object registered.
--
v41: win32u: Handle dbus notification balloons from system_tray_call
win32u: Handle notification balloons through org.freedesktop.Notifications dbus interface
win32u: Add a ShowBalloon driver interface
win32u: Handle StatusNotifierItem management from system_tray_call
win32u: Handle StatusNotifierWatcher owner changing and registering objects to a new watcher
win32u: Add SNI driver for systray handling
win32u: Add DBus event loop for SNI handling
win32u: Add a SystrayRunLoop driver interface
https://gitlab.winehq.org/wine/wine/-/merge_requests/2808
General idea of this test is to show that a lot of factors influence the fog when transformed and untransformed vertex format was used:
- Directly changing z and w (which is not equal in the corners).
- Changing projection matrix that change z and w.
- Using different programmable/ff vs/ps shader.
- Using different depth bias.
- Chaging depth in pixel shader (oDepth) may or may not affect to colors depending on the vendor implementation.
- And various combinations of above.
This gives `succ` in all cases on this configs:
- Windows 10 with Radeon HD 8400 or Ivy Bridge GT1 (Intel HD Graphics).
- Windows 7 with Radeon HD 6450.
- Windows XP with GeForce Go 7300.
--
v2: d3d9/tests: test table fog z vs rhw with shaders, depth bias, oDepth..
https://gitlab.winehq.org/wine/wine/-/merge_requests/2657
The `-Wstringop-overread` fix feels a bit questionable (so I'll add Eric as a
reviewer to clarify the MSC structs details)
--
v4: winedump: Initialize size variable in dump_dir_exceptions().
winedump: Use offsetof() for string position calculations.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5625
That seems to fix some (difficult to reproduce) crashes in EA Desktop / CEF, usually on shutdown but sometimes during starting up.
Currently TpSetWait can set (or clear) the event, while waitqueue_thread_proc() gets woken from NtWaitForMultipleObjects by previously set wait object and call the callback as if new set (or cleared) wait object is signaled. The crashes I was reproducing were always happening when RtlDeregisterWaitEx call is racing with waking the wait and calling the callback.
--
v2: ntdll: Make sure wakeups from already unset events are ignored in waitqueue_thread_proc().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5044
This also bumps the minimum supported version of macOS to 10.12 to unconditionally assume the ulock syscalls are present.
As discussed with @Gcenx this shouldn't be an issue, as the current minimum support version of 10.8 does not work anyways at the moment with only 10.10+ being useable and even then virtually no-one using wine on versions < 10.12 (and also being unsupported by the prebuilt binaries).
Bumping to 10.12 would also have the side-benefit of allowing some cleanup of deprecated functions or legacy codepaths (like `mach_continuous_time` vs `mach_absolute_time` and probably much more).
In my testing ulock futexes are about 2x faster for synchronization than kevents. Using the syscall wrappers here should provide protection against changing syscall numbers, and given that ulock is also directly used by libc++, the probability of an incompatible API change here is basically zero imo.
By default ulock is also process-private, similar to the current linux implementation, cross-process synchronization would require darwin 19+ (macOS 10.15+) with `UL_COMPARE_AND_WAIT_SHARED`.
The diff is a bit bigger than it actually is in effect, since https://gitlab.winehq.org/mzent/wine/-/commit/28a8a991c165f0d37dbf78ca3cdee… is only moving some code around and not actually changing anything.
--
v4: ntdll: Implement futex_wait() and futex_wake_one() on macOS.
ntdll: Simplify futex interface from futex_wake() to futex_wake_one().
ntdll: Use USE_FUTEX to indicate futex support.
ntdll: Prefer futex for thread-ID alerts over kqueue.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5237
This is the first batch of a series implementing faster media source resolution required to workaround an Unreal Engine race condition present in some games, and deterministic stream ordering that decodebin / parsebin cannot provide, which is required to expose the streams in native order, for compatibility in several other applications.
I pushed the full series as a branch here: https://gitlab.winehq.org/rbernon/wine/-/commits/mr/wg-source-part-one
Note that this full series is also a first step in the direction of having a simpler demuxer interface, which will be required in the future for compatibility with applications that build MF or DirectShow pipelines directly and expect the relevant components to behave as a demuxer and expose compressed media types. For now it only delays the use of wg_parser to whenever the media source is started, and matches the non-ordered streams using their media types and tags. This is a best effort solution but I don't think we can do much better for the moment.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3606
--
v2: winegstreamer: Expose the generic video decoder transform.
winegstreamer: Introduce a generic audio decoder transform.
winegstreamer: Rename aac_decoder to audio_decoder.
winegstreamer: Translate generic unknown audio / video media types.
winegstreamer: Support generic audio / video unknown formats.
winegstreamer: Call gst_video_info_from_caps for all video formats.
winegstreamer: Call gst_audio_info_from_caps for all audio formats.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5138
Adds the registry key
HKEY_CURRENT_USER\\Software\\Wine\\Wayland Driver\\rawinput
witch allows mouse raw input. This makes it easier
to calculate the same sensitivity in different games,
use sensitivity calculators, and easily change values
when changing mouse DPI and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
but sensitivity curves in libinput are more difficult
to calculate than mouse sensitivity in the games.
Implementation of ideas written in the comments: https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
--
v6: winewayland.drv: Add mouse rawinput support
https://gitlab.winehq.org/wine/wine/-/merge_requests/5869
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44863
The bug has been fixed already by moving ddraw4 vertex buffers into
system memory. Changing this value makes the game create a smaller
buffer, which makes the game fast on video memory buffers. I think we
should stay close to what Windows drivers report even though we
mitigated the original issue in a different way.
--
v2: ddraw: Set dwMaxVertexCount to 2048.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5687
--
v2: d3dx9: Add support for mipmap generation to D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Use d3dx_image structure inside of D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Cleanup texture value argument handling in D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Refactor texture creation and cleanup in D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9/tests: Add more tests for D3DXCreateVolumeTextureFromFileInMemoryEx().
d3dx9: Use shared code in D3DXLoadVolumeFromFileInMemory().
https://gitlab.winehq.org/wine/wine/-/merge_requests/5881
Fix black screen issues for Active Trader Pro and Assetto Corsa. This reverts commit 4124478b.
For Active Trader Pro, the hack ends up clearing a context that was previously drawn to to black,
possibly because multiple OpenGL contexts are involved according to Henri's investigation.
Assetto Corsa creates a D3D device for a window but doesn't actually do any rendering with it. After
ceefcca7, having an OpenGL context for a window clears its OpenGL surface to black after its view
becomes visible. The OpenGL surface is on top of other layers for the window so the window becomes
black after that. The blackness is originally from glDrawBuffer(GL_FRONT_AND_BACK), which presumably
prepares a zero-initialized OpenGL front draw buffer. This also suggests that 4124478b is no longer
necessary. I could delay the clearToBlackIfNeeded() call so it uses the behavior before ceefcca7,
but now that it seems the hack is no longer necessary and might cause more errors. CrossOver has
disabled the hack for a while and it seems fine. I think it's time to remove the hack.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5929
As mentioned in https://gitlab.winehq.org/wine/wine/-/merge_requests/5264, the next step for OpenGL in the Wayland driver is support for WGL_ARB_pixel_format. It seems possible, at least in theory, to move a large part of the logic involved in this extension outside the drivers for common use by all of them (or ones that want to opt-in).
The goal of this RFC MR is, through experimentation and discussion/feedback, evaluate:
1. Whether making such functionality available outside the drivers (likely in an opt-in manner to begin with) is a productive way forward, or the complexity and platform specific decisions favor the current per-driver approach.
2. If we think that (1) is a worthy goal, what's the best mechanism to achieve it.
Note that the focus of this MR is currently on being a proof-of-concept, rather providing ready-for-detailed-review code (although I have done my best to keep the code decent). This MR currently (roughly in commit order):
* Introduces a new wgl driver callback to allow drivers to provide to opengl32/unix a list of formats and many details about them.
* Uses the information in that list to implement wglGetPixelFormatAttrib*.
* Uses the information in that list plus format sorting rules from WineX11 (effectively GLX rules plus tweaks) to implement wglChoosePixelFormatARB.
* Implements the get_pixel_formats callback for the Wayland driver.
* Hacks the get_pixel_formats callback for WineX11, and to allow me to run some experiments to compare the output of native WineX11 and get_pixel_formats-WineX11. In the admittedly not too many games I tried the sort order is the same, so at least that's encouraging.
My thoughts and notes so far:
* Using this approach for wglGetPixelFormatAttrib* works well, and we can also implement wglDescribePixelFormat in this way.
* It's not at all clear what the "right" sorting rules are for wglChoosePixelFormatARB.
* WineX11 uses GLX + tweaks (e.g., changes depth sorting). This means that larger formats tend to be preferred, at least according to the GLX spec. For example, asking for a r5, g6, b5 in the attributes is supposed to give back rgb888 (or even higher if available) as the top format in the list. Interestingly, and to confuse things even more, I haven't been able to make GLX return non-888(8) configs at all to actually test this more, so perhaps that's what saves it here? However, eglChooseConfig works similarly and there I was able to verify this behavior (e.g., got a nice surprise 10-bit format when asking for 5551 :)).
* Winemac has its own custom logic.
* Mesa's WGL implementation uses a different approach, closer to Wine's normal (wgl)ChoosePixelFormat, where proximity to the target format is strongly rewarded (so it seems asking for r5g6b5 is much more likely to actually get you that).
* Of course, the "gold standard" here would be to try to infer and use the rules used by some windows driver.
Looking forward to thoughts/feedback!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5388
On the client side, frame aperture may be included or omitted. This can be used to include or drop the frame padding, and the VideoProcessor MFT supports it.
On GStreamer side, we can only use the unpadded frame size in the caps, because this is how decoders work, and padding needs to be added as a property of the input/output video buffers. Then, frame size needs to be adjusted to be consistent between input and output, and any difference considered as extra padding to be added on one side or the other.
--
v3: winegstreamer: Respect video format padding for input buffers too.
winegstreamer: Exclude padding from wg_format video frame size.
winegstreamer: Use video info stride in buffer meta rather than videoflip.
winegstreamer: Use a new wg_video_buffer_pool class to add buffer meta.
winegstreamer: Update the output_format when stream format changes.
winegstreamer: Pass optional GstVideoInfo to read_transform_output_data.
winegstreamer: Split read_transform_output_data in two helpers.
winegstreamer: Introduce a new sample_needs_copy_buffer helper.
winegstreamer: Introduce a new sample_set_flags_from_buffer helper.
mf/tests: Add more video processor tests with aperture.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5055
This MR adds a default implementation for `wglChoosePixelFormatARB` (in opengl32.dll) which will be used automatically if the driver populates the wgl_pixel_format ARB fields. Thus winex11 automatically uses this, and this MR removes the driver internal implementation.
The second part of this MR adds `WGL_ARB_pixel_format` support for winewayland (we can move this to a separate MR, but I wanted to have another implementation to better assess the behavior).
The `wglChoosePixelFormatARB` behavior is loosely modeled after the the AMD driver as discussed in https://gitlab.winehq.org/wine/wine/-/merge_requests/5388. I tried to keep things simple to begin with, and the results I am getting in various apps/games are sensible, but please try this out so we can refine further.
--
v2: winewayland: Support WGL_ARB_pixel_format_float.
winewayland: Support WGL_ARB_pixel_format.
winex11: Remove driver wglChoosePixelFormatARB implementation.
opengl32: Add default implementation for wglChoosePixelFormatARB.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5933
I have a question for Julliard before doing additional work:
1. Why do only MR test jobs have the extra-quiet winetest option enabled?
I think it exposes test flakiness (which could be insightful in normal Wine jobs too)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5952
This saves ~1500 LoC, and at the same time allows mapping arbitrary long codec data back and forth GstCaps, which will be required to support arbitrary compressed formats. We can then for instance expose unknown codecs as Wine-specific subtypes, expose generic decoders and pass the backend GstCaps serialized in the codec data.
It makes the code simpler by unifying all frontend mappings and only requiring mapping between GstCaps and a unified set of formats. Mapping between IMFMediaType and the AM_MEDIA_TYPE formats is done using the standard MF functions and are tested and validated in mfplat tests.
--
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5615
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v34: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v33: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v32: psapi: Add tests for querying information for large pages.
ntdll: Use PAGEMAP_SCAN ioctl to implement get_working_set_ex, if available.
kernel32: Add tests for large pages support.
ntdll: Support allocating virtual memory, creating and mapping files backed by large/huge pages.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
without freetype, some calling return failed, so some value may not be initialized (it initialize by some failed calling and pass argument by point of it), it would cause random crash!
Signed-off-by: Fan WenJie <fanwj(a)mail.ustc.edu.cn>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5957
Signed-off-by: Fan WenJie <fanwj(a)mail.ustc.edu.cn>
when get_char_dimensions failed, width not set, width may be undefined value and cause undefined behaviour
--
v7: win32u: fix random crash without libfreetype
https://gitlab.winehq.org/wine/wine/-/merge_requests/5854
On Sat Jun 29 20:07:51 2024 +0000, Loïc Rebmeister wrote:
> @infyquest I'm happy you tried to make a fix, I'm happy you have
> interest in wine.
> > I dont need you to teach me code, Please don't make it personal.
> This ain't personal, if someone want to make a fix, they need at least
> to understand the code they send, this is the same with everyone.
> I know you wanted to do good, but this doesn't change what this code
> effectively does.
I am contributing to wine for more than 10 years. I admit that I might be wrong in understanding the code. Please try to communicate and present in a decent way as it will rub the people in a wrong way.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5771#note_74757
@infyquest I'm happy you tried to make a fix, I'm happy you have interest in wine.
> I dont need you to teach me code, Please don't make it personal.
This ain't personal, if someone want to make a fix, they need at least to understand the code they send, this is the same with everyone.
I know you wanted to do good, but this doesn't change what this code effectively does.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5771#note_74756