r600/sfn: Make the pin_to_channel generic

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>
diff --git a/src/gallium/drivers/r600/sfn/sfn_value.h b/src/gallium/drivers/r600/sfn/sfn_value.h
index 3a53281..222b046 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value.h
+++ b/src/gallium/drivers/r600/sfn/sfn_value.h
@@ -86,6 +86,7 @@
    uint32_t chan() const {return m_chan;}
 
    void set_chan(uint32_t chan);
+   virtual void set_pin_to_channel() { assert(0 && "Only GPRs can be pinned to a channel ");}
    void print(std::ostream& os, const PrintFlags& flags) const;
 
    void print(std::ostream& os) const;
diff --git a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
index bc4a0a5..dba5c04 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp
@@ -152,6 +152,14 @@
    v.set_pin_to_channel();
 }
 
+void GPRVector::pin_all_to_channel()
+{
+   for (auto& v: m_elms) {
+      auto& c = static_cast<GPRValue&>(*v);
+      c.set_pin_to_channel();
+   }
+}
+
 void GPRVector::do_print(std::ostream& os) const
 {
    os << "R" << sel() << ".";
diff --git a/src/gallium/drivers/r600/sfn/sfn_value_gpr.h b/src/gallium/drivers/r600/sfn/sfn_value_gpr.h
index 589e882..d845e02 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value_gpr.h
+++ b/src/gallium/drivers/r600/sfn/sfn_value_gpr.h
@@ -54,7 +54,7 @@
 
    void set_as_input(){ m_input = true; }
    bool is_input() const {return  m_input; }
-   void set_pin_to_channel() { m_pin_to_channel = true;}
+   void set_pin_to_channel() override { m_pin_to_channel = true;}
    bool pin_to_channel()  const { return m_pin_to_channel;}
 
 private:
@@ -94,6 +94,7 @@
    PValue& operator [] (int i) {return m_elms[i];}
 
    void pin_to_channel(int i);
+   void pin_all_to_channel();
 
    PValue x() const {return m_elms[0];}
    PValue y() const {return m_elms[1];}