Commit Graph

62451 Commits

Author SHA1 Message Date
Iago Toral Quiroga dff3439fef i915: Fix build error.
is_power_of_two() is now provided by mesa so its definition must be removed
from the i915 driver code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:29:59 -07:00
Kenneth Graunke 73f80c20f6 glsl: Pass ctx->Const.NativeIntegers to do_algebraic.
The next patch will introduce an optimization that only works when
integers are not represented as floating point values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:06 -07:00
Kenneth Graunke 169c645f12 glsl: Pass ctx->Const.NativeIntegers to do_common_optimization().
The next few patches will introduce an optimization that only works when
integers are not represented as floating point values.

v2: Re-word-wrap a line, as requested by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:03 -07:00
Kenneth Graunke 40d9337406 glsl: Validate that base types match for a number of binops.
The IR is not supposed to support implicit type conversions; we just
failed to validate it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:01 -07:00
Kenneth Graunke e14b93371c glsl: Fix lack of i2u in lower_ubo_reference.
ir_binop_ubo_load takes unsigned integer operands.  However, the array
index used to compute these offsets may be a signed integer.  (For
example, see Piglit's spec/glsl-1.40/uniform_buffer/fs-bvec-array).

For some reason, we were missing an ir_binop_i2u cast, and ir_validator
was failing to catch that.

Without this change, ir_builder's type inference code broke for me when
writing a new optimization pass.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:58 -07:00
Kenneth Graunke 4311f9878d i965/fs: Skip emitting MACH/MOV for small integers.
The vector backend already implemented this optimization, but
surprisingly, we never bothered to implement it in the scalar backend.

In addition to saving two instructions, this eliminates a use of the
accumulator as an explicit source, which is unsupported in SIMD16 mode
on Gen7+, which could help us gain SIMD16 programs.

Cuts 19.23% of the instructions in dolphin/efb2ram.shader_test.

v2: Rebase on is_16bit_integer_constant -> is_uint16_constant rename.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:55 -07:00
Kenneth Graunke 7540be22d1 glsl: Make is_16bit_constant from i965 an ir_constant method.
The i965 MUL instruction doesn't natively support 32-bit by 32-bit
integer multiplication; additional instructions (MACH/MOV) are required.
However, we can avoid those if we know one of the operands can be
represented in 16 bits or less.  The vector backend's is_16bit_constant
static helper function checks for this.

We want to be able to use it in the scalar backend as well, which means
moving the function to a more generally-usable location.  Since it isn't
i965 specific, I decided to make it an ir_constant method, in case it
ends up being useful to other people as well.

v2: Rename from is_16bit_integer_constant to is_uint16_constant, as
    suggested by Ilia Mirkin.  Update comments to clarify that it does
    apply to both int and uint types, as long as the value is
    non-negative and fits in 16-bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:53 -07:00
Kenneth Graunke bd69f65f90 mesa: Move is_power_of_two() function from brw_context.h to macros.h.
This makes the function available from core Mesa code, including the
GLSL compiler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:51 -07:00
Kenneth Graunke 6bda3a5267 i965: Fix "SIMD16 unsupported" messages via KHR_debug.
Performance warnings are logged via KHR_debug in addition to when the
INTEL_DEBUG=perf environment variable is set.  Without this, messages in
debug contexts would have "(null)" for the reason.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:34 -07:00
Kenneth Graunke ee12a03805 i965: Fix missing dirty bits in the gen8_sbe_state atom.
These are clearly needed---the comments in the function are even present
for each one of them.   I originally had two separate state atoms for
3DSTATE_SBE and 3DSTATE_SBE_SWIZ.  When I combined the functions, I must
have forgotten to add the atoms for 3DSTATE_SBE_SWIZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:18 -07:00
Kenneth Graunke 47682f2ca1 i965: Drop BRW_NEW_RASTERIZER_DISCARD flag from Broadwell SOL atom.
Nothing actually uses this---we handle rasterizer discard in the
clipper in order for statistics counters to work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:16 -07:00
Kenneth Graunke f68353c57c i965: Use the correct program when uploading Broadwell SOL state.
This is the equivalent of commit 43e77215b1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:36:19 -07:00
Thomas Hellstrom 47f60cbb71 st/xa: Make sure unused samplers are set to NULL
renderer_copy_prepare was setting the first sampler but never telling
the cso code how many samplers were actually used. Fix this.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-07 22:34:10 -07:00
Thomas Hellstrom e5d2c5b899 st/xa: Bind destination before setting new state
Binding a new destination may cause the svga driver to emit draw calls
while propagating the surface. Make sure this doesn't happen in the middle
of sampler state setup where state may be incosistent.

In practice, surface propagation should never happen here and even if it did,
it wouldn't be a valid reason for the svga driver to emit partially set up
state, but to avoid future uncertainties, make sure this doesn't happen
anyway.

Found while auditing the state tracker for inconsistent sampler state /
sampler view setup.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-07 22:34:10 -07:00
Eric Anholt 34f15903d6 glapi: Fix libglapi build.
This line appears to have been accidentally dropped from the last commit,
and the resulting libglapi was missing symbols.
2014-04-07 14:34:49 -07:00
Matt Turner 144bbb7b78 glapi/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:26 -07:00
Matt Turner fbca1ab780 glapi/gen: Ship more Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:19 -07:00
Matt Turner b0f37a6bd2 glapi/gen: Ship XML and Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner f76ac9c9a6 glapi/gen: Add missing XML files to API_XML
Also (re)move XML files from COMMON to API_XML.

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner cdc3a6bb21 src/build: Add getopt to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:02 -07:00
Matt Turner a97611313d gbm/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:01 -07:00
Matt Turner 3f64c3d591 egl/build: Sort egl sources alphabetically.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:00 -07:00
Matt Turner 5ae2f28ca7 egl/build: Remove unused -DXF86VIDMODE.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:58 -07:00
Matt Turner 5074117928 egl/build: Include headers and XML in distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:57 -07:00
Matt Turner 1d4007fbd9 egl/build: Drop two unnecessary Makefiles.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:31 -07:00
Matt Turner 5c770ba919 i965/fs: Remove left-over 'removed' variable.
I think this was used for coalescing out partly dead large virtual
registers, but the patch that enabled that caused regressions and didn't
make it upstream.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:43 -07:00
Matt Turner 99437b730f i965/fs: Check for interference after finding all channels.
It's more likely that we won't find writes to all channels than one will
interfere, and calculating interference is more expensive. This change
will also help prepare for coalescing load_payload instructions'
operands.

Also update the live intervals for all channels, and not just the last
that we saw.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:22 -07:00
Jordan Justen 70285f607c i965: initialize more device info fields for Cherryview
The intent in 9b6b084eb7 was
for urb .size and .min_vs_entries fields to use the values
from the GEN8_FEATURES macro.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-07 09:52:32 -07:00
Brian Paul d3ef6f5427 swrast: reindent s_texfetch_temp.h, remove trailing whitespace
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul a19d60faef swrast: remove out of date comments in s_texfetch_tmp.h
The comments were out of date and redundant (the functions are
pretty much self-explanatory).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul 56db16fb5b swrast: rename texture fetch functions (pt. 7)
sed commands:
s/f_z24_s8/S8_UINT_Z24_UNORM/g
s/f_s8_z24/Z24_UNORM_S8_UINT/g
s/f_z16/Z_UNORM16/g
s/f_z32/Z_UNORM32/g
s/z32f_x24s8/Z32_FLOAT_S8X24_UINT/g
s/f_ycbcr_rev/YCBCR_REV/g
s/f_ycbcr/YCBCR/g
s/dudv8/DUDV8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul d41fe0aec2 swrast: rename texture fetch functions (pt. 6)
sed commands:
s/rgb9_e5/R9G9B9E5_FLOAT/g
s/r11_g11_b10f/R11G11B10_FLOAT/g
s/f_alpha_f16/A_FLOAT16/g
s/f_alpha_f32/A_FLOAT32/g
s/f_luminance_f16/L_FLOAT16/g
s/f_luminance_f32/L_FLOAT32/g
s/f_luminance_alpha_f16/LA_FLOAT16/g
s/f_luminance_alpha_f32/LA_FLOAT32/g
s/f_intensity_f16/I_FLOAT16/g
s/f_intensity_f32/I_FLOAT32/g
s/f_r_f16/R_FLOAT16/g
s/f_r_f32/R_FLOAT32/g
s/f_rg_f16/RG_FLOAT16/g
s/f_rg_f32/RG_FLOAT32/g
s/f_rgb_f16/RGB_FLOAT16/g
s/f_rgb_f32/RGB_FLOAT32/g
s/f_rgba_f16/RGBA_FLOAT16/g
s/f_rgba_f32/RGBA_FLOAT32/g
s/xbgr16161616_float/RGBX_FLOAT16/g
s/xbgr32323232_float/RGBX_FLOAT32/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul 9eb45114fd swrast: rename texture fetch functions (pt. 5)
sed commands:
s/srgba8/A8B8G8R8_SRGB/g
s/sargb8/B8G8R8A8_SRGB/g
s/sabgr8/R8G8B8A8_SRGB/g
s/sxbgr8/R8G8B8X8_SRGB/g
s/sla8/L8A8_SRGB/g
s/sl8/L_SRGB8/g
s/srgb8/BGR_SRGB8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul faa8a8e8b2 swrast: rename texture fetch functions (pt. 4)
sed commands:
s/signed_rg1616/R16G16_SNORM/g
s/signed_rg88_rev/R8G8_SNORM/g
s/signed_al88/L8A8_SNORM/g
s/signed_a8/A_SNORM8/g
s/signed_a16/A_SNORM16/g
s/signed_l8/L_SNORM8/g
s/signed_l16/L_SNORM16/g
s/signed_i8/I_SNORM8/g
s/signed_i16/I_SNORM16/g
s/signed_r8/R_SNORM8/g
s/signed_r16/R_SNORM16/g
s/signed_al1616/LA_SNORM16/g
s/signed_rgb_16/RGB_SNORM16/g
s/signed_rgba_16/RGBA_SNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul a401362019 swrast: rename texture fetch functions (pt. 3)
Rename functions to match format names.

sed commands:
s/f_rg1616_rev/G16R16_UNORM/g
s/f_rg1616/R16G16_UNORM/g
s/f_argb2101010/B10G10R10A2_UNORM/g
s/f_a8/A_UNORM8/g
s/f_a16/A_UNORM16/g
s/f_i8/I_UNORM8/g
s/f_i16/I_UNORM16/g
s/f_r8/R_UNORM8/g
s/f_r16/R_UNORM16/g
s/f_rgb888/BGR_UNORM8/g
s/f_bgr888/RGB_UNORM8/g
s/f_l8/L_UNORM8/g
s/f_l16/L_UNORM16/g
s/xbgr16161616_unorm/RGBX_UNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul e4ebb24b35 swrast: rename texture fetch functions (pt. 2)
Rename functions to match format names.

sed commands:
s/f_al1616_rev/A16L16_UNORM/g
s/f_al1616/L16A16_UNORM/g
s/f_rgb565_rev/R5G6B5_UNORM/g
s/f_rgb565/B5G6R5_UNORM/g
s/f_argb4444_rev/A4R4G4B4_UNORM/g
s/f_argb4444/B4G4R4A4_UNORM/g
s/f_rgba5551/A1B5G5R5_UNORM/g
s/f_argb1555_rev/A1R5G5B5_UNORM/g
s/f_al88_rev/A8L8_UNORM/g
s/f_al88/L8A8_UNORM/g
s/f_gr88/R8G8_UNORM/g
s/f_rg88/G8R8_UNORM/g
s/f_al44/L4A4_UNORM/g
s/f_rgb332/B2G3R3_UNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul fde3258389 swrast: rename texture fetch functions (pt. 1)
Rename functions to match format names.

sed commands:
s/signed_rgba8888_rev/R8G8B8A8_SNORM/g
s/signed_rgba8888/A8B8G8R8_SNORM/g
s/f_rgba8888_rev/R8G8B8A_UNORM/g
s/f_rgba8888/A8B8G8R8_UNORM/g
s/f_rgbx8888_rev/R8G8B8X8_UNORM/g
s/f_rgbx8888/X8B8G8R8_UNORM/g
s/f_argb8888_rev/A8R8G8B8_UNORM/g
s/f_argb8888/B8G8R8A8_UNORM/g
s/f_xrgb8888_rev/X8R8G8B8_UNORM/g
s/f_xrgb8888/B8G8R8X8_UNORM/g
s/signed_rgbx8888/X8B8G8R8_SNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul e0fafd1913 mesa: rename stencil/Z functions in format_unpack.c
So the function names match the format names.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:24 -06:00
Ilia Mirkin 89c5b56be6 nouveau: fix firmware check on nvd7/nvd9
The kernel driver expects the class to be based on chipset generation
rather than VP generation. Make sure to pass 90b1 for NVDX chipsets
instead of 95b1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77102
Fixes: 40dd777b33
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubunutu.com>
2014-04-07 08:58:15 -04:00
Thomas Hellstrom 2f6fcd65f2 winsys/svga: Fix prime surface references also for guest-backed surfaces
Implement guest-backed surface sharing using prime fds. Previously only
legacy surfaces could use this functionality. Also use the vmwgfx 2.6
single-ioctl prime fd reference if available.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:52 -07:00
Thomas Hellstrom 0887b499e9 winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:47 -07:00
Ilia Mirkin 159cec9dec docs: mark ARB_texture_gather as done on nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin f6579e4b17 nvc0: add support for texture gather
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin 91900c6d33 docs: mark ARB_texture_query_lod as done for nv50, nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin 423f64e83a nvc0: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin d5faf8e786 nv50: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Dave Airlie 4dc13e3c71 st/mesa: add support for ARB_texture_query_lod
Add support for the LODQ texture instruction.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Dave Airlie be5276ae7d gallium: add support for LODQ opcodes.
This opcode provide support for GL_ARB_texture_query_lod,

Signed-off-by: Dave Airlie <airlied@redhat.com>
[imirkin: rebase, docs update]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Matt Turner 5d0b3ec4ae i965/vec4: Allow constant propagation into dot product.
total instructions in shared programs: 1667088 -> 1667055 (-0.00%)
instructions in affected programs:     3362 -> 3329 (-0.98%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-05 09:52:54 -07:00
Matt Turner 34ec1a24d6 glsl: Optimize (x + y cmp 0) into (x cmp -y).
Cuts a small handful of instructions in Serious Sam 3:

instructions in affected programs:     4692 -> 4666 (-0.55%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:37 -07:00