Commit 22063684 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[refactor] remove unnecessary data from request

The request type contains two much stuff, remove extra pointers to win
some space.
parent fa51aea5
...@@ -767,10 +767,8 @@ extern struct aml_scratch_ops aml_scratch_par_ops; ...@@ -767,10 +767,8 @@ extern struct aml_scratch_ops aml_scratch_par_ops;
struct aml_scratch_request_par { struct aml_scratch_request_par {
int type; int type;
struct aml_tiling *stiling;
void *srcptr; void *srcptr;
int srcid; int srcid;
struct aml_tiling *dtiling;
void *dstptr; void *dstptr;
int dstid; int dstid;
struct aml_scratch_par *scratch; struct aml_scratch_par *scratch;
......
...@@ -15,16 +15,13 @@ ...@@ -15,16 +15,13 @@
******************************************************************************/ ******************************************************************************/
int aml_scratch_request_par_init(struct aml_scratch_request_par *req, int type, int aml_scratch_request_par_init(struct aml_scratch_request_par *req, int type,
struct aml_tiling *dt, void *dstptr, int dstid, void *dstptr, int dstid, void *srcptr, int srcid)
struct aml_tiling *st, void *srcptr, int srcid)
{ {
assert(req != NULL); assert(req != NULL);
req->type = type; req->type = type;
req->stiling = st;
req->srcptr = srcptr; req->srcptr = srcptr;
req->srcid = srcid; req->srcid = srcid;
req->dtiling = dt;
req->dstptr = dstptr; req->dstptr = dstptr;
req->dstid = dstid; req->dstid = dstid;
return 0; return 0;
...@@ -45,8 +42,8 @@ void *aml_scratch_par_do_thread(void *arg) ...@@ -45,8 +42,8 @@ void *aml_scratch_par_do_thread(void *arg)
(struct aml_scratch_request_par *)arg; (struct aml_scratch_request_par *)arg;
struct aml_scratch_par *scratch = req->scratch; struct aml_scratch_par *scratch = req->scratch;
aml_dma_copy(scratch->data.dma, req->dtiling, req->dstptr, req->dstid, aml_dma_copy(scratch->data.dma, scratch->data.tiling, req->dstptr,
req->stiling, req->srcptr, req->srcid); req->dstid, scratch->data.tiling, req->srcptr, req->srcid);
} }
struct aml_scratch_par_ops aml_scratch_par_inner_ops = { struct aml_scratch_par_ops aml_scratch_par_inner_ops = {
...@@ -90,9 +87,7 @@ int aml_scratch_par_create_request(struct aml_scratch_data *d, ...@@ -90,9 +87,7 @@ int aml_scratch_par_create_request(struct aml_scratch_data *d,
*srcid = *slot; *srcid = *slot;
/* init request */ /* init request */
aml_scratch_request_par_init(req, type, scratch->data.tiling, aml_scratch_request_par_init(req, type, srcptr, *srcid,
srcptr, *srcid,
scratch->data.tiling,
scratchptr, scratchid); scratchptr, scratchid);
} }
else if(type == AML_SCRATCH_REQUEST_TYPE_PULL) else if(type == AML_SCRATCH_REQUEST_TYPE_PULL)
...@@ -122,10 +117,7 @@ int aml_scratch_par_create_request(struct aml_scratch_data *d, ...@@ -122,10 +117,7 @@ int aml_scratch_par_create_request(struct aml_scratch_data *d,
*scratchid = slot; *scratchid = slot;
/* init request */ /* init request */
aml_scratch_request_par_init(req, type, aml_scratch_request_par_init(req, type, scratchptr, *scratchid,
scratch->data.tiling,
scratchptr, *scratchid,
scratch->data.tiling,
srcptr, srcid); srcptr, srcid);
} }
/* thread creation */ /* thread creation */
......
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