r600/sfn: Fix scheduling with limited channel availability

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>
This commit is contained in:
Gert Wollny
2022-11-28 19:02:41 +01:00
committed by Marge Bot
parent 1f7d34b4a2
commit b47928043d
8 changed files with 20 additions and 12 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ public:
const InstrList& dependend_instr() { return m_dependend_instr; }
virtual AluInstr *as_alu() { return nullptr; }
virtual uint8_t allowed_dest_chan_mask() const { return 0; }
virtual uint8_t allowed_src_chan_mask() const { return 0; }
protected:
const InstrList& required_instr() const { return m_required_instr; }
@@ -465,15 +465,16 @@ AluInstr::set_sources(SrcValues src)
}
}
uint8_t AluInstr::allowed_src_chan_mask() const
{
return 0xf;
}
uint8_t
AluInstr::allowed_dest_chan_mask() const
{
if (alu_slots() != 1) {
if (has_alu_flag(alu_is_cayman_trans)) {
if (alu_slots() != 1 && has_alu_flag(alu_is_cayman_trans)) {
return (1 << alu_slots()) - 1;
} else {
return 0;
}
}
return 0xf;
}
+2 -1
View File
@@ -179,7 +179,8 @@ public:
AluInstr *as_alu() override { return this; }
uint8_t allowed_dest_chan_mask() const override;
uint8_t allowed_src_chan_mask() const override;
uint8_t allowed_dest_chan_mask() const;
private:
friend class AluGroup;
@@ -202,8 +202,14 @@ AluGroup::add_vec_instructions(AluInstr *instr)
if (dest && (dest->pin() == pin_free || dest->pin() == pin_group)) {
int free_mask = 0xf;
for (auto p : dest->parents()) {
auto alu = p->as_alu();
if (alu)
free_mask &= alu->allowed_dest_chan_mask();
}
for (auto u : dest->uses()) {
free_mask &= u->allowed_dest_chan_mask();
free_mask &= u->allowed_src_chan_mask();
if (!free_mask)
return false;
}
@@ -161,7 +161,7 @@ ExportInstr::from_string_impl(std::istream& is, ValueFactory& vf)
}
uint8_t
ExportInstr::allowed_dest_chan_mask() const
ExportInstr::allowed_src_chan_mask() const
{
return value().free_chan_mask();
}
@@ -77,7 +77,7 @@ public:
static Instr::Pointer from_string(std::istream& is, ValueFactory& vf);
static Instr::Pointer last_from_string(std::istream& is, ValueFactory& vf);
uint8_t allowed_dest_chan_mask() const override;
uint8_t allowed_src_chan_mask() const override;
private:
static ExportInstr::Pointer from_string_impl(std::istream& is, ValueFactory& vf);
@@ -423,7 +423,7 @@ TexInstr::replace_source(PRegister old_src, PVirtualValue new_src)
}
uint8_t
TexInstr::allowed_dest_chan_mask() const
TexInstr::allowed_src_chan_mask() const
{
return m_src.free_chan_mask();
}
+1 -1
View File
@@ -153,7 +153,7 @@ public:
bool replace_source(PRegister old_src, PVirtualValue new_src) override;
uint8_t allowed_dest_chan_mask() const override;
uint8_t allowed_src_chan_mask() const override;
private:
bool do_ready() const override;