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;
struct aml_scratch_request_par {
int type;
struct aml_tiling *stiling;
void *srcptr;
int srcid;
struct aml_tiling *dtiling;
void *dstptr;
int dstid;
struct aml_scratch_par *scratch;
......
......@@ -15,16 +15,13 @@
******************************************************************************/
int aml_scratch_request_par_init(struct aml_scratch_request_par *req, int type,
struct aml_tiling *dt, void *dstptr, int dstid,
struct aml_tiling *st, void *srcptr, int srcid)
void *dstptr, int dstid, void *srcptr, int srcid)
{
assert(req != NULL);
req->type = type;
req->stiling = st;
req->srcptr = srcptr;
req->srcid = srcid;
req->dtiling = dt;
req->dstptr = dstptr;
req->dstid = dstid;
return 0;
......@@ -45,8 +42,8 @@ void *aml_scratch_par_do_thread(void *arg)
(struct aml_scratch_request_par *)arg;
struct aml_scratch_par *scratch = req->scratch;
aml_dma_copy(scratch->data.dma, req->dtiling, req->dstptr, req->dstid,
req->stiling, req->srcptr, req->srcid);
aml_dma_copy(scratch->data.dma, scratch->data.tiling, req->dstptr,
req->dstid, scratch->data.tiling, req->srcptr, req->srcid);
}
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,
*srcid = *slot;
/* init request */
aml_scratch_request_par_init(req, type, scratch->data.tiling,
srcptr, *srcid,
scratch->data.tiling,
aml_scratch_request_par_init(req, type, srcptr, *srcid,
scratchptr, scratchid);
}
else if(type == AML_SCRATCH_REQUEST_TYPE_PULL)
......@@ -122,10 +117,7 @@ int aml_scratch_par_create_request(struct aml_scratch_data *d,
*scratchid = slot;
/* init request */
aml_scratch_request_par_init(req, type,
scratch->data.tiling,
scratchptr, *scratchid,
scratch->data.tiling,
aml_scratch_request_par_init(req, type, scratchptr, *scratchid,
srcptr, srcid);
}
/* 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