OSDN Git Service

android-x86/external-mesa.git
9 years agoi965/fs: Don't propagate cmod to inst with different type.
Matt Turner [Fri, 27 Feb 2015 18:22:21 +0000 (10:22 -0800)]
i965/fs: Don't propagate cmod to inst with different type.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1e128e9b69c6336762a2b6ee5d356c763b9ae3b0)

9 years agor300g: Check return value of snprintf().
Matt Turner [Wed, 4 Mar 2015 00:09:58 +0000 (16:09 -0800)]
r300g: Check return value of snprintf().

Would have at least prevented the crash the previous patch fixed.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit ade0b580e75bdea227eec5345f6681b678d0811b)

9 years agor300g: Use PATH_MAX instead of limiting ourselves to 100 chars.
Matt Turner [Wed, 4 Mar 2015 00:02:40 +0000 (16:02 -0800)]
r300g: Use PATH_MAX instead of limiting ourselves to 100 chars.

When built with Gentoo's package manager, the Mesa source directory
exists seven directories deep. The path to the .test file is too long
and is silently truncated, leading to a crash. Just use PATH_MAX.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540970
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit f5e2aa1324dd6a9666bb21834097d2fbc3cb99b6)

9 years agoegl: Take alpha bits into account when selecting GBM formats
Daniel Stone [Mon, 2 Mar 2015 13:52:59 +0000 (13:52 +0000)]
egl: Take alpha bits into account when selecting GBM formats

This fixes piglit when using PIGLIT_PLATFORM=gbm

Tom Stellard:
  - Fix ARGB2101010 format

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
(cherry picked from commit 65c8965d033cf9ade5e6f3c88bda6d247d46af9d)

9 years agogallium/auxiliary/indices: fix start param
Marc-Andre Lureau [Fri, 27 Feb 2015 18:40:19 +0000 (19:40 +0100)]
gallium/auxiliary/indices: fix start param

Since commit 28f3f8d, indices generator take a start parameter. However, some
index values have been left to start at 0.

This fixes the glean/fbo test with the virgl driver, and copytexsubimage
with freedreno.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 073a5d2e84ac9d95f0d037aeb04889822e76aa4e)

9 years agoi965/fs: Don't use backend_visitor::instructions after creating the CFG.
Matt Turner [Tue, 13 Jan 2015 23:35:57 +0000 (15:35 -0800)]
i965/fs: Don't use backend_visitor::instructions after creating the CFG.

This is a fix for a regression introduced in commit a9f8296d ("i965/fs:
Preserve the CFG in a few more places.").

The errata this code works around is described in a comment before the function:

   "[DevBW, DevCL] Errata: A destination register from a send can not be
    used as a destination register until after it has been sourced by an
    instruction with a different destination register.

The framebuffer write's sources must be in message registers, which SEND
instructions cannot have as a destination. There's no way for this
errata to affect anything at the end of the program. Just remove the
code.

Cc: 10.4, 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84613
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e214000f258ae564e64d839cccee9418526f226b)

9 years agomain/base_tex_format: Properly handle STENCIL_INDEX1/4/16
Jason Ekstrand [Fri, 27 Feb 2015 23:53:11 +0000 (18:53 -0500)]
main/base_tex_format: Properly handle STENCIL_INDEX1/4/16

This takes "fbo-stencil blit GL_STENCIL_INDEX1/4/16" from crash to pass on
BDW.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit c4925d7f3b66d63fbdd7b7607cd809db1e58bee9)

9 years agometa/TexSubImage: Stash everything other than PIXEL_TRANSFER/store in meta_begin
Jason Ekstrand [Fri, 27 Feb 2015 20:29:03 +0000 (12:29 -0800)]
meta/TexSubImage: Stash everything other than PIXEL_TRANSFER/store in meta_begin

Previously, there were bugs where if the app set a scissor it could affect
the area of the texture that was downloaded.  There was also potential that
the framebuffer SRGB state could affect downloads.  This ensures that those
will get saved/restored and can't affect the texture download.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89292
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit b1ab02d9c0cc11ba8ef4efaba9452d644b6a0811)

9 years agoi965: Consider scratch writes to have side effects.
Matt Turner [Sat, 28 Feb 2015 21:36:21 +0000 (13:36 -0800)]
i965: Consider scratch writes to have side effects.

We could do better by tracking scratch reads and writes.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88793
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
(cherry picked from commit da20bf068ef0f816968d9bc4dfea81facf0fd680)

9 years agomesa: Correct backwards NULL check.
Matt Turner [Sat, 28 Feb 2015 19:14:02 +0000 (11:14 -0800)]
mesa: Correct backwards NULL check.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 491d42135ad0e5670756216154f2ba9fc79d4ba7)

9 years agomesa: Free memory allocated for luminance in readpixels.
Matt Turner [Sat, 28 Feb 2015 19:08:17 +0000 (11:08 -0800)]
mesa: Free memory allocated for luminance in readpixels.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 87109acbed9c9b52f33d58ca06d9048d0ac7a215)

9 years agomesa: Indent break statements and add a missing one.
Matt Turner [Sat, 28 Feb 2015 19:00:51 +0000 (11:00 -0800)]
mesa: Indent break statements and add a missing one.

Always indenting break statements makes spotting missing ones easier.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 2b2fa1865248c6e3b7baec81c4f92774759b201f)

9 years agoi965/gs: Check newly-generated GS-out VUE map against correct stage
Chris Forbes [Sat, 28 Feb 2015 06:57:20 +0000 (19:57 +1300)]
i965/gs: Check newly-generated GS-out VUE map against correct stage

Previously, we compared our new GS-out VUE map to the existing *VS*-out
VUE map, which is bogus.

This would mostly manifest as redundant dirty flagging where the GS is
in use but the VS and GS output layouts differ; but there is a scary
case where we would fail to flag a GS-out layout change if it happened
to match the VS-out layout.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.5, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88885
(cherry picked from commit b51ff50a767cc78d678ed3d2c25995f5c4194fea)

9 years agoi965/vec4: Fix implementation of i2b.
Matt Turner [Fri, 27 Feb 2015 06:49:47 +0000 (22:49 -0800)]
i965/vec4: Fix implementation of i2b.

I broke this in commit 2881b123d. I must have misread i2b as b2i.

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88246
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 43ef2657a08f850c5756f28520f2cbe506807f24)

9 years agoi965/fs/nir: Use emit_math for nir_op_fpow
Ian Romanick [Fri, 27 Feb 2015 22:17:50 +0000 (14:17 -0800)]
i965/fs/nir: Use emit_math for nir_op_fpow

It appears that all the other instructions that need it already use it.
This one just got missed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b8a1637119249c1d5e76c27d0053360bbb7f4e77)

9 years agodocs: Add sha256 sums for the 10.5.0 release
Emil Velikov [Fri, 6 Mar 2015 23:58:47 +0000 (23:58 +0000)]
docs: Add sha256 sums for the 10.5.0 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Update 10.5.0 release notes
Emil Velikov [Fri, 6 Mar 2015 22:55:59 +0000 (22:55 +0000)]
docs: Update 10.5.0 release notes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoBump version to 10.5.0 (final)
Emil Velikov [Fri, 6 Mar 2015 22:46:49 +0000 (22:46 +0000)]
Bump version to 10.5.0 (final)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoxmlpool: make sure we ship options.h
Emil Velikov [Mon, 2 Mar 2015 13:24:55 +0000 (13:24 +0000)]
xmlpool: make sure we ship options.h

The header is included in ../xmlpool.h. With the latter of which used
directly in a number of places in mesa.
Note that we can also add it (alongside t_option.h) to noinst_HEADERS,
but neither solution fixes the issue that brough us here - namely:
Do not regenerate the headers, if it already exists.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomapi: fix shared-glapi dependency tracking
Emil Velikov [Mon, 2 Mar 2015 14:33:50 +0000 (14:33 +0000)]
mapi: fix shared-glapi dependency tracking

I.e. add shared-glapi/glapi_mapi_tmp.h to the SOURCES list. Otherwise
there will be no knowledge that the file is required by others for the
build. Thus autotools won't pick it up for the distribution tarball.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: drop Makefile from get_hash.h dependency list
Emil Velikov [Mon, 2 Mar 2015 14:28:41 +0000 (14:28 +0000)]
mesa: drop Makefile from get_hash.h dependency list

Not required. Additionally this had the side effect of generating the
file, despite it's existence.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: fix dependency tracking of generated sources
Emil Velikov [Mon, 2 Mar 2015 13:10:15 +0000 (13:10 +0000)]
mesa: fix dependency tracking of generated sources

Some of the files generated were not in the SOURCES variable, thus
although generated prior to compilation the dependency tracking was
incomplete. The latter of which resulted in the files missing from the
distribution tarball.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: rename format_info.c to format_info.h
Emil Velikov [Mon, 2 Mar 2015 13:04:37 +0000 (13:04 +0000)]
mesa: rename format_info.c to format_info.h

The file is auto-generated, and #included by formats.c. Let's rename it
to reflect the latter. This will also help up fix the dependency
tracking by adding it to the _SOURCES variable, without the side effect
of it being compiled (twice).

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa/main: update .gitignore
Emil Velikov [Mon, 2 Mar 2015 13:00:55 +0000 (13:00 +0000)]
mesa/main: update .gitignore

Drop the no longer present get_es{1,2}.c from the list.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoIncrement version to 10.5.0-rc3
Emil Velikov [Sat, 28 Feb 2015 00:04:30 +0000 (00:04 +0000)]
Increment version to 10.5.0-rc3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoauxilary/os: correct sysctl use in os_get_total_physical_memory()
Jonathan Gray [Sun, 22 Feb 2015 08:19:25 +0000 (19:19 +1100)]
auxilary/os: correct sysctl use in os_get_total_physical_memory()

The length argument passed to sysctl was the size of the pointer
not the type.  The result of this is sysctl calls would fail on
32 bit BSD/Mac OS X.

Additionally the wrong pointer was passed as an argument to store
the result of the sysctl call.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 7983a3d2e06b0bc16c1a16bddccc7f14fe1f132c)

9 years agor600g/sb: treat undefined values like constants
Dave Airlie [Wed, 18 Feb 2015 00:13:20 +0000 (10:13 +1000)]
r600g/sb: treat undefined values like constants

When we schedule an instructions with undefined value, we
eventually will use 0, which is a constant, however sb wasn't
taking this into account and creating ops with illegal scalar
swizzles.

this replaces my fix for op3 in t slots.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e8e4437ed0660b3f1d1912f53d997cf5e25f486d)

9 years agoi965/skl: Implement WaDisable1DDepthStencil
Neil Roberts [Mon, 2 Feb 2015 17:47:23 +0000 (17:47 +0000)]
i965/skl: Implement WaDisable1DDepthStencil

Skylake+ doesn't support setting a depth buffer to a 1D surface but it
does allow pretending it's a 2D texture with a height of 1 instead.

This fixes the GL_DEPTH_COMPONENT_* tests of the copyteximage piglit
test (and also seems to avoid a subsequent GPU hang).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89037
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5b29b2922afe2b8167a589fc2896a071fc85b693)
Nominated-by: Ian Romanick <idr@freedesktop.org>
9 years agopipe-loader: Fix build with dri drivers enabled, and vl state trackers disabled
Tom Stellard [Wed, 25 Feb 2015 00:43:43 +0000 (19:43 -0500)]
pipe-loader: Fix build with dri drivers enabled, and vl state trackers disabled

Configure arguments:

./configure --disable-dri3 --disable-xvmc --enable-opencl
            --with-gallium-drivers=r300,r600,radeonsi
            --with-egl-platforms=drm

Build error:

make[3]: *** No rule to make target
`../../../../src/gallium/auxiliary/libgalliumvlwinsys.la', needed by
`pipe_r300.la'.  Stop.

Cc: "10.5" <mesa-stable@lists.freedestkop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ed07255149d7cffac07615e946289b3d683faa4b)

9 years agoglsl: Rewrite and fix min/max to saturate optimization.
Matt Turner [Tue, 24 Feb 2015 18:41:52 +0000 (10:41 -0800)]
glsl: Rewrite and fix min/max to saturate optimization.

There were some bugs, and the code was really difficult to follow. We
would optimize

   min(max(x, b), 1.0) into max(sat(x), b)

but not pay attention to the order of min/max and also do

   max(min(x, b), 1.0) into max(sat(x), b)

Corrects four shaders from Champions of Regnum that do

   min(max(x, 1), 10)

and corrects rendering of Mass Effect under VMware Workstation.

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89180
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit cb25087c7bd5f1ad2515647278b32d3f07803f77)

9 years agoglx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA
Andreas Boll [Tue, 24 Feb 2015 19:01:30 +0000 (20:01 +0100)]
glx: Fix returned values of GLX_RENDERER_PREFERRED_PROFILE_MESA

If the renderer supports the core profile the query returned incorrectly
0x8 as value, because it was using (1U << __DRI_API_OPENGL_CORE) for the
returned value.

The same happened with the compatibility profile. It returned 0x1
(1U << __DRI_API_OPENGL) instead of 0x2.

Internal DRI defines:
   dri_interface.h: #define __DRI_API_OPENGL       0
   dri_interface.h: #define __DRI_API_OPENGL_CORE  3

Those two bits are supposed for internal usage only and should be
translated to GLX_CONTEXT_CORE_PROFILE_BIT_ARB (0x1) for a preferred
core context profile and GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB (0x2)
for a preferred compatibility context profile.

This patch implements the above translation in the glx module.

v2: Fix the incorrect behavior in the glx module

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6d164f65c5a794164d07bc66c1f8f87280514e8c)

9 years agocommon: Fix PBOs for 1D_ARRAY.
Laura Ekstrand [Thu, 19 Feb 2015 01:17:38 +0000 (17:17 -0800)]
common: Fix PBOs for 1D_ARRAY.

Corrects the way that _mesa_meta_pbo_TexSubImage and
_mesa_meta_pbo_GetTexSubImage handle 1D_ARRAY textures.  Fixes a failure in
the Piglit arb_direct_state_access/gettextureimage-targets test.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 546aba143d13ba3f993ead4cc30b2404abfc0202)

9 years agocommon: Correct PBO 2D_ARRAY handling.
Laura Ekstrand [Tue, 24 Feb 2015 22:51:29 +0000 (14:51 -0800)]
common: Correct PBO 2D_ARRAY handling.

Changes PBO uploads and downloads to use a tall (height * depth) 2D texture
for blitting. This fixes the bug where 2D_ARRAY, 3D, and CUBE_MAP_ARRAY
textures are not properly uploaded and downloaded.

Removes the option to use a 2D ARRAY texture for the PBO during upload and
download.  This option didn't work because the miptree couldn't be set up
reliably.

v2: Review from Jason Ekstrand and Neil Roberts:
   -Delete the depth parameter from create_texture_for_pbo
   -Abandon the option to create a 2D ARRAY texture in create_texture_for_pbo

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ccc5ce6f72c1ec86be4dfcef96c0b51fba0faa6d)

9 years agocommon: Correct texture init for meta pbo uploads and downloads.
Laura Ekstrand [Tue, 24 Feb 2015 21:29:11 +0000 (13:29 -0800)]
common: Correct texture init for meta pbo uploads and downloads.

This moves the line setting immutability for the texture to after
_mesa_initialize_texture_object so that the initializer function will not
cancel it out. Moreover, because of the ARB_texture_view extension, immutable
textures must have NumLayers > 0, or depth will equal (0-1)=0xFFFFFFFF during
SURFACE_STATE setup, which triggers assertions.

v2: Review from Kenneth Graunke:
   - Include more explanation in the commit message.
   - Make texture setup bug fixes into a separate patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 06084652fefe49c3d6bf1b476ff74ff602fdc22a)

9 years agost/omx/dec/h264: fix picture out-of-order with poc type 0 v2
Leo Liu [Mon, 23 Feb 2015 18:50:06 +0000 (13:50 -0500)]
st/omx/dec/h264: fix picture out-of-order with poc type 0 v2

poc counter should be reset with IDR frame,
otherwise there would be a re-order issue with
frames before and after IDR

v2: add commit message

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9c7b343bc0a6aa6065055cbc1c0a891ccc445984)

9 years agoIncrement version to 10.5.0-rc2
Emil Velikov [Tue, 24 Feb 2015 15:35:17 +0000 (15:35 +0000)]
Increment version to 10.5.0-rc2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoinstall-lib-links: remove the .install-lib-links file
Emil Velikov [Tue, 24 Feb 2015 14:05:15 +0000 (14:05 +0000)]
install-lib-links: remove the .install-lib-links file

With earlier commit (install-lib-links: don't depend on .libs directory)
we moved the location of the file from .libs/ to the current dir.
Although we did not attribute that in the former case autotools was
doing us a favour and removing the file. Explicitly remove the file at
clean-local time, otherwise we'll end up with dangling files.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit fece147be53880ac8e8e5e2863f91cdd01d98b5c)

9 years agomesa: Fix error validating args for TexSubImage3D
Eduardo Lima Mitev [Mon, 2 Feb 2015 17:14:47 +0000 (18:14 +0100)]
mesa: Fix error validating args for TexSubImage3D

The zoffset and depth values were not being considered when calling
error_check_subtexture_dimensions().

Fixes 2 dEQP tests:
* dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_offset
* dEQP-GLES3.functional.negative_api.texture.texsubimage3d_invalid_offset

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedestkop.org>
(cherry picked from commit 2aa71e9485a5a062b1bd2dd8bdc081a8fa4c873d)

9 years agoegl, wayland: RGB565 format support on Back-buffer
Vivek Kasireddy [Wed, 11 Feb 2015 03:15:31 +0000 (19:15 -0800)]
egl, wayland: RGB565 format support on Back-buffer

In current code, color format is always hardcoded to
__DRI_IMAGE_FORMAT_ARGB8888 when buffer or DRI image is
allocated in function calls, get_back_bo and dri2_get_buffers,
regardless of current target's color format. This problem
may leads to incorrect render pitch calculation, which
eventually ends up with wrong offset of pixels in
the frame buffer when the image is in different color format
from dri surf's, especially with different bpp. (e.g. RGB565-16bpp)

Attached code patch simply adds RGB565 and XRGB8888 cases to two
functions noted above to resolve the issue.

v2: added a case of XRGB8888, format and bpp selection is done
    via switch-case (not "if-else" anymore)

Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1e96eece300bbd2dd621a4941a4418222bb4c8e5)

9 years agoi965: Link test programs with gtest before pthreads.
Matt Turner [Sun, 22 Feb 2015 06:41:24 +0000 (22:41 -0800)]
i965: Link test programs with gtest before pthreads.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=540962
(cherry picked from commit 0b6d43e329d194b01ab5cd554617f79a13f6669a)

9 years agoradeonsi: fix point sprites
Marek Olšák [Mon, 23 Feb 2015 10:39:53 +0000 (11:39 +0100)]
radeonsi: fix point sprites

Broken by a27b74819ad375e8c0bc88e13f42c951d2b5cd6a.

This fix is critical and should be ported to stable ASAP.

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7820a11e3dea2aca8e2b9b4ed9faf94ff5696990)

Squashed with commit

radeonsi: fix a warning caused by previous commit

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 050bf75c8bbaa7cad537aabaf8612129edfee3a4)

9 years agovbo: fix an unitialized-variable warning
Marek Olšák [Fri, 20 Feb 2015 19:17:39 +0000 (20:17 +0100)]
vbo: fix an unitialized-variable warning

It looks like a bug to me.

Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 0feb0b73731cebd1513dd7f4e6cdf6de81edb802)

9 years agoradeonsi: don't use SQC_CACHES to flush ICACHE and KCACHE on SI
Marek Olšák [Thu, 19 Feb 2015 12:03:54 +0000 (13:03 +0100)]
radeonsi: don't use SQC_CACHES to flush ICACHE and KCACHE on SI

This reverts 73c2b0d18c51459697d8ec194ecfc4438c98c139.

It doesn't seem to be reliable. It's probably missing a wait packet or
something, because it's just a register write and doesn't wait for anything.
SURFACE_SYNC at least seems to wait until the flush is done. Just guessing.

Let's not complicate things and revert this.

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

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7692704b144b2aa9a57767a43212ceb5aad6638a)

9 years agoi965/vec4: Add and use byte-MOV instruction for unpack 4x8.
Matt Turner [Thu, 12 Feb 2015 01:42:43 +0000 (01:42 +0000)]
i965/vec4: Add and use byte-MOV instruction for unpack 4x8.

Previously we were using a B/UB source in an Align16 instruction, which
is illegal. It for some reason works on all platforms, except Broadwell.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86811
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e0137fd6f720e4977466b1760ac02a72c5abceb8)

9 years agoi965/fs: Consider MOV.SAT to interfere if it has a source modifier.
Matt Turner [Wed, 11 Feb 2015 00:25:47 +0000 (16:25 -0800)]
i965/fs: Consider MOV.SAT to interfere if it has a source modifier.

The saturate propagation pass recognizes that the second instruction
below does not interfere with an attempt to propagate the saturate
modifier from instruction 3 to 1.

 1:  add(8)     dst0   src0  src1
 2:  mov.sat(8) dst1   dst0
 3:  mov.sat(8) dst2   dst0

Unfortunately, we did not consider the case of instruction 2 having a
source modifier on dst0. Take for instance:

 1:  add(8)     dst0   src0  src1
 2:  mov.sat(8) dst1  -dst0
 3:  mov.sat(8) dst2   dst0

Consider such an instruction to interfere. Increase instruction counts
in Anomaly 2, which could be a bug fix depending on the values the first
instruction produces.

instructions in affected programs:     53228 -> 53934 (1.33%)
HURT:                                  360

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7f8dd91d166e49d7da98f90d6428dc2705fb96d0)

9 years agoi965/fs: Use fs_inst::overwrites_reg() in saturate propagation.
Matt Turner [Wed, 28 Jan 2015 06:43:28 +0000 (22:43 -0800)]
i965/fs: Use fs_inst::overwrites_reg() in saturate propagation.

This is safer and matches the conditional_mod propagation pass.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 871ad3f08bc34e16fdd728e9a4821b9a83e509f0)

9 years agoi965/fs: Add unit tests for saturate propagation pass.
Matt Turner [Tue, 10 Feb 2015 21:38:07 +0000 (13:38 -0800)]
i965/fs: Add unit tests for saturate propagation pass.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit bf3389ec49a158e0b66db8e038d801eacabd20f1)

9 years agost/mesa: fix sampler view reference counting bug in glDraw/CopyPixels
Brian Paul [Wed, 18 Feb 2015 18:16:55 +0000 (11:16 -0700)]
st/mesa: fix sampler view reference counting bug in glDraw/CopyPixels

Use pipe_sampler_view_reference() instead of ordinary assignment.
Also add a new sanity check assertion.

Fixes piglit gl-1.0-drawpixels-color-index test crash.  But note
that the test still fails.

Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 62a8883f32f8a4c8c7d85390d4b17986e4018edf)

9 years agoswrast: fix multiple color buffer writing
Brian Paul [Mon, 16 Feb 2015 18:23:06 +0000 (11:23 -0700)]
swrast: fix multiple color buffer writing

If a fragment program wrote to more than one color buffer, the
first fragment color got replicated to all dest buffers.  This
fixes 5 piglit FBO tests, including fbo-drawbuffers-arbfp.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45348
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 89c96afe3c0acf8f2fccaf02da02945afe8ba5f3)

9 years agoinstall-lib-links: don't depend on .libs directory
Lucas Stach [Thu, 19 Feb 2015 13:52:49 +0000 (14:52 +0100)]
install-lib-links: don't depend on .libs directory

This snippet can be included in Makefiles that may, depending on the
project configuration, not actually build any installable libraries.

In that case we don't have anything to depend on and this part of
the makefile may be executed before the .libs directory is created,
so do not depend on it being there.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
(cherry picked from commit 5c1aac17adffeef9bb6171d83cc7ddd94c61c5f2)

9 years agoauxiliary/vl: honour the DRI2PROTO_CFLAGS
Emil Velikov [Mon, 16 Feb 2015 19:11:33 +0000 (19:11 +0000)]
auxiliary/vl: honour the DRI2PROTO_CFLAGS

Otherwise for non-default installations the build will fail to find the
headers and error out.

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

9 years agoauxiliary/vl: Build vl_winsys_dri.c only when needed.
Emil Velikov [Mon, 16 Feb 2015 18:22:16 +0000 (18:22 +0000)]
auxiliary/vl: Build vl_winsys_dri.c only when needed.

With commit c39dbfdd0f7(auxiliary/vl: bring back the VL code for the dri
targets) we did not fully consider users of dri-swrast alone. Thus we
ended up trying to compile the dri2 specific code on platform which lack
it - Cygwin for example.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reported-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
(cherry picked from commit dd7b6670a29ff3ed48ba44a9fecd1890363d914f)

9 years agoautomake: Use AM_DISTCHECK_CONFIGURE_FLAGS
Emil Velikov [Thu, 12 Feb 2015 15:27:28 +0000 (15:27 +0000)]
automake: Use AM_DISTCHECK_CONFIGURE_FLAGS

Currently we use DISTCHECK_CONFIGURE_FLAGS, which is reserved for
the user. As with other variables, one should use the AM_ variable
within the makefile.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 3018c4a56aab2ac1d8d5b228e6cbf13eea68b790)

9 years agoRevert "radeon/llvm: enable unsafe math for graphics shaders"
Michel Dänzer [Tue, 17 Feb 2015 08:03:35 +0000 (17:03 +0900)]
Revert "radeon/llvm: enable unsafe math for graphics shaders"

This reverts commit 0e9cdedd2e3943bdb7f3543a3508b883b167e427.

It caused the grass to disappear in The Talos Principle.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89069
Cc: "10.5 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 4db985a5fa9ea985616a726b1770727309502d81)

9 years agoi965: Prefer Meta over the BLT for BlitFramebuffer.
Kenneth Graunke [Thu, 15 Jan 2015 09:41:14 +0000 (01:41 -0800)]
i965: Prefer Meta over the BLT for BlitFramebuffer.

There's some debate about whether we should use Meta or BLORP,
but either should run circles around the BLT engine.

In particular, this means that Gen8+ will use the 3D engine for blits,
like we do on Gen6-7.

Improves performance in "copypixrate -blit -back" (from Mesa demos)
by 232.037% +/- 3.15795% (n=10) on Broadwell GT3e.

v2: Rebase on Laura's changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d523fefa756eef9c7a2c0d91cf4c2df10b89ed2a)

9 years agoMake _mesa_swizzle_and_convert argument types in .c match those in .h
Alan Coopersmith [Mon, 16 Feb 2015 00:20:25 +0000 (16:20 -0800)]
Make _mesa_swizzle_and_convert argument types in .c match those in .h

Caused Solaris Studio compilers to fail to build with errors about
incompatible function redefinitions.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit b7ce7c00e35ceb3518d932359ed52cacd6679acb)

9 years agoUse __typeof instead of typeof with Solaris Studio compilers
Alan Coopersmith [Mon, 16 Feb 2015 00:19:06 +0000 (16:19 -0800)]
Use __typeof instead of typeof with Solaris Studio compilers

While the C compiler accepts typeof, C++ requires __typeof.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86944
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4671dca0eecf7dbf3e0d0a13111813756722d57d)

9 years agoAvoid fighting with Solaris headers over isnormal()
Alan Coopersmith [Mon, 16 Feb 2015 00:16:15 +0000 (16:16 -0800)]
Avoid fighting with Solaris headers over isnormal()

When compiling in C99 or C++11 modes, Solaris defines isnormal() as
a macro via <math.h>, which causes the function definition to become
too mangled to compile.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit d602fbd861e2c3c5570b55f0839361a6f8bd32c7)

9 years agoRemove extraneous ; after DECL_TYPE usage
Alan Coopersmith [Sun, 15 Feb 2015 22:46:29 +0000 (14:46 -0800)]
Remove extraneous ; after DECL_TYPE usage

The macro is defined to provide a trailing ; so this caused the expansion
to end in ";;" which made the Solaris Studio compilers issue warnings for
every line of:
  "builtin_type_macros.h", line 113: Warning: extra ";" ignored.
for every file that included the header, filling build logs with thousands
of useless warnings.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 815b3bd096a3eab9f00f9270d45a6885d73180e9)

9 years agoBracket arguments to tr so they work with Solaris tr
Alan Coopersmith [Thu, 1 Jan 2015 20:55:27 +0000 (12:55 -0800)]
Bracket arguments to tr so they work with Solaris tr

https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Usual-Tools.html#index-g_t_0040command_007btr_007d-1842

Without this fix, egl fails to build on Solaris, with the error:

<command-line>:0:22: error: '_EGL_PLATFORM_x11' undeclared (first use in this function)
egldisplay.c:207:31: note: in expansion of macro '_EGL_NATIVE_PLATFORM'
             native_platform = _EGL_NATIVE_PLATFORM;
                               ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 60ad5103b9c85cbb0921082fba9401f117424f25)

9 years agoglsl: Reduce memory consumption of copy propagation passes.
Kenneth Graunke [Wed, 17 Dec 2014 02:33:39 +0000 (18:33 -0800)]
glsl: Reduce memory consumption of copy propagation passes.

opt_copy_propagation and opt_copy_propagation_elements create new ACP
and Kill sets each time they enter a new control flow block.  For if
blocks, they also copy the entire existing ACP set contents into the
new set.

When we exit the control flow block, we discard the new sets.  However,
we weren't freeing them - so they lived on until the pass finished.
This can waste a lot of memory (57MB on one pessimal shader).

This patch makes the pass allocate ACP entries using this->acp as the
memory context, and Kill entries out of this->kill.  It also steals
kill entries when moving them from the inner kill list to the parent.

It then frees the lists, including their contents.

v2: Move ralloc_free(this->acp) just before this->acp = orig_acp
    (suggested by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.5 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 76960a55e6656bb0022e9c31ae7542010da130e3)

9 years agomain: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.
Laura Ekstrand [Mon, 16 Feb 2015 22:29:57 +0000 (14:29 -0800)]
main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.

Previously array textures were not working with GetCompressedTextureImage,
leading to failures in the test
arb_direct_state_access/getcompressedtextureimage.c.

Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 92163482bda87216764edc0beca3ca090678038d)

9 years agoradeonsi: fix a crash if a stencil ref state is set before a DSA state
Marek Olšák [Sun, 15 Feb 2015 17:12:06 +0000 (18:12 +0100)]
radeonsi: fix a crash if a stencil ref state is set before a DSA state

+ minor indentation fixes

Discovered by Axel Davy.

This can't be reproduced with any app, because all state trackers set a DSA
state first.

Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit 2ead74888a70481aa40b5b6ede42279e1917e66c)

9 years agomesa: fix AtomicBuffer typo in _mesa_DeleteBuffers
Marek Olšák [Tue, 10 Feb 2015 00:35:23 +0000 (01:35 +0100)]
mesa: fix AtomicBuffer typo in _mesa_DeleteBuffers

Cc: 10.5 10.4 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit e8625a29fe0942af2876f0684b06c6ed01939227)

9 years agoradeonsi: small fix in SPI state
Marek Olšák [Fri, 6 Feb 2015 17:00:50 +0000 (18:00 +0100)]
radeonsi: small fix in SPI state

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit a27b74819ad375e8c0bc88e13f42c951d2b5cd6a)

9 years agometa: Fix saving the results of the current occlusion query
Neil Roberts [Tue, 25 Nov 2014 17:52:27 +0000 (17:52 +0000)]
meta: Fix saving the results of the current occlusion query

When restoring the current state in _mesa_meta_end it was previously trying to
copy the on-going sample count of the current occlusion query into the new
query after restarting it so that the driver will continue adding to the
previous value. This wouldn't work for two reasons. Firstly, the query might
not be ready yet so the Result member will usually be zero. Secondly the saved
query is stored as a pointer to the query object, not a copy of the struct, so
it is actually restarting the exact same object. Copying the result value is
just copying between identical addresses with no effect. The call to
_mesa_BeginQuery will have always reset it back to zero.

This patch fixes it by making it actually wait for the query object to be
ready before grabbing the previous result. The downside of doing this is that
it could introduce a stall but I think this situation is unlikely so it might
not matter too much. A better solution might be to introduce a real
suspend/resume mechanism to the driver interface. This could be implemented in
the i965 driver by saving the depth count multiple times like it does in the
i945 driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88248
Reviewed-by: Carl Worth <cworth@cworth.org>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit bb77745681e179b53ea64da7bc1987b57643b7b0)

9 years agomesa: Fix element count for byte-swaps in texstore, readpix and texgetimage
Iago Toral Quiroga [Fri, 13 Feb 2015 11:56:26 +0000 (12:56 +0100)]
mesa: Fix element count for byte-swaps in texstore, readpix and texgetimage

Some old format conversion code in pack.c implemented byte-swapping like this:

GLint comps = _mesa_components_in_format(dstFormat);
GLint swapSize = _mesa_sizeof_packed_type(dstType);
if (swapSize == 2)
   _mesa_swap2((GLushort *) dstAddr, n * comps);
else if (swapSize == 4)
   _mesa_swap4((GLuint *) dstAddr, n * comps);

where n is the pixel count. But this is incorrect for packed formats,
where _mesa_sizeof_packed_type is already returning the size of a pixel
instead of the size of a single component, so multiplying this by the
number of components in the format results in a larger element count
for _mesa_swap than we want.

Unfortunately, we followed the same implementation for byte-swapping
in the rewrite of the format conversion code for texstore, readpixels
and texgetimage.

This patch computes the correct element counts for _mesa_swap calls
by computing the bytes per pixel in the image and dividing that by the
swap size to obtain the number of swaps required per pixel. Then multiplies
that by the number of pixels in the image to obtain the swap count that
we need to use.

Also, when handling byte-swapping in texstore_rgba, we were ignoring
the image's depth. This patch fixes this too.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ba426522dddf0860f59dedfe9953dbd509160c7d)

9 years agomesa: Handle transferOps in texstore_rgba
Iago Toral Quiroga [Fri, 13 Feb 2015 09:23:26 +0000 (10:23 +0100)]
mesa: Handle transferOps in texstore_rgba

In the recent rewrite of the format conversion code we did not handle this.
This patch adds the missing support.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89068
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4b249d2eed686384d6d7c36f3232360891d5eeda)

9 years agoi965/vec4/vp: Use vec4_visitor::CMP.
Matt Turner [Thu, 12 Feb 2015 02:01:49 +0000 (02:01 +0000)]
i965/vec4/vp: Use vec4_visitor::CMP.

... instead of emit(BRW_OPCODE_CMP, ...). In commit 6b3a301f I changed
vec4_visitor::CMP to set the destination's type to that of src0. In the
following commit (2335153f) I removed an apparently now unnecessary work
around for Gen8 that did the same thing.

But there was a single place that emitted a CMP instruction without
using the vec4_visitor::CMP function. Use it there.

And change dst_null_d to dst_null_f for good measure, since ARB vp
doesn't have integers.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89032
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 72b9f8db2a035b52dbd59af0d2a6441cbde11a4c)

9 years agonvc0: allow holes in xfb target lists
Ilia Mirkin [Sat, 14 Feb 2015 06:43:31 +0000 (01:43 -0500)]
nvc0: allow holes in xfb target lists

Tested with a modified xfb-streams test which outputs to streams 0, 2,
and 3.

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

9 years agost/mesa: treat resource-less xfb buffers as if they weren't there
Ilia Mirkin [Sat, 14 Feb 2015 06:27:19 +0000 (01:27 -0500)]
st/mesa: treat resource-less xfb buffers as if they weren't there

If a transform feedback buffer's size is 0, st_bufferobj_data doesn't
end up creating a buffer for it. There's no point in trying to write to
such a buffer, so just pretend as if it's not really there.

This fixes arb_gpu_shader5-xfb-streams-without-invocations on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 80d373ed5b1d90a5e71747ee5b8951baac62f750)

9 years agonvc0: bail out of 2d blits with non-A8_UNORM alpha formats
Ilia Mirkin [Sat, 14 Feb 2015 04:21:36 +0000 (23:21 -0500)]
nvc0: bail out of 2d blits with non-A8_UNORM alpha formats

This fixes the teximage-colors uploads with GL_ALPHA format and
non-GL_UNSIGNED_BYTE type.

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

9 years agomesa: fix OES_texture_float texture render target behavior
Tapani Pälli [Thu, 12 Feb 2015 12:33:53 +0000 (14:33 +0200)]
mesa: fix OES_texture_float texture render target behavior

Current implementation allowed usage of unsized type texture GL_FLOAT
and GL_HALF_FLOAT as a render target as this was 'expected behavior' by
WEBGL_oes_texture_float and is also allowed by the oes-texture-float
WebGL test. However this broke some ES3 conformance tests that do not
accept such behavior. Patch sets such an fbo incomplete as expected by
the ES3 conformance tests. Textures with sized types like RGBA32F will
still continue to work as render targets.

v2: code style cleanups (Ian Romanick, Matt Turner)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88905
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e333035c47a6a4cc88f0f9ca2bced500538bebae)

9 years agoRevert use of Mesa IR optimizer for ARB_fragment_programs
Carl Worth [Thu, 12 Feb 2015 18:14:24 +0000 (10:14 -0800)]
Revert use of Mesa IR optimizer for ARB_fragment_programs

Commit f82f2fb3dc770902f1657ab1c22e6004faa3afab added use of the Mesa
IR optimizer for both ARB_fragment_program and ARB_vertex_program, but
only justified the vertex-program portions with measured performance
improvements.

Meanwhile, the optimizer was seen to generate hundreds of unused
immediates without discarding them, causing failures.

Discard the use of the optimizer for now to fix the regression. (In
the future, we anticpate things moving from Mesa IR to NIR for better
optimization anyway.)

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
CC: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 55a57834bf912916a5e07486b32f1778b35657f6)

9 years agocherry-ignore: ignore commits picked without -x
Emil Velikov [Tue, 24 Feb 2015 12:14:20 +0000 (12:14 +0000)]
cherry-ignore: ignore commits picked without -x

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoi965: Fix integer border color on Haswell.
Kenneth Graunke [Fri, 6 Feb 2015 11:39:20 +0000 (03:39 -0800)]
i965: Fix integer border color on Haswell.

+82 Piglits - 100% of border color tests now pass on Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 08a06b6b891df456902f5e170f1d82236d0c73d2)

9 years agoi965: Use a gl_color_union for sampler border color.
Kenneth Graunke [Wed, 7 May 2014 05:56:17 +0000 (22:56 -0700)]
i965: Use a gl_color_union for sampler border color.

This should have no effect, but will make it easier to implement other
bug fixes.

v2: Eliminate "unsigned one" local; just use the value where necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit e1e73443c572b5432ef66a923fe64b73467f411b)

9 years agoi965: Override swizzles for integer luminance formats.
Kenneth Graunke [Fri, 6 Feb 2015 10:06:27 +0000 (02:06 -0800)]
i965: Override swizzles for integer luminance formats.

The hardware's integer luminance formats are completely unusable;
currently we fall back to RGBA.  This means we need to override
the texture swizzle to obtain the XXX1 values expected for luminance
formats.

Fixes spec/EXT_texture_integer/texwrap formats bordercolor [swizzled]
on Broadwell - 100% of border color tests now pass on Broadwell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8cb18760cccf2c89d94c50ff14b330ec2d5c4a3c)

9 years agoIncrement version to 10.5.0-rc1
Emil Velikov [Thu, 12 Feb 2015 14:00:41 +0000 (14:00 +0000)]
Increment version to 10.5.0-rc1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoauxiliary/vl: bring back the VL code for the dri targets
Emil Velikov [Tue, 10 Feb 2015 15:11:09 +0000 (15:11 +0000)]
auxiliary/vl: bring back the VL code for the dri targets

With commit c642e87d9f4(auxiliary/vl: rework the build of the VL code)
we split out the VL code into a separate static library that was meant
to be used by the VL targets alone - va, vdpau, xvmc.

The commit failed to consider the way we handle vdpau-gl interop and
broke it. Bring back the functionality by keeping the vl <> vl_stub
separation as requrested by Christian.

v2: Update the omx target as well. Update mesa-stable email address.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86837
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
9 years agoconfigure: rework wayland_scanner handling(fix make distcheck)
Emil Velikov [Tue, 10 Feb 2015 14:14:16 +0000 (14:14 +0000)]
configure: rework wayland_scanner handling(fix make distcheck)

Currently having the wayland-scanner is optional, which causes problems
when autotools parses through the makefiles, and tries to generate all
the BUILT_SOURCES.

As the config option --with-egl-platform=wayland is not the default, we
won't end up setting the WAYLAND_SCANNER variable, which in turn will
cause some files to not get generated.

There has been a wayland-scanner package as of wayland 1.2 which
provides a variable for the scanner binary, so let's use that one and
fall back to manually searching via AC_PATH_PROG when needed.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agonir: add missing header to the sources list
Emil Velikov [Tue, 10 Feb 2015 13:10:18 +0000 (13:10 +0000)]
nir: add missing header to the sources list

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agonir: resolve nir.h dependency list (fix make distcheck)
Emil Velikov [Sat, 7 Feb 2015 19:20:16 +0000 (19:20 +0000)]
nir: resolve nir.h dependency list (fix make distcheck)

Use nir/nir_opcodes.h as is (w/o the absolute path), as it is the target
name used to generate the actual file. Otherwise the target is missing,
the file won't get generated and the build will fail.

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRM
Axel Davy [Wed, 14 Jan 2015 19:36:04 +0000 (20:36 +0100)]
egl: Soften several HAVE_DRM_PLATFORM to HAVE_LIBDRM

To fix build when libdrm is not found,
commit a594cec7e3ef275c386054127a357110a19dd823 did put several
parts of egl code under #ifdef HAVE_DRM_PLATFORM.

HAVE_DRM_PLATFORM means the egl drm platform is being built.
What should have been used instead is HAVE_LIBDRM.

At a few locations, the HAVE_DRM_PLATFORM introduced
have already been replaced by HAVE_LIBDRM, this patch
replaces the remaining occurences.

This patch makes for example EGL_EXT_image_dma_buf_import
be advertised by egl under x11 when the drm egl platform
is not built, whereas previously it required the drm egl
platform to be built.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodarwin: build fix
Jeremy Huddleston Sequoia [Wed, 11 Feb 2015 06:21:47 +0000 (22:21 -0800)]
darwin: build fix

xfont.c:237:14: error: implicit declaration of function 'GetGLXDRIDrawable' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable);
             ^
Fixes regression from 291be28476ea60c6fb1eb2a882e2e25def5d3735

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit e68b67b53fce39a8c93188262d9e795ca50750ac)

9 years agodarwin: build fix
Jeremy Huddleston Sequoia [Wed, 11 Feb 2015 04:32:02 +0000 (20:32 -0800)]
darwin: build fix

../../../src/mesa/main/compiler.h:47:10: fatal error: 'util/macros.h' file not found

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 1c67a5687a35e984323b6034adb914a66d64bb2f)

9 years agogallium/hud: also try R8_UNORM format for font texture
Brian Paul [Wed, 4 Feb 2015 20:44:48 +0000 (13:44 -0700)]
gallium/hud: also try R8_UNORM format for font texture

Convert the code to try formats from an array rather than a bunch
of if/else cases.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agogallium/hud: flush stdout in print_help(), for Windows
Brian Paul [Wed, 4 Feb 2015 20:34:44 +0000 (13:34 -0700)]
gallium/hud: flush stdout in print_help(), for Windows

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoi965: Add more stringent blitter assertions
Ben Widawsky [Tue, 23 Dec 2014 21:59:16 +0000 (13:59 -0800)]
i965: Add more stringent blitter assertions

Blits to or from a y-tiled surface must always be a multiple of the tile size.
From page 16 of the HSW PRM
(https://01.org/linuxgraphics/sites/default/files/documentation/intel-gfx-prm-osrc-hsw-memory-views.pdf#16)
"The pitch of a tiled enclosing region must be an integral number of tile
widths"

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Consolidate some of the intel_blit logic
Ben Widawsky [Tue, 23 Dec 2014 20:28:29 +0000 (12:28 -0800)]
i965: Consolidate some of the intel_blit logic

An upcoming patch is going to introduce some code here, and having this code
organized as the patch does makes it a bit easier to read later.

There should be no functional change here.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agost/dri: Make depth buffer optional for postprocessing
Park, Jeongmin [Sat, 7 Feb 2015 08:53:48 +0000 (17:53 +0900)]
st/dri: Make depth buffer optional for postprocessing

Since only pp_jimenezmlaa uses depth buffer, we can make it optional.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agopostprocess: Check for depth buffer in pp_jimenezmlaa
Park, Jeongmin [Sat, 7 Feb 2015 08:53:47 +0000 (17:53 +0900)]
postprocess: Check for depth buffer in pp_jimenezmlaa

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88962
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoi965/vec4: Correct MUL destination hazard
Ben Widawsky [Wed, 3 Dec 2014 01:30:49 +0000 (17:30 -0800)]
i965/vec4: Correct MUL destination hazard

As it turns out, we were over-thinking the cause of the hang on
Cherryview. It's simply errata for Cherryview.

commit 88fea85f09e2252035bec66ab26c375b45b000f5
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Nov 21 10:47:41 2014 -0800

    i965/vec4/gen8: Handle the MUL dest hazard exception

This is an explanation to why we never saw the hang on BDW.

NOTE: The problem the original patch was trying to fix does still exist. It will
have to be fixed at some point.

v2: Modify commit message, s/CHV/BDW

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84212
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agodocs: add news item and link release notes for mesa 10.4.4
Emil Velikov [Sat, 7 Feb 2015 00:51:08 +0000 (00:51 +0000)]
docs: add news item and link release notes for mesa 10.4.4

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 sums for the 10.4.4 release
Emil Velikov [Sat, 7 Feb 2015 00:47:18 +0000 (00:47 +0000)]
docs: Add sha256 sums for the 10.4.4 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 54da987baec25fbaf6975c93f197ddbfe65a303c)

9 years agoAdd release notes for the 10.4.4 release
Emil Velikov [Sat, 7 Feb 2015 00:17:09 +0000 (00:17 +0000)]
Add release notes for the 10.4.4 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 62eb27ac8bbd979796f50e253f6c786d7d791242)

9 years agonir: Fix broken fsat recognizer.
Eric Anholt [Fri, 30 Jan 2015 22:03:14 +0000 (14:03 -0800)]
nir: Fix broken fsat recognizer.

We've probably never seen this ridiculous pattern in the wild, so it
didn't matter.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agonir: Slightly simplify algebraic code generation by reusing a struct.
Eric Anholt [Wed, 28 Jan 2015 00:42:38 +0000 (16:42 -0800)]
nir: Slightly simplify algebraic code generation by reusing a struct.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agotgsi/ureg: Add missing some missing opcodes opcode_tmp.h
Eric Anholt [Mon, 10 Nov 2014 22:26:14 +0000 (14:26 -0800)]
tgsi/ureg: Add missing some missing opcodes opcode_tmp.h

I wanted all of these for NIR-to-TGSI.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agotgsi/ureg: Move ureg_dst_register() to the header.
Eric Anholt [Fri, 7 Nov 2014 20:35:58 +0000 (12:35 -0800)]
tgsi/ureg: Move ureg_dst_register() to the header.

I wanted to use it for nir-to-tgsi.  The equivalent ureg_src_register() is
also located here.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>