mesa.git
7 years agoac: eliminate duplicated VS exports
Marek Olšák [Sat, 29 Apr 2017 21:56:03 +0000 (23:56 +0200)]
ac: eliminate duplicated VS exports

Only very few shaders have them (from 48486 shaders):

shaders/private/left_4_dead_2/765.shader_test - ac: 1 matches 2
shaders/private/left_4_dead_2/877.shader_test - ac: 1 matches 6
shaders/private/left_4_dead_2/2141.shader_test - ac: 1 matches 6
shaders/private/ue4_effects_cave/11.shader_test - ac: 4 matches 5
shaders/private/ue4_effects_cave/14.shader_test - ac: 5 matches 6
shaders/private/ue4_effects_cave/46.shader_test - ac: 5 matches 6
shaders/private/ue4_effects_cave/42.shader_test - ac: 4 matches 5
shaders/private/ue4_effects_cave/104.shader_test - ac: 4 matches 5
shaders/private/f1-2015/336.shader_test - ac: 3 matches 4
shaders/private/f1-2015/948.shader_test - ac: 6 matches 7
shaders/private/f1-2015/602.shader_test - ac: 0 matches 3
shaders/private/f1-2015/600.shader_test - ac: 0 matches 3
shaders/private/f1-2015/1214.shader_test - ac: 0 matches 1
shaders/private/f1-2015/988.shader_test - ac: 4 matches 5
shaders/private/ue4_elemental/149.shader_test - ac: 3 matches 4
shaders/private/ue4_elemental/346.shader_test - ac: 4 matches 5
shaders/private/ue4_elemental/178.shader_test - ac: 3 matches 4
shaders/private/ue4_elemental/136.shader_test - ac: 4 matches 5
shaders/private/ue4_elemental/168.shader_test - ac: 4 matches 5
shaders/private/ue4_elemental/690.shader_test - ac: 3 matches 4
shaders/private/ue4_elemental/19.shader_test - ac: 5 matches 6
shaders/private/dota2/1901.shader_test - ac: 0 matches 5
shaders/private/dota2/1357.shader_test - ac: 0 matches 5
shaders/private/dota2/1375.shader_test - ac: 0 matches 5
shaders/private/dota2/1369.shader_test - ac: 0 matches 5
shaders/private/dota2/1583.shader_test - ac: 0 matches 5
shaders/private/dota2/1811.shader_test - ac: 0 matches 5
shaders/private/dota2/1893.shader_test - ac: 0 matches 5
shaders/private/dota2/1533.shader_test - ac: 0 matches 5
shaders/private/dota2/1951.shader_test - ac: 0 matches 5
shaders/private/dota2/1361.shader_test - ac: 0 matches 5
shaders/private/mad_max/2792.shader_test - ac: 0 matches 1
shaders/private/mad_max/2794.shader_test - ac: 0 matches 1
shaders/private/mad_max/2780.shader_test - ac: 0 matches 1
shaders/private/mad_max/2902.shader_test - ac: 0 matches 1
shaders/private/bioshock-infinite/3050.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/2544.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/3062.shader_test - ac: 3 matches 8
shaders/private/bioshock-infinite/2012.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/3058.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/3270.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/732.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/3026.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/3258.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/3198.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/3046.shader_test - ac: 3 matches 7
shaders/private/bioshock-infinite/3168.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/2550.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/3210.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/3032.shader_test - ac: 3 matches 6
shaders/private/bioshock-infinite/668.shader_test - ac: 3 matches 7

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoac: rename ac_eliminate_const_vs_outputs -> ac_optimize_vs_outputs
Marek Olšák [Sat, 29 Apr 2017 21:53:08 +0000 (23:53 +0200)]
ac: rename ac_eliminate_const_vs_outputs -> ac_optimize_vs_outputs

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoac: first parse VS exports before eliminating constant ones
Marek Olšák [Sat, 29 Apr 2017 21:47:08 +0000 (23:47 +0200)]
ac: first parse VS exports before eliminating constant ones

A later commit will make use of this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoanv: Trivially implement multiDrawIndirect
Jason Ekstrand [Thu, 20 Apr 2017 00:37:46 +0000 (17:37 -0700)]
anv: Trivially implement multiDrawIndirect

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv: Enable VK_KHX_multiview and SPV_KHR_multiview
Jason Ekstrand [Thu, 23 Mar 2017 00:43:10 +0000 (17:43 -0700)]
anv: Enable VK_KHX_multiview and SPV_KHR_multiview

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/cmd_buffer: Emit instanced draws for multiple views
Jason Ekstrand [Thu, 23 Mar 2017 00:15:32 +0000 (17:15 -0700)]
anv/cmd_buffer: Emit instanced draws for multiple views

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/cmd_buffer: Pull indirect draw parameter loading into a helper
Jason Ekstrand [Wed, 22 Mar 2017 23:22:38 +0000 (16:22 -0700)]
anv/cmd_buffer: Pull indirect draw parameter loading into a helper

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/pipeline: Add shader lowering for multiview
Jason Ekstrand [Wed, 22 Mar 2017 22:37:17 +0000 (15:37 -0700)]
anv/pipeline: Add shader lowering for multiview

v2 (Jason Ekstrand):
 - Take a view_mask rather than a whole subpass
 - Build the view mask into the VS shader key

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/pipeline: Add a subpass field to anv_pipeline
Jason Ekstrand [Wed, 22 Mar 2017 22:36:46 +0000 (15:36 -0700)]
anv/pipeline: Add a subpass field to anv_pipeline

This simplifies the code a variety of places.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/pipeline: Call nir_gather_info later
Jason Ekstrand [Wed, 22 Mar 2017 22:24:06 +0000 (15:24 -0700)]
anv/pipeline: Call nir_gather_info later

We want to insert more lowering code that may insert system values and
we need to gather info after that lowering.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv: Move shader hashing to anv_pipeline
Jason Ekstrand [Thu, 27 Apr 2017 13:25:06 +0000 (06:25 -0700)]
anv: Move shader hashing to anv_pipeline

Shader hashing is very closely related to shader compilation.  Putting
them right next to each other in anv_pipeline makes it easier to verify
that we're actually hashing everything we need to be hashing.  The only
real change (other than the order of hashing) is that we now hash in the
shader stage.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/pass: Store the per-subpass view mask
Jason Ekstrand [Tue, 21 Mar 2017 23:04:08 +0000 (16:04 -0700)]
anv/pass: Store the per-subpass view mask

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv: Add the KHX_multiview boilerplate
Jason Ekstrand [Tue, 21 Mar 2017 21:40:46 +0000 (14:40 -0700)]
anv: Add the KHX_multiview boilerplate

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agoanv/nir: Delete the apply_dynamic_offsets prototype
Jason Ekstrand [Wed, 22 Mar 2017 22:10:14 +0000 (15:10 -0700)]
anv/nir: Delete the apply_dynamic_offsets prototype

That pass hasn't existed since dd4db84640bbb694f180dd50850c3388f67228be
but the prototype stuck around for no reason.

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
7 years agospirv: Add support for SPV_KHR_multiview
Jason Ekstrand [Tue, 21 Mar 2017 22:24:25 +0000 (15:24 -0700)]
spirv: Add support for SPV_KHR_multiview

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agospirv: Bump the SPIR-V header to the latest public version
Jason Ekstrand [Tue, 21 Mar 2017 21:47:32 +0000 (14:47 -0700)]
spirv: Bump the SPIR-V header to the latest public version

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agocompiler: Add a system value and varying for ViewIndex
Jason Ekstrand [Tue, 21 Mar 2017 22:22:10 +0000 (15:22 -0700)]
compiler: Add a system value and varying for ViewIndex

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agomesa/vbo: reduce prim array size
Bartosz Tomczyk [Tue, 2 May 2017 11:19:34 +0000 (13:19 +0200)]
mesa/vbo: reduce prim array size

We always use only single element.

v2: Change single element arrays to variables

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: add const qualifier on _mesa_valid_to_render()
Brian Paul [Tue, 2 May 2017 17:32:08 +0000 (11:32 -0600)]
mesa: add const qualifier on _mesa_valid_to_render()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoi965/vec4: don't modify regioning parameters to the sources of DF align1 instructions
Samuel Iglesias Gonsálvez [Tue, 25 Apr 2017 10:28:18 +0000 (12:28 +0200)]
i965/vec4: don't modify regioning parameters to the sources of DF align1 instructions

The regioning parameters are now properly set by convert_to_hw_regs()
and we don't need to fix them in the generator. That latter fix
previously done in the generator was strictly speaking wrong for any
non-identity regions.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
7 years agoi965/vec4: fix register width for DF VGRF and UNIFORM
Samuel Iglesias Gonsálvez [Tue, 25 Apr 2017 10:18:17 +0000 (12:18 +0200)]
i965/vec4: fix register width for DF VGRF and UNIFORM

On gen7, the swizzles used in DF align16 instructions works for element
size of 32 bits, so we can address only 2 consecutive DFs. As we assumed that
in the rest of the code and prepare the instructions for this (scalarize_df()),
we need to set it to two again.

However, for DF align1 instructions, a width of 2 is wrong as we are not
reading the data we want. For example, an uniform would have a region of
<0, 2, 1> so it would repeat the first 2 DFs, when we wanted to access
to the first 4.

This patch sets the default one to 4 and then modifies the width of
align16 instruction's DF sources when we translate the logical swizzle
to the physical one.

v2:
- Remove conditional (Curro).

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
7 years agoi965/vec4: fix vertical stride to avoid breaking region parameter rule
Samuel Iglesias Gonsálvez [Wed, 26 Apr 2017 08:12:03 +0000 (10:12 +0200)]
i965/vec4: fix vertical stride to avoid breaking region parameter rule

From IVB PRM, vol4, part3, "General Restrictions on Regioning
Parameters":

  "If ExecSize = Width and HorzStride ≠ 0, VertStride must
   be set to Width * HorzStride."

In next patch, we are going to modify the region parameter for
uniforms and vgrf. For uniforms that are the source of
DF align1 instructions, they will have <0, 4, 1> regioning and
the execsize for those instructions will be 4, so they will break
the regioning rule. This will be the same for VGRF sources where
we use the vstride == 0 exploit.

As we know we are not going to cross the GRF boundary with that
execsize and parameters (not even with the exploit), we just fix
the vstride here.

v2:
- Move is_align1_df() (Curro)
- Refactor exec_size == width calculation (Curro)

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
7 years agoradv/ac: canonicalize the output for 32-bit float min/max.
Dave Airlie [Fri, 17 Mar 2017 03:38:41 +0000 (13:38 +1000)]
radv/ac: canonicalize the output for 32-bit float min/max.

This fixes:
dEQP-VK.glsl.builtin.precision.min.*
dEQP-VK.glsl.builtin.precision.max.*
dEQP-VK.glsl.builtin.precision.clamp.*

The problem is the hw doesn't compare denorms properly,
so we have to flush them, even though the spec says
flushing is optional, if you don't flush the results
should be correct.

The -pro driver changes the shader float mode,
it would be nice if llvm could grow that perhaps.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: flush f32->f16 conversion denormals to zero. (v2)
Dave Airlie [Fri, 17 Mar 2017 02:11:30 +0000 (12:11 +1000)]
radv: flush f32->f16 conversion denormals to zero. (v2)

SPIR-V defines the f32->f16 operation as flushing denormals to 0,
this compares the class using amd class opcode.

Thanks to Matt Arsenault for figuring it out.

This fix is VI+ only, add a TODO for SI/CIK.

This fixes:
dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Add userspace fence buffer per context.
Bas Nieuwenhuizen [Wed, 3 May 2017 00:21:39 +0000 (02:21 +0200)]
radv: Add userspace fence buffer per context.

Having it in the winsys didn't work when multiple devices use
the same winsys, as we then have multiple contexts per queue,
and each context counts separately.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 7b9963a28f4 "radv: Enable userspace fence checking."
7 years agoradv: enable lower_sub to fix loop unrolling.
Dave Airlie [Tue, 2 May 2017 22:59:56 +0000 (08:59 +1000)]
radv: enable lower_sub to fix loop unrolling.

Loop unroll asserts if it hits a sub, we don't really want
to lower subs as llvm handles these things, but do this for
now, until we can fix loop unroll to work with subs.

Fixes: 14ae0bfa5 (radv: Add NIR loop unrolling)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Don't set dynamic state for pipelines with rasterizer dicard.
Bas Nieuwenhuizen [Tue, 2 May 2017 21:39:29 +0000 (23:39 +0200)]
radv: Don't set dynamic state for pipelines with rasterizer dicard.

All of the dynamic states apply to rasterization & fragment processing,
so we don't need to set them if we don't rasterize.

We don't clear the dirty flags for them though, so we don't miss any
updates for the next pipeline with rasterization.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 76603aa90b8 "radv: Drop the default viewport when 0 viewports are given."
7 years agoradv: flush more stages when semaphore are waiting.
Dave Airlie [Tue, 2 May 2017 21:13:21 +0000 (07:13 +1000)]
radv: flush more stages when semaphore are waiting.

This still doesn't give us complete pWaitDstStageMask support,
but it should provide enough to be correct if not as efficent as
possible.

If we have wait semaphores we must flush between submits and
flush the shaders as well.

This fixes the remaining fails in:
dEQP-VK.synchronization.op.single_queue.semaphore.*ssbo*

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoglsl: set vector_elements to 1 for samplers
Samuel Pitoiset [Wed, 26 Apr 2017 11:49:13 +0000 (13:49 +0200)]
glsl: set vector_elements to 1 for samplers

I don't see any reasons why vector_elements is 1 for images and
0 for samplers. This increases consistency and allows to clean
up some code a bit.

This will also help for ARB_bindless_texture.

No piglit regressions with RadeonSI.

This time the Intel CI system doesn't report any failures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agovc4: Use runtime CPU detection for whether NEON is available.
Eric Anholt [Thu, 13 Apr 2017 18:48:22 +0000 (11:48 -0700)]
vc4: Use runtime CPU detection for whether NEON is available.

This will allow Raspbian's ARMv6 builds to take advantage of the new NEON
code, and could prevent problems if vc4 ends up getting used on a v7 CPU
without NEON.

v2: Drop dead NEON_SUFFIX (noted by Erik Faye-Lund)

7 years agovc4: Use a wrapper file to set VC4_BUILD_NEON instead of CFLAGS.
Eric Anholt [Thu, 13 Apr 2017 22:09:16 +0000 (15:09 -0700)]
vc4: Use a wrapper file to set VC4_BUILD_NEON instead of CFLAGS.

Android.mk was setting the flag across the entire driver, so we didn't
have non-NEON versions getting built.  This was going to be a problem with
the next commit, when I start auto-detecting NEON support and use the
non-NEON version when appropriate.

Reviewed-by: Rob Herring <robh@kernel.org>
7 years agogallium: Enable ARM NEON CPU detection.
Eric Anholt [Thu, 13 Apr 2017 18:43:30 +0000 (11:43 -0700)]
gallium: Enable ARM NEON CPU detection.

I wrote this code with reference to pixman, though I've only decided to
cover Linux (what I'm testing) and Android (seems obvious enough).  Linux
has getauxval() as a cleaner interface to the /proc entry, but it's more
glibc-specific and I didn't want to add detection for that.

This will be used to enable NEON at runtime on ARMv6 builds of vc4.

v2: Actually initialize the temp vars in the Android path (noticed by
    daniels)
v3: Actually pull in the cpufeatures library (change by robher).
    Use O_CLOEXEC.  Break out of the loop when we find our feature.
v4: Drop VFP code, which was confused about what it was detecting and not
    actually used yet.

Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
7 years agoradv: fix stencil only clears.
Dave Airlie [Tue, 2 May 2017 05:29:28 +0000 (15:29 +1000)]
radv: fix stencil only clears.

If we are clearing stencil only, we still need to provide a
a valid Z output from the vertex shader, we can't rely
on the depth clear value having any meaning, as we use this
for the position output, and it could get clipped, so we
don't end up clearing anything.

Fixes:
dEQP-VK.renderpass.simple.stencil
since I added S8 support.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agorenderonly: use drmIoctl
Philipp Zabel [Fri, 28 Apr 2017 11:14:20 +0000 (13:14 +0200)]
renderonly: use drmIoctl

To restart interrupted system calls, use drmIoctl.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agorenderonly: drop resources on destroy
Philipp Zabel [Thu, 27 Apr 2017 16:44:02 +0000 (18:44 +0200)]
renderonly: drop resources on destroy

The renderonly_scanout holds a reference on its prime pipe resource,
which should be released when it is destroyed. If it was created by
renderonly_create_kms_dumb_buffer_for_resource, the dumb BO also has
to be destroyed.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agorenderonly: close transfer prime_fd
Philipp Zabel [Thu, 27 Apr 2017 16:44:01 +0000 (18:44 +0200)]
renderonly: close transfer prime_fd

prime_fd is only used to transfer the scanout buffer to the GPU inside
renderonly_create_kms_dumb_buffer_for_resource. It should be closed
immediately to avoid leaking the DMA-BUF file handle.

Fixes: 848b49b288f ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoradv/wsi: report presentation error per image request
Dave Airlie [Tue, 2 May 2017 03:40:36 +0000 (13:40 +1000)]
radv/wsi: report presentation error per image request

This ports
0fcb92c17dee681bd39c08ddf0abc358a27337c7
anv: wsi: report presentation error per image request

This fixes:
dEQP-VK.wsi.xlib.incremental_present.scale_none.*

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: minor pahole related improvements.
Dave Airlie [Tue, 2 May 2017 00:32:02 +0000 (10:32 +1000)]
radv: minor pahole related improvements.

This just reduces the structs by 4-8 bytes each.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/image: resize some surface members.
Dave Airlie [Tue, 2 May 2017 00:31:14 +0000 (10:31 +1000)]
radv/image: resize some surface members.

Oops meant to be part of previous series.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: drop unused surface level members.
Dave Airlie [Tue, 2 May 2017 00:12:51 +0000 (10:12 +1000)]
radv: drop unused surface level members.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/image: drop blk_d
Dave Airlie [Tue, 2 May 2017 00:12:36 +0000 (10:12 +1000)]
radv/image: drop blk_d

This was pretty much unused.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: remove some members of radeon surface.
Dave Airlie [Mon, 1 May 2017 23:58:33 +0000 (09:58 +1000)]
radv: remove some members of radeon surface.

We would be storing this info twice per image, no need to,
remove it from the surface struct.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: move some image info into a separate struct.
Dave Airlie [Mon, 1 May 2017 23:49:14 +0000 (09:49 +1000)]
radv: move some image info into a separate struct.

This is to rework the surface code like radeonsi.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: provide a helper for comparing an image extents.
Dave Airlie [Mon, 1 May 2017 23:40:36 +0000 (09:40 +1000)]
radv: provide a helper for comparing an image extents.

This just makes it easier to do the follow in cleanups of the surface.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agogbm/dri: Fix sign-extension in modifier query
Daniel Stone [Tue, 2 May 2017 18:44:38 +0000 (19:44 +0100)]
gbm/dri: Fix sign-extension in modifier query

When we were assembling the unsigned 64-bit query return from its
two signed 32-bit component parts, the lower half was getting
sign-extended into the top half. Be more explicit about what we want to
do.

Fixes gbm_bo_get_modifier() returning ((1 << 64) - 1) rather than
((1 << 56) - 1), i.e. DRM_FORMAT_MOD_INVALID.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
7 years agonir: Pick just the channels we want for bitmap and drawpixels lowering.
Eric Anholt [Wed, 8 Mar 2017 23:20:31 +0000 (15:20 -0800)]
nir: Pick just the channels we want for bitmap and drawpixels lowering.

NIR now validates that SSA references use the same number of channels as
are in the SSA value.

v2: Reword commit message, since the commit didn't land before the
    validation change did.

Fixes: 370d68babcbb ("nir/validate: Validate that bit sizes and components always match")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v1)
Cc: <mesa-stable@lists.freedesktop.org>
7 years agoanv/tests: Create a dummy instance as well as device
Jason Ekstrand [Mon, 1 May 2017 23:48:12 +0000 (16:48 -0700)]
anv/tests: Create a dummy instance as well as device

This fixes crashes caused by 35e626bd0e59e7ce9fd97ccef66b2468c09206a4
which made us start referencing the instance in the allocators.  With
this commit, the tests now happily pass again.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100877
Tested-by: Vinson Lee <vlee@freedesktop.org>
7 years agoradv: Use correct stage for ready bit.
Bas Nieuwenhuizen [Sun, 30 Apr 2017 15:56:24 +0000 (17:56 +0200)]
radv: Use correct stage for ready bit.

Set the bit in the same stage as the timestamp, instead always at top of pipe.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
7 years agoradv: Add top of pipe timestamp queries.
Bas Nieuwenhuizen [Sun, 30 Apr 2017 15:49:15 +0000 (17:49 +0200)]
radv: Add top of pipe timestamp queries.

Does not fix brokenness with the ready bit.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Add NIR loop unrolling.
Bas Nieuwenhuizen [Wed, 26 Apr 2017 20:29:01 +0000 (22:29 +0200)]
radv: Add NIR loop unrolling.

Not much effect on dota2/talos, but positive on deferred.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@itsqueeze.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoi965: Solve Android native fence fd double close
Randy Xu [Tue, 18 Apr 2017 06:27:10 +0000 (14:27 +0800)]
i965: Solve Android native fence fd double close

The Android native fence in i965 has two fds: _EGLSync::SyncFd and
brw_fence::sync_fd.

The semantics of __DRI2fenceExtensionRec::create_fence_fd are unclear on
whether the DRI driver takes ownership of the incoming fd (which is the
same incoming fd from eglCreateSync).  i965 did take ownership, but all
other Mesa drivers do not; instead, they dup the incoming fd. As
a result, _EGLSync::SyncFd and brw_fence::sync_fd were the same fd, and
both egl_dri2 and i965 believed they owned it. On eglDestroySync, that
led to a double-close.

Fix the double-close by making brw_dri_create_fence_fd dup the incoming
fd, just like the other drivers do.

Signed-off-by: Randy Xu <randy.xu@intel.com>
Test: Run Vulkan and GLES stress test and no crash.
Fixes: 6403e376511 ("i965/sync: Implement fences based on Linux sync_file")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
[chadv: Polish the commit message]
Cc: mesa-stable@lists.freedesktop.org
7 years agovc4: Only build the NEON code on arm32.
Eric Anholt [Fri, 14 Apr 2017 17:41:51 +0000 (10:41 -0700)]
vc4: Only build the NEON code on arm32.

NEON is sufficiently different on arm64 that we can't just reuse this
code.  Disable it on arm64 for now.

v2: Use PIPE_ARCH_ARM instead, as __ARM_ARCH may be 8 for a 32-bit build
    for a v8 CPU.

Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: <mesa-stable@lists.freedesktop.org>
7 years agogm107/ir: add a missing assertion in emitISCADD()
Samuel Pitoiset [Sat, 29 Apr 2017 15:40:26 +0000 (17:40 +0200)]
gm107/ir: add a missing assertion in emitISCADD()

For consistency, similar to the other emitters.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
7 years agoi965: Don't allocate uniform space for samplers
Timothy Arceri [Sun, 30 Apr 2017 02:12:35 +0000 (12:12 +1000)]
i965: Don't allocate uniform space for samplers

Samplers are encoded into the instruction word, so there's no need to
make space in the uniform file.

Previously matrix_columns and vector_elements were set to 0, making this
else case a no-op. Commit 75a31a20af26 changed that, causing malloc
corruption in thousands of tests on i965.

Fixes: 75a31a20af26 ("glsl: set vector_elements to 1 for samplers")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100871

7 years agoegl: initialise dummy_thread via _eglInitThreadInfo
Emil Velikov [Tue, 25 Apr 2017 16:07:46 +0000 (17:07 +0100)]
egl: initialise dummy_thread via _eglInitThreadInfo

Considering we cannot make dummy_thread a constant we might as well,
initialise by the same function that handles the actual thread info.

This way we don't need to worry about mismatch between the initialiser
and initialising function.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoegl: polish dri2_to_egl_attribute_map[]
Emil Velikov [Fri, 28 Apr 2017 16:01:03 +0000 (17:01 +0100)]
egl: polish dri2_to_egl_attribute_map[]

Annotate the array as static const and use C99 initialiser to populate
it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agogallium/targets: fix bool setting on BE architectures
Ilia Mirkin [Tue, 18 Apr 2017 04:00:40 +0000 (00:00 -0400)]
gallium/targets: fix bool setting on BE architectures

val_bool and val_int are in a union. val_bool gets the first byte, which
happens to work on LE when setting via the int, but breaks on BE. By
setting the value properly, we are able to use DRI3 on BE architectures.
Tested by running glxgears with a NV34 in a G5 PPC.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
[Emil Velikov: squash the vmwgfx hunk]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agodocs: add release calendar page and references to it
Emil Velikov [Mon, 24 Apr 2017 16:22:19 +0000 (17:22 +0100)]
docs: add release calendar page and references to it

Add a page that has information which release is expected when and
associated information.

Reference to it from the "Releasing process" and "Release notes" pages.

v2:
 - Add Andres for 17.0.5
 - Rework table format to include the branch (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agotravis: bump MAKEFLAGS to -j4
Emil Velikov [Thu, 27 Apr 2017 16:09:12 +0000 (17:09 +0100)]
travis: bump MAKEFLAGS to -j4

The instance should have 2 cores, yet bumping the jobs to 4 should give
us a minor speed improvement.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: enable wayland support
Emil Velikov [Tue, 18 Apr 2017 12:57:31 +0000 (13:57 +0100)]
travis: enable wayland support

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: add Gallium state-tracker targets
Emil Velikov [Fri, 7 Apr 2017 13:06:25 +0000 (14:06 +0100)]
travis: add Gallium state-tracker targets

Split into OpenCL and others, since the former is quite time consuming.

v2:
 - explicitly enable/disable components
 - build libvdpau 1.1 requirement
 - enable st/vdpau
 - build libva 1.6.2 (API 0.38) requirement

v3: Drop ubuntu-toolchain-r-test from sources (Andres)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: model scons check target like the make one
Emil Velikov [Fri, 28 Apr 2017 18:01:33 +0000 (19:01 +0100)]
travis: model scons check target like the make one

Should make things a bit more consistent across the board.

Cc: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: split the make target to three separate ones
Emil Velikov [Fri, 7 Apr 2017 11:13:56 +0000 (12:13 +0100)]
travis: split the make target to three separate ones

Split the target to allow faster builds for each run.

The overall build time will be more, yet Travis runs multiple builds in
parallel so we're limited by the slowest one.

Things are split roughly as:
 - DRI loaders, classic DRI drivers, classic OSMesa, make check
 - All Gallium drivers (minus the SWR) alongside st/dri (mesa)
 - The Vulkan drivers - ANV and RADV, make check (anv)

v2:
 - rework RUN_CHECK to MAKE_CHECK_COMMAND
 - explicitly disable DRI loaders
 - generate linux/memfd.h locally and enable ANV
 - add libedit-dev

v3: Use printf to create the header (Andres).
v4: Really add the libedit + printf hunks.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: add "make swr" to the build matrix
Emil Velikov [Thu, 6 Apr 2017 17:01:19 +0000 (18:01 +0100)]
travis: add "make swr" to the build matrix

v2: Quote OVERRIDE variables.
v3: Add missplaced libedit-dev hunk (Andres).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: add "scons swr" to the build matrix
Emil Velikov [Thu, 6 Apr 2017 15:23:21 +0000 (16:23 +0100)]
travis: add "scons swr" to the build matrix

Requires GCC 5.0 (due to the C++14 requirement) and LLVM 3.9.

v2: Enable the target, add libedit-dev, rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS, quote OVERRIDE
variables.
v4: Keep check target as-is (Andres)

Cc: Tim Rowley <timothy.o.rowley@intel.com>
Cc: George Kyriazis <george.kyriazis@intel.com>
Reviewed-by: George Kyriazis <george.kyriazis@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: add separate "scons" and "scons llvm" targets
Emil Velikov [Thu, 6 Apr 2017 13:41:44 +0000 (14:41 +0100)]
travis: add separate "scons" and "scons llvm" targets

The former does not require any LLVM, while the latter uses LLVM 3.3.

This way we'll quickly catch any LLVM 3.3+ functionality that gets
introduced where it shouldn't.

Add the full list of addons for each build permutation.

v2: Keep libedit-dev, rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS
v4:
 - Remove llvm-toolchain-trusty-3.3 source (Andres)
 - Keep check target as-is (Andres)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: split out matrix from env
Emil Velikov [Thu, 6 Apr 2017 13:38:40 +0000 (14:38 +0100)]
travis: split out matrix from env

With next commits we'll add a couple of more options.

v2: Rework check target.
v3: Comment the current check target, add -j4 SCONSFLAGS
v4: Keep check target as-is, will rework with later patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: rework "if test" blocks in the script section
Emil Velikov [Thu, 6 Apr 2017 13:23:36 +0000 (14:23 +0100)]
travis: rework "if test" blocks in the script section

Split the "if test" blocks so that we get more sensible output in case
of a failure.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: remove unused -dev packages
Emil Velikov [Thu, 6 Apr 2017 13:09:58 +0000 (14:09 +0100)]
travis: remove unused -dev packages

We effectively override libdrm-dev and libxcb-dri2-0-dev since we build
and install the package locally.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: automatically manage ccache caching
Emil Velikov [Thu, 6 Apr 2017 13:02:38 +0000 (14:02 +0100)]
travis: automatically manage ccache caching

According to the manual

"If you are using ccache, use:

  language: c # or other C/C++ variants

  cache: ccache

to cache $HOME/.ccache and automatically add /usr/lib/ccache to your
$PATH."

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: enable apt cache
Emil Velikov [Thu, 6 Apr 2017 15:36:59 +0000 (16:36 +0100)]
travis: enable apt cache

Provides a small, but consistent improvement.
Example numbers of the jobs added later in the series.

"make loaders/classic DRI" - 1s
"scons SWR" - 6s

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agotravis: add the possibility of using the txc-dxtn library
Andres Gomez [Fri, 7 Apr 2017 12:16:21 +0000 (15:16 +0300)]
travis: add the possibility of using the txc-dxtn library

The txc-dxtn library implements the patented S3 Texture Compression
algorithm.

By default it won't be used but we add the possibility of setting the
USE_TXC_DXTN variable to yes in the travis web UI so it will be
installed and used for the scons tests.

Cc: Eric Anholt <eric@anholt.net>
Cc: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
[Emil Velikov: keep the LIB prefix, drop the LD_LIBRARY_PATH, fold URL]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotravis: replace Trusty-based LLVM toolchain apt-get with apt addon
Andres Gomez [Wed, 5 Apr 2017 17:27:30 +0000 (20:27 +0300)]
travis: replace Trusty-based LLVM toolchain apt-get with apt addon

Trusty's LLVM toochain repository was whitelisted some time ago. See:
https://github.com/travis-ci/apt-source-whitelist/commit/479067c5e74cb0c1e2419209179b1afe2edce274

Signed-off-by: Andres Gomez <agomez@igalia.com>
[Emil Velikov]
 - set sudo to false
 - reference the Trusty change (Rhys)
 - keep libedit-dev
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotravis: explicitly LD_LIBRARY_PATH the local libraries
Emil Velikov [Thu, 6 Apr 2017 12:32:36 +0000 (13:32 +0100)]
travis: explicitly LD_LIBRARY_PATH the local libraries

Some of the libraries may be dlopened, which may not always work due to
the non-standard prefix that we're using.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
7 years agost/wgl: whitespace, formatting fixes in stw_pixelformat.c
Brian Paul [Sat, 29 Apr 2017 03:48:47 +0000 (21:48 -0600)]
st/wgl: whitespace, formatting fixes in stw_pixelformat.c

Trivial.

7 years agost/wgl: allow WGL_BIND_TO_TEXTURE_RGB_ARB for RGBA visuals
Charmaine Lee [Wed, 18 May 2016 17:11:25 +0000 (10:11 -0700)]
st/wgl: allow WGL_BIND_TO_TEXTURE_RGB_ARB for RGBA visuals

We do not need to restrict WGL_BIND_TO_TEXTURE_RGB_ARB to
RGB visuals only. It can be supported with RGBA visuals as well.

This fixes the early exit of cinebench-r15-test trace.

Tested with cinebench-r15, piglit, glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agost/wgl: use ARRAY_SIZE() macro in wglChoosePixelFormatARB()
Brian Paul [Sat, 29 Apr 2017 03:32:05 +0000 (21:32 -0600)]
st/wgl: use ARRAY_SIZE() macro in wglChoosePixelFormatARB()

Trivial.

7 years agost/wgl: whitespace/formatting fixes in stw_ext_pixelformat.c
Brian Paul [Sat, 29 Apr 2017 03:32:05 +0000 (21:32 -0600)]
st/wgl: whitespace/formatting fixes in stw_ext_pixelformat.c

Trivial.

7 years agosvga: implement sRGB rendering for imported surfaces
Neha Bhende [Thu, 27 Apr 2017 17:05:35 +0000 (10:05 -0700)]
svga: implement sRGB rendering for imported surfaces

If texture is imported and templ format is sRGB, use compatible sRGB format
to the imported texture format while creating surface view.

tested with MTT piglit, glretrace, viewperf and conform

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agosvga: add function svga_linear_to_srgb()
Neha Bhende [Thu, 27 Apr 2017 17:37:02 +0000 (10:37 -0700)]
svga: add function svga_linear_to_srgb()

This function will return compatible svga srgb format for corresponding
linear format

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agoglx: add missing sRGB attribute check in fbconfigs_compatible()
Neha Bhende [Wed, 26 Apr 2017 23:21:32 +0000 (16:21 -0700)]
glx: add missing sRGB attribute check in fbconfigs_compatible()

This patch will allow driver to choose srgb capable FBconfig
if GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB attribute is 1

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agosvga: Add a more elaborate format compatibility determination v2
Thomas Hellstrom [Fri, 7 Apr 2017 12:54:56 +0000 (14:54 +0200)]
svga: Add a more elaborate format compatibility determination v2

dri3 is a bit sloppy about its format compatibility requirements, so add
a possibility to import xrgb surfaces as argb textures and vice versa.

At the same time, make the svga_texture_from_handle() function a bit more
readable and fix the error path where we leaked a winsys surface.

v2: Addressed review comments by Brian.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agoswr/rast: add memory api to SwrGetInterface()
Tim Rowley [Sat, 22 Apr 2017 03:14:16 +0000 (22:14 -0500)]
swr/rast: add memory api to SwrGetInterface()

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: use gather instruction for odd format fetch
Tim Rowley [Fri, 21 Apr 2017 18:35:55 +0000 (13:35 -0500)]
swr/rast: use gather instruction for odd format fetch

Small fetch performance optimization - use gather instruction
for odd format fetch instead of slow emulated code.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: enable SIMD16 8x2 tile backend
Tim Rowley [Fri, 21 Apr 2017 18:18:55 +0000 (13:18 -0500)]
swr/rast: enable SIMD16 8x2 tile backend

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: add SwrInit() to init backend/memory tables
Tim Rowley [Fri, 21 Apr 2017 15:21:19 +0000 (10:21 -0500)]
swr/rast: add SwrInit() to init backend/memory tables

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: increment depth/stencil tile pointer in SIMD16 BE
Tim Rowley [Thu, 20 Apr 2017 23:34:29 +0000 (18:34 -0500)]
swr/rast: increment depth/stencil tile pointer in SIMD16 BE

Misplaced #endif preventing depth and stencil hot tile pointers
from incrementing in SIMD16 8x2 configuration of BackendPixelRate.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: add SwrGetInterface() function to return api
Tim Rowley [Thu, 20 Apr 2017 00:00:21 +0000 (19:00 -0500)]
swr/rast: add SwrGetInterface() function to return api

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: enable per-warp scratch space for CS
Tim Rowley [Wed, 19 Apr 2017 22:03:32 +0000 (17:03 -0500)]
swr/rast: enable per-warp scratch space for CS

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: reduce simd{16}vertex stack for VS output
Tim Rowley [Wed, 19 Apr 2017 17:21:05 +0000 (12:21 -0500)]
swr/rast: reduce simd{16}vertex stack for VS output

Frontend - reduce simdvertex/simd16vertex stack usage for VS output in
ProcessDraw, fixes stack overflow in some of the deeper call stacks under
SIMD16.

1. Move the vertex store out of PA_FACTORY, and off the stack
2. Allocate the vertex store out of the aligned heap (pointer is
   temporarily stored in TLS, but will be migrated to thread pool
   along with other frontend temporary buffers).
3. Grow the vertex store as necessary for the number of verts per
   primitive, in chunks of 8/4 simdvertex/simd16vertex

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: remove default argument from SwrSync()
Tim Rowley [Wed, 19 Apr 2017 15:58:59 +0000 (10:58 -0500)]
swr/rast: remove default argument from SwrSync()

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: remove unused variables in the SIMD16 FE
Tim Rowley [Thu, 13 Apr 2017 21:26:08 +0000 (16:26 -0500)]
swr/rast: remove unused variables in the SIMD16 FE

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: move construction of const above goto
Tim Rowley [Thu, 13 Apr 2017 21:11:09 +0000 (16:11 -0500)]
swr/rast: move construction of const above goto

Fixes gcc error for SIMD16 FE.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: name threads to aid debugging
Tim Rowley [Thu, 13 Apr 2017 21:01:12 +0000 (16:01 -0500)]
swr/rast: name threads to aid debugging

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: disable buffer overrun warning for Assemble()
Tim Rowley [Wed, 26 Apr 2017 18:11:00 +0000 (13:11 -0500)]
swr/rast: disable buffer overrun warning for Assemble()

Disabling buffer overrun warning for Assemble(uint32_t slot,
simdvector *verts) due to what looks like a MSVC compiler bug
when compiling the SIMD16 FE.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: clean up clipper comments
Tim Rowley [Wed, 26 Apr 2017 18:10:23 +0000 (13:10 -0500)]
swr/rast: clean up clipper comments

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: add SIMDAPI decorators in binner/clipper
Tim Rowley [Wed, 26 Apr 2017 18:09:00 +0000 (13:09 -0500)]
swr/rast: add SIMDAPI decorators in binner/clipper

Fixes MSVC errors with SIMD16 FE.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: add additional jit utility functions
Tim Rowley [Tue, 11 Apr 2017 22:25:11 +0000 (17:25 -0500)]
swr/rast: add additional jit utility functions

Not used yet.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoswr/rast: more flexible max attribute slots
Tim Rowley [Mon, 10 Apr 2017 16:29:45 +0000 (11:29 -0500)]
swr/rast: more flexible max attribute slots

Ability to allocate space for an arbitrary number (at compile time)
of positions in the vertex layout.

Removes KNOB_NUM_ATTRIBUTES from knobs.h, replaces the VTX slot
number #defines with the SWR_VTX_SLOTS enum (which contains
replacement for NUM_ATTRIBUTES: SWR_VTX_NUM_SLOTS)

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoi965: Drop BRW_NEW_CONTEXT from 3DSTATE_DS/GS on Gen7-7.5.
Kenneth Graunke [Thu, 27 Apr 2017 06:49:49 +0000 (23:49 -0700)]
i965: Drop BRW_NEW_CONTEXT from 3DSTATE_DS/GS on Gen7-7.5.

We already have BRW_NEW_BATCH, which completely covers all the cases
that BRW_NEW_CONTEXT would handle.  Drop it.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>