-
-
Notifications
You must be signed in to change notification settings - Fork 382
nv2a: Update Conexant field counter on vblank #2537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
nv2a: Update Conexant field counter on vblank #2537
Conversation
hw/xbox/nv2a/nv2a.c
Outdated
| VGACommonState *vga = opaque; | ||
| vga->hw_ops->gfx_update(vga); | ||
|
|
||
| smbus_cx25871_notify_vblank(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When investigating #1962 it appeared that the code checking for the field count was only run for the Conexant encoder. That said, it seems plausible that the other encoders might have a similar mechanism that could be queried in other cases.
I wonder if there's a callback mechanism that we could use to notify (at least TV encoder) devices of vblank instead of calling out from here? That would potentially let us remove the object_resolve_path_type call as well.
dc764c1 to
37f262a
Compare
|
Verified that the report of the fix not working is related to M8+ bios use. I suspect the bios does something that stops it from checking the field count. |
|
/gemini review (Testing to see if code assist is enabled) |
37f262a to
2ce1d00
Compare
DreamWorks: Over the Hedge performs D3D resets before playing FMVs at startup. As a part of this process, an initialization is performed that checks to see if a DirectX frame counter aligns with the counter reported by the TV encoder (at least if Conexant is the encoder, it looks like it is bypassed for other cases). If there is a mismatch, the DirectX frame counter is incremented. This can cause an issue where the vblank interrupt handler misses the expected frame counter, causing it to fail to update the nv2a buffer read index via the NV_PGRAPH_INCREMENT PGRAPH register. In this particular title, this leads to a livelock where the pushbuffer is waiting on a buffer flip that cannot be triggered until the current buffer is marked as read via the register write. This change populates the low nibble of the Conexant device with a simple frame counter. See https://xboxdevwiki.net/Video_Encoder for a link to the datasheet. Unfortunately testing this on HW has proved difficult, as some state is changed during D3D Present calls that causes SMBus reads to stop providing accurate data. Thus, this change is mostly a guess at the actual behavior along with some light testing without using D3D that shows the field value incrementing from 0-3 and wrapping around forever, presumably aligned with vsync. Fixes xemu-project#1962
2ce1d00 to
6a7ee08
Compare
DreamWorks: Over the Hedge performs D3D resets before playing FMVs at startup. As a part of this process, an initialization is performed that checks to see if a DirectX frame counter aligns with the counter reported by the TV encoder (at least if Conexant is the encoder, it looks like it is bypassed for other cases). If there is a mismatch, the DirectX frame counter is incremented.
This can cause an issue where the vblank interrupt handler misses the expected frame counter, causing it to fail to update the nv2a buffer read index via the NV_PGRAPH_INCREMENT PGRAPH register. In this particular title, this leads to a livelock where the pushbuffer is waiting on a buffer flip that cannot be triggered until the current buffer is marked as read via the register write.
This change populates the low nibble of the Conexant device with a simple frame counter. See https://xboxdevwiki.net/Video_Encoder for a link to the datasheet.
Unfortunately testing this on HW has proved difficult, as some state is changed during D3D Present calls that causes SMBus reads to stop providing accurate data. Thus, this change is mostly a guess at the actual behavior along with some light testing without using D3D that shows the field value incrementing from 0-3 and wrapping around forever, presumably aligned with vsync.
Fixes #1962