mesa.git
8 years agoegl/x11: handle when invalid drawable is passed in create_surface
Emil Velikov [Thu, 18 Jun 2015 19:39:28 +0000 (20:39 +0100)]
egl/x11: handle when invalid drawable is passed in create_surface

0 is not used as a valid drawable id, as such there is no point in
attempting to query its geometry. Just bail out early and provide the
more meaningful EGL_BAD_NATIVE_WINDOW to the user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoegl/wayland: cleanup dri2_wl_create_surface error path
Emil Velikov [Thu, 18 Jun 2015 19:22:54 +0000 (20:22 +0100)]
egl/wayland: cleanup dri2_wl_create_surface error path

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoegl/wayland: handle NULL native_window in create_surface
Emil Velikov [Thu, 18 Jun 2015 19:19:32 +0000 (20:19 +0100)]
egl/wayland: handle NULL native_window in create_surface

Raise EGL_BAD_NATIVE_WINDOW instead of crashing.

v2: s/Rise/Raise/ (spotted by Michel)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoegl/drm: plug memory leak
Emil Velikov [Thu, 18 Jun 2015 19:16:46 +0000 (20:16 +0100)]
egl/drm:  plug memory leak

Free the memory for dri2_surf in the unlikely case that one provides
NULL for native_window. Also set the relevant EGL_ERROR to provide
feedback to the user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agogallium/ttn: don't upset nir_validate w/ BRK's
Rob Clark [Fri, 26 Jun 2015 18:24:08 +0000 (14:24 -0400)]
gallium/ttn: don't upset nir_validate w/ BRK's

Previously we were unconditionally doing ttn_get_src() even for
instructions with no src's.  Which created a lot of unnecessary
load_const instructions.  These were mostly harmless since NIR opt
passes would strip them back out.  But for an ENDIF following a
BRK, it would result in load_const instructions created after the
NIR break instruction.  Which nir_validate dislikes.

But we can actually just dtrt by using NumSrcRegs instead.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agogallium/ttn: add TXB2
Rob Clark [Fri, 26 Jun 2015 17:48:29 +0000 (13:48 -0400)]
gallium/ttn: add TXB2

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agogallium/ttn: partial fix for output arrays
Rob Clark [Sat, 27 Jun 2015 13:58:28 +0000 (09:58 -0400)]
gallium/ttn: partial fix for output arrays

It isn't quite yet practical to enable TGSI_ANY_INOUT_DECL_RANGE shader
cap yet, at least not in drivers that need lower_to_scalar pass (which
right now is all of the ttn users), since the register arrays do not get
converted to SSA, which angers nir_lower_alu_to_scalar.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
8 years agonir: cleanup open-coded instruction casts
Rob Clark [Sat, 27 Jun 2015 14:07:18 +0000 (10:07 -0400)]
nir: cleanup open-coded instruction casts

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agofreedreno/ir3: cache defining instruction
Rob Clark [Mon, 29 Jun 2015 18:49:08 +0000 (14:49 -0400)]
freedreno/ir3: cache defining instruction

It is silly to traverse back to find first instruction that writes part
of a larger "virtual" register many times per instruction (plus per use
as a src to later instructions).  Cache this information so we only
figure it out once.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fix RA issue with fanin
Rob Clark [Sun, 28 Jun 2015 15:13:58 +0000 (11:13 -0400)]
freedreno/ir3: fix RA issue with fanin

The fanin source could be grouped, for example with shaders like:

    VERT
    DCL IN[0]
    DCL IN[1]
    DCL OUT[0], POSITION
    DCL OUT[1], GENERIC[9]
    DCL SAMP[0]
    DCL SVIEW[0], 2D, FLOAT
    DCL TEMP[0], LOCAL
      0: MOV TEMP[0].xy, IN[1].xyyy
      1: MOV TEMP[0].w, IN[1].wwww
      2: TXF TEMP[0], TEMP[0], SAMP[0], 2D
      3: MOV OUT[1], TEMP[0]
      4: MOV OUT[0], IN[0]
      5: END

The second arg to the isaml is IN[1].w, so we need to look at the fanin
source to get the correct offset.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: add ir3_shader_disasm()
Rob Clark [Mon, 29 Jun 2015 14:21:08 +0000 (10:21 -0400)]
freedreno/ir3: add ir3_shader_disasm()

Split out most of dump_info() from ir3_cmdline compiler into a function
that can be used both by cmdline compiler and also for the disasm debug
option.  This way, for FD_MESA_DEBUG=disasm we also get to see intput/
output registers, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/a4xx: fix for sparse-samplers
Rob Clark [Fri, 26 Jun 2015 17:55:49 +0000 (13:55 -0400)]
freedreno/a4xx: fix for sparse-samplers

Some piglit tests, like arb_fragment_program-sparse-samplers, result in
having a null samp#0 but valid samp#1.

TODO: a3xx probably needs similar fix

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fix crash in fail path
Rob Clark [Fri, 26 Jun 2015 17:38:03 +0000 (13:38 -0400)]
freedreno/ir3: fix crash in fail path

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fix crash in RA
Rob Clark [Fri, 26 Jun 2015 18:32:08 +0000 (14:32 -0400)]
freedreno/ir3: fix crash in RA

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fixes for indirect writes
Rob Clark [Fri, 26 Jun 2015 14:52:34 +0000 (10:52 -0400)]
freedreno/ir3: fixes for indirect writes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agofreedreno/ir3: fix constlen in case of load_uniform_indirect
Rob Clark [Wed, 24 Jun 2015 22:57:22 +0000 (18:57 -0400)]
freedreno/ir3: fix constlen in case of load_uniform_indirect

We can't rely on what we get from the assembler if we have indirect
addressing of constant file, since the assembler doesn't know the array
index.  This got lost in the transition to NIR.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
8 years agoglsl: validate sampler array indexing for 'constant-index-expression'
Tapani Pälli [Tue, 19 May 2015 12:01:49 +0000 (15:01 +0300)]
glsl: validate sampler array indexing for 'constant-index-expression'

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

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
8 years agomesa/st: use EmitNoIndirectSampler if !ARB_gpu_shader5
Tapani Pälli [Mon, 29 Jun 2015 06:48:52 +0000 (09:48 +0300)]
mesa/st: use EmitNoIndirectSampler if !ARB_gpu_shader5

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
8 years agoi915: use EmitNoIndirectSampler
Tapani Pälli [Mon, 29 Jun 2015 06:53:45 +0000 (09:53 +0300)]
i915: use EmitNoIndirectSampler

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
8 years agoi965: use EmitNoIndirectSampler for gen < 7
Tapani Pälli [Wed, 24 Jun 2015 10:22:43 +0000 (13:22 +0300)]
i965: use EmitNoIndirectSampler for gen < 7

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
8 years agomesa/glsl: new compiler option EmitNoIndirectSampler
Tapani Pälli [Tue, 9 Jun 2015 10:33:39 +0000 (13:33 +0300)]
mesa/glsl: new compiler option EmitNoIndirectSampler

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

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

v2: change option name as EmitNoIndirectSampler

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
8 years agoglsl: Allow dynamic sampler array indexing with GLSL ES < 3.00
Tapani Pälli [Tue, 9 Jun 2015 10:28:44 +0000 (13:28 +0300)]
glsl: Allow dynamic sampler array indexing with GLSL ES < 3.00

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

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

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84225

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91056
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
8 years agoi965: Don't use GCC extension for ?: with only two operands.
Kenneth Graunke [Wed, 24 Jun 2015 06:57:31 +0000 (23:57 -0700)]
i965: Don't use GCC extension for ?: with only two operands.

From the "apparently I don't know C" files...GCC apparently supports:

    x ?: y

which is equivalent to

    x ? x : y

except that it doesn't cause side-effects to occur twice.  See:
https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html#Conditionals

This was confusing and looked like a typo.  It doesn't really buy us
anything, so just write the obvious code in normal C.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agoegl/haiku: fix Mesa build under Haiku
Alexander von Gluck IV [Tue, 30 Jun 2015 04:29:44 +0000 (23:29 -0500)]
egl/haiku: fix Mesa build under Haiku

Performing a goto crosses the initialization of 'BWindow* win'
breaking the build. We also fix a missing semicolon.

8 years agonv30: align transfer stride to 64, required by blit, sifm transfer impls
Ilia Mirkin [Tue, 30 Jun 2015 01:58:54 +0000 (21:58 -0400)]
nv30: align transfer stride to 64, required by blit, sifm transfer impls

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv30: allow vertex state creation with 0 elements
Ilia Mirkin [Tue, 30 Jun 2015 01:58:11 +0000 (21:58 -0400)]
nv30: allow vertex state creation with 0 elements

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv30: reset fragprog bufctx at bind time
Ilia Mirkin [Mon, 29 Jun 2015 06:38:38 +0000 (02:38 -0400)]
nv30: reset fragprog bufctx at bind time

A clear will do a partial validate, which will in turn reference all the
buffers in the bufctx again. However the fragprog last validated might
have already been deleted. So reset the bufctx when updating state.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv30: modernize fp upload logic
Ilia Mirkin [Mon, 29 Jun 2015 06:16:23 +0000 (02:16 -0400)]
nv30: modernize fp upload logic

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv30: provide a minimum map buffer alignment
Ilia Mirkin [Tue, 30 Jun 2015 02:04:50 +0000 (22:04 -0400)]
nv30: provide a minimum map buffer alignment

Otherwise we return 0, which is out of spec. Return 64 like all the
other nouveau drivers.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965/skl: Extract the blit command setup in to a helper
Anuj Phogat [Thu, 28 May 2015 02:28:34 +0000 (19:28 -0700)]
i965/skl: Extract the blit command setup in to a helper

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/gen9: Add XY_FAST_COPY_BLT support to intelEmitCopyBlit()
Anuj Phogat [Wed, 15 Apr 2015 05:06:49 +0000 (22:06 -0700)]
i965/gen9: Add XY_FAST_COPY_BLT support to intelEmitCopyBlit()

This patch enables using XY_FAST_COPY_BLT only for Yf/Ys tiled buffers.
It can be later turned on for other tiling patterns (X,Y) too.

V3: Flush in between sequential fast copy blits.
    Fix src/dst alignment requirements.
    Make can_fast_copy_blit() helper.
    Use ffs(), is_power_of_two()
    Move overlap computation inside intel_miptree_blit().

V4: Use _mesa_regions_overlap() function.
    Add check for src_buffer == dst_buffer.
    Simplify horizontal and vertical alignment computations.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agomesa/swrast: Use global function _mesa_regions_overlap()
Anuj Phogat [Tue, 9 Jun 2015 22:18:13 +0000 (15:18 -0700)]
mesa/swrast: Use global function _mesa_regions_overlap()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa/st: Use global function _mesa_regions_overlap()
Anuj Phogat [Sat, 6 Jun 2015 02:23:46 +0000 (19:23 -0700)]
mesa/st: Use global function _mesa_regions_overlap()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa: Add a new helper function _mesa_regions_overlap()
Anuj Phogat [Sat, 6 Jun 2015 02:18:19 +0000 (19:18 -0700)]
mesa: Add a new helper function _mesa_regions_overlap()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoi965/gen9: Allocate YF/YS tiled buffer objects
Anuj Phogat [Wed, 15 Apr 2015 05:06:48 +0000 (22:06 -0700)]
i965/gen9: Allocate YF/YS tiled buffer objects

In case of I915_TILING_{X,Y} we need to pass tiling format to libdrm
using drm_intel_bo_alloc_tiled(). But, In case of YF/YS tiled buffers
libdrm need not know about the tiling format because these buffers
don't have hardware support to be tiled or detiled through a fenced
region. libdrm still need to know buffer alignment value for its use
in kernel when resolving the relocation.

Using drm_intel_bo_alloc_for_render() for YF/YS tiled buffers
satisfy both the above conditions.

V2: Delete min/max buffer size restrictions not valid for i965+.
    Remove redundant align to tile size statements.
    Remove some redundant code now when there are no min/max buffer size.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Make a helper function intel_miptree_can_use_tr_mode()
Anuj Phogat [Fri, 5 Jun 2015 17:56:40 +0000 (10:56 -0700)]
i965: Make a helper function intel_miptree_can_use_tr_mode()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Make a helper function intel_miptree_release_levels()
Anuj Phogat [Fri, 5 Jun 2015 17:41:24 +0000 (10:41 -0700)]
i965: Make a helper function intel_miptree_release_levels()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965/gen9: Plugin the code for selecting YF/YS tiling on skl+
Anuj Phogat [Wed, 15 Apr 2015 05:06:49 +0000 (22:06 -0700)]
i965/gen9: Plugin the code for selecting YF/YS tiling on skl+

Buffers with Yf/Ys tiling end up using meta upload / download
paths or the blitter for cases where they used tiled_memcpy paths
in case of Y tiling. This has exposed some bugs in meta path. To
avoid any piglit regressions on SKL this patch keeps the Yf/Ys
tiling disabled at the moment.

V3: Make brw_miptree_choose_tr_mode() actually choose TRMODE. (Ben)
    Few cosmetic changes.
V4: Get rid of brw_miptree_choose_tr_mode().
    Take care of all tile resource modes {Yf, Ys, none} for all
    generations at one place.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agoi965: Make a helper function intel_miptree_set_alignment()
Anuj Phogat [Thu, 4 Jun 2015 23:57:02 +0000 (16:57 -0700)]
i965: Make a helper function intel_miptree_set_alignment()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agomesa/main: free locale at exit
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:09 +0000 (14:51 +0200)]
mesa/main: free locale at exit

In order to save a small leak if mesa is continously loaded and
unloaded, let's free the locale when the shared object is unloaded.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoutil: port _mesa_strto[df] to C
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:08 +0000 (14:51 +0200)]
util: port _mesa_strto[df] to C

_mesa_strtod and _mesa_strtof are only used from the GLSL compiler and
the ARB_[vertex|fragment]_program code, meaning that the locale doesn't
need to be initialized before the first OpenGL context gets initialized.

So let's use explicit initialization from the one-time init code instead
of depending on a C++ compiler to initialize at image-load time.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoglsl: No need to lock in _mesa_glsl_release_types
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:07 +0000 (14:51 +0200)]
glsl: No need to lock in _mesa_glsl_release_types

This function only gets called while mesa is unloading, so there's
no potential of racing or multiple calls at the same time. So let's
just get rid of the locking.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa/main: only call _mesa_destroy_shader_compiler once on exit
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:06 +0000 (14:51 +0200)]
mesa/main: only call _mesa_destroy_shader_compiler once on exit

There's no point in calling _mesa_destroy_shader_compiler multiple
times on exit; the resources will only be released once anyway.

So let's move the atexit-call into the part that is only called
once.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agodri: don't touch the shader compiler
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:05 +0000 (14:51 +0200)]
dri: don't touch the shader compiler

This function is for deleting per-screen resources, and the shader
compiler resources are not of such nature. Besides, dri shouldn't
need to even know about the presence of a shader compiler.

These resources will already be released when mesa gets unloaded,
and that should be sufficient.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa/main: Get rid of outdated GDB-hack
Erik Faye-Lund [Sun, 28 Jun 2015 12:51:04 +0000 (14:51 +0200)]
mesa/main: Get rid of outdated GDB-hack

All of these enums are now in use around in the code, so there's no need
to explicitly use them here any more.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoclover: implement CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
Grigori Goronzy [Thu, 28 May 2015 11:01:51 +0000 (13:01 +0200)]
clover: implement CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

Work-group size should always be aligned to subgroup size; this is a
basic requirement, otherwise some work-items will be no-operation.

It might make sense to refine the value according to a kernel's
resource usage, but that's a possible optimization for the future.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agogallium: add PIPE_COMPUTE_CAP_SUBGROUP_SIZE
Grigori Goronzy [Thu, 28 May 2015 10:40:29 +0000 (12:40 +0200)]
gallium: add PIPE_COMPUTE_CAP_SUBGROUP_SIZE

We need this to implement OpenCL's
CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoi965: Don't try to print the GLSL IR if it has been freed
Neil Roberts [Fri, 26 Jun 2015 16:54:15 +0000 (17:54 +0100)]
i965: Don't try to print the GLSL IR if it has been freed

Since commit 104c8fc2c2aa5621261f8 the GLSL IR will be freed if NIR is
being used. This was causing it to segfault if INTEL_DEBUG=wm is set.
This patch just makes it avoid dumping the GLSL IR in that case.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
8 years agodocs: add news item and link release notes for mesa 10.6.1
Emil Velikov [Mon, 29 Jun 2015 08:03:19 +0000 (09:03 +0100)]
docs: add news item and link release notes for mesa 10.6.1

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agodocs: Add sha256 checksums for the 10.6.1 release
Emil Velikov [Mon, 29 Jun 2015 08:00:24 +0000 (09:00 +0100)]
docs: Add sha256 checksums for the 10.6.1 release

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

8 years agoAdd release notes for the 10.6.1 release
Emil Velikov [Mon, 29 Jun 2015 07:23:14 +0000 (08:23 +0100)]
Add release notes for the 10.6.1 release

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

8 years agoRevert "glsl: clone inputs and outputs during linking"
Kenneth Graunke [Mon, 29 Jun 2015 05:17:16 +0000 (22:17 -0700)]
Revert "glsl: clone inputs and outputs during linking"

This reverts commit c2ff3485b3d48749ea9dcad07bc1a691627dc3e5.

Ilia and I noticed a memory leak caused by this patch: at least with
fixed-function programs, we clone things using ProgramResourceList as
the context before reralloc makes it non-NULL.

I believe Tapani found other bugs with these patches, so I'm just going
to revert them for now and let him pursue them further.

8 years agoRevert "i965: Delete linked GLSL IR when using NIR."
Kenneth Graunke [Mon, 29 Jun 2015 05:17:09 +0000 (22:17 -0700)]
Revert "i965: Delete linked GLSL IR when using NIR."

This reverts commit 104c8fc2c2aa5621261f80aa6b4f76c3163078f1.

8 years agonv30: avoid leaking blit fp/vp
Ilia Mirkin [Mon, 29 Jun 2015 04:23:55 +0000 (00:23 -0400)]
nv30: avoid leaking blit fp/vp

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agonv40: enable base vertex
Ilia Mirkin [Mon, 29 Jun 2015 02:30:27 +0000 (22:30 -0400)]
nv40: enable base vertex

Still appears to have issues with negative indices less than -1M, but
that's a corner case of a corner case.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoi965/vs: Move compute_clip_distance() out of emit_urb_writes().
Kenneth Graunke [Fri, 26 Jun 2015 22:05:13 +0000 (15:05 -0700)]
i965/vs: Move compute_clip_distance() out of emit_urb_writes().

Legacy user clipping (using gl_Position or gl_ClipVertex) is handled by
turning those into the modern gl_ClipDistance equivalents.

This is unnecessary in Core Profile: if user clipping is enabled, but
the shader doesn't write the corresponding gl_ClipDistance entry,
results are undefined.  Hence, it is also unnecessary for geometry
shaders.

This patch moves the call up to run_vs().  This is equivalent for VS,
but removes the need to pass clip distances into emit_urb_writes().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
8 years agoi965: Write at least some data in SIMD8 URB write messages.
Kenneth Graunke [Sat, 30 May 2015 05:40:07 +0000 (22:40 -0700)]
i965: Write at least some data in SIMD8 URB write messages.

According to the "URB SIMD8 Write > Write Data Payload" documentation,
"The write data payload can be between 1 and 8 message phases long."

Apparently, the simulator considers it an error if you issue an URB
SIMD8 message with only a header and no actual data to write.

v2: Try to put in a better PRM citation, now that the Broadwell docs
    actually exist (requested by Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agogallium/hud: prevent NULL pointer dereference with pipe_query functions
Samuel Pitoiset [Wed, 24 Jun 2015 19:11:27 +0000 (21:11 +0200)]
gallium/hud: prevent NULL pointer dereference with pipe_query functions

The HUD doesn't check if query_create() fails and it calls other
pipe_query functions with NULL pointer instead of a valid query object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agonouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.
Mario Kleiner [Fri, 5 Jun 2015 13:36:52 +0000 (15:36 +0200)]
nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.

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

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

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

Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agometa: Only change and restore viewport 0 in mesa meta mode
Mike Stroyan [Fri, 26 Jun 2015 21:15:46 +0000 (15:15 -0600)]
meta: Only change and restore viewport 0 in mesa meta mode

The meta code was setting a default depth range for all viewports
and 'restoring' all viewports to depth range values saved from viewport 0.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoradeonsi: add support for geometry shader invocations.
Dave Airlie [Thu, 25 Jun 2015 02:55:54 +0000 (03:55 +0100)]
radeonsi: add support for geometry shader invocations.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoradeonsi: add support for viewport array (v3)
Dave Airlie [Thu, 25 Jun 2015 02:36:23 +0000 (03:36 +0100)]
radeonsi: add support for viewport array (v3)

This isn't pretty and I'd suggest it the pm4 interface builder
could be tweaked to do this more efficently, but I'd need
guidance on how that would look.

This seems to pass the few piglit tests I threw at it.

v2: handle passing layer/viewport index to fragment shader.
fix crash in blit changes,
add support to io_get_unique_index for layer/viewport index
update docs.
v3: avoid looking up viewport index and layer in es (Marek).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoi965/fs: Fix ir_txs in emit_texture_gen4_simd16().
Kenneth Graunke [Thu, 18 Jun 2015 20:55:52 +0000 (13:55 -0700)]
i965/fs: Fix ir_txs in emit_texture_gen4_simd16().

We were not emitting the LOD, which led to message lengths of 1 instead
of 3.  Setting has_lod makes us emit the LOD, but I had to make changes
to avoid emitting the non-existent coordinate as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91022
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agonv50/ir: propagate modifier to right arg when const-folding mad
Ilia Mirkin [Fri, 26 Jun 2015 19:01:22 +0000 (15:01 -0400)]
nv50/ir: propagate modifier to right arg when const-folding mad

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91117
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
8 years agoegl_dri2: Remove trailing whitespaces
Boyan Ding [Sat, 13 Jun 2015 07:36:27 +0000 (15:36 +0800)]
egl_dri2: Remove trailing whitespaces

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965/skl: Fix aligning mt->total_width to the block size
Neil Roberts [Tue, 16 Jun 2015 12:53:40 +0000 (13:53 +0100)]
i965/skl: Fix aligning mt->total_width to the block size

brw_miptree_layout_2d tries to ensure that mt->total_width is a
multiple of the compressed block size, presumably because it wouldn't
be possible to make an image that has a fraction of a block. However
it was doing this by aligning mt->total_width to align_w. Previously
align_w has been used as a shortcut for getting the block width
because before Gen9 the block width was always equal to the alignment.
Commit 4ab8d59a2 tried to fix these cases to use the block width
instead of the alignment but it missed this case.

I think in practice this probably won't make any difference because
the buffer for the texture will be allocated to be large enough to
contain the entire pitch and libdrm aligns the pitch to the tile width
anyway. However I think the patch is worth having to make the
intention clearer.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agomesa: Enable subdir-objects globally.
Matt Turner [Wed, 10 Jun 2015 23:30:56 +0000 (16:30 -0700)]
mesa: Enable subdir-objects globally.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agomesa: fold duplicated GL/GL_CORE/GLES3 entry in get_hash_params.py
Emil Velikov [Wed, 24 Jun 2015 13:06:33 +0000 (14:06 +0100)]
mesa: fold duplicated GL/GL_CORE/GLES3 entry in get_hash_params.py

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoilo: define ILO_IMAGE_MAX_LEVEL_COUNT
Chia-I Wu [Fri, 26 Jun 2015 03:38:46 +0000 (11:38 +0800)]
ilo: define ILO_IMAGE_MAX_LEVEL_COUNT

Define ILO_IMAGE_MAX_LEVEL_COUNT for ilo_image and remove unnecessary header
includes.

8 years agoilo: replace pipe_format by gen_surface_format
Chia-I Wu [Thu, 25 Jun 2015 14:27:04 +0000 (22:27 +0800)]
ilo: replace pipe_format by gen_surface_format

Replace pipe_format by gen_surface_format in ilo_image.  Change how depth
format is specified in ilo_state_zs.

8 years agoilo: always use the specified image format
Chia-I Wu [Wed, 24 Jun 2015 23:43:47 +0000 (07:43 +0800)]
ilo: always use the specified image format

Move silent promotion of PIPE_FORMAT_ETC1_RGB8 or combined depth/stencil out
of core.

8 years agoilo: replace pipe_texture_target by gen_surface_type
Chia-I Wu [Wed, 24 Jun 2015 14:47:30 +0000 (22:47 +0800)]
ilo: replace pipe_texture_target by gen_surface_type

Replace pipe_texture_target by gen_surface_type in ilo_image.  Change how
GEN6_SURFTYPE_CUBE is specified in ilo_state_surface and ilo_state_zs.

8 years agoilo: initialize ilo_image from ilo_image_info
Chia-I Wu [Wed, 24 Jun 2015 14:46:36 +0000 (22:46 +0800)]
ilo: initialize ilo_image from ilo_image_info

Convert pipe_resource to ilo_image_info for image initialization.

8 years agoilo: remove ilo_image_disable_aux()
Chia-I Wu [Wed, 24 Jun 2015 23:18:31 +0000 (07:18 +0800)]
ilo: remove ilo_image_disable_aux()

Fail resource creation when aux bo allocation fails.

8 years agoilo: improve SURFTYPE_BUFFER validations
Chia-I Wu [Wed, 24 Jun 2015 04:57:57 +0000 (12:57 +0800)]
ilo: improve SURFTYPE_BUFFER validations

Reorganize the validations to make them more systematic.

8 years agoilo: remove ilo_buffer
Chia-I Wu [Fri, 26 Jun 2015 05:08:32 +0000 (13:08 +0800)]
ilo: remove ilo_buffer

Since the addition of ilo_vma, it was used only to pad a bo for sampling
engine surfaces.  Replace it entirely with these functions

  ilo_state_surface_buffer_size()
  ilo_state_vertex_buffer_size()
  ilo_state_index_buffer_size()
  ilo_state_sol_buffer_size()

8 years agoilo: introduce ilo_vma
Chia-I Wu [Wed, 24 Jun 2015 05:59:31 +0000 (23:59 -0600)]
ilo: introduce ilo_vma

This cleans up the code a bit and makes ilo_state_vector_resource_renamed()
simpler and more robust.  It also allows a single bo to back mulitple VMAs.

8 years agomesa: remove unnecessary checks in _mesa_readpixels_needs_slow_path
Iago Toral Quiroga [Tue, 23 Jun 2015 06:42:14 +0000 (08:42 +0200)]
mesa: remove unnecessary checks in _mesa_readpixels_needs_slow_path

readpixels_can_use_memcpy will later call _mesa_format_matches_format_and_type
which does much tighter checks than these to decide if we can use
memcpy for readpixels.

Also, the checks do not seem to be extensive enough anyway, since we are
checking for signed/unsigned conversion only when the framebuffer has integers,
but the same checks could be done for other types anyway, since as long as
there is a signed/unsigned conversion we can't memcpy.

No regressions observed on i965/llvmpipe.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoi965/vec4_live_variables: Do liveness analysis bottom-to-top
Jason Ekstrand [Thu, 25 Jun 2015 15:08:27 +0000 (08:08 -0700)]
i965/vec4_live_variables: Do liveness analysis bottom-to-top

From Muchnick's Advanced Compiler Design and Implementation:

"To determine which variables are live at each point in a flowgraph, we
perform a backward data-flow analysis"

Previously, we were walking the blocks forwards and updating the livein and
then the liveout.  However, the livein calculation depends on the liveout
and the liveout depends on the successor blocks.  The net result is that it
takes one full iteration to go from liveout to livein and then another
full iteration to propagate to the predecessors.  This works out to an
O(n^2) computation where n is the number of blocks.  If we run things in
the other order, it's O(nl) where l is the maximum loop depth which is
practically bounded by 3.

In b2c6ba0c4b21391dc35018e1c8c4f7f7d8952bea, we made this same change in
the FS backend to great effect.  Might as well keep it consistent and make
the same change for vec4.  Also, this took the time to run the test:

ES31-CTS.arrays_of_arrays.InteractionFunctionCalls1

from 6:49.62 to 3:31.40 on Timothy Arceri's machine.

Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965/skl: Use more compact hiz dimensions
Ben Widawsky [Thu, 25 Jun 2015 03:07:54 +0000 (20:07 -0700)]
i965/skl: Use more compact hiz dimensions

gen8 had some special restrictions which don't seem to carry over to gen9.
Quoting the spec for SKL:
"The Z_Height and Z_Width values must equal those present in
3DSTATE_DEPTH_BUFFER incremented by one."

This fixes nothing in piglit (and regresses nothing).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoradeonsi: don't fail in si_shader_io_get_unique_index
Marek Olšák [Thu, 25 Jun 2015 12:58:37 +0000 (14:58 +0200)]
radeonsi: don't fail in si_shader_io_get_unique_index

Trivial. Picked from my tessellation branch.

8 years agoi965: Drop brw->depthstencil.stencil_offset from gen8_depth_state.c.
Kenneth Graunke [Wed, 24 Jun 2015 07:04:11 +0000 (00:04 -0700)]
i965: Drop brw->depthstencil.stencil_offset from gen8_depth_state.c.

This is always 0 - only brw_workaround_depthstencil_alignment ever sets
it, and that doesn't run on Gen6+.  My initial Broadwell depth state
commit had this mistake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
8 years agonir: Recognize max(min(a, 1.0), 0.0) as fsat(a).
Kenneth Graunke [Thu, 11 Jun 2015 08:59:44 +0000 (01:59 -0700)]
nir: Recognize max(min(a, 1.0), 0.0) as fsat(a).

We already recognize min(max(a, 0.0), 1.0) as a saturate, but neglected
this variant (which is also handled by the GLSL IR pass).

shader-db results on Broadwell:
total instructions in shared programs: 7363046 -> 7362788 (-0.00%)
instructions in affected programs:     11928 -> 11670 (-2.16%)
helped:                                64
HURT:                                  0

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
8 years agosoftpipe,llvmpipe: fix PIPE_SHADER_CAP_MAX_INPUTS value
Marek Olšák [Wed, 24 Jun 2015 22:56:32 +0000 (00:56 +0200)]
softpipe,llvmpipe: fix PIPE_SHADER_CAP_MAX_INPUTS value

PIPE_MAX_SHADER_INPUTS was recently bumped to 80 because of tessellation.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agoi965/bxt: Add basic Broxton infrastructure
Ben Widawsky [Wed, 17 Jun 2015 22:50:11 +0000 (15:50 -0700)]
i965/bxt: Add basic Broxton infrastructure

The thread counts and URB information are all speculative numbers that were
based on some CHV numbers at the time.

v2:
Originally this patch had PCI IDs. I've moved that to a new patch at the end of
the series.
Remove is_cherryview hack.
Add PCI ids. These match the ones defined in the kernel. The only one tested by
us is 0x0a84.
Capitalize the hex string (Mark)

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: "Lecluse, Philippe" <Philippe.Lecluse@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
8 years agoradeon: Advertise correct GL_QUERY_COUNTER_BITS/GL_SAMPLES_PASSED value
Ian Romanick [Mon, 22 Jun 2015 18:09:27 +0000 (11:09 -0700)]
radeon: Advertise correct GL_QUERY_COUNTER_BITS/GL_SAMPLES_PASSED value

Commit b765119c changed the default value of all the counter bits to
64.  However, older hardware only has 32 counter bits.

This has only been build-tested.  We don't have any tests that verify
the advertised value against implementation behavior, so I don't know
what additional testing could be done.

NOTE: It appears that many Gallium drivers (at least r300 and i915g)
have the same problem, but I don't see a way for the state-tracker to
determine the counter size.  Marek says, "For Gallium, a new PIPE_CAP or
new get_xxx_param function will be needed."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
8 years agoi965/fs_live_variables: Do liveness analysis bottom-to-top
Jason Ekstrand [Mon, 8 Jun 2015 23:03:19 +0000 (16:03 -0700)]
i965/fs_live_variables: Do liveness analysis bottom-to-top

From Muchnick's Advanced Compiler Design and Implementation:

"To determine which variables are live at each point in a flowgraph, we
perform a backward data-flow analysis"

Previously, we were walking the blocks forwards and updating the livein and
then the liveout.  However, the livein calculation depends on the liveout
and the liveout depends on the successor blocks.  The net result is that it
takes one full iteration to go from liveout to livein and then another
full iteration to propagate to the predecessors.  This works out to an
O(n^2) computation where n is the number of blocks.  If we run things in
the other order, it's O(nl) where l is the maximum loop depth which is
practically bounded by 3.

On my HSW desktop, one particular shadertoy test gets a 20% improvement in
compile times:

N           Min           Max        Median           Avg        Stddev
x  10        15.965        16.884        16.026       16.1822    0.34736846
+  10        12.813        13.052        12.876       12.8891    0.06913666
Difference at 95.0% confidence
        -3.2931 +/- 0.235316
        -20.3501% +/- 1.45417%
        (Student's t, pooled s = 0.250444)

Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoi965: Delete linked GLSL IR when using NIR.
Tapani Pälli [Thu, 11 Jun 2015 07:41:53 +0000 (10:41 +0300)]
i965: Delete linked GLSL IR when using NIR.

This is based on Kenneth's patch to delete 'most of the IR'. Due to
linker changes to clone variables, we can now free all of IR.

Saves 58MB of memory when replaying a Dota 2 trace on Broadwell.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
8 years agoglsl: clone inputs and outputs during linking
Tapani Pälli [Thu, 11 Jun 2015 07:41:52 +0000 (10:41 +0300)]
glsl: clone inputs and outputs during linking

This increases memory pressure during linking but makes it easier
for backend to free IR after it is not needed anymore.

v2: use resource list as ralloc context in case of relink (Kenneth)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
8 years agoi965: Rename intel_emit* to reflect their new location in brw_pipe_control
Chris Wilson [Thu, 30 Apr 2015 16:04:51 +0000 (17:04 +0100)]
i965: Rename intel_emit* to reflect their new location in brw_pipe_control

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Transplant PIPE_CONTROL routines to brw_pipe_control
Chris Wilson [Thu, 30 Apr 2015 15:53:12 +0000 (16:53 +0100)]
i965: Transplant PIPE_CONTROL routines to brw_pipe_control

Start trimming the fat from intel_batchbuffer.c. First by moving the set
of routines for emitting PIPE_CONTROLS (along with the lore concerning
hardware workarounds) to a separate brw_pipe_control.c

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agonir: Use a switch statement for detecting move-like operations.
Kenneth Graunke [Wed, 24 Jun 2015 06:17:53 +0000 (23:17 -0700)]
nir: Use a switch statement for detecting move-like operations.

Suggested by Jason Ekstrand.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
8 years agosvga: silence warnings about unexpected shader type
Brian Paul [Wed, 24 Jun 2015 16:41:52 +0000 (10:41 -0600)]
svga: silence warnings about unexpected shader type

Trivial.

8 years agost/mesa: remove unneeded pipe_surface_release() in st_render_texture()
Brian Paul [Mon, 22 Jun 2015 20:04:09 +0000 (14:04 -0600)]
st/mesa: remove unneeded pipe_surface_release() in st_render_texture()

This caused us to always free the pipe_surface for the renderbuffer.
The subsequent call to st_update_renderbuffer_surface() would typically
just recreate it.  Remove the call to pipe_surface_release() and let
st_update_renderbuffer_surface() take care of freeing the old surface
if it needs to be replaced (because of change to mipmap level, etc).

This can save quite a few calls to pipe_context::create_surface() and
surface_destroy().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agost/wgl: add stw_nopfuncs.h to the sources lists
Emil Velikov [Wed, 24 Jun 2015 11:59:55 +0000 (12:59 +0100)]
st/wgl: add stw_nopfuncs.h to the sources lists

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agoloader: move loader_open_device out of HAVE_LIBUDEV block
Julien Isorce [Tue, 23 Jun 2015 21:47:05 +0000 (22:47 +0100)]
loader: move loader_open_device out of HAVE_LIBUDEV block

Fixes the following build issue, when building without libudev.

CCLD   libGL.la
./.libs/libglx.a(dri2_glx.o): In function `dri2CreateScreen':
src/glx/dri2_glx.c:1186: undefined reference to `loader_open_device'
collect2: ld returned 1 exit status

CCLD     libEGL.la
Undefined symbols for architecture x86_64:
"_loader_open_device", referenced from:
  _dri2_initialize_x11_dri2 in libegl_dri2.a(platform_x11.o)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91077
Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agowinsys/radeon: reduce BO cache timeout
Grigori Goronzy [Wed, 24 Jun 2015 01:40:38 +0000 (03:40 +0200)]
winsys/radeon: reduce BO cache timeout

1000 ms is an extreme value for typical interactive loads. A large
cache has some disadvantages. Search for reusable BOs can take a long
time and memory might get exhausted.

Let's be rather conservative and use half of the old value,
500ms. This is beneficial to some loads on my test system and there
are no regressions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agowinsys/radeon: align BO size to page size
Grigori Goronzy [Wed, 24 Jun 2015 01:38:02 +0000 (03:38 +0200)]
winsys/radeon: align BO size to page size

This is the basic granularity for BO allocations. The alignment also
helps with BO reuse by the cached bufmgr.

This results in a huge 45% speedup in Metro 2033 Redux on my test
system. The game relies on buffer orphaning with very small buffers
(hundreds of bytes in size) and that did not work efficiently
before. This change may also affect other applications and games.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
8 years agoglsl: remove cross validation of interpolation qualifier with GLSL 4.40
Tapani Pälli [Tue, 9 Jun 2015 08:06:56 +0000 (11:06 +0300)]
glsl: remove cross validation of interpolation qualifier with GLSL 4.40

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>