freedreno/registers: Extend ncrb builder for new gens

We want to use the A7XX version for anything CHIP>=A7XX.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38450>
This commit is contained in:
Rob Clark 2025-08-23 07:45:29 -07:00 committed by Marge Bot
parent b5d307ef03
commit ce4373ede5

View file

@ -88,7 +88,7 @@ public:
friend class fd_pkt; friend class fd_pkt;
friend class fd_pkt4; friend class fd_pkt4;
friend class fd_pkt7; friend class fd_pkt7;
template <chip CHIP> friend class fd_ncrb; template <chip CHIP, typename Enable> friend class fd_ncrb;
}; };
class fd_pkt; class fd_pkt;
@ -422,7 +422,7 @@ private:
* A builder for writing non-context regs, which is implemented differently * A builder for writing non-context regs, which is implemented differently
* depending on generation (A6XX doesn't have CP_NON_CONTEXT_REG_BUNCH) * depending on generation (A6XX doesn't have CP_NON_CONTEXT_REG_BUNCH)
*/ */
template <chip CHIP> template <chip_range_support>
class fd_ncrb { class fd_ncrb {
public: public:
fd_ncrb(fd_cs &cs, unsigned nregs); fd_ncrb(fd_cs &cs, unsigned nregs);
@ -441,8 +441,8 @@ public:
* A6XX does not have CP_NON_CONTEXT_REG_BUNCH, so the builder is implemented * A6XX does not have CP_NON_CONTEXT_REG_BUNCH, so the builder is implemented
* as a sequence of pkt4's * as a sequence of pkt4's
*/ */
template <> template <chip CHIP>
class fd_ncrb<A6XX> : fd_pkt4 { class fd_ncrb<chip_range(CHIP == A6XX)> : fd_pkt4 {
public: public:
fd_ncrb(fd_cs &cs, unsigned nregs) : fd_pkt4(cs.ring_) { fd_ncrb(fd_cs &cs, unsigned nregs) : fd_pkt4(cs.ring_) {
/* worst case, one pkt4 per reg: */ /* worst case, one pkt4 per reg: */
@ -476,10 +476,10 @@ private:
}; };
/** /**
* Builder to write non-context regs for A7XX, which uses CP_NON_CONTEXT_REG_BUNCH * Builder to write non-context regs for A7XX+, which uses CP_NON_CONTEXT_REG_BUNCH
*/ */
template <> template <chip CHIP>
class fd_ncrb<A7XX> : fd_crb { class fd_ncrb<chip_range(CHIP >= A7XX)> : fd_crb {
public: public:
fd_ncrb(fd_cs &cs, unsigned nregs) : fd_crb(cs.ring_) { fd_ncrb(fd_cs &cs, unsigned nregs) : fd_crb(cs.ring_) {
init(cs, CP_NON_CONTEXT_REG_BUNCH, 2 + (nregs * 2)); init(cs, CP_NON_CONTEXT_REG_BUNCH, 2 + (nregs * 2));