Skip to content
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

Cleanup register combiner code #16

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Cleanup register combiner code #16

wants to merge 23 commits into from

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Aug 13, 2018

No description provided.

@JayFoxRox JayFoxRox force-pushed the psh-cleanup branch 5 times, most recently from e7dc6ac to 42f77f3 Compare August 13, 2018 11:21
if (qstring_get_length(ab_dest)) {
qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n",
qstring_get_str(ab_dest), write_mask, caster, qstring_get_str(ab_mapping));
if (ab_dest != NULL) {
Copy link
Owner Author

@JayFoxRox JayFoxRox Aug 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a separate change

@JayFoxRox JayFoxRox force-pushed the psh-cleanup branch 2 times, most recently from f69331b to 6ee2433 Compare August 13, 2018 11:40
@JayFoxRox JayFoxRox changed the title PSH Cleanup Refactor register combiner code Aug 13, 2018
if (qstring_get_length(cd_dest)) {
qstring_append_fmt(ps->code, "%s.%s = %s(%s);\n",
qstring_get_str(cd_dest), write_mask, caster, qstring_get_str(cd_mapping));
if (cd_dest != NULL) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite this by checking PS_REGISTER_DISCARD directly for code clarity

@JayFoxRox JayFoxRox force-pushed the psh-cleanup branch 3 times, most recently from 3a27846 to 8f27f59 Compare August 13, 2018 17:52
@@ -84,7 +84,7 @@ typedef struct ShaderBinding {
GLuint gl_program;
GLenum gl_primitive_mode;

GLint psh_constant_loc[9][2];
GLint psh_constant_loc[2][9];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this

@@ -2754,7 +2754,7 @@ static void pgraph_shader_update_constants(PGRAPHState *pg,
}

for (j = 0; j < 2; j++) {
GLint loc = binding->psh_constant_loc[i][j];
GLint loc = binding->psh_constant_loc[j][i];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo

@JayFoxRox JayFoxRox force-pushed the psh-cleanup branch 8 times, most recently from d81db1f to 8efac13 Compare August 14, 2018 01:08
JayFoxRox pushed a commit that referenced this pull request Sep 11, 2018
With a Spice port chardev, it is possible to reenter
monitor_qapi_event_queue() (when the client disconnects for
example). This will dead-lock on monitor_lock.

Instead, use some TLS variables to check for recursion and queue the
events.

Fixes:
 (gdb) bt
 #0  0x00007fa69e7217fd in __lll_lock_wait () at /lib64/libpthread.so.0
 #1  0x00007fa69e71acf4 in pthread_mutex_lock () at /lib64/libpthread.so.0
 #2  0x0000563303567619 in qemu_mutex_lock_impl (mutex=0x563303d3e220 <monitor_lock>, file=0x5633036589a8 "/home/elmarco/src/qq/monitor.c", line=645) at /home/elmarco/src/qq/util/qemu-thread-posix.c:66
 #3  0x0000563302fa6c25 in monitor_qapi_event_queue (event=QAPI_EVENT_SPICE_DISCONNECTED, qdict=0x56330602bde0, errp=0x7ffc6ab5e728) at /home/elmarco/src/qq/monitor.c:645
 #4  0x0000563303549aca in qapi_event_send_spice_disconnected (server=0x563305afd630, client=0x563305745360, errp=0x563303d8d0f0 <error_abort>) at qapi/qapi-events-ui.c:149
 #5  0x00005633033e600f in channel_event (event=3, info=0x5633061b0050) at /home/elmarco/src/qq/ui/spice-core.c:235
 #6  0x00007fa69f6c86bb in reds_handle_channel_event (reds=<optimized out>, event=3, info=0x5633061b0050) at reds.c:316
 #7  0x00007fa69f6b193b in main_dispatcher_self_handle_channel_event (info=0x5633061b0050, event=3, self=0x563304e088c0) at main-dispatcher.c:197
 #8  0x00007fa69f6b193b in main_dispatcher_channel_event (self=0x563304e088c0, event=event@entry=3, info=0x5633061b0050) at main-dispatcher.c:197
 #9  0x00007fa69f6d0833 in red_stream_push_channel_event (s=s@entry=0x563305ad8f50, event=event@entry=3) at red-stream.c:414
 #10 0x00007fa69f6d086b in red_stream_free (s=0x563305ad8f50) at red-stream.c:388
 #11 0x00007fa69f6b7ddc in red_channel_client_finalize (object=0x563304df2360) at red-channel-client.c:347
 #12 0x00007fa6a56b7fb9 in g_object_unref () at /lib64/libgobject-2.0.so.0
 #13 0x00007fa69f6ba212 in red_channel_client_push (rcc=0x563304df2360) at red-channel-client.c:1341
 #14 0x00007fa69f68b259 in red_char_device_send_msg_to_client (client=<optimized out>, msg=0x5633059b6310, dev=0x563304e08bc0) at char-device.c:305
 #15 0x00007fa69f68b259 in red_char_device_send_msg_to_clients (msg=0x5633059b6310, dev=0x563304e08bc0) at char-device.c:305
 #16 0x00007fa69f68b259 in red_char_device_read_from_device (dev=0x563304e08bc0) at char-device.c:353
 #17 0x000056330317d01d in spice_chr_write (chr=0x563304cafe20, buf=0x563304cc50b0 "{\"timestamp\": {\"seconds\": 1532944763, \"microseconds\": 326636}, \"event\": \"SHUTDOWN\", \"data\": {\"guest\": false}}\r\n", len=111) at /home/elmarco/src/qq/chardev/spice.c:199
 #18 0x00005633034deee7 in qemu_chr_write_buffer (s=0x563304cafe20, buf=0x563304cc50b0 "{\"timestamp\": {\"seconds\": 1532944763, \"microseconds\": 326636}, \"event\": \"SHUTDOWN\", \"data\": {\"guest\": false}}\r\n", len=111, offset=0x7ffc6ab5ea70, write_all=false) at /home/elmarco/src/qq/chardev/char.c:112
 #19 0x00005633034df054 in qemu_chr_write (s=0x563304cafe20, buf=0x563304cc50b0 "{\"timestamp\": {\"seconds\": 1532944763, \"microseconds\": 326636}, \"event\": \"SHUTDOWN\", \"data\": {\"guest\": false}}\r\n", len=111, write_all=false) at /home/elmarco/src/qq/chardev/char.c:147
 #20 0x00005633034e1e13 in qemu_chr_fe_write (be=0x563304dbb800, buf=0x563304cc50b0 "{\"timestamp\": {\"seconds\": 1532944763, \"microseconds\": 326636}, \"event\": \"SHUTDOWN\", \"data\": {\"guest\": false}}\r\n", len=111) at /home/elmarco/src/qq/chardev/char-fe.c:42
 #21 0x0000563302fa6334 in monitor_flush_locked (mon=0x563304dbb800) at /home/elmarco/src/qq/monitor.c:425
 #22 0x0000563302fa6520 in monitor_puts (mon=0x563304dbb800, str=0x563305de7e9e "") at /home/elmarco/src/qq/monitor.c:468
 #23 0x0000563302fa680c in qmp_send_response (mon=0x563304dbb800, rsp=0x563304df5730) at /home/elmarco/src/qq/monitor.c:517
 #24 0x0000563302fa6905 in qmp_queue_response (mon=0x563304dbb800, rsp=0x563304df5730) at /home/elmarco/src/qq/monitor.c:538
 #25 0x0000563302fa6b5b in monitor_qapi_event_emit (event=QAPI_EVENT_SHUTDOWN, qdict=0x563304df5730) at /home/elmarco/src/qq/monitor.c:624
 #26 0x0000563302fa6c4b in monitor_qapi_event_queue (event=QAPI_EVENT_SHUTDOWN, qdict=0x563304df5730, errp=0x7ffc6ab5ed00) at /home/elmarco/src/qq/monitor.c:649
 #27 0x0000563303548cce in qapi_event_send_shutdown (guest=false, errp=0x563303d8d0f0 <error_abort>) at qapi/qapi-events-run-state.c:58
 #28 0x000056330313bcd7 in main_loop_should_exit () at /home/elmarco/src/qq/vl.c:1822
 #29 0x000056330313bde3 in main_loop () at /home/elmarco/src/qq/vl.c:1862
 #30 0x0000563303143781 in main (argc=3, argv=0x7ffc6ab5f068, envp=0x7ffc6ab5f088) at /home/elmarco/src/qq/vl.c:4644

Note that error report is now moved to the first caller, which may
receive an error for a recursed event. This is probably fine (95% of
callers use &error_abort, the rest have NULL error and ignore it)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180731150144.14022-1-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[*_no_recurse renamed to *_no_reenter, local variables reordered]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
dracc and others added 3 commits September 26, 2018 16:01
Set NV2A_CRYSTAL_FREQ to Retail speed
Fix ptimer_get_clock() behaviour
* Port espes's fifo work to the split up nv2a code

This patch ports over the following commits from the XQEMU 1.x tree
(available via tag archive-xqemu-1.x) to the refactored nv2a code:

- 4d9107e (HEAD -> xbox, upstream/xbox) Merge branch 'fix-fifo' into xbox
- c33f4ab cleanups
- d3f83d9 cleanups
- faca5dd fix
- 7c62d7c fixes
- 8ad239b wip
- 45ed3c3 wip
- c006d5e wip

However, in its current form, this patch causes some regressions and
needs further investigation.

* nv2a: basic pattern object
espes and others added 9 commits September 26, 2018 17:42
…rrect instruction emulation by QEMU hvf, which resulted in a ruined register that was not supposed to touch.

+ copy it over to target/i386 as well (for latest QEMU version)

Change-Id: Ibdada114db8736560d41402d6af4042fc6e6c25b
Change-Id: I9d8d08d922eb08748b1535c628b08f27db3d5619
Fixes: 111676629
Change-Id: I26e116194e3fb2a5570bd2654e111307a14cc161
Signed-off-by: Haitao Shan <hshan@google.com>
If gpa is exactly the start address of one slot, the
old code fails to find the slot. Change to use one byte
range to find slot.

Change-Id: I169ec8f759bb211a5ea7c693c5d99f27576c2e93
Signed-off-by: Tao Wu <lepton@google.com>
QEMU core will call this handler when a RAM block is removed (no
surprises there), but it does _not_ check to see if this handler is
non-NULL. Add a dummy handler for now.
Marking all pages as always dirty has some really bad consequences for
the current NV2A emulation. The lesser of two evils for now is to leave
the pages as-is. Eventually this will be replaced by proper dirty page
tracking once HAXM supports it.
@JayFoxRox JayFoxRox changed the title Refactor register combiner code Cleanup register combiner code Oct 31, 2018
@JayFoxRox
Copy link
Owner Author

The history of this PR is fucked up.
I've renamed the branch and moved it to #21. This branch name was re-used for a PR that's upstream now.

PR comments must be moved from here, to #21.

@JayFoxRox
Copy link
Owner Author

Once the comments have been moved, this branch can be deleted. Upstream PR was merged.

@dracc
Copy link

dracc commented Feb 8, 2020

As far as I understand, all comments have now landed in #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants