Commit 6cc035e0 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Eliminate further addressism for jc

parent 20ec3f9a
......@@ -635,10 +635,12 @@ static void panwrap_replay_fragment_job(const struct panwrap_mapped_memory *mem,
static int job_descriptor_number = 0;
void panwrap_replay_jc(mali_ptr jc_gpu_va)
int panwrap_replay_jc(mali_ptr jc_gpu_va)
{
struct mali_job_descriptor_header *h;
int start_number;
bool first = true;
bool last_size;
......@@ -658,6 +660,9 @@ void panwrap_replay_jc(mali_ptr jc_gpu_va)
int job_no = job_descriptor_number++;
if (first)
start_number = job_no;
panwrap_log("struct mali_job_descriptor_header job_%d = {\n", job_no);
panwrap_indent++;
......@@ -736,6 +741,8 @@ void panwrap_replay_jc(mali_ptr jc_gpu_va)
break;
}
} while ((jc_gpu_va = h->job_descriptor_size ? h->next_job_64 : h->next_job_32));
return start_number;
}
void panwrap_replay_soft_replay_payload(mali_ptr jc_gpu_va, int job_no)
......@@ -778,9 +785,11 @@ void panwrap_replay_soft_replay_payload(mali_ptr jc_gpu_va, int job_no)
TOUCH(mem, jc_gpu_va, *v, "soft_replay_payload", job_no);
}
void panwrap_replay_soft_replay(mali_ptr jc_gpu_va)
int panwrap_replay_soft_replay(mali_ptr jc_gpu_va)
{
struct mali_jd_replay_jc *v;
int start_no;
bool first = true;
do {
struct panwrap_mapped_memory *mem =
......@@ -789,7 +798,13 @@ void panwrap_replay_soft_replay(mali_ptr jc_gpu_va)
v = PANWRAP_PTR(mem, jc_gpu_va, typeof(*v));
int job_no = job_descriptor_number++;
panwrap_log("struct mali_jd_replay_jc soft_replay_%d = {\n", job_no);
if (first)
start_no = job_no;
first = false;
panwrap_log("struct mali_jd_replay_jc job_%d = {\n", job_no);
panwrap_indent++;
MEMORY_PROP(v, next);
......@@ -800,6 +815,8 @@ void panwrap_replay_soft_replay(mali_ptr jc_gpu_va)
panwrap_replay_soft_replay_payload(jc_gpu_va + sizeof(struct mali_jd_replay_jc), job_no);
TOUCH(mem, jc_gpu_va, *v, "soft_replay", job_no);
TOUCH(mem, jc_gpu_va, *v, "job", job_no);
} while ((jc_gpu_va = v->next));
return start_no;
}
......@@ -19,7 +19,7 @@
#include <mali-job.h>
#include "panwrap.h"
void panwrap_replay_jc(mali_ptr jc_gpu_va);
void panwrap_replay_soft_replay(mali_ptr jc_gpu_va);
int panwrap_replay_jc(mali_ptr jc_gpu_va);
int panwrap_replay_soft_replay(mali_ptr jc_gpu_va);
#endif /* !PANWRAP_DECODER_H */
......@@ -629,16 +629,17 @@ static void emit_atoms(void *ptr) {
int job_no = job_count++;
int job_numbers[256] = { 0 };
//assert(args->nr_atoms < 256); /* XXX */
for (int i = 0; i < args->nr_atoms; i++) {
const struct mali_jd_atom_v2 *a = &atoms[i];
if (a->jc) {
/* We don't care about soft jobs, at least not yet */
if (!(a->core_req & MALI_JD_REQ_SOFT_JOB))
panwrap_replay_jc(a->jc);
job_numbers[i] = panwrap_replay_jc(a->jc);
else if (a->core_req & MALI_JD_REQ_SOFT_REPLAY)
panwrap_replay_soft_replay(a->jc);
job_numbers[i] = panwrap_replay_soft_replay(a->jc);
}
}
......@@ -669,9 +670,7 @@ static void emit_atoms(void *ptr) {
panwrap_log("{\n");
panwrap_indent++;
char *jc_name = pointer_as_memory_reference(a->jc);
panwrap_prop("jc = %s", jc_name);
free(jc_name);
panwrap_prop("jc = job_%d_p", job_numbers[i]);
/* Don't passthrough udata; it's nondeterministic and for userspace use only */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment