Changing the colour of the second pixel of the source bitmap clarifies
the incorrect behaviour of PixelOffsetMode Half and HighQuality.
This also provides better proof that PixelOffsetMode None and Fast are
implemented correctly.
Extending tests is starting point for further
improvements of implementation pixel offset modes
to match implementation from native gdiplus.
--
v2: gdiplus/tests: Extend DrawImage scaling tests.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3774
--
v4: dmsynth/tests: Test DirectMusicSynth class in isolation.
dmsynth/tests: Test DirectMusicSynthSink class in isolation.
dmsynth/tests: Import and use a check_interface helper.
dmsynth/tests: Avoid dynamic format string.
https://gitlab.winehq.org/wine/wine/-/merge_requests/3675
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.
--
v36: advapi32: Fake the SeLockMemoryPrivilege right in LsaEnumerateAccountRights.
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.
server: Use memfd to back anonymous mappings on Linux.
kernelbase: Implement GetLargePageMinimum by returning the value of LargePageMinimum in _KUSER_SHARED_DATA.
server: Set LargePageMinimum in _KUSER_SHARED_DATA on Linux.
server: Require SeLockMemoryPrivilege to create large page mappings.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This WIP branch prototypes the usage of virtual display devices (through "virtual desktop" mode at the moment) to support display mode emulation in the Wayland driver.
It works by allowing the driver to mark each host adapter with a virtual_id, which, if present, signals to win32u that it should include the adapter in the virtual display configuration. The virtual configuration (along with the virtual ids) is reported back to the driver though a new user driver function. If none of the host adapters is marked with a virtual id (i.e., all other drivers) we fall back to the single virtual display mode as before.
Some deficiencies and open questions with the prototype:
1. Virtual desktop mode implies a lot of behavior that we don't want at this point the Wayland driver (e.g., taskbar window, changing the display mode to the virtual desktop resolution at startup, some changes in fsclip behavior). One way forward would be to have a "virtual display devices" mode separate from the "virtual desktop" mode, so that drivers can opt in only to the desired behavior (virtual desktop would imply virtual devices, to maintain the current behavior).
2. It's not clear to me what would be the best way for a driver to opt in or out of certain core behavior. Perhaps the driver would change some volatile registry key which other components would consult? Or introduce a user driver function for core to query the driver about such features on demand? Is there some precedence I can get inspiration from?
3. At the moment, the prototype calls the new "NotifyVirtualDevices" user driver callback only in the process which the display update occurred. This means that other processes don't get notified of the virtual devices mapping to host devices, so, in the Wayland driver case, we are not able to scale windows from those processes properly. One approach would be for core to ensure that the NotifyVirtualDevices callback is called once in all processes, but I am not sure what's the best way to achieve this (or even if this is the preferred approach). Another way would be to have a mechanism for the driver to query the virtual device info (+mappings) on demand, and just broadcast a message to all windows. In this case it could even be done internally by the driver (so more in line with what the part-12 MR is doing), if we don't want to introduce a more global behavior. Perhaps there is some even better mechanism, which would also be more fitting to how we envision the virtual display/devic
es to evolve going forward.
Let me know what you think!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5057
--
v3: include: Fix wmemchr C++ warning.
include: Fix InlineIsEqualGUID C++ warning.
include: Add some _BitScanForward(64) declarations in intrin.h.
include: Add a __shiftright128 intrinsic definition.
include: Add a _umul128 intrinsic definition.
include: Move FILE_DISPOSITION_INFO after DeleteFile(A|W).
include: Add a MB_CUR_MAX definition in ctype.h.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6752