Commit Graph

38497 Commits

Author SHA1 Message Date
Matt Borgerson ba6f7f360e mcpx: Move VP files into vp/ 2025-06-03 19:36:08 -07:00
Matt Borgerson 2321dbfeb6 mcpx: Split some VP structs out to vp.h 2025-06-03 19:36:08 -07:00
Matt Borgerson 8ee8732aad mcpx: Drop some redundant protos 2025-06-03 19:36:08 -07:00
Matt Borgerson 9bdeb2d793 mcpx: Add inline keyword to float conversion helpers 2025-06-03 19:36:08 -07:00
Matt Borgerson bf9985e7bf mcpx: Move DSP functions to dsp.c 2025-06-03 19:36:08 -07:00
Matt Borgerson 2d5c4fa34d mcpx: Move VP functions to vp.c 2025-06-03 19:36:08 -07:00
Matt Borgerson bee1cb6006 mcpx: Move debug functions to debug.c 2025-06-03 19:36:08 -07:00
Matt Borgerson eb88acf4c0 mcpx: Move some definitions to apu_int.h 2025-06-03 19:36:08 -07:00
Erik Abair 9732026aca nv2a: Ignore unsupported depth funcs to match HW 2025-06-03 12:11:46 -07:00
Matt Borgerson 26c451fc36 mcpx: Process voices concurrently 2025-06-03 01:54:09 -07:00
Matt Borgerson 344f7da132 mcpx: Support 3D voice HRTF filtering 2025-05-31 17:16:54 -07:00
Matt Borgerson 05b1f2c13d mcpx: Define a constant for 3D voice count 2025-05-31 17:16:54 -07:00
Matt Borgerson 38d33367ea xbox: Move xbox machine property creation to class init handler 2025-05-27 19:38:54 -07:00
Erik Abair 8667193001 nv2a: Prevent NaN in specular power factor calculation 2025-05-20 13:28:39 -07:00
coldhex ce936bccdd nv2a/gl: y-flipped rendering to framebuffer object
Render scenes upside-down to framebuffer objects (FBO). The strange thing
about rendering to OpenGL FBO is that it follows the bottom-left triangle
rasterization rule with common PC GPUs. At least Intel and AMD. NVIDIA to
be tested. My raster-rule-test github gist demonstrates this.

This commit flips coordinates in y-direction, which effectively turns the
bottom-left rule into top-left rule needed for Xbox compatibility.

This (together with the previous commit) fixes Midtown Madness 3 Seine
water rectangular seam rendering artifacts (and the remaining seams are
present with Xbox hardware too.) May fix similar artifacts in other games.
2025-05-20 13:15:12 -07:00
coldhex a316d74872 nv2a: Use trunc in vertex rounding instead of floor
Xbox seems to truncate instead of flooring, which can be inferred from
interpolated depth buffer values.
2025-05-20 13:15:12 -07:00
coldhex 11dcae01b9 nv2a: implement screen coordinate rounding to 4 bit fractional precision
Xbox triangle rasterization appears to follow the usual top-left rule.
However, since Xemu renders to an OpenGL framebuffer object (FBO) instead
of directly to the default framebuffer, Xemu actually has what could be
called the bottom-left triangle rasterization rule. I'll address that in
another commit.

Also, note that the ProjAdjacentGeometry_0.5625 test in nxdk_pgraph_tests
is very sensitive to floating point rounding errors. For example, the
nxdk_pgraph_tests commit 66b32a0b1feba32a0db7a95d6358e84f7a6246ad changed
the math library which caused the test result to change also on real Xbox
hardware due to floating point rounding error differences in matrix
inverse computation. Apart from the bottom-left rasterization issue, the
differing result between Xbox and the rounding I am proposing here for
Xemu seems to stem from floating point rounding that happens in screen
coordinate calculations before the rounding to 4 bit precision takes place.
Fixing such rounding issues would require carrying all preceding floating
point computations exactly in the same order and with same precision as
Xbox. Note that Xbox Direct3D library seems to add 0.03125 (1/32) to
screen coordinates by default. Likely the idea there was to make floating
point screen coordinates round to the nearest screen coordinates in
4 bit fixed point precision. So the Xbox Direct3D library (and therefore
games) already mitigate against precarious rounding when exactly
half-integer coordinates are used by games. Actually they would use
integer coordinates because it is Direct3D 8, but since nv2a appears to
rasterize at half-integer coordinates like OpenGL, Xbox Direct3D
also adds 0.5 to screen coordinates in addition to 1/32.
2025-05-20 13:15:12 -07:00
Erik Abair c720af00bb
nv2a/vsh: Replace NaN with 1.0 for Bx, Dx, Fog outputs and MUL zero-check 2025-05-15 12:54:56 -07:00
Erik Abair 428c975f09 nv2a: Allow multiframe RenderDoc captures with nv2a traces
Allows multiple frames to be captured at once by holding shift while pressing
F10.

Temporarily toggles nv2a trace messages if control is held while pressing F10.
2025-05-15 08:37:13 -07:00
Erik Abair d593869429
nv2a: Move point params to uniforms
Co-authored-by: Matt Borgerson <contact@mborgerson.com>
2025-04-30 23:43:38 -07:00
Matt Borgerson 6e513ed948 nv2a/psh: Fix 2D texture addressing in DOT_STR_3D mode 2025-04-29 23:41:05 -07:00
Erik Abair 89185e6937 nv2a/psh: Fix default alpha for unbound texture samplers 2025-04-22 20:16:15 -07:00
Matt Borgerson 0c2a617819 nv2a: Bump vmstate version for new NV2A_MAX_BATCH_LENGTH 2025-04-18 11:58:22 -07:00
Erik Abair 270dbe01ea nv2a: Increase MAX_BATCH_LENGTH beyond highest known retail use 2025-04-18 10:46:43 -07:00
Matt Borgerson 5685a6290c nv2a/vk: Set specular power uniform 2025-04-16 20:26:22 -07:00
Erik Abair 679f6d06bd nv2a: Handle LOCALEYE light control 2025-04-16 18:24:46 -07:00
Erik Abair 34ed0f75de nv2a: Handle LOCAL_RANGE 2025-04-16 18:24:46 -07:00
Erik Abair 69c8df2a3e nv2a: Partial implementation of SET_SPECULAR_PARAMS 2025-04-16 18:24:46 -07:00
Erik Abair 7a34eedd6f nv2a: Partially handle SET_LIGHT_CONTROL 2025-04-16 18:24:46 -07:00
Erik Abair 86c85023e6 nv2a: Handle SET_FOG_COORD and SET_WEIGHT* commands 2025-04-16 14:09:13 -07:00
Matt Borgerson 2cc926588b nv2a/gl: Fix COLOR_LE_G8B8 GL surface format type 2025-04-11 04:18:28 -07:00
Erik Abair ebec5e3028 nv2a: Fix assert when setting fog gen mode to fog_x 2025-04-08 16:24:50 -07:00
Matt Borgerson 57cdee770e mcpx/dsp: Fix some formatting/spelling nits 2025-03-31 12:40:31 -07:00
Matt Borgerson 9439f605a8 mcpx/dsp: Drop redundant value/address assertions 2025-03-31 12:40:31 -07:00
Matt Borgerson e08011b772 mcpx/dsp: Rename *.inl -> *.c.inc 2025-03-31 12:40:31 -07:00
Matt Borgerson 4b81c28901 mcpx/dsp: Migrate some DPRINTFs to trace events 2025-03-31 12:40:31 -07:00
Matt Borgerson 31d8237ee3 mcpx/dsp: Remove dsp56k_execute_one_disasm_instruction 2025-03-31 12:40:31 -07:00
Matt Borgerson 8dafd513b9 mcpx/dsp: Move some debug functions out to debug.c 2025-03-31 12:40:31 -07:00
Matt Borgerson d18125994c mcpx/dsp: Drop some dead code 2025-03-31 12:40:31 -07:00
Matt Borgerson f8cbcbadaa mcpx/dsp: Move dma reg defs to a header 2025-03-31 12:40:31 -07:00
Matt Borgerson c68cdd9479 mcpx/dsp: Fix minor header issues 2025-03-31 12:40:31 -07:00
Matt Borgerson 31c491a702 mcpx/dsp: Move cpu reg defs to a header 2025-03-31 12:40:31 -07:00
Matt Borgerson 5ba2ef790c mcpx/dsp: Factor out debug bits to a header 2025-03-31 12:40:31 -07:00
Matt Borgerson 148f04e1c7 mcpx/dsp: Replace printf -> DPRINTF 2025-03-31 12:40:31 -07:00
Matt Borgerson 115456f255 mcpx/dsp: Bring back disassembly 2025-03-31 12:40:31 -07:00
Matt Borgerson 89f98947f6 mcpx/dsp: Fix dprintf use 2025-03-31 12:40:31 -07:00
Matt Borgerson 9af3c1a005 mcpx/dsp: Add missing copyright 2025-03-31 12:40:31 -07:00
Matt Borgerson bf51af891d mcpx/dsp: Move to a library 2025-03-31 12:40:31 -07:00
Erik Abair 672e9cd553 nv2a: Handle SET_SPECULAR_ENABLE 2025-03-28 02:18:42 -07:00
Matt Borgerson 312bd94573 mcpx: Move voice_list_regs to apu.c 2025-03-27 23:33:40 -07:00
Matt Borgerson 2d73e8aafe nv2a: Use root-relative paths to reference parent dir headers 2025-03-27 23:33:40 -07:00
Matt Borgerson 0e18d11d90 nv2a: Rename methods.h -> methods.h.inc 2025-03-27 23:33:40 -07:00
Matt Borgerson a830cc4526 xbox: Disable clang-format for deliberately aligned reg defs 2025-03-27 23:33:40 -07:00
Matt Borgerson 1893b56c38 nv2a/vk: Fix vertex ram buffer dirty bit check 2025-03-19 02:25:33 -07:00
Matt Borgerson b929d4eced nv2a: Drop surface compat clip constraint 2025-03-17 14:48:47 -07:00
Matt Borgerson c3a8b9569f nv2a: Simplify surface clip to scissor size calculation 2025-03-17 14:48:47 -07:00
Logan Stromberg 860bccb722
nv2a: Fix surface clip to scissor origin 2025-03-17 14:32:40 -07:00
coldhex 02659dd3cc nv2a: Fix cubemap fourth texture coordinate component handling
Xbox hardware ignores fourth texture coordinate component for cubemaps.
2025-03-17 11:37:41 -07:00
wilkovatch a00820746f
nv2a: Handle texture dimensions not divisible by 4 in S3TC decoder 2025-03-14 18:44:25 -07:00
Matt Borgerson a143f66ce4 nv2a/psh: Handle 3D textures in PROJECT2D mode 2025-03-10 16:13:09 -07:00
Matt Borgerson 6e3dfb36d8 nv2a/vk: Don't set compressed, swizzled when attribute is uniform 2025-03-10 14:23:43 -07:00
Matt Borgerson 4665515d80 nv2a: Group attributes in pgraph_get_glsl_vtx_header 2025-03-10 12:30:16 -07:00
coldhex 3eb22b6b81 nv2a: Explicit float representation for RCC and vertex shader W range 2025-03-08 14:54:18 -07:00
coldhex 63cb75ce84 nv2a: Fix -0.0 clamping of RCC instruction and vertex shader W-output
Xbox rounds -0.0 to the negative range and 0.0 to the positive range. This
commit also restores RCC instruction clamping to be done on the output of
reciprocal calculation (which current Xemu release does) with fix for the
input=Infinity case.
2025-03-08 14:54:18 -07:00
coldhex 8dc6c90e11 nv2a/vk: Drop unnecessary dirty check for NV_PGRAPH_ZCOMPRESSOCCLUDE
This was used to enable/disable Vulkan depth clamping, but that was
removed in previous commit.
2025-03-08 14:54:18 -07:00
coldhex 854a001063 nv2a: Fix zero-vector input in fixed function vertex shader
If tPosition is a zero-vector, then invViewport matrix had no effect.
Bounding w-coordinate away from zero and infinity must be done before
applying invViewport (which is needed for OpenGL/Vulkan) to emulate
Xbox hardware behaviour properly.
2025-03-08 14:54:18 -07:00
coldhex 798ad30819 nv2a: Perspective-correct interpolation for w-buffering
z_perspective is true implies w-buffering and then the w-coordinate stored
in the depth buffer should also be interpolated in a perspective-correct
way. We do this by calculating w and setting gl_FragDepth in the fragment
shader.

Since enabling polygon offset and setting values using glPolygonOffset
won't have any effect when manually setting gl_FragDepth for w-buffering,
we introduce the depthOffset variable to obtain similar behaviour (but the
glPolygonOffset factor-argument is currently not emulated.) (Note that
glPolygonOffset is OpenGL implementation-dependent and it might be good to
use depthOffset for z-buffering as well, but this is not done here and we
still use OpenGL/Vulkan zbias functionality.)

This also implements depth clipping and clamping in the fragment shader.
If triangles are clipped, the shadows of the small rocks in Halo 2 Beaver
Creek map can have flickering horizontal lines. The shadows are drawn on
the ground in another pass with the same models as for the ground, but for
some reason with depth clamping enabled. The flickering happens if Xemu
clips the ground triangles, but the exact same shadow triangles are depth
clamped, so there are small differences in the coordinates. The shadows
are drawn with depth function GL_EQUAL so there is no tolerance for any
differences. Clipping in the fragment shader solves the problem because
the ground and shadow triangles remain exactly the same regardless of
depth clipping/clamping. For some performance gain, it might be a good
idea to cull triangles by depth in the geometry shader, but this is not
implemented here.

In the programmable vertex shader we always multiply position output by w
because this improves numerical stability in subsequent floating point
computations by modern GPUs. This usually means that the perspective
divide done by the vertex program gets undone.

The magic bounding constants 5.42101e-020 and 1.884467e+019 are replaced
by 5.421011e-20 and 1.8446744e19, i.e. more decimals added. This makes the
32-bit floating point numbers represent exactly 2^(-64) and 2^64 (raw bits
0x1f800000 and 0x5f800000) which seem more likely the correct values
although testing with hardware was not done to this precision.

Testing indicates that the same RCC instruction magic constants are also
applied to both fixed function and programmable vertex shader w-coordinate
output. This bounding replaces the special test for w==0.0 and abs(w)==inf
which used to set vtx_inv_w=1.0 (which did not match Xbox hardware
behaviour.)
2025-03-08 14:54:18 -07:00
Erik Abair f701573d44 nv2a: Use rounded values for alpha testing 2025-03-05 17:12:14 -07:00
mborgerson de1f311efa
Merge QEMU v9.2.1 2025-02-15 15:17:25 -07:00
coldhex 0427ae8cfc mcpx: Implement APU multipass voice processing
Voice Processor (VP) multipass feature allows configuring lists of voices
that are first mixed (in order) into a designated mixbin which is then used
as a sample source when processing voices with multipass flag set to true
in NV_PAVS_VOICE_CFG_FMT. Setting correct voice order in lists is the
responsibility of the game/application and in practice is handled by the
DirectSound library. The multipass mixbin is hardcoded to 31 in
DirectSound, but hardware would allow other bins.

This implementation also adds additional info to audio debug UI to see what
the source and destination voices involved are. The info is only shown
when DSP processing is off, i.e. "VP Only" (MON_VP) is selected. This is
because storing the voice numbers requires additional digging which is
required for MON_VP anyway and therefore is free. The multipass feature
itself works fine with DSP (i.e. GP and EP) enabled, only the additional
debug info is not shown.
2025-02-15 15:01:29 -07:00
Matt Borgerson 366aacb398 v9.2.1 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmenP10ACgkQgqpKJDse
 lHhYXxAAhSGXrrfEjfyNPO0N5tRKqCzYkoeB5GDScRMb3UogF2/jg/VV2uAVBKnl
 ikCO87w81+8FctiYKfMYnhTk+axlxYq//H8JALX3tyt35BpSfSkyxS8RGzVl4S3l
 0TMA0l+cs3zPDq+yA3UAhppV5CgwBbzaN8xCm9mNFe49nlIHymgcFc3tFFtS0x+H
 PLjbqGX3X7joyqZ0O2cYk3UwzF01ZR1RKgM3sUumvsoSOwuKGul4jc0iLCn9hTHX
 QdxrThxb9KL5iL+fY5DlYc/LiJNPk1NcU1dQzqJinzrux9wNr4RpF7iSrs+m0Y/d
 3FNzMTPuiqwBh4JJFGuSguR83q6nJLlVR/kKxPmPNBSX86q4L1Dw0rbyb40ZRGAA
 xV88kv8gzvmhR2hnScn7S+2d3EG9D3DKDCKTPp0unHhMjZk9rP+hcPmQaTqi1CIW
 c400CI2gP0e0a8TFLKTnTFVP2+scvOkVn6rBy9+pQat0eTMgWjA9VSxvG5GRJ4W9
 +i/9RSTyCLy3s7DWX3JN9nytZ5mS/RDv5YB3FfeMlT/1wH5PFYitxHdyxjHrBE+8
 KjXPtqDsJTMvwqPP+2nDD7D1MQWJgz0468GeuPK5itJCYBVYilIOUlibKfAEPbo+
 0eUtq1oVMJfKnJadARf2cQrzR2IGEWF1rZqrRrkxfl+mHnTxnss=
 =XhYS
 -----END PGP SIGNATURE-----

Merge QEMU v9.2.1
2025-02-15 13:59:10 -07:00
Hongren Zheng e82fbf01b6 hw/usb/canokey: Fix buffer overflow for OUT packet
When USBPacket in OUT direction has larger payload
than the ep_out_buffer (of size 512), a buffer overflow
would occur.

It could be fixed by limiting the size of usb_packet_copy
to be at most buffer size. Further optimization gets rid
of the ep_out_buffer and directly uses ep_out as the target
buffer.

This is reported by a security researcher who artificially
constructed an OUT packet of size 2047. The report has gone
through the QEMU security process, and as this device is for
testing purpose and no deployment of it in virtualization
environment is observed, it is triaged not to be a security bug.

Cc: qemu-stable@nongnu.org
Fixes: d7d3491855 ("hw/usb: Add CanoKey Implementation")
Reported-by: Juan Jose Lopez Jaimez <thatjiaozi@gmail.com>
Signed-off-by: Hongren Zheng <i@zenithal.me>
Message-id: Z4TfMOrZz6IQYl_h@Sun
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 664280abddcb3cacc9c6204706bb739fcc1316f7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-29 22:29:03 +03:00
Matt Borgerson 7cb7bb68a9 nv2a: Multiversion [un]swizzle to optimize for common bpp 2025-01-26 18:47:46 -07:00
Matt Borgerson eae328dc19 nv2a: Move [un]swizzle_rect to swizzle.h 2025-01-26 18:47:46 -07:00
Matt Borgerson bb5ee6865b nv2a: Drop osdep.h, add stdbool.h to swizzle.c 2025-01-26 18:47:46 -07:00
NZJenkins ae4b5c0695
nv2a: Speed up software swizzling 2025-01-26 14:00:35 -07:00
Fred Hallock 191bc40f70
xid: Add Xbox Controller S 2025-01-25 20:48:58 -07:00
Li Zhijian acc4e8b69b hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`
This assertion always happens when we sanitize the CXL memory device.
$ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize

It is incorrect to register an MSIX number beyond the device's capability.

Increase the device's MSIX number to cover the mailbox msix number(9).

Fixes: 43efb0bfad ("hw/cxl/mbox: Wire up interrupts for background completion")
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Message-Id: <20250115075834.167504-1-lizhijian@fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 1ce979e7269a34d19ea1a65808df014d8b2acbf6)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-17 10:57:59 +03:00
Igor Mammedov 7170aa66aa pci: acpi: Windows 'PCI Label Id' bug workaround
Current versions of Windows call _DSM(func=7) regardless
of whether it is supported or not. It leads to NICs having bogus
'PCI Label Id = 0', where none should be set at all.

Also presence of 'PCI Label Id' triggers another Windows bug
on localized versions that leads to hangs. The later bug is fixed
in latest updates for 'Windows Server' but not in consumer
versions of Windows (and there is no plans to fix it
as far as I'm aware).

Given it's easy, implement Microsoft suggested workaround
(return invalid Package) so that affected Windows versions
could boot on QEMU.
This would effectvely remove bogus 'PCI Label Id's on NICs,
but MS teem confirmed that flipping 'PCI Label Id' should not
change 'Network Connection' ennumeration, so it should be safe
for QEMU to change _DSM without any compat code.

Smoke tested with WinXP and WS2022
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/774
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20250115125342.3883374-3-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 0b053391985abcc40b16ac8fc4a7f6588d1d95c1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-17 09:30:54 +03:00
Nicholas Piggin c8fb662a58 pci/msix: Fix msix pba read vector poll end calculation
The end vector calculation has a bug that results in polling fewer
than required vectors when reading at a non-zero offset in PBA memory.

Fixes: bbef882cc1 ("msi: add API to get notified about pending bit poll")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20241212120402.1475053-1-npiggin@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 42e2a7a0ab23784e44fcb18369e06067abc89305)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-17 09:26:23 +03:00
Sebastian Ott 91b2cb9a78 pci: ensure valid link status bits for downstream ports
PCI hotplug for downstream endpoints on arm fails because Linux'
PCIe hotplug driver doesn't like the QEMU provided LNKSTA:

  pcieport 0000:08:01.0: pciehp: Slot(2): Card present
  pcieport 0000:08:01.0: pciehp: Slot(2): Link Up
  pcieport 0000:08:01.0: pciehp: Slot(2): Cannot train link: status 0x2000

There's 2 cases where LNKSTA isn't setup properly:
* the downstream device has no express capability
* max link width of the bridge is 0

Move the sanity checks added via 88c869198a
("pci: Sanity test minimum downstream LNKSTA") outside of the
branch to make sure downstream ports always have a valid LNKSTA.

Signed-off-by: Sebastian Ott <sebott@redhat.com>
Tested-by: Zhenyu Zhang <zhenyzha@redhat.com>
Message-Id: <20241203121928.14861-1-sebott@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 694632fd44987cc4618612a38ad151047524a590)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-17 09:22:13 +03:00
Phil Dennis-Jordan 4a3538e6f2 hw/usb/hcd-xhci-pci: Use modulo to select MSI vector as per spec
QEMU would crash with a failed assertion if the XHCI controller
attempted to raise the interrupt on an interrupter corresponding
to a MSI vector with a higher index than the highest configured
for the device by the guest driver.

This behaviour is correct on the MSI/PCI side: per PCI 3.0 spec,
devices must ensure they do not send MSI notifications for
vectors beyond the range of those allocated by the system/driver
software. Unlike MSI-X, there is no generic way for handling
aliasing in the case of fewer allocated vectors than requested,
so the specifics are up to device implementors. (Section
6.8.3.4. "Sending Messages")

It turns out the XHCI spec (Implementation Note in section 4.17,
"Interrupters") requires that the host controller signal the MSI
vector with the number computed by taking the interrupter number
modulo the number of enabled MSI vectors.

This change introduces that modulo calculation, fixing the
failed assertion. This makes the device work correctly in MSI mode
with macOS's XHCI driver, which only allocates a single vector.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250112210056.16658-2-phil@philjordan.eu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit bb5b7fced6b5d3334ab20702fc846e47bb1fb731)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-17 09:16:01 +03:00
Keoseong Park 48876bfc47 hw/ufs: Adjust value to match CPU's endian format
In ufs_write_attr_value(), the value parameter is handled in the CPU's
endian format but provided in big-endian format by the caller. Thus, it
is converted to the CPU's endian format. The related test code is also
fixed to reflect this change.

Fixes: 7c85332a2b ("hw/ufs: minor bug fixes related to ufs-test")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>
Message-ID: <20250107084356epcms2p2af4d86432174d76ea57336933e46b4c3@epcms2p2>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
(cherry picked from commit 4572dacc33e232a7c951ba7ba7a20887fad29e71)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-15 15:53:53 +03:00
Ryzee119 e293f6ba67 input: Add xbox live communicator support 2025-01-15 03:08:14 -07:00
Matt Borgerson 6de26b0c2c ac97: Disable pi/mc reads for now 2025-01-15 03:05:35 -07:00
Fabiano Rosas e7a9d93428 s390x: Fix CSS migration
Commit a55ae46683 ("s390: move css_migration_enabled from machine to
css.c") disabled CSS migration globally instead of doing it
per-instance.

CC: Paolo Bonzini <pbonzini@redhat.com>
CC: qemu-stable@nongnu.org #9.1
Fixes: a55ae46683 ("s390: move css_migration_enabled from machine to css.c")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2704
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20250109185249.23952-8-farosas@suse.de>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
(cherry picked from commit c76ee1f6255c3988a9447d363bb17072f1ec84e1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-01-13 11:25:57 +03:00
Matt Borgerson 7eba0d3124 nv2a/gl: Update copyright on recently modified files 2025-01-07 17:37:06 -07:00
Matt Borgerson 510c280b05 nv2a/gl: Unify ShaderBinding and ShaderLruNode 2025-01-07 17:35:06 -07:00
Matt Borgerson 5dcbb7ebdb nvnet: Minor cleanup 2025-01-07 14:28:27 -07:00
Matt Borgerson 6c389194b6 nv2a/psh: Remove unused arguments in string format 2025-01-07 00:52:51 -07:00
Matt Borgerson d76898f63b nv2a: Fix variable shadowing complaints 2025-01-07 00:52:51 -07:00
Matt Borgerson 281f42c5e1 mcpx: Fix variable shadowing 2025-01-07 00:52:51 -07:00
Matt Borgerson 85f84be04d mcpx: Narrow variable def scopes, fix shadowing 2025-01-07 00:52:51 -07:00
Matt Borgerson 57c6d82fa3 nv2a/vk: Simplify debug indent loop to a variable field width format 2025-01-07 00:52:51 -07:00
Matt Borgerson 6ac52147a4 nv2a/psh: Remove function scope variable i, which was being shadowed 2025-01-07 00:52:51 -07:00
Matt Borgerson 3070d6422c mstring: Remove mstring_append_{int,char} 2025-01-07 00:52:51 -07:00
Matt Borgerson 0e50741c28 ui,xbox: Copyright updates on changed files 2025-01-06 23:06:21 -07:00
Matt Borgerson 34fe7918d3 nvnet: Return `true' instead of `1' when returning a bool 2025-01-06 23:05:53 -07:00
Matt Borgerson 8687b152c9 nvnet: Drop pc.h, add pci_device.h includes 2025-01-06 23:05:53 -07:00
Matt Borgerson 376280a635 xbox: Configure nic 2025-01-06 23:05:53 -07:00
Matt Borgerson 24c24e030d mc146818rtc: Move Xbox RTC init pattern to reset handler 2025-01-06 23:05:53 -07:00
Matt Borgerson 75ce25c9b5 nv2a: Define DEBUG_NV2A_*=0 ifndef 2025-01-06 23:05:53 -07:00
Matt Borgerson f4ef9f6309 mcpx: Rename dev to parent_obj, use QOM casts 2025-01-06 23:05:53 -07:00
Matt Borgerson 83e91385b7 smc: Include block_int-io.h 2025-01-06 23:05:53 -07:00
Matt Borgerson 31f615c9e9 xbox_pci: Replace sysbus_add_io with memory_region_add_subregion 2025-01-06 23:05:53 -07:00
Matt Borgerson 68497e96d4 xbox_pci: Use Resettable interface 2025-01-06 23:05:53 -07:00
Matt Borgerson dcfc47951e xbox_pci: Use new pci_bus_map_irqs function 2025-01-06 23:05:53 -07:00
Matt Borgerson 7b52d02640 xbox_pci: Drop arg in call to pci_create_simple_multifunction 2025-01-06 23:05:53 -07:00
Matt Borgerson 95b3efb570 xbox_pci: Drop ioapi.h include 2025-01-06 23:05:53 -07:00
Matt Borgerson db2101dab5 xbox: Update nvnet creation 2025-01-06 23:05:53 -07:00
Matt Borgerson fbb5ba3fed xbox: pcspk_init was removed, inline it 2025-01-06 23:05:53 -07:00
Matt Borgerson 0ef5ad787c xbox: Pass isa_bus to i8257_dma_init 2025-01-06 23:05:53 -07:00
Matt Borgerson 5aa997e89b xbox: Rename isa_bus_irqs -> isa_bus_register_input_irqs 2025-01-06 23:05:53 -07:00
Matt Borgerson d38f0e7901 xbox: Rename pcms->bus -> pcms->pcibus 2025-01-06 23:05:53 -07:00
Matt Borgerson 9560677f0a nv2a: Include hw/pci/pci_device.h header 2025-01-06 23:05:53 -07:00
Matt Borgerson f45e61afc8 xbox: Use new mc146818 interface, set x86ms->rtc 2025-01-06 23:05:53 -07:00
Matt Borgerson 4239f64dd5 xbox: Update kvm clock header and drop kvmclock_enabled check 2025-01-06 23:05:53 -07:00
Matt Borgerson a49ee1439f nvnet: Pass mem_reentrancy_guard to object_get_typename 2025-01-06 23:05:53 -07:00
Matt Borgerson cab8b9fbc0 nvnet: Use Resettable interface 2025-01-06 23:05:53 -07:00
Matt Borgerson 9327159f7c nv2a: Use Resettable interface 2025-01-06 23:05:53 -07:00
Matt Borgerson 3106ea97e5 mcpx: Use new bql_[un]lock functions 2025-01-06 23:05:53 -07:00
Matt Borgerson 5cb65d1791 nv2a: Migrate nv2a_get_offsets to new _get_params model 2025-01-06 23:05:53 -07:00
Matt Borgerson 008d848582 mcpx: Use new bql_[un]lock functions 2025-01-06 23:05:53 -07:00
Matt Borgerson 08d4c3611b mcpx: Update headers 2025-01-06 23:05:53 -07:00
Matt Borgerson 81a6985bb0 mcpx: Use new fifo8_pop_buf api 2025-01-06 23:05:53 -07:00
Matt Borgerson 6cce59135b mcpx: Use Resettable interface 2025-01-06 23:05:53 -07:00
Matt Borgerson 3b59f9b2f1 lpc47m157: Drop call to serial_set_frequency 2025-01-06 23:05:53 -07:00
Matt Borgerson f2f1c4e6cb hw/ide: Update ide_security_cmd ide_set_irq -> ide_bus_set_irq 2025-01-06 23:05:53 -07:00
Matt Borgerson 769af4c453 hw/i386/Kconfig: Update PIIX3 -> PIIX 2025-01-06 23:05:52 -07:00
Matt Borgerson 801e77cbc8 hw/audio/ac97: Pass error_fatal to new AUD_register_card errp arg 2025-01-06 23:05:52 -07:00
Matt Borgerson 5ed35dc074 mc146818rtc: Add back Xbox changes (bad merge) 2025-01-06 23:05:52 -07:00
Matt Borgerson 1aa8825ec9 hw/audio/ac97: Remove bad merge conflict resolution 2025-01-06 23:05:52 -07:00
Matt Borgerson ec974f1c7c v9.2.0 release
-----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmdYamYZHHBldGVyLm1h
 eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3iruD/91YiKIo5HZw7pE7FCtIcWS
 6K2frz/ruujhDYqLclyANppxrypI7JyYF1xw0jWLqZMSP8/qn/YKEdMCNoVnIo7S
 cUg/i+RWsncKPEeCSRLlartsgMHwlyXq8W3YQ7ONkEPUwwODzNKTdyoe+8npRjyf
 TfbQVjNN8Sw11w2aYME+or1nm1XnH8aB7O1sdBxGFy6Z9//2xeMvf/EKEdCbThn/
 sWBGKbgkku5Rjk0E/xE94tVJcuOFJGhzDraLqU0ZMLivQvLPY0hOZLbaK3q1NHm/
 YTrK9S0EwXtfJXG5uAJ+5IXoLnWk7gzqQa70PYYhiXsJYyQk65m6muT47eNNOQRs
 1s8FIV23/zespuaDCc/wvnp/nIkGCYh5DUme8/vgY1gA+YoHavmVJW+72/N6TS+v
 Ym5t9Ud2y/jWKgZgCtdHwGXLvM4e0u0Ou3WGKnLUAmlL82A8Xo9CBE1VjDXaP/WA
 6s2U1UPML/15tjig/pO5YVDO1nXSkKr+yoWL3myUHIDJslIrOJoGQKHLBpeckqL8
 4hhb+jcRRz24PrpqMSOCehnUuUM58b/eFeQQ9mpVnKAC7I5OQTj6QCjreO5gLt0n
 CcuuuQV4VDHwc03hpVuTNuNcXKEDqNfS7AsGDr3ZcFemScRADmcxXLM0YOp8xdTG
 8guHE/F7RYy5mfsD0TF49w==
 =aEmF
 -----END PGP SIGNATURE-----

Merge tag 'v9.2.0'

v9.2.0 release
2025-01-03 22:30:04 -07:00
Matt Borgerson 824af3978f meson: Migrate nv2a_vsh_cpu submodule to a subproject 2025-01-02 19:07:25 -07:00
Matt Borgerson 8f478e017a nv2a/psh: Handle 3D textures in BUMPENVMAP[_LUM] modes 2024-12-31 03:17:52 -07:00
Matt Borgerson b6d6a4709d nv2a/gl: Use snake case for line width ranges 2024-12-31 01:37:05 -07:00
Matt Borgerson e67f19d03b nv2a/vk,gl: Fix a couple 64b shift/printing bugs 2024-12-31 01:37:05 -07:00
Matt Borgerson ae3fe91223 nv2a/gl: Rebase line width feature 2024-12-31 01:37:05 -07:00
Matt Borgerson fb7feb7b1f nv2a/vk: Fix missing display surface addr in debug marker 2024-12-31 01:37:05 -07:00
Matt Borgerson 4a09eeb121 nv2a/vk: Use unsigned types for clear scissor calculation for now 2024-12-31 01:37:05 -07:00
Matt Borgerson 1e5cae068a nv2a/vk: Drop unused vertex_buffer_inline field 2024-12-31 01:37:05 -07:00
Matt Borgerson 477d5489ac nv2a/vk: Copy remapped vert data after pre-draw 2024-12-31 01:37:05 -07:00
Matt Borgerson 28c9f5f6ef nv2a/vk: Load 16b float depth textures as unorm to match surface w/a 2024-12-31 01:37:05 -07:00
Matt Borgerson c098b82108 nv2a/vk: VK_CHECK call to vkBindImageMemory 2024-12-31 01:37:05 -07:00
Matt Borgerson 085fb33141 nv2a/vk: Fix external memory handle type on Windows 2024-12-31 01:37:05 -07:00
Matt Borgerson 88835a1019 nv2a/vk,gl: Handle case where pline_offset == 0 2024-12-31 01:37:05 -07:00
Matt Borgerson 58c1daf594 nv2a/vk: Report dirty if no pipeline is bound 2024-12-31 01:37:05 -07:00
Matt Borgerson 8dc3b646a3 nv2a/vk: Move display GL compat after line_offset adjust 2024-12-31 01:37:05 -07:00
Matt Borgerson 7afeda5da0 nv2a/vk: Add regs control_{0,3}, setupraster to shader dirty test 2024-12-31 01:37:05 -07:00
Matt Borgerson 4cd4153937 nv2a/vk: Move reg dirty clear into create_pipeline 2024-12-31 01:37:05 -07:00
Matt Borgerson de1381c932 nv2a/vk: Drop pipeline merge stat 2024-12-31 01:37:05 -07:00
Matt Borgerson 986b18214c nv2a/vk: Drop display update early-out 2024-12-31 01:37:05 -07:00
Matt Borgerson 974b2be87a nv2a/vk: Add command buffer region debug markers 2024-12-31 01:37:05 -07:00
Matt Borgerson c7f82ab79f nv2a/gl: Fix bind_shaders dgroup 2024-12-31 01:37:05 -07:00
Matt Borgerson 580c2e9da4 nv2a/vk: Run full dirty texture check 2024-12-31 01:37:05 -07:00
Matt Borgerson 5527e908b7 nv2a/vk: Process pending surface upload just in time for display 2024-12-31 01:37:05 -07:00
Matt Borgerson e5be3f2714 nv2a/vk: Add missing math.h include 2024-12-31 01:37:05 -07:00
Matt Borgerson d054b366f8 nv2a/vk: Add pvideo support 2024-12-31 01:37:05 -07:00
Matt Borgerson f26b8c32d6 n2va/vk: Key textures on sampler state for now 2024-12-31 01:37:05 -07:00
Matt Borgerson 69b5318cb5 nv2a/vk: Fix create_pipeline debug marker inbalance 2024-12-31 01:37:05 -07:00
Matt Borgerson 9ab1f96911 nv2a/vk: Make pgraph_vk_insert_debug_marker format strings 2024-12-31 01:37:05 -07:00
Matt Borgerson ca42f0f2df nv2a/vk: Clear in separate renderpass for now 2024-12-31 01:37:05 -07:00
Matt Borgerson 31db8d04b0 nv2a/vk: Ensure queries do not include clears 2024-12-31 01:37:05 -07:00
Matt Borgerson d47fef9467 nv2a/vk: Fix reports 2024-12-31 01:37:05 -07:00
Matt Borgerson 2f910eeacf nv2a/vk: Fixup unaligned attribute data in inline buffer 2024-12-31 01:37:05 -07:00
Matt Borgerson 3096f2a9c8 nv2a/vk: Always bind fragment shader in draw pipeline 2024-12-31 01:37:05 -07:00
Matt Borgerson a2b994d80d nv2a/vk: Only bind clear fragment shader on partial color clear 2024-12-31 01:37:05 -07:00
Matt Borgerson 76e2b779e3 nv2a/psh: Handle rect tex on project3d 2024-12-31 01:37:05 -07:00
Matt Borgerson 62acb2db7e nv2a/psh: Drop rect_tex assertion 2024-12-31 01:37:05 -07:00
Matt Borgerson 1c38a0a42b nv2a/psh: Normalize coords at sample time 2024-12-31 01:37:05 -07:00
Matt Borgerson ec59148333 nv2a: Normalize unnormalized texture coordinates in shader 2024-12-31 01:37:05 -07:00
Matt Borgerson 20f318f437 nv2a/glsl: Add swizzled attr check 2024-12-31 01:37:05 -07:00
Matt Borgerson 6ba917fed9 nv2a/vk: Fix clear scissor ymin 2024-12-31 01:37:05 -07:00
Matt Borgerson 605605d0da nv2a/vk: Fix scissor overflow 2024-12-31 01:37:05 -07:00
Matt Borgerson a3d0131a03 nv2a/vk: Fix mipmap filtering for _LOD0 min filters 2024-12-31 01:37:05 -07:00
Matt Borgerson bc066fdea9 nv2a/vk: Flush/barrier on texture upload 2024-12-31 01:37:05 -07:00
Matt Borgerson 6171e40c39 nv2a/vk: Minor cleanup 2024-12-31 01:37:05 -07:00
Matt Borgerson a5877b17f8 nv2a/vk: Fix compute pipeline finalize 2024-12-31 01:37:05 -07:00
Matt Borgerson 5a6b8a14da nv2a/vk: Only clear stencil on images with stencil aspect 2024-12-31 01:37:05 -07:00
Matt Borgerson 824a378a23 nv2a/vk: Disable memory trimmer for now 2024-12-31 01:37:05 -07:00
Matt Borgerson 9200246c62 nv2a/vk: Make main buffers dedicated 2024-12-31 01:37:05 -07:00
Matt Borgerson c66bdbe85d nv2a/vk: Include result code in device/instance creation error messages 2024-12-31 01:37:05 -07:00
Matt Borgerson 894bcf1b58 nv2a/vk: Add texture finalize checks 2024-12-31 01:37:05 -07:00
Matt Borgerson f68159d1c4 nv2a/vk: Simplify zeta to texture, add barrier 2024-12-31 01:37:05 -07:00
Matt Borgerson e20a2b15b3 nv2a/vk: Don't release textures until after draw completes 2024-12-31 01:37:05 -07:00
Matt Borgerson 33db2787f7 nv2a/vk: Fixup depth transition stages 2024-12-31 01:37:05 -07:00
Matt Borgerson f6d70abd04 nv2a: Fix nv2a_dbg_renderdoc_init on Windows 2024-12-31 01:37:05 -07:00
Matt Borgerson 4e75b5e3ce nv2a/vk: Always use staging image for surface upload 2024-12-31 01:37:05 -07:00
Matt Borgerson 64e8046d1f nv2a/vk: Specify local_size_{y,z} = 1 in compute shader 2024-12-31 01:37:05 -07:00
Matt Borgerson dc5a220486 nv2a/vk: Specify set in compute shader layout 2024-12-31 01:37:05 -07:00
Matt Borgerson 9161e3e14a nv2a/vk: Create surface if one not currently bound 2024-12-31 01:37:05 -07:00
Matt Borgerson c802468d05 nv2a/vk: Relax invalid surface compat check 2024-12-31 01:37:05 -07:00
Matt Borgerson 1fec4947b6 nv2a/vk: Ensure clear rect never extends beyond surface 2024-12-31 01:37:05 -07:00
Matt Borgerson c881f8641f nv2a/vk: Ensure pack buffer offsets meet minStorageBufferOffsetAlignment 2024-12-31 01:37:05 -07:00
Matt Borgerson 374eada8ef nv2a/vk: Ensure pg->clearing set before pgraph_vk_surface_update 2024-12-31 01:37:05 -07:00
Matt Borgerson 28092ad13b nv2a/vk: Only include uniform attr definition when necessary 2024-12-31 01:37:05 -07:00
Matt Borgerson 567bc33a70 nv2a/glsl: Fix project2d usampler lookup 2024-12-31 01:37:05 -07:00
Matt Borgerson 017444b8a0 nv2a/glsl: Ensure sampler type matches texture dimensionality 2024-12-31 01:37:05 -07:00
Matt Borgerson bc46a9303d nv2a/vk: Add compute pipeline cache, scale workgroups 2024-12-31 01:37:05 -07:00
Matt Borgerson 8e5a77c45d nv2a/vk: Fix missing scale in d32_sfloat_s8_uint pack 2024-12-31 01:37:05 -07:00