Mesa (master): i965: Write at least some data in SIMD8 URB write messages.
Kenneth Graunke
kwg at kemper.freedesktop.org
Mon Jun 29 02:48:28 UTC 2015
Module: Mesa
Branch: master
Commit: 17e8fca626c908dcbedabf57ce175113840e65c2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=17e8fca626c908dcbedabf57ce175113840e65c2
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Fri May 29 22:40:07 2015 -0700
i965: Write at least some data in SIMD8 URB write messages.
According to the "URB SIMD8 Write > Write Data Payload" documentation,
"The write data payload can be between 1 and 8 message phases long."
Apparently, the simulator considers it an error if you issue an URB
SIMD8 message with only a header and no actual data to write.
v2: Try to put in a better PRM citation, now that the Broadwell docs
actually exist (requested by Jordan).
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 4e13199..0cbaf17 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1799,16 +1799,23 @@ fs_visitor::emit_urb_writes(gl_clip_plane *clip_planes)
compute_clip_distance(clip_planes);
/* If we don't have any valid slots to write, just do a minimal urb write
- * send to terminate the shader. */
+ * send to terminate the shader. This includes 1 slot of undefined data,
+ * because it's invalid to write 0 data:
+ *
+ * From the Broadwell PRM, Volume 7: 3D Media GPGPU, Shared Functions -
+ * Unified Return Buffer (URB) > URB_SIMD8_Write and URB_SIMD8_Read >
+ * Write Data Payload:
+ *
+ * "The write data payload can be between 1 and 8 message phases long."
+ */
if (vue_map->slots_valid == 0) {
-
- fs_reg payload = fs_reg(GRF, alloc.allocate(1), BRW_REGISTER_TYPE_UD);
+ fs_reg payload = fs_reg(GRF, alloc.allocate(2), BRW_REGISTER_TYPE_UD);
bld.exec_all().MOV(payload, fs_reg(retype(brw_vec8_grf(1, 0),
BRW_REGISTER_TYPE_UD)));
fs_inst *inst = bld.emit(SHADER_OPCODE_URB_WRITE_SIMD8, reg_undef, payload);
inst->eot = true;
- inst->mlen = 1;
+ inst->mlen = 2;
inst->offset = 1;
return;
}
More information about the mesa-commit
mailing list