From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 69155] [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures Date: Sun, 01 Dec 2013 08:03:21 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1248585606==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1248585606== Content-Type: multipart/alternative; boundary="1385885001.E8573f1.3573"; charset="us-ascii" --1385885001.E8573f1.3573 Date: Sun, 1 Dec 2013 08:03:21 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=69155 Ilia Mirkin changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|codegen/nv50_ir_emit_nv50.c |[NV50 gallium] [piglit] |pp:169:srcAddr8: Assertion |bin/varying-packing-simple |`(offset <= 0x1fc || offset |triggers memory |== 0x3fc) && !(offset & |corruption/failures |0x3)' failed. | --- Comment #1 from Ilia Mirkin --- OK, so there are a few problems here, not the least of which is that there's memory corruption in the program logic because nv50_program only has 16 in/out varyings, but it reports support for a lot more than that. Once you fix that, there's another incorrect assert. Fixing that makes the test run, but it fails. For posterity, here is the patch that makes the test not-completely-die. I'll look into what the test is doing and why it's failing later. diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 762b48f..167d228 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -223,9 +223,7 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader, case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: return 4; case PIPE_SHADER_CAP_MAX_INPUTS: - if (shader == PIPE_SHADER_VERTEX) - return 32; - return 0x300 / 16; + return 16; case PIPE_SHADER_CAP_MAX_CONSTS: return 65536 / 16; case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c index ba4f592..a7f7a36 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c @@ -443,14 +443,15 @@ nv50_fp_linkage_validate(struct nv50_context *nv50) } n = (m + 3) / 4; - assert(m <= 64); if (unlikely(nv50->gmtyprog)) { + assert(n <= 33); BEGIN_NV04(push, NV50_3D(GP_RESULT_MAP_SIZE), 1); PUSH_DATA (push, m); BEGIN_NV04(push, NV50_3D(GP_RESULT_MAP(0)), n); PUSH_DATAp(push, map, n); } else { + assert(n <= 17); // XXX use the nva3+ ALT version? BEGIN_NV04(push, NV50_3D(VP_GP_BUILTIN_ATTR_EN), 1); PUSH_DATA (push, vp->vp.attrs[2]); -- You are receiving this mail because: You are the assignee for the bug. --1385885001.E8573f1.3573 Date: Sun, 1 Dec 2013 08:03:21 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" changed bug 69155
What Removed Added
Summary codegen/nv50_ir_emit_nv50.cpp:169:srcAddr8: Assertion `(offset <= 0x1fc || offset == 0x3fc) && !(offset & 0x3)' failed. [NV50 gallium] [piglit] bin/varying-packing-simple triggers memory corruption/failures

Comment # 1 on bug 69155 from
OK, so there are a few problems here, not the least of which is that there's
memory corruption in the program logic because nv50_program only has 16 in/out
varyings, but it reports support for a lot more than that.

Once you fix that, there's another incorrect assert. Fixing that makes the test
run, but it fails. For posterity, here is the patch that makes the test
not-completely-die. I'll look into what the test is doing and why it's failing
later.

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 762b48f..167d228 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -223,9 +223,7 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen,
unsigned shader,
    case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
       return 4;
    case PIPE_SHADER_CAP_MAX_INPUTS:
-      if (shader == PIPE_SHADER_VERTEX)
-         return 32;
-      return 0x300 / 16;
+      return 16;
    case PIPE_SHADER_CAP_MAX_CONSTS:
       return 65536 / 16;
    case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
index ba4f592..a7f7a36 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -443,14 +443,15 @@ nv50_fp_linkage_validate(struct nv50_context *nv50)
    }

    n = (m + 3) / 4;
-   assert(m <= 64);

    if (unlikely(nv50->gmtyprog)) {
+      assert(n <= 33);
       BEGIN_NV04(push, NV50_3D(GP_RESULT_MAP_SIZE), 1);
       PUSH_DATA (push, m);
       BEGIN_NV04(push, NV50_3D(GP_RESULT_MAP(0)), n);
       PUSH_DATAp(push, map, n);
    } else {
+      assert(n <= 17); // XXX use the nva3+ ALT version?
       BEGIN_NV04(push, NV50_3D(VP_GP_BUILTIN_ATTR_EN), 1);
       PUSH_DATA (push, vp->vp.attrs[2]);


You are receiving this mail because:
  • You are the assignee for the bug.
--1385885001.E8573f1.3573-- --===============1248585606== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Nouveau mailing list Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org http://lists.freedesktop.org/mailman/listinfo/nouveau --===============1248585606==--