r600/sfn: Handle chipclass with kcache allocation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>
This commit is contained in:
Gert Wollny
2022-07-29 01:08:23 +02:00
committed by Marge Bot
parent 3c7368de56
commit 42f2e82fe0
3 changed files with 15 additions and 2 deletions

View File

@@ -337,10 +337,20 @@ bool Block::try_reserve_kcache(const AluInstr& instr)
return true;
}
void Block::set_chipclass(r600_chip_class chip_class)
{
if (chip_class < ISA_CC_EVERGREEN)
s_max_kcache_banks = 2;
else
s_max_kcache_banks = 4;
}
unsigned Block::s_max_kcache_banks = 4;
bool Block::try_reserve_kcache(const UniformValue& u,
std::array<KCacheLine, 4>& kcache) const
{
const int kcache_banks = 4; // TODO: handle pre-evergreen
const int kcache_banks = s_max_kcache_banks; // TODO: handle pre-evergreen
int bank = u.kcache_bank();
int sel = (u.sel() - 512);

View File

@@ -210,6 +210,8 @@ public:
bool kcache_reservation_failed() const { return m_kcache_alloc_failed;}
static void set_chipclass(r600_chip_class chip_class);
private:
bool try_reserve_kcache(const UniformValue& u,
std::array<KCacheLine, 4>& kcache) const;
@@ -231,7 +233,7 @@ private:
int m_lds_group_requirement{0};
AluInstr *m_lds_group_start{nullptr};
static unsigned s_max_kcache_banks;
};
class InstrWithVectorResult : public Instr {

View File

@@ -224,6 +224,7 @@ private:
Shader *schedule(Shader *original)
{
Block::set_chipclass(original->chip_class());
AluGroup::set_chipclass(original->chip_class());
sfn_log << SfnLog::schedule << "Original shader\n";