mesa.git
7 years agoglsl: fix optimization of discard nested multiple levels
Nicolai Hähnle [Tue, 26 Jul 2016 08:04:57 +0000 (10:04 +0200)]
glsl: fix optimization of discard nested multiple levels

The order of optimizations can lead to the conditional discard optimization
being applied twice to the same discard statement. In this case, we must
ensure that both conditions are applied.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96762
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agost_glsl_to_tgsi: only skip over slots of an input array that are present
Nicolai Hähnle [Mon, 25 Jul 2016 16:05:46 +0000 (18:05 +0200)]
st_glsl_to_tgsi: only skip over slots of an input array that are present

When an application declares varying arrays but does not actually do any
indirect indexing, some array indices may end up unused in the consuming
shader, so the number of input slots that correspond to the array ends
up less than the array_size.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoclover: make GCC 4.8 happy
Dieter Nützel [Wed, 27 Jul 2016 22:20:25 +0000 (00:20 +0200)]
clover: make GCC 4.8 happy

Without this GCC 4.8.x throws below error:

error: invalid initialization of non-const reference of type
'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}'
from an rvalue of type '<brace-enclosed initializer list>'

v2: change commit title and add error message like Eric Engestrom requested

Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97019
[ Francisco Jerez: Trivial formatting fix. ]
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
7 years agoi965: remove unnecessary null check
Timothy Arceri [Thu, 28 Jul 2016 00:24:57 +0000 (10:24 +1000)]
i965: remove unnecessary null check

We would have hit a segfault already if this could be null.

Fixes Coverity warning spotted by Matt.

Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoglsl: free hash tables earlier
Timothy Arceri [Tue, 26 Jul 2016 23:52:04 +0000 (09:52 +1000)]
glsl: free hash tables earlier

These are only used by get_matching_input() which has been call
at this point so free the hash tables.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agonvc0: enable ARB_tessellation_shader on GM107+
Samuel Pitoiset [Tue, 14 Jun 2016 16:27:31 +0000 (18:27 +0200)]
nvc0: enable ARB_tessellation_shader on GM107+

This exposes OpenGL 4.1 on Maxwell (tested on GM107 and GM206).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agogm107/ir: add a legalize SSA pass for PFETCH
Samuel Pitoiset [Wed, 20 Jul 2016 23:18:45 +0000 (01:18 +0200)]
gm107/ir: add a legalize SSA pass for PFETCH

PFETCH, actually ISBERD on GM107+ ISA only accepts a GPR for src0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agonvc0: fix up TCP header on GM107+
Samuel Pitoiset [Tue, 14 Jun 2016 16:40:29 +0000 (18:40 +0200)]
nvc0: fix up TCP header on GM107+

The number of outputs patch (limited to 255) has moved in the TCP
header, but blob seems to also set the old position. Also, the high
8-bits are now located inbetween the min/max parallel output read
address at position 20.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agovbo: Fix handling of POS/GENERIC0 attributes.
Mathias Fröhlich [Fri, 22 Jul 2016 08:58:58 +0000 (10:58 +0200)]
vbo: Fix handling of POS/GENERIC0 attributes.

In case of split primitives we need to restore
the original setting of the vtx.attrsz array to make
immediate mode attribute array tracking work.

v2: Use bool instead of boolean.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96950

7 years agoradeon/llvm: Use alloca instructions for larger arrays [revert a revert]
Marek Olšák [Mon, 25 Jul 2016 19:26:05 +0000 (21:26 +0200)]
radeon/llvm: Use alloca instructions for larger arrays [revert a revert]

This reverts commit f84e9d749fbb6da73a60fb70e6725db773c9b8f8.

Bioshock Infinite no longer hangs.

7 years agor600g: add support for B5G6R5 PBO uploads via texture buffers (v2)
Marek Olšák [Mon, 11 Jul 2016 22:48:00 +0000 (00:48 +0200)]
r600g: add support for B5G6R5 PBO uploads via texture buffers (v2)

v2: set endian swap to 16

untested

7 years agoradeonsi: pre-generate shader logs for ddebug
Marek Olšák [Fri, 22 Jul 2016 21:40:45 +0000 (23:40 +0200)]
radeonsi: pre-generate shader logs for ddebug

This cuts down the overhead of si_dump_shader when ddebug is capturing
shader logs, which is done for every draw call unconditionally (that's
quite a lot of work for a draw call).

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: add empty lines after shader stats
Marek Olšák [Fri, 22 Jul 2016 21:47:49 +0000 (23:47 +0200)]
radeonsi: add empty lines after shader stats

to separate individual shaders dumped consecutively.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: move the shader key dumping to si_shader_dump
Marek Olšák [Fri, 22 Jul 2016 21:23:11 +0000 (23:23 +0200)]
radeonsi: move the shader key dumping to si_shader_dump

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: implement pipelined hang detection mode
Marek Olšák [Tue, 19 Jul 2016 16:28:24 +0000 (18:28 +0200)]
ddebug: implement pipelined hang detection mode

For good performance while being able to generate decent hang reports.
The report doesn't contain the parsed IB and the buffer list, but it
isolates the draw call and dumps shaders while not having to flush
the context.

This is for GPU hangs that are harder to reproduce and require interactive
playing for minutes or even hours.

dd_pipe.h explains some implementation details. Initializing, copying
(recording) and clearing states is most of the code.

The performance should be at least 50% of the normal performance depending
on the circumstances. (i.e. 50% is expected to be the worst case scenario,
not the best case) The majority of time is spent in
dump_debug_state(PIPE_DUMP_CURRENT_SHADERS) and that's after all
the optimizations in later patches. There is no obvious way to optimize
that further.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: don't save pointers to call parameters
Marek Olšák [Thu, 21 Jul 2016 23:36:55 +0000 (01:36 +0200)]
ddebug: don't save pointers to call parameters

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: move dd_call into dd_pipe.h
Marek Olšák [Thu, 21 Jul 2016 23:09:19 +0000 (01:09 +0200)]
ddebug: move dd_call into dd_pipe.h

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: separate draw call dumping logic
Marek Olšák [Tue, 19 Jul 2016 19:31:02 +0000 (21:31 +0200)]
ddebug: separate draw call dumping logic

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: move all states into a separate structure
Marek Olšák [Wed, 13 Jul 2016 14:00:06 +0000 (16:00 +0200)]
ddebug: move all states into a separate structure

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: write contents of dmesg into hang reports
Marek Olšák [Wed, 20 Jul 2016 14:23:48 +0000 (16:23 +0200)]
ddebug: write contents of dmesg into hang reports

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: implement create_batch_query
Marek Olšák [Fri, 22 Jul 2016 15:30:06 +0000 (17:30 +0200)]
ddebug: implement create_batch_query

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: don't use abort()
Marek Olšák [Tue, 19 Jul 2016 19:18:25 +0000 (21:18 +0200)]
ddebug: don't use abort()

We don't want a core dump.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: make dd_get_file_stream accept the screen only
Marek Olšák [Tue, 19 Jul 2016 16:23:02 +0000 (18:23 +0200)]
ddebug: make dd_get_file_stream accept the screen only

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoddebug: clean up ddebug_screen_create
Marek Olšák [Mon, 18 Jul 2016 19:42:14 +0000 (21:42 +0200)]
ddebug: clean up ddebug_screen_create

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium: rework flags for pipe_context::dump_debug_state
Marek Olšák [Tue, 19 Jul 2016 19:41:03 +0000 (21:41 +0200)]
gallium: rework flags for pipe_context::dump_debug_state

The pipelined hang detection mode will not want to dump everything.
(and it's also time consuming) It will only dump shaders after a draw call
and then dump the status registers separately if a hang is detected.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agovc4: add hash table look-up for exported dmabufs
Rob Herring [Fri, 22 Jul 2016 20:28:30 +0000 (15:28 -0500)]
vc4: add hash table look-up for exported dmabufs

It is necessary to reuse existing BOs when dmabufs are imported. There
are 2 cases that need to be handled. dmabufs can be created/exported and
imported by the same process and can be imported multiple times.
Copying other drivers, add a hash table to track exported BOs so the
BOs get reused.

v2: Whitespace fixup (by anholt)

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
7 years agovc4: Disable early Z with computed depth.
Eric Anholt [Tue, 19 Jul 2016 18:10:36 +0000 (11:10 -0700)]
vc4: Disable early Z with computed depth.

We don't tell the hardware whether we're computing depth, so we need
to manage early Z state manually.  Fixes piglit early-z.

7 years agottn: Update shader->info as we generate code.
Eric Anholt [Tue, 19 Jul 2016 17:55:47 +0000 (10:55 -0700)]
ttn: Update shader->info as we generate code.

We could use the nir_shader_gather_info() pass to update it after the
fact, but this is what glsl_to_nir and prog_to_nir do.

Reviewed-by: Rob Clark <robclark@freedesktop.org>
7 years agomesa: standardize naming Mesa3D, MESA -> Mesa
Vedran Miletić [Thu, 14 Jul 2016 10:17:21 +0000 (12:17 +0200)]
mesa: standardize naming Mesa3D, MESA -> Mesa

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agomesa: Make MESA_SHADER_CAPTURE_PATH skip shaders with Name == -1.
Kenneth Graunke [Mon, 25 Jul 2016 21:49:28 +0000 (14:49 -0700)]
mesa: Make MESA_SHADER_CAPTURE_PATH skip shaders with Name == -1.

Shaders with shProg->Name == ~0 (aka 4294967295) are internal meta
shaders that we don't really want to capture.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agomesa: Use AC_HEADER_MAJOR to include correct header for major().
Matt Turner [Thu, 21 Jul 2016 18:46:23 +0000 (11:46 -0700)]
mesa: Use AC_HEADER_MAJOR to include correct header for major().

Gentoo has been smoke testing an upcoming change to glibc.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=580392

7 years agoglsl: Remove references to tail_pred.
Matt Turner [Mon, 25 Jul 2016 22:10:42 +0000 (15:10 -0700)]
glsl: Remove references to tail_pred.

7 years agoglx: Avoid aliasing violations.
Matt Turner [Wed, 24 Jun 2015 01:41:38 +0000 (18:41 -0700)]
glx: Avoid aliasing violations.

Compilers are perfectly capable of generating efficient code for calls
like these to memcpy().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agomesa: Avoid aliasing violation in uniform_query.cpp.
Matt Turner [Thu, 26 May 2016 22:53:58 +0000 (15:53 -0700)]
mesa: Avoid aliasing violation in uniform_query.cpp.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agomesa: Avoid aliasing violation in FXT1.
Matt Turner [Thu, 26 May 2016 22:53:30 +0000 (15:53 -0700)]
mesa: Avoid aliasing violation in FXT1.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoswrast: Avoid aliasing violation.
Matt Turner [Thu, 26 May 2016 22:52:33 +0000 (15:52 -0700)]
swrast: Avoid aliasing violation.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoglsl: Avoid aliasing violations.
Matt Turner [Thu, 26 May 2016 22:53:00 +0000 (15:53 -0700)]
glsl: Avoid aliasing violations.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoglsl: Separate overlapping sentinel nodes in exec_list.
Matt Turner [Mon, 27 Jun 2016 21:42:57 +0000 (14:42 -0700)]
glsl: Separate overlapping sentinel nodes in exec_list.

I do appreciate the cleverness, but unfortunately it prevents a lot more
cleverness in the form of additional compiler optimizations brought on
by -fstrict-aliasing.

No difference in OglBatch7 (n=20).

Co-authored-by: Davin McCall <davmac@davmac.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoi965/miptree: Stop multiplying cube depth by 6 in HiZ calculations
Jason Ekstrand [Wed, 20 Jul 2016 15:24:15 +0000 (08:24 -0700)]
i965/miptree: Stop multiplying cube depth by 6 in HiZ calculations

intel_mipmap_tree::logical_depth0 is now in number of 2D slices so we no
longer need to be multiplying by 6.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
7 years agoi965/miptree/isl: Stop multiplying depth by 6 for cubes
Jason Ekstrand [Wed, 20 Jul 2016 15:22:53 +0000 (08:22 -0700)]
i965/miptree/isl: Stop multiplying depth by 6 for cubes

Now that the logical_depth0 field is in number of 2D slices, we don't need
to be multiplying by 6 when creating the surface.  It wasn't hurting
anything primarily because we get the actual length from the view which was
already handling it correctly.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoi965/blorp/gen8: Stop multiplying depth by 6 for cubes
Jason Ekstrand [Sat, 23 Jul 2016 02:53:59 +0000 (19:53 -0700)]
i965/blorp/gen8: Stop multiplying depth by 6 for cubes

intel_mipmap_tree::logical_depth0 is now in 2-D slices so there is no need
for us to multiply by 6 when we go to fill out a blorp surface state.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agonvc0: use nvc0_m2mf_push_linear() to reduce code duplication
Samuel Pitoiset [Mon, 25 Jul 2016 22:46:47 +0000 (00:46 +0200)]
nvc0: use nvc0_m2mf_push_linear() to reduce code duplication

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agonvc0: use nve4_p2mf_push_linear() to reduce code duplication
Samuel Pitoiset [Mon, 25 Jul 2016 23:38:49 +0000 (01:38 +0200)]
nvc0: use nve4_p2mf_push_linear() to reduce code duplication

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agobuild: Remove unused AX_CHECK_COMPILE_FLAG macro
Andreas Boll [Wed, 20 Jul 2016 08:37:45 +0000 (10:37 +0200)]
build: Remove unused AX_CHECK_COMPILE_FLAG macro

Unused since 1a6ae840413d7fb6d2e83f6a83081d5246c7ac9e

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomain: memcpy larger chunks in _mesa_propagate_uniforms_to_driver_storage
Nils Wallménius [Fri, 22 Jul 2016 11:10:03 +0000 (13:10 +0200)]
main: memcpy larger chunks in _mesa_propagate_uniforms_to_driver_storage

When possible, do the memcpy on larger blocks. This reduces cycles
spent in _mesa_propagate_uniforms_to_driver_storage from
1.51 % to 0.62% according to perf during the Unigine Heaven benchmark.
It did not affect the framerate of the benchmark. The system used for
testing was an i5 6600K with a Radeon R9 380.

Piglit hangs randomly on this system both with and without the patch
so i could not make a comparison.

v2: fixed whitespace

Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agost/va: enable h264 VAAPI encode
Boyuan Zhang [Thu, 21 Jul 2016 23:40:22 +0000 (19:40 -0400)]
st/va: enable h264 VAAPI encode

Enable H.264 VAAPI encoding through config. Currently only H.264 baseline is supported. Encode entrypoint is not accepted by driver.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
7 years agost/va: add function to handle misc param type frame rate
Boyuan Zhang [Thu, 21 Jul 2016 23:40:21 +0000 (19:40 -0400)]
st/va: add function to handle misc param type frame rate

Frame rate can be passed to driver either through VAEncSequenceParameterBufferType or VAEncMiscParameterTypeFrameRate. Previous code only implement the former one, which is used by Gstreamer-Vaapi. Now adding implementation for VAEncMiscParameterTypeFrameRate. Also adding default frame rate as 30 just in case application never provides frame rate information to driver.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
7 years agost/va: add enviromental variable to disable interlace
Boyuan Zhang [Thu, 21 Jul 2016 23:40:20 +0000 (19:40 -0400)]
st/va: add enviromental variable to disable interlace

Add environmental variable to disable interlace mode. At VAAPI decoding stage, driver can not distinguish b/w pure decoding case and transcoding case. And since interlace encoding is not supported, we have to disable interlace for transcoding case. The temporary solution is to use enviromental variable to disable interlace mode.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
7 years agost/va: add preset values for VAAPI encode
Boyuan Zhang [Thu, 21 Jul 2016 23:40:19 +0000 (19:40 -0400)]
st/va: add preset values for VAAPI encode

Add some hardcoded values hardware needs mainly for rate control purpose. With previously hardcoded values for OMX, the rate control result is not correct. This change fixed the rate control result by setting correct values for Vaapi.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
7 years agost/va: add functions for VAAPI encode
Boyuan Zhang [Thu, 21 Jul 2016 23:40:18 +0000 (19:40 -0400)]
st/va: add functions for VAAPI encode

Add necessary functions/changes for VAAPI encoding to buffer and picture. These changes will allow driver to handle all Vaapi encode related operations. This patch doesn't change the Vaapi decode behaviour.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
7 years agost/va: get rate control method from configattrib v2
Boyuan Zhang [Thu, 21 Jul 2016 23:40:17 +0000 (19:40 -0400)]
st/va: get rate control method from configattrib v2

Rate control method is passed from app to driver through config attrib list.
That is why we need to store this rate control method to config. And later
on, we will pass this value to context->desc.h264enc.rate_ctrl.rate_ctrl_method.

v2 (chk): fix broken build and commit message

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add conversion for yv12 to nv12in putimage v2
Boyuan Zhang [Thu, 21 Jul 2016 23:40:16 +0000 (19:40 -0400)]
st/va: add conversion for yv12 to nv12in putimage v2

For putimage call, if image format is yv12 (or IYUV with U V field swap) and
surface format is nv12, then we need to convert yv12 to nv12 and then copy
the converted data from image to surface. We can't use the existing logic
where surface is destroyed and re-created with yv12 format.

v2 (chk): fix some compiler warnings and commit message

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
7 years agovl/util: add copy func for yv12image to nv12surface v2
Boyuan Zhang [Thu, 21 Jul 2016 23:40:15 +0000 (19:40 -0400)]
vl/util: add copy func for yv12image to nv12surface v2

Add function to copy from yv12 image to nv12 surface for VAAPI putimage call.
We need this function in VaPutImage call where copying from yv12 image to nv12
surface for encoding. Existing function can't be used because it only work for
copying from yv12 surface to nv12 image in Vaapi.

v2: cleanup variable types and commit message

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add encode entrypoint v2
Boyuan Zhang [Thu, 21 Jul 2016 23:40:14 +0000 (19:40 -0400)]
st/va: add encode entrypoint v2

VAAPI passes PIPE_VIDEO_ENTRYPOINT_ENCODE as entry point for encoding case. We
will save this encode entry point in config. config_id was used as profile
previously. Now, config has both profile and entrypoint field, and config_id is
used to get the config object. Later on, we pass this entrypoint to
context->templat.entrypoint instead of always hardcoded to
PIPE_VIDEO_ENTRYPOINT_BITSTREAM for decoding case previously. Encode entrypoint
is not accepted by driver until we enable Vaapi encode in later patch.

v2 (chk): fix commit message to match 80 chars, use switch instead of ifs,
  fix memory leaks in the error path, implement vlVaQueryConfigEntrypoints
  as well, drop VAEntrypointEncPicture (only used for JPEG).

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
7 years agonvc0: upload sample locations on GM20x
Samuel Pitoiset [Sun, 24 Jul 2016 22:02:12 +0000 (00:02 +0200)]
nvc0: upload sample locations on GM20x

This fixes a bunch of multisample piglit tests on GM206, like
bin/arb_texture_multisample-texelfetch 2 -auto -fbo

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agofreedreno/a4xx: time-elapsed query should be active for clears
Rob Clark [Sun, 24 Jul 2016 13:32:09 +0000 (09:32 -0400)]
freedreno/a4xx: time-elapsed query should be active for clears

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agonvc0/ir: fix up an assertion in emitUADD()
Samuel Pitoiset [Sat, 23 Jul 2016 01:08:34 +0000 (03:08 +0200)]
nvc0/ir: fix up an assertion in emitUADD()

It's illegal to have neg modifiers on both sources for OP_ADD,
and it's illegal to have OP_SUB with just src0 neg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agonvc0: fix wrong indentation in nvc0_validate_fb()
Samuel Pitoiset [Sat, 23 Jul 2016 22:28:11 +0000 (00:28 +0200)]
nvc0: fix wrong indentation in nvc0_validate_fb()

Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoglsl: reuse main extension table to appropriately restrict extensions
Ilia Mirkin [Sun, 12 Jun 2016 22:56:43 +0000 (18:56 -0400)]
glsl: reuse main extension table to appropriately restrict extensions

Previously we were only restricting based on ES/non-ES-ness and whether
the overall enable bit had been flipped on. However we have been adding
more fine-grained restrictions, such as based on compat profiles, as
well as specific ES versions. Most of the time this doesn't matter, but
it can create awkward situations and duplication of logic.

Here we separate the main extension table into a separate object file,
linked to the glsl compiler, which makes use of it with a custom
function which takes the ES-ness of the shader into account (thus
allowing desktop shaders to properly use ES extensions that would
otherwise have been disallowed.) We can also now use this logic to
generate #define's for all supported extensions automatically, removing
the duplicate (and often inaccurate) list in glcpp.

The effect of this change should be nil in most cases. However in some
situations, extensions like GL_ARB_gpu_shader5 which were formerly
available in compat contexts on the GLSL side of things will now become
inaccessible.

This regresses two ES CTS tests:

  ES3-CTS.shaders.shader_integer_mix.define
  ES31-CTS.shader_integer_mix.define

however that is due to them using #version 100 instead of 300 es. As the
extension is only defined for ES3, I believe this is the correct
behavior.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v2)
v2 -> v3: integrate glcpp defines into the same mechanism

7 years agofreedreno/a4xx: timestamp queries
Rob Clark [Sun, 14 Feb 2016 16:14:06 +0000 (11:14 -0500)]
freedreno/a4xx: timestamp queries

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: hw timestamp support
Rob Clark [Tue, 23 Feb 2016 17:03:43 +0000 (12:03 -0500)]
freedreno: hw timestamp support

If the kernel supports it, use hw counter for timestamps.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno: prep work for timestamp queries
Rob Clark [Tue, 1 Mar 2016 15:45:32 +0000 (10:45 -0500)]
freedreno: prep work for timestamp queries

We need "NULL" state to be a valid bit in the bitmask, because timestamp
queries are not restricted to draw/etc stages (ie. the only commands to
submit may just be to read the timestamp).  And just because there are
no draws, isn't a reason to skip the flush and return zero.

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agoradeonsi: ensure sample locations are set for line and polygon smoothing
Nicolai Hähnle [Sat, 16 Jul 2016 18:41:18 +0000 (20:41 +0200)]
radeonsi: ensure sample locations are set for line and polygon smoothing

Since commit d938b8c, the sample locations are no longer set unconditionally,
so we need to set the atom to dirty on all chips, not just Polaris.

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
7 years agoradeonsi: fix Polaris MSAA regression
Nicolai Hähnle [Sat, 16 Jul 2016 18:37:29 +0000 (20:37 +0200)]
radeonsi: fix Polaris MSAA regression

The regression was introduced by commit d938b8c. The problem here is that in
order to use the small primitive filter, we need to explicitly set the sample
locations to 0. But the DB doesn't properly process the change of sample
locations without a flush, and so we can end up with incorrect Z values.

Instead of doing a flush, just disable the small primitive filter when MSAA
is force-disabled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96908
Cc: 12.0 <mesa-stable@lists.freedesktop.org>
7 years agofreedreno/ir3: Add missing braces in initializer
francians@gmail.com [Wed, 20 Jul 2016 07:49:34 +0000 (09:49 +0200)]
freedreno/ir3: Add missing braces in initializer

Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agofreedreno/a2xx: silence missing case 'SHADER_COMPUTE' warning (v2)
francians@gmail.com [Fri, 22 Jul 2016 06:28:46 +0000 (08:28 +0200)]
freedreno/a2xx: silence missing case 'SHADER_COMPUTE' warning (v2)

v2: no need for break after an unreachable (Matt Turner)

Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
7 years agoradeonsi: implement buffer_subdata without indirect calls
Marek Olšák [Sat, 16 Jul 2016 19:52:20 +0000 (21:52 +0200)]
radeonsi: implement buffer_subdata without indirect calls

There is less noise in CPU profile data now.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium/util: don't modify usage in pipe_buffer_write
Marek Olšák [Sun, 17 Jul 2016 12:34:50 +0000 (14:34 +0200)]
gallium/util: don't modify usage in pipe_buffer_write

All drivers were already doing it except virgl.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium: split transfer_inline_write into buffer and texture callbacks
Marek Olšák [Sat, 16 Jul 2016 19:19:48 +0000 (21:19 +0200)]
gallium: split transfer_inline_write into buffer and texture callbacks

to reduce the call indirections with u_resource_vtbl.

The worst call tree you could get was:
  - u_transfer_inline_write_vtbl
    - u_default_transfer_inline_write
      - u_transfer_map_vtbl
        - driver_transfer_map
      - u_transfer_unmap_vtbl
        - driver_transfer_unmap

That's 6 indirect calls. Some drivers only had 5. The goal is to have
1 indirect call for drivers that care. The resource type can be determined
statically at most call sites.

The new interface is:
  pipe_context::buffer_subdata(ctx, resource, usage, offset, size, data)
  pipe_context::texture_subdata(ctx, resource, level, usage, box, data,
                                stride, layer_stride)

v2: fix whitespace, correct ilo's behavior

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
7 years agonir: Lower interp_var_at_* like a normal load_var for flat inputs.
Kenneth Graunke [Fri, 22 Jul 2016 00:42:01 +0000 (17:42 -0700)]
nir: Lower interp_var_at_* like a normal load_var for flat inputs.

"flat centroid" and "flat sample" both just mean "flat", so we should
ignore interpolateAtCentroid/Sample and just return the flat value.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97032
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agomesa: Don't call GenerateMipmap if Width or Height == 0.
Kenneth Graunke [Fri, 22 Jul 2016 05:13:38 +0000 (22:13 -0700)]
mesa: Don't call GenerateMipmap if Width or Height == 0.

One of the WebGL 2.0 conformance tests is trying to call
glGenerateMipmaps with a width and height of 0.  With the meta
implementation, this generates a "framebuffer attachment incomplete"
status, and falls back to the CPU path, calling MapTextureImage.

Except that there's no actual texture to map, and we assert fail.

There's no work to do in this case.  The test expects it to succeed,
so just return early with no error and avoid hassling the driver.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96911
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
7 years agoanv/pipeline: Set up point coord enables
Jason Ekstrand [Fri, 22 Jul 2016 22:59:22 +0000 (15:59 -0700)]
anv/pipeline: Set up point coord enables

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
7 years agospirv/nir: Add support for ImageQuerySamples
Jason Ekstrand [Thu, 21 Jul 2016 20:15:59 +0000 (13:15 -0700)]
spirv/nir: Add support for ImageQuerySamples

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Handle texture projectors
Jason Ekstrand [Thu, 21 Jul 2016 19:01:46 +0000 (12:01 -0700)]
spirv/nir: Handle texture projectors

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agonir/spirv: Refactor coordinate handling in handle_texture
Jason Ekstrand [Thu, 21 Jul 2016 19:01:35 +0000 (12:01 -0700)]
nir/spirv: Refactor coordinate handling in handle_texture

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Refactor type handling in handle_texture
Jason Ekstrand [Thu, 21 Jul 2016 18:56:09 +0000 (11:56 -0700)]
spirv/nir: Refactor type handling in handle_texture

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Move opcode selection higher up in handle_texture
Jason Ekstrand [Thu, 21 Jul 2016 18:47:44 +0000 (11:47 -0700)]
spirv/nir: Move opcode selection higher up in handle_texture

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agoanv/image: Assert that the image format is actually supported
Jason Ekstrand [Thu, 21 Jul 2016 04:10:20 +0000 (21:10 -0700)]
anv/image: Assert that the image format is actually supported

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Don't increment coord_components for array lod queries
Jason Ekstrand [Thu, 21 Jul 2016 03:57:37 +0000 (20:57 -0700)]
spirv/nir: Don't increment coord_components for array lod queries

For lod query instructions, we really don't care whether or not the sampler
is an array type because that doesn't factor into the LOD.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agoi965: Get rid of the do_lower_unnormalized_offsets pass
Jason Ekstrand [Thu, 21 Jul 2016 20:07:17 +0000 (13:07 -0700)]
i965: Get rid of the do_lower_unnormalized_offsets pass

We can do this in NIR now.  No need to keep a GLSL pass lying around for
it.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agoi965/nir: Enable NIR lowering of txf and rect offsets
Jason Ekstrand [Thu, 21 Jul 2016 19:55:21 +0000 (12:55 -0700)]
i965/nir: Enable NIR lowering of txf and rect offsets

This fixes the following piglit tests on gen6+:

tex-miplevel-selection textureProjGradOffset 2DRect
tex-miplevel-selection textureGradOffset 2DRect
tex-miplevel-selection textureGradOffset 2DRectShadow
tex-miplevel-selection textureProjGradOffset 2DRect_ProjVec4
tex-miplevel-selection textureProjGradOffset 2DRectShadow

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agonir/lower_tex: Add support for lowering coordinate offsets
Jason Ekstrand [Thu, 21 Jul 2016 03:32:31 +0000 (20:32 -0700)]
nir/lower_tex: Add support for lowering coordinate offsets

On i965, we can't support coordinate offsets for texelFetch or rectangle
textures.  Previously, we were doing this with a GLSL pass but we need to
do it in NIR if we want those workarounds for SPIR-V.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agonir/lower_tex: Add some helpers for working with tex sources
Jason Ekstrand [Thu, 21 Jul 2016 03:40:43 +0000 (20:40 -0700)]
nir/lower_tex: Add some helpers for working with tex sources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agonir: Add a helper for determining the type of a texture source
Jason Ekstrand [Wed, 4 May 2016 03:18:50 +0000 (20:18 -0700)]
nir: Add a helper for determining the type of a texture source

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agoanv/pipeline: Set binding_table.gather_texture_start
Jason Ekstrand [Thu, 21 Jul 2016 03:06:09 +0000 (20:06 -0700)]
anv/pipeline: Set binding_table.gather_texture_start

This should get texture gather working on gen8+ and mostly working on gen7.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Properly handle gather components
Jason Ekstrand [Thu, 21 Jul 2016 02:56:45 +0000 (19:56 -0700)]
spirv/nir: Properly handle gather components

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Add support for shadow samplers that return vec4
Jason Ekstrand [Thu, 21 Jul 2016 02:55:51 +0000 (19:55 -0700)]
spirv/nir: Add support for shadow samplers that return vec4

While SPIR-V technically doesn't support "old style" shadow, the
shadow-compare gather instruction does return a vec4 so we need to be able
to set the old_style_shadow bit in NIR.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agospirv/nir: Fix some texture opcode asserts
Jason Ekstrand [Thu, 21 Jul 2016 02:23:17 +0000 (19:23 -0700)]
spirv/nir: Fix some texture opcode asserts

We can't get an lod with txf_ms and SPIR-V considers textureGrad to be an
explicit-LOD texturing instruction.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
7 years agonv50/ir: allow to swap sources for OP_SUB
Samuel Pitoiset [Wed, 20 Jul 2016 18:07:35 +0000 (20:07 +0200)]
nv50/ir: allow to swap sources for OP_SUB

This allows the load-propagation pass to swap the sources in presence
of immediate values.

Maxwell (GM107):

total instructions in shared programs :1928187 -> 1927634 (-0.03%)
total gprs used in shared programs    :330741 -> 330154 (-0.18%)
total local used in shared programs   :28032 -> 28032 (0.00%)

                local        gpr       inst      bytes
    helped           0         271         425         425
      hurt           0           0         194         194

Fermi (GF114):

total instructions in shared programs :2334474 -> 2333829 (-0.03%)
total gprs used in shared programs    :380934 -> 380215 (-0.19%)
total local used in shared programs   :33304 -> 33264 (-0.12%)

                local        gpr       inst      bytes
    helped           5         314         521         521
      hurt           0           4         195         195

No regressions on GM107 and GF114 with full piglit.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agogallium/radeon: make deferred flushes asynchronous
Marek Olšák [Fri, 15 Jul 2016 13:51:34 +0000 (15:51 +0200)]
gallium/radeon: make deferred flushes asynchronous

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
7 years agogallium: add PIPE_FLUSH_DEFERRED
Marek Olšák [Fri, 15 Jul 2016 13:44:29 +0000 (15:44 +0200)]
gallium: add PIPE_FLUSH_DEFERRED

There are 2 uses:
- Asynchronous flushing for multithreaded drivers.
- Return a fence without flushing (mid-command-buffer fence). The driver
  can defer flushing until fence_finish is called.

This is required to make Bioshock Infinite faster, which creates
1000 fences (flushes) per frame.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
7 years agogallium/os: use CLOCK_MONOTONIC for sleeps (v2)
Marek Olšák [Sat, 16 Jul 2016 16:38:21 +0000 (18:38 +0200)]
gallium/os: use CLOCK_MONOTONIC for sleeps (v2)

v2: handle EINTR, remove backslashes

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomapi: fix typo in macro name
Eric Engestrom [Fri, 22 Jul 2016 09:24:03 +0000 (10:24 +0100)]
mapi: fix typo in macro name

Fixes: 5ec140c17b54c2592009 ("mapi: Massage code to allow clang to compile.")
Reported-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agodocs: Put swr back on the GL_ARB_texture_buffer_object_rgb32 list.
Kenneth Graunke [Fri, 22 Jul 2016 16:56:53 +0000 (09:56 -0700)]
docs: Put swr back on the GL_ARB_texture_buffer_object_rgb32 list.

Looks like this was lost when resolving merge conflicts in
commit d1fbd4cdb1bdb8041362a8e5f05833c43a39c9a6.

7 years agoglsl: subroutine types cannot be compared
Andres Gomez [Mon, 18 Jul 2016 13:39:43 +0000 (16:39 +0300)]
glsl: subroutine types cannot be compared

subroutine variables are to be used just in the way functions are
called. Although the spec doesn't say it explicitely, this means that
these variables are not to be used in any other way than those left
for function calls. Therefore, a comparison between 2 subroutine
variables should also cause a compilation error.

From The OpenGL® Shading Language 4.40, page 117:

  "  To use subroutines, a subroutine type is declared, one or more
     functions are associated with that subroutine type, and a
     subroutine variable of that type is declared. The function
     currently assigned to the variable function is then called by
     using function calling syntax replacing a function name with the
     name of the subroutine variable. Subroutine variables are
     uniforms, and are assigned to specific functions only through
     commands (UniformSubroutinesuiv) in the OpenGL API."

From The OpenGL® Shading Language 4.40, page 118:

  "  Subroutine uniform variables are called the same way functions
     are called. When a subroutine variable (or an element of a
     subroutine variable array) is associated with a particular
     function, all function calls through that variable will call that
     particular function."

Fixes GL44-CTS.shader_subroutine.subroutines_cannot_be_assigned_float_int_values_or_be_compared

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
7 years agoi965: fix varying output setup
Timothy Arceri [Fri, 22 Jul 2016 13:19:09 +0000 (23:19 +1000)]
i965: fix varying output setup

Since 7f53fead5c we treat every location as using all
four components so we only need special handling for
doubles when they cross multiple locations.

This fixes a crash in GL45-CTS.enhanced_layouts.varying_locations
where the outputs array would overflow when a dmat2 was stored at
the max varying location i.e 30.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agonvc0/mme: fix offsets used for indirect draws
Samuel Pitoiset [Thu, 21 Jul 2016 20:15:53 +0000 (22:15 +0200)]
nvc0/mme: fix offsets used for indirect draws

This fixes a regression introduced in
1da704a94c57aa0b0cf8faaa3236fe47dfb8f88c because the offset has moved
from 0x180 to 0x1a0, and the macros have to be re-compiled.

Fixes: 1da704a ("nvc0: increase the tex handles area size in the driver")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agonvc0: fix offsets of MP perf counters input parameters
Samuel Pitoiset [Thu, 21 Jul 2016 20:15:52 +0000 (22:15 +0200)]
nvc0: fix offsets of MP perf counters input parameters

This fixes a regression introduced in
1da704a94c57aa0b0cf8faaa3236fe47dfb8f88c because the offset has moved
from 0x600 to 0x620, and the kernels used for reading MP perf counters
have to be re-assembled.

This also fixes amd_performance_monitor_measure piglit.

Fixes: 1da704a ("nvc0: increase the tex handles area size in the driver")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agomesa: Add GL_BGRA_EXT to the list of GenerateMipmap internal formats.
Kenneth Graunke [Thu, 21 Jul 2016 23:48:05 +0000 (16:48 -0700)]
mesa: Add GL_BGRA_EXT to the list of GenerateMipmap internal formats.

The GL_EXT_texture_format_BGRA8888 extension specification defines a
GL_BGRA_EXT unsized internal format (which is a little odd - usually
BGRA is a pixel transfer format).  The extension is written against
the ES 1.0 specification, so it's a little hard to map, but I believe
it's effectively adding it to the table used here, so we should allow
it here as well.

Note that GL_EXT_texture_format_BGRA8888 is always enabled (dummy_true),
so we don't need to check if it's enabled here.

This fixes mipmap generation in Skia and ChromeOS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
References: https://bugs.chromium.org/p/chromium/issues/detail?id=630371
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Stéphane Marchesin <marcheu@chromium.org>
Cc: mesa-stable@lists.freedesktop.org
7 years agoi965: Fix "operation operation" in comment.
Kenneth Graunke [Fri, 22 Jul 2016 04:28:15 +0000 (21:28 -0700)]
i965: Fix "operation operation" in comment.

From the redundant redundant department.

Reported-by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>