From: Alyssa Rosenzweig Date: Wed, 15 Apr 2020 15:45:49 +0000 (-0400) Subject: pan/bi: Workaround constant packing errata X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1647884cec58577024c0ff5e22d276b9e8e741f6;p=mesa.git pan/bi: Workaround constant packing errata Incomplete fix. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index edeb050aae1..f135cab5c02 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -1261,18 +1261,23 @@ bi_pack_constants(bi_context *ctx, bi_clause *clause, /* TODO: Pos */ assert(index == 0 && clause->bundle_count == 1); + assert(only); + + uint64_t hi = clause->constants[index + 0] >> 60ull; struct bifrost_fmt_constant quad = { .pos = 0, /* TODO */ .tag = done ? BIFROST_FMTC_FINAL : BIFROST_FMTC_CONSTANTS, .imm_1 = clause->constants[index + 0] >> 4, - .imm_2 = only ? 0 : clause->constants[index + 1] >> 4 + .imm_2 = ((hi < 8) ? (hi << 60ull) : 0) >> 4, }; /* XXX: On G71, Connor observed that the difference of the top 4 bits * of the second constant with the first must be less than 8, otherwise - * we have to swap them. I am not able to reproduce this on G52, - * further investigation needed. Possibly an errata. XXX */ + * we have to swap them. On G52, I'm able to reproduce a similar issue + * but with a different workaround (modeled above with a single + * constant, unclear how to workaround for multiple constants.) Further + * investigation needed. Possibly an errata. XXX */ util_dynarray_append(emission, struct bifrost_fmt_constant, quad);