[Bug 78679] Gen4-5 code lost: runtime_check_aads_emit

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 15 04:43:35 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=78679

--- Comment #1 from Iago Toral <itoral at igalia.com> ---
The code needs to be fixed:

On an IronLake laptop here I can make the current implementation break badly 
producing a global system freeze. To reproduce the problem the requirements
are:

- Enable line smoothing: glEnable(GL_LINE_SMOOTH)
- Enable line rendering mode for front-faces: glPolygonMode(GL_FRONT, GL_LINE)
- Render a triangle

Long explanation:

The setup I describe above the makes the code in brw_wm_populate_key() set
key->line_aa = AA_SOMETIMES, which will then make c->runtime_check_aads_emit be
TRUE.

The original code removed with the mentioned commit checked
c->runtime_check_aads_emit and did different things depending on its value. I
think the current code for this, which now seems to live in
fs_visitor::emit_fb_writes() handles the original case where
runtime_check_aads_emit is FALSE, but does not consider the other case.

This works in Gen >= 6 in all cases because as far as I can see, the code in
brw_wm_populate_key() will never set line_aa to anything other than AA_NEVER.
The reason for this is that brw_wm_populate_key() checks the value of
brw->reduced_primitive to decide the value of line_aa but this field is only
set in Gen <= 5 (Gen >= 6 uses brw->primitive). I suppose these checks against
reduced_primitive for the value of line_aa are only meaningful in Gen < 6
(otherwise this code is not correct for Gen >= 6).

I think the work to do here involves adding the code that handles the case were
runtime_check_aads_emit is TRUE. The old code doing this was this:

-   else {
-      struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(),
BRW_REGISTER_TYPE_UD));
-      struct brw_reg ip = brw_ip_reg();
-      int jmp;
-      
-      brw_set_compression_control(p, BRW_COMPRESSION_NONE);
-      brw_set_conditionalmod(p, BRW_CONDITIONAL_Z);
-      brw_AND(p, 
-             v1_null_ud, 
-             get_element_ud(brw_vec8_grf(1,0), 6), 
-             brw_imm_ud(1<<26)); 
-
-      jmp = brw_JMPI(p, ip, ip, brw_imm_w(0)) - p->store;
-      {
-        emit_aa(c, arg1, 2);
-        fire_fb_write(c, 0, nr, target, eot);
-        /* note - thread killed in subroutine */
-      }
-      brw_land_fwd_jump(p, jmp);
-
-      /* ELSE: Shuffle up one register to fill in the hole left for AA:
-       */
-      fire_fb_write(c, 1, nr-1, target, eot);
-   }

Unfortunately, the code base has changed quite a bit since this code was
removed so it is not as easy as putting the code back, many of the functions
used do not exist any more and the code . I'll have to see if I can figure how
to get an up-to-date version of this code in place.

I'll attach a sample program that reproduces the problem too.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20140515/1c9b3a74/attachment-0001.html>


More information about the intel-3d-bugs mailing list