Mesa (master): intel/eu: Add a brw_urb_desc helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 23 17:53:19 UTC 2020


Module: Mesa
Branch: master
Commit: 2c762955d4157041f0624b8e485e822af1695c2a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c762955d4157041f0624b8e485e822af1695c2a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Aug  8 19:16:32 2019 -0700

intel/eu: Add a brw_urb_desc helper

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

---

 src/intel/compiler/brw_eu.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index 9ed481e10e6..1d509eb026c 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -311,6 +311,28 @@ brw_message_ex_desc_ex_mlen(UNUSED const struct gen_device_info *devinfo,
    return GET_BITS(ex_desc, 9, 6);
 }
 
+static inline uint32_t
+brw_urb_desc(const struct gen_device_info *devinfo,
+             unsigned msg_type,
+             bool per_slot_offset_present,
+             bool channel_mask_present,
+             unsigned global_offset)
+{
+   if (devinfo->gen >= 8) {
+      return (SET_BITS(per_slot_offset_present, 17, 17) |
+              SET_BITS(channel_mask_present, 15, 15) |
+              SET_BITS(global_offset, 14, 4) |
+              SET_BITS(msg_type, 3, 0));
+   } else if (devinfo->gen >= 7) {
+      assert(!channel_mask_present);
+      return (SET_BITS(per_slot_offset_present, 16, 16) |
+              SET_BITS(global_offset, 13, 3) |
+              SET_BITS(msg_type, 3, 0));
+   } else {
+      unreachable("unhandled URB write generation");
+   }
+}
+
 /**
  * Construct a message descriptor immediate with the specified sampler
  * function controls.



More information about the mesa-commit mailing list