diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2009-05-23 15:15:20 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2009-05-28 16:06:23 +1000 |
commit | 7ab96f4f733437de693b9578c3649b56069e6f24 (patch) | |
tree | 1204dbc9034ba6e40abd6d52834ddf5f659885d7 | |
parent | 708c711f8361ea82c1217e2614914ae047bc5bdf (diff) |
nv50: release hw TEMPs early
Since we know when we don't use a TEMP or FP ATTR register anymore,
we can release their hw resources early.
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 30aa358860..15d7ab0da5 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -214,6 +214,22 @@ assimilate_temp(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src) FREE(src); } +/* release the hardware resource held by r */ +static void +release_hw(struct nv50_pc *pc, struct nv50_reg *r) +{ + assert(r->type == P_TEMP); + if (r->hw == -1) + return; + + assert(pc->r_temp[r->hw] == r); + pc->r_temp[r->hw] = NULL; + + r->acc = 0; + if (r->index == -1) + FREE(r); +} + static void free_temp(struct nv50_pc *pc, struct nv50_reg *r) { @@ -1496,6 +1512,9 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok) continue; if (src[i][c]->index == -1 && src[i][c]->type == P_IMMD) FREE(src[i][c]); + else + if (src[i][c]->acc == pc->insn_cur) + release_hw(pc, src[i][c]); } } |