Commit 30c873c1 authored by Connor Abbott's avatar Connor Abbott

panwrap: Start plumbing through Bifrost stuff

The trace won't compile, of course, but it's a start. The actual
mali-job.h changes will come later.
parent e1a350a2
......@@ -503,7 +503,17 @@ panwrap_replay_attribute_meta(int job_no, int count, const struct mali_payload_v
}
static int
panwrap_replay_vertex_or_tiler_job(const struct mali_job_descriptor_header *h,
panwrap_replay_vertex_or_tiler_job_bfr(const struct mali_job_descriptor_header *h,
const struct panwrap_mapped_memory *mem,
mali_ptr payload, int job_no)
{
const uint8_t *PANWRAP_PTR_VAR(v, mem, payload);
panwrap_log_hexdump(v, sizeof(struct mali_payload_vertex_tiler));
return sizeof(struct mali_payload_vertex_tiler);
}
static int
panwrap_replay_vertex_or_tiler_job_mdg(const struct mali_job_descriptor_header *h,
const struct panwrap_mapped_memory *mem,
mali_ptr payload, int job_no)
{
......@@ -1011,7 +1021,7 @@ static int panwrap_replay_fragment_job(const struct panwrap_mapped_memory *mem,
static int job_descriptor_number = 0;
int panwrap_replay_jc(mali_ptr jc_gpu_va)
int panwrap_replay_jc(mali_ptr jc_gpu_va, bool bifrost)
{
struct mali_job_descriptor_header *h;
......@@ -1102,7 +1112,10 @@ int panwrap_replay_jc(mali_ptr jc_gpu_va)
}
case JOB_TYPE_TILER:
case JOB_TYPE_VERTEX:
payload_size = panwrap_replay_vertex_or_tiler_job(h, mem, payload_ptr, job_no);
if (bifrost)
payload_size = panwrap_replay_vertex_or_tiler_job_bfr(h, mem, payload_ptr, job_no);
else
payload_size = panwrap_replay_vertex_or_tiler_job_mdg(h, mem, payload_ptr, job_no);
break;
case JOB_TYPE_FRAGMENT:
......
......@@ -19,7 +19,7 @@
#include <mali-job.h>
#include "panwrap.h"
int panwrap_replay_jc(mali_ptr jc_gpu_va);
int panwrap_replay_jc(mali_ptr jc_gpu_va, bool bifrost);
int panwrap_replay_soft_replay(mali_ptr jc_gpu_va);
#endif /* !PANWRAP_DECODER_H */
......@@ -105,6 +105,12 @@ void replay_memory_specific(struct panwrap_mapped_memory *pos, int offset, int l
/* If we don't have write access, no replay :) */
if (!(pos->flags & MALI_MEM_PROT_CPU_WR)) return;
/* Tracking these types of mappings would require more
* sophistication to avoid faulting when reading pages that
* haven't been committed yet, so don't try and read them.
*/
if (pos->flags & MALI_MEM_GROW_ON_GPF) return;
if (pos->flags & MALI_MEM_PROT_GPU_EX) {
if (offset)
panwrap_msg("Shader sync not supported!\n");
......
......@@ -556,7 +556,7 @@ ioctl_decode_pre_stream_create(unsigned long int request, void *ptr)
static int job_count = 0;
static void emit_atoms(void *ptr) {
static void emit_atoms(void *ptr, bool bifrost) {
const struct mali_ioctl_job_submit *args = ptr;
const struct mali_jd_atom_v2 *atoms = args->addr;
......@@ -571,7 +571,7 @@ static void emit_atoms(void *ptr) {
int req = a->core_req | a->compat_core_req;
if (!(req & MALI_JD_REQ_SOFT_JOB))
job_numbers[i] = panwrap_replay_jc(a->jc);
job_numbers[i] = panwrap_replay_jc(a->jc, bifrost);
else if (req & MALI_JD_REQ_SOFT_REPLAY)
job_numbers[i] = panwrap_replay_soft_replay(a->jc);
}
......@@ -955,6 +955,9 @@ static char *panwrap_lower_string(const char *str)
static int ioctl_count = 0;
/* HW version */
static bool bifrost = false;
/* XXX: Android has a messed up ioctl signature */
int ioctl(int fd, int _request, ...)
{
......@@ -1010,7 +1013,7 @@ int ioctl(int fd, int _request, ...)
if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_JOB_SUBMIT)) {
panwrap_log("for (int i = 0; i < 30; ++i) {\n");
panwrap_indent++;
emit_atoms(ptr);
emit_atoms(ptr, bifrost);
replay_memory();
}
......@@ -1083,7 +1086,17 @@ int ioctl(int fd, int _request, ...)
}
#endif
if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_GPU_PROPS_REG_DUMP)) {
const struct mali_ioctl_gpu_props_reg_dump *dump = ptr;
unsigned product_id = dump->core.product_id;
panwrap_msg("product id: %d\n", product_id);
/* based on mali_kbase_gpu_id.h and mali_kbase_hw.c */
if (product_id >> 12 == 6 && product_id != 0x6956 /* T60x */)
bifrost = true;
}
/* Call the actual ioctl */
if (!ignore) {
panwrap_log("rc = pandev_ioctl(fd, MALI_IOCTL_%s, &%s_%d);\n", name, lname, number);
panwrap_log("if (rc) printf(\"Error %%d in %s_%d\\n\", rc);\n\n", name, number);
......
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