[Mesa-dev] [PATCH 1/3] i965: Handle IVB DF differences in the validator.

Matt Turner mattst88 at gmail.com
Fri Jan 20 21:35:31 UTC 2017


On IVB/BYT, region parameters and execution size for DF are in terms of
32-bit elements, so they are doubled. For evaluating the validity of an
instruction, we halve them.
---
 src/mesa/drivers/dri/i965/brw_eu_validate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_eu_validate.c b/src/mesa/drivers/dri/i965/brw_eu_validate.c
index 2265394..0787029 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_validate.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_validate.c
@@ -466,6 +466,10 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf
       brw_hw_reg_type_to_size(devinfo, exec_type, BRW_GENERAL_REGISTER_FILE);
    unsigned dst_type_size = brw_element_size(devinfo, inst, dst);
 
+   if (devinfo->gen == 7 && !devinfo->is_haswell &&
+       exec_type_size == 8 && dst_type_size == 4)
+      dst_type_size = 8;
+
    if (exec_type_size > dst_type_size) {
       ERROR_IF(dst_stride * dst_type_size != exec_type_size,
                "Destination stride must be equal to the ratio of the sizes of "
@@ -575,6 +579,10 @@ general_restrictions_on_region_parameters(const struct gen_device_info *devinfo,
       }
 #undef DO_SRC
 
+      if (devinfo->gen == 7 && !devinfo->is_haswell &&
+          element_size == 8)
+         element_size = 4;
+
       /* ExecSize must be greater than or equal to Width. */
       ERROR_IF(exec_size < width, "ExecSize must be greater than or equal "
                                   "to Width");
@@ -791,6 +799,10 @@ region_alignment_rules(const struct gen_device_info *devinfo,
    if (error_msg.str)
       return error_msg;
 
+   if (devinfo->gen == 7 && !devinfo->is_haswell &&
+       element_size == 8)
+      element_size = 4;
+
    align1_access_mask(dst_access_mask, exec_size, element_size, subreg,
                       exec_size == 1 ? 0 : exec_size * stride,
                       exec_size == 1 ? 1 : exec_size,
-- 
2.7.3



More information about the mesa-dev mailing list