Module: Mesa
Branch: main
Commit: 5d5a1b660b8961dcfbc581600262b1733becf54d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5d5a1b660b8961dcfbc581600262b1733becf54d

Author: Lionel Landwerlin <[email protected]>
Date:   Wed Jun 23 18:26:28 2021 +0300

intel/devinfo: add a helper to check for slice availability

Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14510>

---

 src/intel/dev/intel_device_info.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/intel/dev/intel_device_info.h 
b/src/intel/dev/intel_device_info.h
index 1e97da0f1c8..324196dd46f 100644
--- a/src/intel/dev/intel_device_info.h
+++ b/src/intel/dev/intel_device_info.h
@@ -385,6 +385,14 @@ struct intel_device_info
 
 #endif
 
+static inline bool
+intel_device_info_slice_available(const struct intel_device_info *devinfo,
+                                  int slice)
+{
+   assert(slice < INTEL_DEVICE_MAX_SLICES);
+   return (devinfo->slice_masks & (1U << slice)) != 0;
+}
+
 static inline bool
 intel_device_info_subslice_available(const struct intel_device_info *devinfo,
                                      int slice, int subslice)

Reply via email to