OSDN Git Service

android-x86/external-mesa.git
8 years agonv50/ir: support different unordered_set implementations android-x86-4.4-r3
Chih-Wei Huang [Fri, 19 Jun 2015 16:05:48 +0000 (00:05 +0800)]
nv50/ir: support different unordered_set implementations

If build with C++11 standard, use std::unordered_set.

Otherwise if build on old Android version with stlport,
use std::tr1::unordered_set with a wrapper class.

Otherwise use std::tr1::unordered_set.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: build with libcxx on android lollipop
Chih-Wei Huang [Wed, 20 May 2015 03:25:39 +0000 (11:25 +0800)]
android: build with libcxx on android lollipop

The libcxx introduced in android lollipop can be used to
replace stlport.

Fallback to use stlport when build with earlier android
releases.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: generate files by $(call es-gen)
Chih-Wei Huang [Mon, 11 May 2015 13:24:56 +0000 (21:24 +0800)]
android: generate files by $(call es-gen)

Use the pre-defined macro es-gen to generate new added files
instead of writing new rules manually. The handmade rules
that may generate the files before the directory is created
result in such an error:

/bin/bash: out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c: No such file or directory
make: *** [out/target/product/x86/gen/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/main/format_pack.c] Error 1

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: do not use copied headers
Chih-Wei Huang [Mon, 27 Apr 2015 16:50:38 +0000 (00:50 +0800)]
android: do not use copied headers

LOCAL_COPY_HEADERS is deprecated and removed in libdrm.

Use LOCAL_SHARED_LIBRARIES to get the exported include paths
of libdrm_*.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: fix the building rules for Android 5.0
Chih-Wei Huang [Fri, 3 Apr 2015 07:22:56 +0000 (15:22 +0800)]
android: fix the building rules for Android 5.0

Android 5.0 allows modules to generate source into $OUT/gen, which will
then be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as necessary.
Modules will need to change calls to local-intermediates-dir into
local-generated-sources-dir.

The patch changes local-intermediates-dir into local-generated-sources-dir.
If the Android version is less than 5.0, fallback to local-intermediates-dir.

The patch also fixes the 64-bit building issue of Android 5.0.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: fix building issues of host binaries
Chih-Wei Huang [Fri, 3 Apr 2015 07:11:12 +0000 (15:11 +0800)]
android: fix building issues of host binaries

Define _GNU_SOURCE to enable features (__USE_XOPEN2K and __USE_UNIX98)
required to build the host binaries.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: a workaround for GL_INVALID_OPERATION (0x502) error
Chih-Wei Huang [Fri, 23 Jan 2015 19:53:48 +0000 (03:53 +0800)]
android: a workaround for GL_INVALID_OPERATION (0x502) error

Inspired by the nice work of Paulo Sergio (pstglia):

"Bypass a check for external target enabled only for images
created with EGL_EXT_image_dma_buf_import - this makes
Android graphical components receive a GL_INVALID_OPERATION (0x502)."

8 years agoandroid: don't define the math functions
Chih-Wei Huang [Fri, 23 Jan 2015 12:02:17 +0000 (20:02 +0800)]
android: don't define the math functions

They are all defined in Android bionic.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoi915: add support for GL_OES_EGL_image_external
Chih-Wei Huang [Thu, 22 Jan 2015 16:43:56 +0000 (00:43 +0800)]
i915: add support for GL_OES_EGL_image_external

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoutil: android: optimize the rules to generate format_srgb.c
Chih-Wei Huang [Wed, 21 Jan 2015 17:21:00 +0000 (01:21 +0800)]
util: android: optimize the rules to generate format_srgb.c

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: simplify the subdirs including rules
Chih-Wei Huang [Wed, 21 Jan 2015 17:17:42 +0000 (01:17 +0800)]
android: simplify the subdirs including rules

Use the macro defined in the Android build system.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agou_math.h: don't define lrint family functions on Android
Chih-Wei Huang [Wed, 21 Jan 2015 16:20:51 +0000 (00:20 +0800)]
u_math.h: don't define lrint family functions on Android

Android bionic has defined these functions.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoglsl: Use INFINITY instead of std::numeric_limits<float>::infinity().
Matt Turner [Tue, 13 Jan 2015 06:35:53 +0000 (22:35 -0800)]
glsl: Use INFINITY instead of std::numeric_limits<float>::infinity().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agoandroid: enlarge cache_resources
Chih-Wei Huang [Thu, 5 Jun 2014 02:51:43 +0000 (10:51 +0800)]
android: enlarge cache_resources

8 years agoi915: Support Android RGBX8888 format for EGL generated images
Sean V Kelley [Mon, 10 Sep 2012 18:52:35 +0000 (11:52 -0700)]
i915: Support Android RGBX8888 format for EGL generated images

Enabled MESA_FORMAT_R8G8B8X8_UNORM (formerly MESA_FORMAT_RGBX8888_REV)
for RGBX with i915.  Android software requires RGBX8888 format to be
supported for software rendering.

Previously had done so for i965 but have requests for i915 support.

Change-Id: I87c3a8e3f206d75d58b63182ed94851749740762
Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
8 years agoi915: enable GL_APPLE_texture_2D_limited_npot
Chia-I Wu [Wed, 7 Sep 2011 07:18:17 +0000 (15:18 +0800)]
i915: enable GL_APPLE_texture_2D_limited_npot

Enable GL_ARB_texture_non_power_of_two for GLESv1 to advertise
GL_APPLE_texture_2D_limited_npo.  The former is actually a superset of
the latter, but we really want to enable NPOT support in some way.

8 years agoandroid: advertise GL_ARB_texture_non_power_of_two
Chia-I Wu [Wed, 16 Mar 2011 09:26:22 +0000 (17:26 +0800)]
android: advertise GL_ARB_texture_non_power_of_two

It maps to DisplayHardware::NPOT_EXTENSION in SurfaceFlinger.  Does not
seem to matter when EGL_ANDROID_image_native_buffer is available.

8 years agoi915: Fix texcoord vs. varying collision in fragment programs
Ville Syrjälä [Wed, 2 Jul 2014 14:28:23 +0000 (17:28 +0300)]
i915: Fix texcoord vs. varying collision in fragment programs

i915 fragment programs utilize the texture coordinate registers
for both texture coordinates and varyings. Unfortunately the
code doesn't check if the same index might be in use for both.
It just naively uses the index to pick a texture unit, which
could lead to collisions.

Add an extra mapping step to allocate non conflicting texture
units for both uses.

The issue can be reproduced with a pair of simple shaders like
these:
 attribute vec4 in_mod;
 varying vec4 mod;
 void main() {
   mod = in_mod;
   gl_TexCoord[0] = gl_MultiTexCoord0;
   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
 }

 varying vec4 mod;
 uniform sampler2D tex;
 void main() {
   gl_FragColor = texture2D(tex, vec2(gl_TexCoord[0])) * mod;
 }

This was tested on a PNV.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Fix culling with user fbos on gen2
Ville Syrjälä [Wed, 26 Nov 2014 09:08:13 +0000 (11:08 +0200)]
i915: Fix culling with user fbos on gen2

Flip the cull bits when rendering to a user fbo on gen2. This
was already done on gen3 (since before git history starts)
but was missing from the gen2 code.

Fixes rendering of the driver+kart model in supertuxkart kart
selection screen.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Drop broken front_buffer_reading/drawing optimization
Ville Syrjälä [Mon, 24 Nov 2014 12:28:33 +0000 (14:28 +0200)]
i915: Drop broken front_buffer_reading/drawing optimization

Bring the following commit over to i915:
 commit ec542d74578bbef6b55125dd6aba1dc7f5079e65
 Author: Eric Anholt <eric@anholt.net>
 Date:   Mon Mar 3 10:43:10 2014 -0800

    i965: Drop broken front_buffer_reading/drawing optimization.

Not sure if it might fix anything, but since the i965 and i915 used to
share a bunch of that code, it would seem reasonable the same problems
could be present in the i915 code still, and the i965 approach is well
tested by now so bringing it over seems fairly safe.

No piglit regressions on 855.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Remember to call intel_prepare_render() before blitting
Ville Syrjälä [Mon, 24 Nov 2014 12:51:15 +0000 (14:51 +0200)]
i915: Remember to call intel_prepare_render() before blitting

Bring over the following fix from i965:
 commit fb3d62fe3d4fc40ba4ad9804d8b6f451316c9ae2
 Author: Kenneth Graunke <kenneth@whitecape.org>
 Date:   Tue Aug 6 14:36:09 2013 -0700

    i965: Remember to call intel_prepare_render() before blitting.

Fixes a crash in the following piglit tests:
 bin/fbo-sys-blit -auto
 bin/fbo-sys-sub-blit -auto

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Adjust line size limits
Ville Syrjälä [Tue, 1 Jul 2014 07:33:33 +0000 (10:33 +0300)]
i915: Adjust line size limits

The hardware can draw lines 0.5 to 7.5 pixels wide. Adjust the limits
to 1.0-7.0. The old limits seems to be from the era when i915 and i965
were sharing this code.

Not really sure if 1.0-7.0 is correct. Maybe it could be 0.5.7.5 as
those are the hw limits, or maybe some combination of the two?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Enable intel_render path for points
Ville Syrjälä [Mon, 30 Jun 2014 23:57:50 +0000 (02:57 +0300)]
i915: Enable intel_render path for points

The sub-pixel adjustment for points was killed off in
 commit 60d762aa625095a8c1f9597d8530bb5a6fa61b4c
 Author: Xiang, Haihao <haihao.xiang@intel.com>
 Date:   Wed Jan 2 11:38:51 2008 +0800

    i915: Needn't adjust pixel centers. fix #12944

so if we don't need it in intel_tris.c we don't need it in
intel_render.c either, which means we can allow
intel_render.c to render points.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Use COPY_DWORDS for points
Ville Syrjälä [Mon, 30 Jun 2014 23:55:39 +0000 (02:55 +0300)]
i915: Use COPY_DWORDS for points

The sub-pixel adjustment for points was killed off in
 commit 60d762aa625095a8c1f9597d8530bb5a6fa61b4c
 Author: Xiang, Haihao <haihao.xiang@intel.com>
 Date:   Wed Jan 2 11:38:51 2008 +0800

    i915: Needn't adjust pixel centers. fix #12944

so we can just as well use COPY_DWORDS().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Use c99 initializers for primitive arrays
Ville Syrjälä [Mon, 30 Jun 2014 23:54:45 +0000 (02:54 +0300)]
i915: Use c99 initializers for primitive arrays

Using c99 initializers for the primitive arrays makes things more
readable.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Make hw_prim[] const
Ville Syrjälä [Mon, 30 Jun 2014 23:38:41 +0000 (02:38 +0300)]
i915: Make hw_prim[] const

The table used to map the GL primitive to the hw primitive never
changes so make it const.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Use _tnl_RenderClippedPolygon and _tnl_RenderClippedLine
Ville Syrjälä [Tue, 1 Jul 2014 08:24:09 +0000 (11:24 +0300)]
i915: Use _tnl_RenderClippedPolygon and _tnl_RenderClippedLine

_tnl_RenderClippedPolygon and _tnl_RenderClippedLine already do most of
what we want so use them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Fix t_vb_rendertmp.h's provoking vertex handywork
Ville Syrjälä [Sat, 28 Jun 2014 18:58:47 +0000 (21:58 +0300)]
i915: Fix t_vb_rendertmp.h's provoking vertex handywork

t_vb_rendertmp.h reorder the vertices passed to the driver based on
the provoking vertex convention. The last vertex passed is always the
provoking vertex. For us however that's a bit bad since the hardware
itself handles the provoking vertex. Reorder the vertices back to the
original order in the driver to make sure the correct provoking vertex
is used.

This seemed easier than trying to adjust t_vd_rendertmp.h to not
reorder (mainly because swrast would still need the reordering),
or having to mess about with the hardware state depending on the
path we take to render the primitives.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Handle provoking vertex in intelFastRenderClippedPoly()
Ville Syrjälä [Mon, 30 Jun 2014 15:45:40 +0000 (18:45 +0300)]
i915: Handle provoking vertex in intelFastRenderClippedPoly()

intelFastRenderClippedPoly() renders the polygon using triangles. For
polygons the provoking vertex is always the first one, and currently
this function assumes that the provoking vertex for triangles is the
last one. In case the user changed the provoking vertex convention,
the hardware may be configured to treat the first vertex of triangles
as the provoking vertex. So check the convention and emit the triangles
in the appropriate order to avoid having to change the hardware
provoking vertex convention for rendering polygons.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agoi915: Fix collision between I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0)
Ville Syrjälä [Sat, 28 Jun 2014 18:54:42 +0000 (21:54 +0300)]
i915: Fix collision between I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0)

I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0) are trying to occupy
the same bit. Move the texture bits upwards a bit to make room for
I830_UPLOAD_RASTER_RULES.

Now the driver will actually upload the raster rules which is rather
important to get the provoking vertex right. Fixes the appearance
of glxgears teeth on gen2.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Make the render_tab[]s const
Ville Syrjälä [Mon, 30 Jun 2014 23:36:54 +0000 (02:36 +0300)]
t_dd_dmatmp: Make the render_tab[]s const

These tables hold function pointers and they never change so
make them const.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Fix render_quad_strip_elts
Ville Syrjälä [Mon, 30 Jun 2014 19:15:01 +0000 (22:15 +0300)]
t_dd_dmatmp: Fix render_quad_strip_elts

Split the tri vs. tristrip paths in render_quad_strip_elts apart
and add the appropriate smooth vs. flat shading and provoking
vertex checks. Add the same checks to validate_render to make
sure we don't end up there under the wrong circumstances.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Call render_tri_fan_elts from render_poly_elts
Ville Syrjälä [Mon, 30 Jun 2014 18:17:41 +0000 (21:17 +0300)]
t_dd_dmatmp: Call render_tri_fan_elts from render_poly_elts

Calling render_tri_fan_verts() from render_poly_elts() doesn't seem sane.
I presume the intention was to call render_tri_fan_elts() instead.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Check provoking vertex convention when rendering quads
Ville Syrjälä [Sat, 28 Jun 2014 20:22:21 +0000 (23:22 +0300)]
t_dd_dmatmp: Check provoking vertex convention when rendering quads

When drawing quads using triangles we need to be careful to make
the provoking vertices match when flat shading.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Disallow flat shading when rendering quad strips via tri strips
Ville Syrjälä [Mon, 30 Jun 2014 16:53:12 +0000 (19:53 +0300)]
t_dd_dmatmp: Disallow flat shading when rendering quad strips via tri strips

When rendering quad strips via tri strips we can't get the provoking
vertex right, so disallow flat shading.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Allow flat shaded polygons with tri fans
Ville Syrjälä [Mon, 30 Jun 2014 15:55:48 +0000 (18:55 +0300)]
t_dd_dmatmp: Allow flat shaded polygons with tri fans

We can allow rendering flat shaded polygons using tri fans if we check
the provoking vertex convention.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agot_dd_dmatmp: Kill the paths rendering quads/quad strips via indexed vertices
Ville Syrjälä [Mon, 30 Jun 2014 19:01:02 +0000 (22:01 +0300)]
t_dd_dmatmp: Kill the paths rendering quads/quad strips via indexed vertices

No driver supports elts currently, and these make the validate_render
code a bit hard to follow. Just kill them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 years agodocs: Add sha256sums for the 10.5.9 release
Emil Velikov [Sat, 4 Jul 2015 11:48:39 +0000 (12:48 +0100)]
docs: Add sha256sums for the 10.5.9 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoAdd release notes for the 10.5.9 release
Emil Velikov [Sat, 4 Jul 2015 11:09:10 +0000 (12:09 +0100)]
Add release notes for the 10.5.9 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 10.5.9
Emil Velikov [Sat, 4 Jul 2015 11:04:06 +0000 (12:04 +0100)]
Update version to 10.5.9

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agowinsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.
Mario Kleiner [Sun, 28 Jun 2015 01:02:31 +0000 (03:02 +0200)]
winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.

Same problem and fix as for nouveau's ZaphodHeads trouble.

See patch ...

"nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads."

... for reference.

Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 28dda47ae4d974e3e032d60e8e0965c8c068c6d8)

8 years agoi965/skl: Use 1 register for uniform pull constant payload
Ben Widawsky [Tue, 23 Jun 2015 00:18:02 +0000 (17:18 -0700)]
i965/skl: Use 1 register for uniform pull constant payload

When under dispatch_width=16 the previous code would allocate 2 registers for
the payload when only one is needed. This manifested itself through bugs on SKL
which needs to mess with this instruction.

Ken thought this might impact shader-db, but apparently it doesn't

Backported to 10.5.8 from (upstream uses alloc.allocate()):
commit 6e62a52865787362ae1deb9dee80140d3a66c519
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Thu Feb 19 15:49:34 2015 -0800

    i965/skl: Use 1 register for uniform pull constant payload

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89118
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88999
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
8 years agonv50/ir: copy joinAt when splitting both before and after
Ilia Mirkin [Wed, 1 Jul 2015 06:11:39 +0000 (02:11 -0400)]
nv50/ir: copy joinAt when splitting both before and after

The current implementation only moves the joinAt when splitting after
the given instruction, not before it. So if you have a BB with

  foo
  instr
  bar
  joinat

and thus with joinAt set, we end up first splitting before instr, at
which point the instr's bb is updated to the new bb. Since that bb
doesn't have a joinAt set (despite containing one), when splitting after
the instr, there is nothing to copy over. Since the joinat will be in
the "split" bb irrespective of whether we're splitting before or after
the instruction, move it over in either case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91124
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5dcb28c3d26828ed1b0e2bd5a0589c5baab04b85)

8 years agoglsl: validate sampler array indexing for 'constant-index-expression'
Tapani Pälli [Tue, 19 May 2015 12:01:49 +0000 (15:01 +0300)]
glsl: validate sampler array indexing for 'constant-index-expression'

Desktop GLSL < 130 and GLSL ES < 300 allow sampler array indexing where
index can contain a loop induction variable. This extra check will warn
during linking if some of the indexes could not be turned in to constant
expressions.

v2: warning instead of error for backends that did not enable
    EmitNoIndirectSampler option (have dynamic indexing)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9350ea6979c48772e1fb55d4f1c7c5a3cfa987b0)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/glsl/linker.cpp

8 years agoi965: use EmitNoIndirectSampler for gen < 7
Tapani Pälli [Wed, 24 Jun 2015 10:22:43 +0000 (13:22 +0300)]
i965: use EmitNoIndirectSampler for gen < 7

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8852e26e93af1fc4b72bf9d57e847f53e1a1371b)
[Emil Velikov: move the hunk to brw_initialize_context_constants()]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/mesa/drivers/dri/i965/brw_shader.cpp

8 years agomesa/st: use EmitNoIndirectSampler if !ARB_gpu_shader5
Tapani Pälli [Mon, 29 Jun 2015 06:48:52 +0000 (09:48 +0300)]
mesa/st: use EmitNoIndirectSampler if !ARB_gpu_shader5

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f17c8c287f3581fccb52714fbd4b2ea09a58e3d3)

8 years agoi915: use EmitNoIndirectSampler
Tapani Pälli [Mon, 29 Jun 2015 06:53:45 +0000 (09:53 +0300)]
i915: use EmitNoIndirectSampler

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2dc2b12ed15abb84c7e2b3c2726dcc1b735abcda)

8 years agomesa/glsl: new compiler option EmitNoIndirectSampler
Tapani Pälli [Tue, 9 Jun 2015 10:33:39 +0000 (13:33 +0300)]
mesa/glsl: new compiler option EmitNoIndirectSampler

Patch provides new compiler option for backend to force unroll loops
that have non-constant expression indexing on sampler arrays.

This makes sure that we can never end up with a shader that uses loop
induction variable as sampler array index but does not unroll because
of having too much instructions. This would not work without dynamic
indexing support.

v2: change option name as EmitNoIndirectSampler

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e4512e1581cf90f56d13cfa6a809832ef3517283)

8 years agoglsl: Allow dynamic sampler array indexing with GLSL ES < 3.00
Tapani Pälli [Tue, 9 Jun 2015 10:28:44 +0000 (13:28 +0300)]
glsl: Allow dynamic sampler array indexing with GLSL ES < 3.00

Dynamic indexing of sampler arrays is prohibited by GLSL ES 3.00.
Earlier versions allow 'constant-index-expression' indexing, where
index can contain a loop induction variable.

Patch allows dynamic indexing for sampler arrays when GLSL ES < 3.00.
This change makes 'sampler-array-index.frag' parser test in Piglit
pass + fishgl.com works when running Chrome on OpenGL ES 2.0 backend

v2: small change and some more commit message (Tapani)
v3: refactor checks to make it more readable (Ian Romanick)
v4: change warning comment in GLSL ES case (Curro)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84225
(cherry picked from commit edb8383c98ee23385731d0fc23a6b6673528a8ec)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/glsl/ast_array_index.cpp

8 years agonv50/ir: fix emission of address reg in 3rd source
Ilia Mirkin [Tue, 30 Jun 2015 06:46:26 +0000 (02:46 -0400)]
nv50/ir: fix emission of address reg in 3rd source

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91056
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d5f1253b0c4637ad996fd0da45095165006d61d3)

8 years agonouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.
Mario Kleiner [Fri, 5 Jun 2015 13:36:52 +0000 (15:36 +0200)]
nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.

The dup'ed fd owned by the nouveau_screen for a device node
must also be used as key for the winsys hash table, instead
of using the original fd passed in for a screen, to make
multi-x-screen ZaphodHeads configurations work on nouveau.

The original fd's lifetime differs from that of the nouveau_screen stored
in the hash. The hash key is the fd, and in order to compare hash entries
we fstat them, so the fd must be around for as long as the screen is.

This is an extension of the fix in commit a59f2bb1 (nouveau: dup fd
before passing it to device).

Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit a98600b0ebdfc8481c168aae6c5670071e22fc29)

8 years agonv50/ir: propagate modifier to right arg when const-folding mad
Ilia Mirkin [Fri, 26 Jun 2015 19:01:22 +0000 (15:01 -0400)]
nv50/ir: propagate modifier to right arg when const-folding mad

An immediate has to be the second arg of an ADD operation. However we
were mistakenly propagating the modifier of the non-folded value to the
folded immediate argument.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91117
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ad62ec8316a926682958e7ab52639992867c3755)

8 years agowinsys/radeon: Unmap GPU VM address range when destroying BO
Michel Dänzer [Thu, 21 May 2015 01:49:05 +0000 (10:49 +0900)]
winsys/radeon: Unmap GPU VM address range when destroying BO

But only when doing so is safe according to the
RADEON_INFO_VA_UNMAP_WORKING kernel query.

This avoids kernel GPU VM address range conflicts when the BO has other
references than the GEM handle being closed, e.g. when the BO is shared.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90537
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90873

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 7796e8889a9a2cc1b454dc32d8da3d756404339a)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

8 years agoegl/x11: Remove duplicate call to dri2_x11_add_configs_for_visuals
Boyan Ding [Sat, 13 Jun 2015 07:33:20 +0000 (15:33 +0800)]
egl/x11: Remove duplicate call to dri2_x11_add_configs_for_visuals

The call to dri2_x11_add_configs_for_visuals (previously
dri2_add_configs_for_visuals) was moved downwards in commit f8c5b8a1,
but appeared again in its original position after its rename in
d019cd81. Remove it.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit 3fa9bb81ec8b21f472de32e08d0caf917239da08)

8 years agonv50,nvc0: make sure to pushbuf_refn before putting bo into pushbuf_data
Ilia Mirkin [Sun, 21 Jun 2015 23:03:35 +0000 (19:03 -0400)]
nv50,nvc0: make sure to pushbuf_refn before putting bo into pushbuf_data

Without first running the bo through pushbuf_refn, the nouveau drm
library will have uninitialized structures regarding this bo, and will
insert incorrect data.

This fixes supertuxkart 0.9 crash on start (where it ends up doing a lot
of indirect draws).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 78d58e642549fbf340fdb4fca06720d2891216a8)

8 years agonvc0: always put all tfb bufs into bufctx
Ilia Mirkin [Sun, 21 Jun 2015 19:00:16 +0000 (15:00 -0400)]
nvc0: always put all tfb bufs into bufctx

Since we clear the TFB bufctx binding point above, we need to put all of
the active tfb's back in, even if they haven't changed since last time.
Otherwise the tfb may get moved into sysmem and the underlying mapping
will generate write errors.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9fcbf515b431a92e0289f234ab77a796cf2a5612)

8 years agoglsl: binding point is a texture unit, which is a combined space
Ilia Mirkin [Tue, 23 Jun 2015 04:16:59 +0000 (00:16 -0400)]
glsl: binding point is a texture unit, which is a combined space

This fixes compilation failures in Dota 2 Reborn where a texture unit
binding point was used that was numerically higher than the max
per stage.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fccf012adc0d3aad877de095244324aa1d2d046a)

8 years agogbm: do not (over)link against libglapi.so
Emil Velikov [Fri, 19 Jun 2015 18:22:38 +0000 (19:22 +0100)]
gbm: do not (over)link against libglapi.so

The whole of GBM does not rely on even a single symbol from the GL
dispatch library, unsuprisingly. The only need for it comes from the
unresolved symbols in the DRI modules, which are now correctly handled
with Frank's commit.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit a0dc6b7824d3b9095919e29393a379ea7f9c1318)

8 years agogbm: dlopen libglapi so gbm_create_device works
Frank Henigman [Thu, 6 Nov 2014 21:29:26 +0000 (16:29 -0500)]
gbm: dlopen libglapi so gbm_create_device works

Dri driver libs are not linked to pull in libglapi so gbm_create_device()
fails when it tries to dlopen them (unless the application is linked
with something that does pull in libglapi, like libGL).
Until dri drivers can be fixed properly, dlopen libglapi before trying
to dlopen them.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Frank Henigman <fjhenigman@google.com>
[Emil Velikov: Drop misleading bugzilla link, mention that libname differs]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 828f13330c9384f2b55c8b0f962d93a74ecd0601)

8 years agoconfigure: error out when building libEGL without shared-glapi
Emil Velikov [Fri, 19 Jun 2015 16:46:41 +0000 (17:46 +0100)]
configure: error out when building libEGL without shared-glapi

The latter is a hard requirement and without it we'll error out later
on in the build.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 994be5143a097ae2cf504ba344362edfee388ac3)

8 years agoconfigure: error out when building backend-less libEGL
Emil Velikov [Fri, 19 Jun 2015 16:44:02 +0000 (17:44 +0100)]
configure: error out when building backend-less libEGL

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ddc886b5bfe5976fa2e5f49eeefa918736f1aa97)

8 years agoconfigure: warn about shared_glapi & xlib-glx only when both are set
Emil Velikov [Fri, 19 Jun 2015 16:19:46 +0000 (17:19 +0100)]
configure: warn about shared_glapi & xlib-glx only when both are set

Printing out the message when shared_glapi is disabled only leads to
confusion.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 6d744aaf4e427b6b0b3d8d35d756592a50abbb97)

8 years agoi965/gen9: Implement Push Constant Buffer workaround
Ben Widawsky [Thu, 4 Jun 2015 04:35:51 +0000 (21:35 -0700)]
i965/gen9: Implement Push Constant Buffer workaround

This implements a workaround (exact excerpt as a comment in the code). The docs
specify [clearly, after you struggle for a while] that the offset isn't relative
to state base. This actually makes sense. This fixes hangs on SKL.

Buffer #0 is meant to be used for normal uniforms.
Buffer #1 is typically used for gather constants when using RS.
Buffer #1-#3 could be used to push a bunch of UBO data which would just be
  somewhere in memory, and not relative to the dynamic state.

NOTE: I've moved away from the ternary operator for the new gen9 conditions.
Admittedly it's probably not great to do this, but I really want to fix this all
up in the subsequent patch and doing it here makes that diff a lot nicer. I want
to split out the gen8/9 code to make the function a bit more readable, but to
keep this easily cherry-pickable I am doing this fix first. If we decide not to
merge the cleanup patch then I can revisit this.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Valtteri Rantala <Valtteri.rantala@intel.com>
(cherry picked from commit 90754d2df05eafe1a3ee3cd9bb1611a19099fc49)

8 years agomesa: add GL_PROGRAM_PIPELINE support in KHR_debug calls
Ilia Mirkin [Thu, 18 Jun 2015 03:00:44 +0000 (23:00 -0400)]
mesa: add GL_PROGRAM_PIPELINE support in KHR_debug calls

This was apparently missed when ARB_sso support was added.
Add label support to pipeline objects just like all the other
debug-related objects.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 770f141866654dab969302f720228497f0fb35fd)

8 years agoglsl: add version checks to conditionals for builtin variable enablement
Ilia Mirkin [Wed, 17 Jun 2015 19:09:26 +0000 (15:09 -0400)]
glsl: add version checks to conditionals for builtin variable enablement

A number of builtin variables have checks based on the extension being
enabled, but were missing enablement via a higher GLSL version.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b6e238023c4f8af2328dc3bcab1d73a3e19f4fbb)

8 years agoi965: Export format comparison for blitting between miptrees
Chris Wilson [Fri, 5 Jun 2015 13:45:18 +0000 (14:45 +0100)]
i965: Export format comparison for blitting between miptrees

Since the introduction of

commit 536003c11e4cb1172c540932ce3cce06f03bf44e
Author: Boyan Ding <boyan.j.ding@gmail.com>
Date:   Wed Mar 25 19:36:54 2015 +0800

    i965: Add XRGB8888 format to intel_screen_make_configs

winsys buffers no longer have an alpha channel. This causes
_mesa_format_matches_format_and_type() to reject previously working BGRA
uploads from using the BLT fast path. Instead of using the generic
routine for matching formats exactly, export the slightly more relaxed
check from intel_miptree_blit() which importantly allows the blitter
routine to apply a small number of format conversions.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90839
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Alexander Monakov <amonakov@gmail.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 922c0c9fd526ce19b87bc74a3159dec7705c1de1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/mesa/drivers/dri/i965/intel_pixel_draw.c

8 years agoi915: Blit RGBX<->RGBA drawpixels
Chris Wilson [Fri, 5 Jun 2015 13:33:36 +0000 (14:33 +0100)]
i915: Blit RGBX<->RGBA drawpixels

The blitter already has code to accommodate filling in the alpha channel
for BGRX destination formats, so expand this to also allow filling the
alpha channgel in RGBX formats.

More importantly for the next patch is moving the test into its own
function for the purpose of exporting the check to the callers.

v2: Fix alpha expansion as spotted by Alexander with the fix suggested by
Kenneth

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Alexander Monakov <amonakov@gmail.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c2d0606827412b710dcaed80268fc665de8c9c5d)

8 years agoi965: Fix HW blitter pitch limits
Chris Wilson [Fri, 5 Jun 2015 12:49:08 +0000 (13:49 +0100)]
i965: Fix HW blitter pitch limits

The BLT pitch is specified in bytes for linear surfaces and in dwords
for tiled surfaces. In both cases the programmable limit is 32,767, so
adjust the check to compensate for the effect of tiling.

v2: Tweak whitespace for functions (Kenneth)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8da79b8378ae87474d8c47ad955e4833edf98359)

8 years agodocs: Add sha256sums for the 10.5.8 release
Emil Velikov [Sat, 20 Jun 2015 15:37:16 +0000 (16:37 +0100)]
docs: Add sha256sums for the 10.5.8 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoAdd release notes for the 10.5.8 release
Emil Velikov [Sat, 20 Jun 2015 14:14:45 +0000 (15:14 +0100)]
Add release notes for the 10.5.8 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 10.5.8
Emil Velikov [Sat, 20 Jun 2015 14:09:23 +0000 (15:09 +0100)]
Update version to 10.5.8

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoegl/x11: Set version of swrastLoader to 2
Boyan Ding [Tue, 16 Jun 2015 03:08:33 +0000 (11:08 +0800)]
egl/x11: Set version of swrastLoader to 2

which it actually implements instead of the newest version defined in
dri_interface.h

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 997fc807b2f71ef65b4601d6db33d0f912c18d3f)

8 years agonvc0/ir: can't have a join on a load with an indirect source
Ilia Mirkin [Thu, 18 Jun 2015 02:18:09 +0000 (22:18 -0400)]
nvc0/ir: can't have a join on a load with an indirect source

Triggers an INVALID_OPCODE warning on GK208. Seems rare enough to not
warrant verification on other chips. Fixes the new piglits:

  ubo_array_indexing/fs-nonuniform-control-flow.shader_test
  ubo_array_indexing/vs-nonuniform-control-flow.shader_test

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 36e3eb6a957f8f20ed187ec88a067fc65cb81432)

8 years agonv50,nvc0: clamp uniform size to 64k
Ilia Mirkin [Mon, 15 Jun 2015 19:48:58 +0000 (15:48 -0400)]
nv50,nvc0: clamp uniform size to 64k

The state tracker will pass through requests from buggy applications
which will have the buffer size larger than the max allowed (64k). Clamp
the size to 64k so that we don't get errors when uploading the constbuf
data.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8b24388647f626a5cad10fd48e61335ed26a8560)

8 years agonvc0/ir: fix collection of first uses for texture barrier insertion
Ilia Mirkin [Fri, 12 Jun 2015 14:09:05 +0000 (16:09 +0200)]
nvc0/ir: fix collection of first uses for texture barrier insertion

One of the places we have to insert texbars is in situations where the
result of the tex gets overwritten by a different instruction (e.g. in a
conditional statement). However in some situations it can actually
appear as though the original tex itself is an overwriting instruction.
This can naturally never really happen, so just ignore the tex
instruction when it comes up.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90347
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a2af42c1d2dc91f4c31e25ff9fff15a89a9b6ead)

8 years agomesa: build xmlconfig to a separate static library
Erik Faye-Lund [Wed, 10 Jun 2015 22:35:04 +0000 (23:35 +0100)]
mesa: build xmlconfig to a separate static library

As we use the file from both the dri modules and loader, we end up with
multiple definition of the symbols provided in our gallium dri  modules.
Additionally we compile the file twice.

Resolve both issues, effectively enabling the build on toolchains which
don't support -Wl,--allow-multiple-definition.

v2: [Emil Velikov]
 - Fix the Scons/Android build.
 - Resolve libgbm build issues (bring back the missing -lm)

Cc: Julien Isorce <j.isorce@samsung.com>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 634f2002563b4fca68490c0a39518ea838f28fb1)

8 years agoi965/fs: Don't let the EOT send message interfere with the MRF hack
Jason Ekstrand [Sat, 6 Jun 2015 19:15:30 +0000 (12:15 -0700)]
i965/fs: Don't let the EOT send message interfere with the MRF hack

Previously, we just put the message for the EOT send as high in the file as
it would go.  This is because the register pre-filling hardware will stop
all over the early registers in the file in preparation for the next thread
while you're still sending the last message.  However, if something happens
to spill, then the MRF hack interferes with the EOT send message and, if
things aren't scheduled nicely, will stomp on it.

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90520
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 86e5afbfee5492235cab1a7be4ea49ac02be1644)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp

8 years agodraw: (trivial) fix NULL pointer dereference
Roland Scheidegger [Thu, 4 Jun 2015 12:35:59 +0000 (14:35 +0200)]
draw: (trivial) fix NULL pointer dereference

This probably got broken when the samplers were converted to be indexed
by shader type.
Seen when looking at bug 89819 though I'm not sure if that really was what
the bug was about...

Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6e5970ffee0129fb94d8b7f0ebd4fac3992e7dce)

8 years agoi965: Disable compaction for EOT send messages
Ben Widawsky [Mon, 8 Jun 2015 18:18:35 +0000 (11:18 -0700)]
i965: Disable compaction for EOT send messages

AFAICT, there is no real way to make sure a send message with EOT is properly
ignored from compact, nor can I see a way to actually encode EOT while
compacting. Before the single send optimization we'd always bail because we hit
the is_immediate && !is_compactable_immediate case. However, with single send,
is_immediate is not true, and so we end up trying to compact the un-compactible.

Without this, any compacting single send instruction will hang because the EOT
isn't there. I am not sure how I didn't hit this when I originally enabled the
optimization.  I didn't check if some surrounding code changed.

I know Neil and Matt were both looking into this. I did a quick search and
didn't see any patches out there to handle this. Please ignore if this has
already been sent by someone. (Direct me to it and I will review it).

Reported-by: Neil Roberts <neil@linux.intel.com>
Reported-by: Mark Janes <mark.a.janes@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b307921c3ff3b36607752f881a180272366a79cf)

8 years agoi965: Don't compact instructions with unmapped bits.
Francisco Jerez [Mon, 8 Jun 2015 18:18:34 +0000 (11:18 -0700)]
i965: Don't compact instructions with unmapped bits.

Some instruction bits don't have a mapping defined to any compacted
instruction field.  If they're ever set and we end up compacting the
instruction they will be forced to zero.  Avoid using compaction in such
cases.

v2: Align multiple lines of an expression to the same column.  Change
    conditional compaction of 3-source instructions to an
    assertion. (Matt)
v3: The 3-source instruction bit 105 is part of SourceIndex on CHV.
    Add assertion that reserved bit 7 is not set. (Matt)
    Document overlap with UIP and 64-bit immediate fields.
v4: Make some more unmapped bit checks assertions. (Matt)

Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 35a77a148f8b7ef03fe3b31d63719e0bfdf4b783)

8 years agoegl: fix setting context flags
Marek Olšák [Mon, 11 May 2015 22:44:20 +0000 (00:44 +0200)]
egl: fix setting context flags

Cc: 10.6 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit f9f894447e4e7442d5dfa489bb43f2823e2fc71d)

8 years agodocs: Add sha256sums for the 10.5.7 release
Emil Velikov [Sun, 7 Jun 2015 10:45:25 +0000 (11:45 +0100)]
docs: Add sha256sums for the 10.5.7 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoAdd release notes for the 10.5.7 release
Emil Velikov [Sun, 7 Jun 2015 10:13:19 +0000 (11:13 +0100)]
Add release notes for the 10.5.7 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoUpdate version to 10.5.7
Emil Velikov [Sun, 7 Jun 2015 10:11:38 +0000 (11:11 +0100)]
Update version to 10.5.7

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agonv30: avoid doing extra work on clear and hitting unexpected states
Ilia Mirkin [Thu, 5 Mar 2015 17:10:15 +0000 (12:10 -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)

8 years agost/dri: fix postprocessing crash when there's no depth buffer
Marek Olšák [Tue, 26 May 2015 17:32:36 +0000 (19:32 +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)

8 years agoi965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)
Ben Widawsky [Thu, 21 May 2015 02:20:14 +0000 (19:20 -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)

8 years agocherry-ignore: add clover build fix not applicable for 10.5
Emil Velikov [Wed, 3 Jun 2015 11:03:35 +0000 (12:03 +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>
8 years agonv30: falling back to draw path for edgeflag does no good
Ilia Mirkin [Mon, 25 May 2015 21:46:45 +0000 (17:46 -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)

8 years agonv30/draw: switch varying hookup logic to know about texcoords
Ilia Mirkin [Sun, 24 May 2015 02:11:38 +0000 (22:11 -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)

8 years agonv30/draw: allocate vertex buffers in gart
Ilia Mirkin [Tue, 26 May 2015 01:14:13 +0000 (21:14 -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)

8 years agonv30/draw: only use the DMA1 object (GART) if the bo is not in VRAM
Ilia Mirkin [Tue, 26 May 2015 01:12:46 +0000 (21:12 -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)

8 years agonv30/draw: fix indexed draws with swtnl path and a resource index buffer
Ilia Mirkin [Tue, 26 May 2015 00:15:09 +0000 (20:15 -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)

8 years agoglsl: avoid leaking linked gl_shader when there's a late linker error
Ilia Mirkin [Sun, 17 May 2015 21:56:44 +0000 (17:56 -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)

8 years agost/mesa: don't leak glsl_to_tgsi object on link failure
Ilia Mirkin [Sun, 17 May 2015 21:32:24 +0000 (17:32 -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)

8 years agonv30/draw: draw expects constbuf size in bytes, not vec4 units
Ilia Mirkin [Mon, 25 May 2015 18:06:01 +0000 (14:06 -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)

8 years agonv30/draw: avoid leaving stale pointers in draw state
Ilia Mirkin [Sun, 24 May 2015 15:56:21 +0000 (11:56 -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)

8 years agonv30: fix clip plane uploads and enable changes
Ilia Mirkin [Sun, 24 May 2015 00:58:53 +0000 (20:58 -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)

8 years agonv30: avoid leaking render state and draw shaders
Ilia Mirkin [Sun, 24 May 2015 06:23:16 +0000 (02:23 -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)

8 years agonv30: don't leak fragprog consts
Ilia Mirkin [Sun, 24 May 2015 05:31:11 +0000 (01:31 -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)