[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'upstream-unstable'



 VERSION                                                        |    2 
 bin/.cherry-ignore                                             |    3 
 bin/get-pick-list.sh                                           |    2 
 configure.ac                                                   |    1 
 docs/relnotes/10.5.5.html                                      |    3 
 docs/relnotes/10.5.6.html                                      |  147 ++++++++++
 docs/relnotes/10.5.7.html                                      |  102 ++++++
 include/pci_ids/radeonsi_pci_ids.h                             |    1 
 src/egl/drivers/dri2/egl_dri2.c                                |    2 
 src/egl/drivers/dri2/platform_wayland.c                        |    5 
 src/egl/main/eglapi.c                                          |    6 
 src/gallium/auxiliary/draw/draw_llvm.c                         |    2 
 src/gallium/drivers/freedreno/freedreno_context.h              |    2 
 src/gallium/drivers/freedreno/freedreno_gmem.c                 |    9 
 src/gallium/drivers/freedreno/freedreno_screen.c               |    1 
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp      |    6 
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gm107.cpp |    1 
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp  |    6 
 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp       |   23 +
 src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp    |    5 
 src/gallium/drivers/nouveau/nv30/nv30_clear.c                  |    2 
 src/gallium/drivers/nouveau/nv30/nv30_context.h                |    2 
 src/gallium/drivers/nouveau/nv30/nv30_draw.c                   |   74 +++--
 src/gallium/drivers/nouveau/nv30/nv30_fragprog.c               |    5 
 src/gallium/drivers/nouveau/nv30/nv30_state_validate.c         |   26 -
 src/gallium/drivers/nouveau/nv30/nv30_vbo.c                    |    2 
 src/gallium/drivers/nouveau/nv30/nv30_vertprog.c               |    5 
 src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c               |    5 
 src/gallium/drivers/nouveau/nv50/nv50_context.c                |   11 
 src/gallium/drivers/nouveau/nv50/nv50_context.h                |   29 -
 src/gallium/drivers/nouveau/nv50/nv50_screen.h                 |   24 +
 src/gallium/drivers/nouveau/nv50/nv50_state_validate.c         |    2 
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c                |    7 
 src/gallium/drivers/nouveau/nvc0/nvc0_context.h                |   24 -
 src/gallium/drivers/nouveau/nvc0/nvc0_program.c                |   13 
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.h                 |   25 +
 src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c         |    2 
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c                |    6 
 src/gallium/state_trackers/clover/core/event.cpp               |   79 ++++-
 src/gallium/state_trackers/clover/core/event.hpp               |   12 
 src/gallium/state_trackers/clover/core/queue.cpp               |    2 
 src/gallium/state_trackers/clover/core/queue.hpp               |    2 
 src/gallium/state_trackers/dri/dri_context.c                   |    9 
 src/gallium/targets/osmesa/Makefile.am                         |    1 
 src/glsl/linker.cpp                                            |   10 
 src/glx/dri3_glx.c                                             |    5 
 src/mesa/drivers/dri/i965/brw_fs.cpp                           |    2 
 src/mesa/drivers/dri/i965/gen8_depth_state.c                   |   10 
 src/mesa/drivers/dri/i965/intel_pixel_read.c                   |   24 +
 src/mesa/drivers/dri/i965/intel_tex_image.c                    |    9 
 src/mesa/drivers/dri/swrast/swrast.c                           |   18 +
 src/mesa/drivers/osmesa/Makefile.am                            |    1 
 src/mesa/main/fbobject.c                                       |   51 +++
 src/mesa/main/ffvertex_prog.c                                  |    2 
 src/mesa/main/get.c                                            |    1 
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp                     |    3 
 56 files changed, 663 insertions(+), 171 deletions(-)

New commits:
commit 495bcbc48cf4e7cee0f2de11c1166a1fd6eb3969
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Jun 7 11:13:19 2015 +0100

    Add release notes for the 10.5.7 release
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/docs/relnotes/10.5.7.html b/docs/relnotes/10.5.7.html
new file mode 100644
index 0000000..49440c4
--- /dev/null
+++ b/docs/relnotes/10.5.7.html
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <title>Mesa Release Notes</title>
+  <link rel="stylesheet" type="text/css" href="../mesa.css">
+</head>
+<body>
+
+<div class="header">
+  <h1>The Mesa 3D Graphics Library</h1>
+</div>
+
+<iframe src="../contents.html"></iframe>
+<div class="content">
+
+<h1>Mesa 10.5.7 Release Notes / June 07, 2015</h1>
+
+<p>
+Mesa 10.5.7 is a bug fix release which fixes bugs found since the 10.5.6 release.
+</p>
+<p>
+Mesa 10.5.7 implements the OpenGL 3.3 API, but the version reported by
+glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
+glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.3.  OpenGL
+3.3 is <strong>only</strong> available if requested at context creation
+because compatibility contexts are not supported.
+</p>
+
+
+<h2>SHA256 checksums</h2>
+<pre>
+TBD
+</pre>
+
+
+<h2>New features</h2>
+<p>None</p>
+
+<h2>Bug fixes</h2>
+
+<p>This list is likely incomplete.</p>
+
+<ul>
+
+<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89131";>Bug 89131</a> - [Bisected] Graphical corruption in Weston,  shows old framebuffer pieces</li>
+
+</ul>
+
+
+<h2>Changes</h2>
+
+<p>Ben Widawsky (1):</p>
+<ul>
+  <li>i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)</li>
+</ul>
+
+<p>Emil Velikov (4):</p>
+<ul>
+  <li>docs: Add sha256sums for the 10.5.6 release</li>
+  <li>get-pick-list.sh: Require explicit "10.5" for nominating stable patches</li>
+  <li>cherry-ignore: add clover build fix not applicable for 10.5</li>
+  <li>Update version to 10.5.7</li>
+</ul>
+
+<p>Ilia Mirkin (18):</p>
+<ul>
+  <li>nvc0/ir: set ftz when sources are floats, not just destinations</li>
+  <li>nv50/ir: guess that the constant offset is the starting slot of array</li>
+  <li>nvc0/ir: LOAD's can't be used for shader inputs</li>
+  <li>nvc0: a geometry shader can have up to 1024 vertices output</li>
+  <li>nv50/ir: avoid messing up arg1 of PFETCH</li>
+  <li>nv30: don't leak fragprog consts</li>
+  <li>nv30: avoid leaking render state and draw shaders</li>
+  <li>nv30: fix clip plane uploads and enable changes</li>
+  <li>nv30/draw: avoid leaving stale pointers in draw state</li>
+  <li>nv30/draw: draw expects constbuf size in bytes, not vec4 units</li>
+  <li>st/mesa: don't leak glsl_to_tgsi object on link failure</li>
+  <li>glsl: avoid leaking linked gl_shader when there's a late linker error</li>
+  <li>nv30/draw: fix indexed draws with swtnl path and a resource index buffer</li>
+  <li>nv30/draw: only use the DMA1 object (GART) if the bo is not in VRAM</li>
+  <li>nv30/draw: allocate vertex buffers in gart</li>
+  <li>nv30/draw: switch varying hookup logic to know about texcoords</li>
+  <li>nv30: falling back to draw path for edgeflag does no good</li>
+  <li>nv30: avoid doing extra work on clear and hitting unexpected states</li>
+</ul>
+
+<p>Jason Ekstrand (1):</p>
+<ul>
+  <li>i965/fs: Fix implied_mrf_writes for scratch writes</li>
+</ul>
+
+<p>Marek Olšák (1):</p>
+<ul>
+  <li>st/dri: fix postprocessing crash when there's no depth buffer</li>
+</ul>
+
+
+</div>
+</body>
+</html>

commit 95b81ee9e86babeb5f19e4785ea1a2075a1a403b
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Jun 7 11:11:38 2015 +0100

    Update version to 10.5.7
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/VERSION b/VERSION
index 3b24057..e9d57a4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-10.5.6
+10.5.7

commit 07aa6d78bbc9639dd7bbc86bbb375aae1103ddfd
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Thu Mar 5 12:10:15 2015 -0500

    nv30: avoid doing extra work on clear and hitting unexpected states
    
    Clearing can happen at a time when various state objects are incoherent
    and not ready for a draw. Some of the validation functions don't handle
    this well, so only flush the framebuffer state. This has the advantage
    of also not doing extra work.
    
    This works around some crashes that can happen when clearing.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
    (cherry picked from commit aba3392541f38f82e3ebde251fdcca78e90adbf3)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_clear.c b/src/gallium/drivers/nouveau/nv30/nv30_clear.c
index 1ab8929..83fd1fa 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_clear.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_clear.c
@@ -58,7 +58,7 @@ nv30_clear(struct pipe_context *pipe, unsigned buffers,
    struct pipe_framebuffer_state *fb = &nv30->framebuffer;
    uint32_t colr = 0, zeta = 0, mode = 0;
 
-   if (!nv30_state_validate(nv30, TRUE))
+   if (!nv30_state_validate(nv30, NV30_NEW_FRAMEBUFFER | NV30_NEW_SCISSOR, TRUE))
       return;
 
    if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) {
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.h b/src/gallium/drivers/nouveau/nv30/nv30_context.h
index 7b32aae..592cdbe 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_context.h
+++ b/src/gallium/drivers/nouveau/nv30/nv30_context.h
@@ -204,7 +204,7 @@ void
 nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info);
 
 boolean
-nv30_state_validate(struct nv30_context *nv30, boolean hwtnl);
+nv30_state_validate(struct nv30_context *nv30, uint32_t mask, boolean hwtnl);
 
 void
 nv30_state_release(struct nv30_context *nv30);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 4ef94c7..c1665b7 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -134,7 +134,7 @@ nv30_render_draw_elements(struct vbuf_render *render,
                        NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
    }
 
-   if (!nv30_state_validate(nv30, FALSE))
+   if (!nv30_state_validate(nv30, ~0, FALSE))
       return;
 
    BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
@@ -179,7 +179,7 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
                        NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
    }
 
-   if (!nv30_state_validate(nv30, FALSE))
+   if (!nv30_state_validate(nv30, ~0, FALSE))
       return;
 
    BEGIN_NV04(push, NV30_3D(VERTEX_BEGIN_END), 1);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
index 704c24b..a954dcc 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
@@ -454,7 +454,7 @@ nv30_state_context_switch(struct nv30_context *nv30)
 }
 
 boolean
-nv30_state_validate(struct nv30_context *nv30, boolean hwtnl)
+nv30_state_validate(struct nv30_context *nv30, uint32_t mask, boolean hwtnl)
 {
    struct nouveau_screen *screen = &nv30->screen->base;
    struct nouveau_pushbuf *push = nv30->base.pushbuf;
@@ -479,14 +479,16 @@ nv30_state_validate(struct nv30_context *nv30, boolean hwtnl)
    else
       validate = swtnl_validate_list;
 
-   if (nv30->dirty) {
+   mask &= nv30->dirty;
+
+   if (mask) {
       while (validate->func) {
-         if (nv30->dirty & validate->mask)
+         if (mask & validate->mask)
             validate->func(nv30);
          validate++;
       }
 
-      nv30->dirty = 0;
+      nv30->dirty &= ~mask;
    }
 
    nouveau_pushbuf_bufctx(push, bctx);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
index 67ab829..d4e384b 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
@@ -564,7 +564,7 @@ nv30_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    if (nv30->vbo_user && !(nv30->dirty & (NV30_NEW_VERTEX | NV30_NEW_ARRAYS)))
       nv30_update_user_vbufs(nv30);
 
-   nv30_state_validate(nv30, TRUE);
+   nv30_state_validate(nv30, ~0, TRUE);
    if (nv30->draw_flags) {
       nv30_render_vbo(pipe, info);
       return;

commit 70816a66d5431db37cb6207efe6439b895746d16
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Tue May 26 19:32:36 2015 +0200

    st/dri: fix postprocessing crash when there's no depth buffer
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89131
    
    Cc: 10.6 10.5 <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    (cherry picked from commit 25e9ae2b79f32631e7255807a242e5fc4e39984c)

diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 8ac81b7..400114e 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -233,11 +233,10 @@ dri_make_current(__DRIcontext * cPriv,
 
    ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
 
-   // This is ok to call here. If they are already init, it's a no-op.
-   if (draw->textures[ST_ATTACHMENT_BACK_LEFT] && draw->textures[ST_ATTACHMENT_DEPTH_STENCIL]
-      && ctx->pp)
-         pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
-            draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
+   /* This is ok to call here. If they are already init, it's a no-op. */
+   if (ctx->pp && draw->textures[ST_ATTACHMENT_BACK_LEFT])
+      pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
+                   draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
 
    return GL_TRUE;
 }

commit f8bb4a814d9aac2825737e48fefc16785cb9060c
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Wed May 20 19:20:14 2015 -0700

    i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)
    
    Starting with GEN8, there is documentation that the multisample state command
    must be emitted before the 3DSTATE_WM_HZ_OP command any time the multisample
    count changes. The 3DSTATE_WM_HZ_OP packet gets emitted as a result of a
    intel_hix_exec(), which is called upon a fast clear and/or a resolve. This can
    happen before the state atoms are checked, and so the multisample state must be
    put directly in the function.
    
    v1:
    - In v0, I was always emitting the command, but Ken came up with the condition to
    determine whether or not the sample count actually changed.
    - Ken's recommendation was to set brw->num_multisamples after emitting
    3DSTATE_MULTISAMPLE. This doesn't work. I put my best guess as to why in the XXX
    (it was causing 7 regressions on BDW).
    
    v2:
    Flag NEW_MULTISAMPLE state. As Ken found, in state upload we check for the
    multisample change to determine whether or not to emit certain packets. Since
    the hiz code doesn't actually care about the number of multisamples, set the
    flag and let the later code take care of it.
    
    Jenkins results:
    http://otc-mesa-ci.jf.intel.com/view/dev/job/bwidawsk/136/
    
    Fixes around 200 piglit tests on SKL. I'm somewhat surprised that it seems to
    have no impact on BDW as the restriction is needed there as well.
    
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
    Reviewed-by: Neil Roberts <neil@linux.intel.com> (v0)
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
    (cherry picked from commit e2d84d99f5a66738e8f584bdfea66182f36fe46c)

diff --git a/src/mesa/drivers/dri/i965/gen8_depth_state.c b/src/mesa/drivers/dri/i965/gen8_depth_state.c
index b4eb6e1..cc00610 100644
--- a/src/mesa/drivers/dri/i965/gen8_depth_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_depth_state.c
@@ -412,6 +412,16 @@ gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
    uint32_t surface_width  = ALIGN(mt->logical_width0,  level == 0 ? 8 : 1);
    uint32_t surface_height = ALIGN(mt->logical_height0, level == 0 ? 4 : 1);
 
+   /* From the documentation for 3DSTATE_WM_HZ_OP: "3DSTATE_MULTISAMPLE packet
+    * must be used prior to this packet to change the Number of Multisamples.
+    * This packet must not be used to change Number of Multisamples in a
+    * rendering sequence."
+    */
+   if (brw->num_samples != mt->num_samples) {
+      gen8_emit_3dstate_multisample(brw, mt->num_samples);
+      brw->NewGLState |= _NEW_MULTISAMPLE;
+   }
+
    /* The basic algorithm is:
     * - If needed, emit 3DSTATE_{DEPTH,HIER_DEPTH,STENCIL}_BUFFER and
     *   3DSTATE_CLEAR_PARAMS packets to set up the relevant buffers.

commit 8c56fc92750a4a6c390354c0b1428cdc9edac5b5
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Wed Jun 3 12:03:35 2015 +0100

    cherry-ignore: add clover build fix not applicable for 10.5
    
    The 10.5 codebase uses a compat/wrapper implementation for the string
    class. As such it already explicitly includes the string header.
    
    Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
index ec06241..9a828ae 100644
--- a/bin/.cherry-ignore
+++ b/bin/.cherry-ignore
@@ -24,3 +24,6 @@ fe5fddd7e2df74233a2a02ae021418485f39d11c
 
 # The optimisations mentioned are not available in 10.5
 627c68308683abbd6e563a09af6013a33938a790 i965/fs: in MAD optimizations, switch last argument to be immediate
+
+# 10.5 has the compat string implementation, which includes the <string>
+967825d053f71c5f5fc3ba31eabc0c6004fde4f1 clover: Build fix for FreeBSD.

commit 6338bd6f7000e9fc60161b27f4f66be857d22351
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Mon May 25 17:46:45 2015 -0400

    nv30: falling back to draw path for edgeflag does no good
    
    The problem is that the EDGEFLAG has to be toggled at vertex submission
    time. This can be done from either the draw or the regular paths. Avoid
    falling back to draw just because there's an edgeflag.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 3ec18152858fd9aadb398d78d5ad2d2b938507c1)

diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
index 51e1fb6..a2ae4a8 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c
@@ -873,9 +873,8 @@ nvfx_vertprog_parse_decl_output(struct nvfx_vpc *vpc,
       }
       break;
    case TGSI_SEMANTIC_EDGEFLAG:
-      /* not really an error just a fallback */
-      NOUVEAU_ERR("cannot handle edgeflag output\n");
-      return FALSE;
+      vpc->r_result[idx] = nvfx_reg(NVFXSR_NONE, 0);
+      return TRUE;
    default:
       NOUVEAU_ERR("bad output semantic\n");
       return FALSE;

commit 7087a507bfccf8e96889eb8f86a48268b7525d20
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat May 23 22:11:38 2015 -0400

    nv30/draw: switch varying hookup logic to know about texcoords
    
    Commit 8acaf862dfe switched things over to use TEXCOORD instead of
    GENERIC, but did not update the nv30 swtnl draw paths. This teaches the
    draw logic about TEXCOORD.
    
    Among other things, this fixes a crash in demos/arbocclude when using
    swtnl. Curiously enough, the point-sprite piglit works without this.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 25be70462dbb7ee994e69ffccc3de94e4114e667)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index f6a66dd..4ef94c7 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -218,22 +218,24 @@ static const struct {
    [TGSI_SEMANTIC_BCOLOR  ] = { EMIT_4F, INTERP_LINEAR     , 1, 3, 0x00000004 },
    [TGSI_SEMANTIC_FOG     ] = { EMIT_4F, INTERP_PERSPECTIVE, 5, 5, 0x00000010 },
    [TGSI_SEMANTIC_PSIZE   ] = { EMIT_1F_PSIZE, INTERP_POS  , 6, 6, 0x00000020 },
-   [TGSI_SEMANTIC_GENERIC ] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 }
+   [TGSI_SEMANTIC_TEXCOORD] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 },
 };
 
 static boolean
 vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
 {
-   struct pipe_screen *pscreen = &r->nv30->screen->base.base;
+   struct nv30_screen *screen = r->nv30->screen;
    struct nv30_fragprog *fp = r->nv30->fragprog.program;
    struct vertex_info *vinfo = &r->vertex_info;
    enum pipe_format format;
    uint emit = EMIT_OMIT;
    uint result = *idx;
 
-   if (sem == TGSI_SEMANTIC_GENERIC && result >= 8) {
-      for (result = 0; result < 8; result++) {
-         if (fp->texcoord[result] == *idx) {
+   if (sem == TGSI_SEMANTIC_GENERIC) {
+      uint num_texcoords = (screen->eng3d->oclass < NV40_3D_CLASS) ? 8 : 10;
+      for (result = 0; result < num_texcoords; result++) {
+         if (fp->texcoord[result] == *idx + 8) {
+            sem = TGSI_SEMANTIC_TEXCOORD;
             emit = vroute[sem].emit;
             break;
          }
@@ -248,11 +250,11 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
    draw_emit_vertex_attr(vinfo, emit, vroute[sem].interp, attrib);
    format = draw_translate_vinfo_format(emit);
 
-   r->vtxfmt[attrib] = nv30_vtxfmt(pscreen, format)->hw;
+   r->vtxfmt[attrib] = nv30_vtxfmt(&screen->base.base, format)->hw;
    r->vtxptr[attrib] = vinfo->size;
    vinfo->size += draw_translate_vinfo_size(emit);
 
-   if (nv30_screen(pscreen)->eng3d->oclass < NV40_3D_CLASS) {
+   if (screen->eng3d->oclass < NV40_3D_CLASS) {
       r->vtxprog[attrib][0] = 0x001f38d8;
       r->vtxprog[attrib][1] = 0x0080001b | (attrib << 9);
       r->vtxprog[attrib][2] = 0x0836106c;
@@ -264,7 +266,12 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
       r->vtxprog[attrib][3] = 0x6041ff80 | (result + vroute[sem].vp40) << 2;
    }
 
-   *idx = vroute[sem].ow40 << result;
+   if (result < 8)
+      *idx = vroute[sem].ow40 << result;
+   else {
+      assert(sem == TGSI_SEMANTIC_TEXCOORD);
+      *idx = 0x00001000 << (result - 8);
+   }
    return TRUE;
 }
 
@@ -318,7 +325,7 @@ nv30_render_validate(struct nv30_context *nv30)
 
    while (pntc && attrib < 16) {
       uint index = ffs(pntc) - 1; pntc &= ~(1 << index);
-      if (vroute_add(r, attrib, TGSI_SEMANTIC_GENERIC, &index)) {
+      if (vroute_add(r, attrib, TGSI_SEMANTIC_TEXCOORD, &index)) {
          vp_attribs |= (1 << attrib++);
          vp_results |= index;
       }

commit 93650a80e9d9cee000c88a6e96be83c1e5788fc6
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Mon May 25 21:14:13 2015 -0400

    nv30/draw: allocate vertex buffers in gart
    
    These are only used once per draw, so it makes sense to keep them in
    GART. Also take this opportunity to modernize the buffer mapping API
    usage.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit c3d36a2e1a87a4aded662db7a5d320ee7ac3a8b5)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 4fcc434..f6a66dd 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -71,12 +71,12 @@ nv30_render_allocate_vertices(struct vbuf_render *render,
    struct nv30_render *r = nv30_render(render);
    struct nv30_context *nv30 = r->nv30;
 
-   r->length = vertex_size * nr_vertices;
+   r->length = (uint32_t)vertex_size * (uint32_t)nr_vertices;
 
    if (r->offset + r->length >= render->max_vertex_buffer_bytes) {
       pipe_resource_reference(&r->buffer, NULL);
       r->buffer = pipe_buffer_create(&nv30->screen->base.base,
-                                     PIPE_BIND_VERTEX_BUFFER, 0,
+                                     PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_STREAM,
                                      render->max_vertex_buffer_bytes);
       if (!r->buffer)
          return FALSE;
@@ -91,10 +91,14 @@ static void *
 nv30_render_map_vertices(struct vbuf_render *render)
 {
    struct nv30_render *r = nv30_render(render);
-   char *map = pipe_buffer_map(&r->nv30->base.pipe, r->buffer,
-                               PIPE_TRANSFER_WRITE |
-                               PIPE_TRANSFER_UNSYNCHRONIZED, &r->transfer);
-   return map + r->offset;
+   char *map = pipe_buffer_map_range(
+         &r->nv30->base.pipe, r->buffer,
+         r->offset, r->length,
+         PIPE_TRANSFER_WRITE |
+         PIPE_TRANSFER_DISCARD_RANGE,
+         &r->transfer);
+   assert(map);
+   return map;
 }
 
 static void

commit 23c0c94ac36945c08ec21db8fa2b4e36d137320f
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Mon May 25 21:12:46 2015 -0400

    nv30/draw: only use the DMA1 object (GART) if the bo is not in VRAM
    
    Instead of always having it in the data, let the bo placement decide it.
    This fixes glxgears with swtnl forced on.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit fdad7dfbdae07b9273fc8f57e63258dbe542c9b5)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index de8cde2..4fcc434 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -127,7 +127,7 @@ nv30_render_draw_elements(struct vbuf_render *render,
    for (i = 0; i < r->vertex_info.num_attribs; i++) {
       PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
                        nv04_resource(r->buffer), r->offset + r->vtxptr[i],
-                       NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
+                       NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
    }
 
    if (!nv30_state_validate(nv30, FALSE))
@@ -172,7 +172,7 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
    for (i = 0; i < r->vertex_info.num_attribs; i++) {
       PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
                        nv04_resource(r->buffer), r->offset + r->vtxptr[i],
-                       NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
+                       NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
    }
 
    if (!nv30_state_validate(nv30, FALSE))
@@ -245,7 +245,7 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
    format = draw_translate_vinfo_format(emit);
 
    r->vtxfmt[attrib] = nv30_vtxfmt(pscreen, format)->hw;
-   r->vtxptr[attrib] = vinfo->size | NV30_3D_VTXBUF_DMA1;
+   r->vtxptr[attrib] = vinfo->size;
    vinfo->size += draw_translate_vinfo_size(emit);
 
    if (nv30_screen(pscreen)->eng3d->oclass < NV40_3D_CLASS) {

commit efaf906415f1cc9cf123cd89dd346c35d327d26b
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Mon May 25 20:15:09 2015 -0400

    nv30/draw: fix indexed draws with swtnl path and a resource index buffer
    
    The map = assignment was missing.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 3600439897c79d37c3c654546867ddfa0c420743)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 783ffe8..de8cde2 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -419,9 +419,9 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    if (info->indexed) {
       const void *map = nv30->idxbuf.user_buffer;
       if (!map)
-         pipe_buffer_map(pipe, nv30->idxbuf.buffer,
-                                  PIPE_TRANSFER_UNSYNCHRONIZED |
-                                  PIPE_TRANSFER_READ, &transferi);
+         map = pipe_buffer_map(pipe, nv30->idxbuf.buffer,
+                               PIPE_TRANSFER_UNSYNCHRONIZED |
+                               PIPE_TRANSFER_READ, &transferi);
       draw_set_indexes(draw,
                        (ubyte *) map + nv30->idxbuf.offset,
                        nv30->idxbuf.index_size, ~0);

commit adee8f1ca5ba636b6ab996b2a05b9516a74e04a5
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sun May 17 17:56:44 2015 -0400

    glsl: avoid leaking linked gl_shader when there's a late linker error
    
    This makes piglit mixing-clip-distance-and-clip-vertex-disallowed have 0
    definitely lost blocks with valgrind. (Same non-0 number of possibly
    lost blocks though.)
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 5646f0f18a620292524eebcd77353ff3d3687eb2)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 01526de..ef815ae 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2570,8 +2570,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
             link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage],
                                     num_shaders[stage]);
 
-         if (!prog->LinkStatus)
+         if (!prog->LinkStatus) {
+            if (sh)
+               ctx->Driver.DeleteShader(ctx, sh);
             goto done;
+         }
 
          switch (stage) {
          case MESA_SHADER_VERTEX:
@@ -2584,8 +2587,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
             validate_fragment_shader_executable(prog, sh);
             break;
          }
-         if (!prog->LinkStatus)
+         if (!prog->LinkStatus) {
+            if (sh)
+               ctx->Driver.DeleteShader(ctx, sh);
             goto done;
+         }
 
          _mesa_reference_shader(ctx, &prog->_LinkedShaders[stage], sh);
       }

commit 56d13627ebb07cac52401714f11a92be6b2d34e6
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sun May 17 17:32:24 2015 -0400

    st/mesa: don't leak glsl_to_tgsi object on link failure
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit bb973723a5e1f27817b6be2c2fa4fb3ea28e733c)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 3a8639fa..5306d6d 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5339,6 +5339,7 @@ get_mesa_program(struct gl_context *ctx,
     */
    _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
    if (!shader_program->LinkStatus) {
+      free_glsl_to_tgsi_visitor(v);
       return NULL;
    }
 

commit a10c9c6725259c55281a17efc98566c659ba9146
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Mon May 25 14:06:01 2015 -0400

    nv30/draw: draw expects constbuf size in bytes, not vec4 units
    
    This fixes glxgears with NV30_SWTNL=1 forced on. Probably fixes a bunch
    of other situations where we fall back to the swtnl path.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 147816375d22a653176ab28ed650fa811ceea83f)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 145a78e..783ffe8 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -399,7 +399,7 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
       if (nv30->vertprog.constbuf) {
          void *map = nv04_resource(nv30->vertprog.constbuf)->data;
          draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
-                                         map, nv30->vertprog.constbuf_nr);
+                                         map, nv30->vertprog.constbuf_nr * 16);
       } else {
          draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
       }

commit 2d610edf5c998de8297ce1d0f3034efbbcf76ee5
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sun May 24 11:56:21 2015 -0400

    nv30/draw: avoid leaving stale pointers in draw state
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 89585edf3c01c94b62d163adf0209568efa68568)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 13aad7a..145a78e 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -400,16 +400,16 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
          void *map = nv04_resource(nv30->vertprog.constbuf)->data;
          draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
                                          map, nv30->vertprog.constbuf_nr);
+      } else {
+         draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
       }
    }
 
    for (i = 0; i < nv30->num_vtxbufs; i++) {
       const void *map = nv30->vtxbuf[i].user_buffer;
       if (!map) {
-         if (!nv30->vtxbuf[i].buffer) {
-            continue;
-         }
-         map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
+         if (nv30->vtxbuf[i].buffer)
+            map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
                                   PIPE_TRANSFER_UNSYNCHRONIZED |
                                   PIPE_TRANSFER_READ, &transfer[i]);
       }

commit 0f7c9815a0897ce7da1b87a4695d2c9f867da527
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat May 23 20:58:53 2015 -0400

    nv30: fix clip plane uploads and enable changes
    
    nv30_validate_clip depends on the rasterizer state. Also we should
    upload all the new clip planes on change since next time the plane data
    won't have changed, but the enables might.
    
    This fixes fixed-clip-enables and vs-clip-vertex-enables shader tests.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 7518fc3c66e9b5703b987bccca7970a344deadfa)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
index 0f9d19d..704c24b 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
@@ -272,15 +272,13 @@ nv30_validate_clip(struct nv30_context *nv30)
    uint32_t clpd_enable = 0;
 
    for (i = 0; i < 6; i++) {
-      if (nv30->rast->pipe.clip_plane_enable & (1 << i)) {
-         if (nv30->dirty & NV30_NEW_CLIP) {
-            BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
-            PUSH_DATA (push, i);
-            PUSH_DATAp(push, nv30->clip.ucp[i], 4);
-         }
-
-         clpd_enable |= 1 << (1 + 4*i);
+      if (nv30->dirty & NV30_NEW_CLIP) {
+         BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
+         PUSH_DATA (push, i);
+         PUSH_DATAp(push, nv30->clip.ucp[i], 4);
       }
+      if (nv30->rast->pipe.clip_plane_enable & (1 << i))
+         clpd_enable |= 2 << (4*i);
    }
 
    BEGIN_NV04(push, NV30_3D(VP_CLIP_PLANES_ENABLE), 1);
@@ -389,7 +387,7 @@ static struct state_validate hwtnl_validate_list[] = {
     { nv30_validate_stipple,       NV30_NEW_STIPPLE },
     { nv30_validate_scissor,       NV30_NEW_SCISSOR | NV30_NEW_RASTERIZER },
     { nv30_validate_viewport,      NV30_NEW_VIEWPORT },
-    { nv30_validate_clip,          NV30_NEW_CLIP },
+    { nv30_validate_clip,          NV30_NEW_CLIP | NV30_NEW_RASTERIZER },
     { nv30_fragprog_validate,      NV30_NEW_FRAGPROG | NV30_NEW_FRAGCONST },
     { nv30_vertprog_validate,      NV30_NEW_VERTPROG | NV30_NEW_VERTCONST |
                                    NV30_NEW_FRAGPROG | NV30_NEW_RASTERIZER },

commit ece96b4954d4b44cea19926c46f9f91fad4ca35e
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sun May 24 02:23:16 2015 -0400

    nv30: avoid leaking render state and draw shaders
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 9870ed05dd333a20662479b9b1e3a8db542924c4)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_draw.c b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
index 3575c3d..13aad7a 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_draw.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_draw.c
@@ -103,6 +103,7 @@ nv30_render_unmap_vertices(struct vbuf_render *render,
 {
    struct nv30_render *r = nv30_render(render);
    pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
+   r->transfer = NULL;
 }
 
 static void
@@ -444,6 +445,12 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
 static void
 nv30_render_destroy(struct vbuf_render *render)
 {
+   struct nv30_render *r = nv30_render(render);
+
+   if (r->transfer)
+      pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
+   pipe_resource_reference(&r->buffer, NULL);
+   nouveau_heap_free(&r->vertprog);
    FREE(render);
 }
 
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
index ee669b1..7f22786 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
@@ -23,6 +23,7 @@
  *
  */
 
+#include "draw/draw_context.h"
 #include "tgsi/tgsi_parse.h"
 
 #include "nv_object.xml.h"
@@ -147,6 +148,9 @@ nv30_fp_state_delete(struct pipe_context *pipe, void *hwcso)
 
    pipe_resource_reference(&fp->buffer, NULL);
 
+   if (fp->draw)
+      draw_delete_fragment_shader(nv30_context(pipe)->draw, fp->draw);
+
    FREE((void *)fp->pipe.tokens);
    FREE(fp->insn);
    FREE(fp->consts);
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vertprog.c b/src/gallium/drivers/nouveau/nv30/nv30_vertprog.c
index 3c1b7e7..4d4145d 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_vertprog.c
@@ -23,6 +23,7 @@
  *
  */
 
+#include "draw/draw_context.h"
 #include "util/u_dynarray.h"
 #include "tgsi/tgsi_parse.h"
 
@@ -237,6 +238,10 @@ nv30_vp_state_delete(struct pipe_context *pipe, void *hwcso)
 
    if (vp->translated)
       nv30_vertprog_destroy(vp);
+
+   if (vp->draw)
+      draw_delete_vertex_shader(nv30_context(pipe)->draw, vp->draw);
+
    FREE((void *)vp->pipe.tokens);
    FREE(vp);
 }

commit e692b6428cdeac5a16c5a5d7c3326e7550116970
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sun May 24 01:31:11 2015 -0400

    nv30: don't leak fragprog consts
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit 605ce36d7f4a90c4062d6940bea82ab483bbe3b2)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
index a05bfe1..ee669b1 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_fragprog.c
@@ -149,6 +149,7 @@ nv30_fp_state_delete(struct pipe_context *pipe, void *hwcso)
 
    FREE((void *)fp->pipe.tokens);
    FREE(fp->insn);
+   FREE(fp->consts);
    FREE(fp);
 }
 

commit 7d76e8905321f884a9bf58d818e4c6852c3c0832
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat May 23 01:57:41 2015 -0400

    nv50/ir: avoid messing up arg1 of PFETCH
    
    There can be scenarios where the "indirect" arg of a PFETCH becomes
    known, and so the code will attempt to propagate it. Use this
    opportunity to just fold it into the first argument, and prevent the
    load propagation pass from touching PFETCH further.
    
    This fixes gs-input-array-vec4-index-rd.shader_test and
    vs-output-array-vec4-index-wr-before-gs.shader_test on nvc0 at least.
    
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
    Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
    (cherry picked from commit fa7f9f123b70f313d3c073b52c9c16b4b8df28f8)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 19c53d1..85ebd1c 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -207,6 +207,9 @@ LoadPropagation::visit(BasicBlock *bb)
       if (i->op == OP_CALL) // calls have args as sources, they must be in regs
          continue;
 
+      if (i->op == OP_PFETCH) // pfetch expects arg1 to be a reg
+         continue;
+
       if (i->srcExists(1))
          checkSwapSrc01(i);
 
@@ -545,6 +548,11 @@ ConstantFolding::expr(Instruction *i,
    case OP_POPCNT:
       res.data.u32 = util_bitcount(a->data.u32 & b->data.u32);
       break;
+   case OP_PFETCH:
+      // The two arguments to pfetch are logically added together. Normally
+      // the second argument will not be constant, but that can happen.


Reply to: