Commit Graph

60239 Commits

Author SHA1 Message Date
Kenneth Graunke 9f330481c3 i965: Use RED for depth texture formats rather than INTENSITY.
While looking through the documentation, I found this in the Sandybridge
PRM (Volume 4, Part 1, Page 140):
"Use of sample_c with SURFTYPE_CUBE surfaces is undefined with the
 following surface formats: I24X8_UNORM, L24X8_UNORM, A24X8_UNORM,
 I32_FLOAT, L32_FLOAT, A32_FLOAT."

I haven't observed this to be true, but it suggests that we may want to
use other formats.

We already perform DEPTH_TEXTURE_MODE swizzling in the shaders, and
don't rely on the surface format to splat things appropriately.  So
using RED should work just as well as INTENSITY.

A few notes about the formats:
- R24_UNORM_X8_TYPELESS has the exact same properties as I24X8_UNORM.
- R16_UNORM and R32_FLOAT are additionally supported as a render target,
  while the old I16_UNORM/I32_FLOAT formats are not.
- R32_FLOAT_X8X24_TYPELESS is not supported as a render target, while
  the old format (R32G32_FLOAT) was.  However, it shares the same
  properties as the formats we use for Z24, so it should suffice.

This makes translate_tex_format and brw_blorp_surface_info::set
a bit more similar.

No Piglit changes on Sandybridge or Ivybridge.  No oglconform changes on
Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-20 16:14:35 -08:00
Chad Versace 1a928816a1 i965/gen6: Fix HiZ hang in WebGL Google Maps
Emitting flushes before depth and hiz resolves at the top of blorp's
state emission fixes the hang. Marchesin and I found the fix
experimentally, as opposed to adhering to a documented hardware
workaround.  A more minimal fix likely exists, but this gets the job
done.

Fixes HiZ hangs in the new WebGL Google maps on Sandybridge Chrome OS.
Tested by zooming in and out continuously for 2 hours.

This patch is based on
8bc07bb701

CC: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70740
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-20 15:20:30 -08:00
Kenneth Graunke b97fa1e75b i965: Store QPitch in intel_mipmap_tree.
Broadwell allows us to specify an arbitrary value for QPitch, rather
than baking a specific formula into the hardware and requiring software
to lay things out to match.  The only restriction is that the software
provided QPitch needs to be large enough so successive array slices do
not overlap.

In order to support this flexibility, software needs to specify QPitch
in a bunch of packets.  Storing QPitch makes that easy, and allows us to
adjust it in a single place should we wish to change it in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-20 12:41:54 -08:00
Kenneth Graunke 1e8e17ccd7 i965: Add support for Broadwell's new register types.
Broadwell introduces support for Q, UQ, and HF types.  It also extends
DF support to allow immediate values.

Irritatingly, although HF and DF both support immediates, they're
represented by a different value depending on the register file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:43 -08:00
Kenneth Graunke 15b9aa22d7 i965: Add BRW_REGISTER_TYPE_DF.
Ivybridge, Baytrail, and Haswell support double float register types,
but do not support them as immediate values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:41 -08:00
Kenneth Graunke 54e91e7420 i965: Abstract BRW_REGISTER_TYPE_* into an enum with unique values.
On released hardware, values 4-6 are overloaded.  For normal registers,
they mean UB/B/DF.  But for immediates, they mean UV/VF/V.

Previously, we just created #defines for each name, reusing the same
value.  This meant we could directly splat the brw_reg::type field into
the assembly encoding, which was fairly nice, and worked well.

Unfortunately, Broadwell makes this infeasible: the HF and DF types are
represented as different numeric values depending on whether the
source register is an immediate or not.

To preserve sanity, I decided to simply convert BRW_REGISTER_TYPE_* to
an abstract enum that has a unique value for each register type, and
write translation functions.  One nice benefit is that we can add
assertions about register files and generations.

I've chosen not to convert brw_reg::type to the enum, since converting
it caused a lot of trouble due to C++ enum rules (even though it's
defined in an extern "C" block...).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:39 -08:00
Kenneth Graunke 13454fc3de i965: Decode three-source register types directly.
Three-source instructions use a different encoding for register types
(and have a much more limited set to choose from).

Previously, we translated those into BRW_REGISTER_TYPE_* values, then
reused the existing reg_encoding mapping.

Doing it directly is more straightforward and actually less code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:38 -08:00
Kenneth Graunke 4e95a09937 i965: Disassemble UV types, not UB types.
UB types have never been supported as immediates.  On Gen4-5, register
encoding 4 is "Reserved."  On Gen6+, it means UV.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:36 -08:00
Kenneth Graunke d10242c5f7 i965: Add missing BRW_REGISTER_TYPE_UV.
Sandybridge added support for packed unsigned vectors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-20 12:34:15 -08:00
Kenneth Graunke 51c9cfc296 i965: Fix 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet creation.
When adding geometry shader support, we accidentally reversed the size
and offset parameters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-20 12:25:43 -08:00
Kenneth Graunke 0d0edf8e4c i965: Use {point_sprite,flat}_enable variable names instead of dw*.
Calling the local variables flat_enable and point_sprite_enable is
clearer than dw16 and such.  It also matches the names used in
calculate_attr_overrides, which computes them.

v2: Add /* dw16 */ and /* dw10 */ comments, requested by Jordan.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-12-20 12:25:33 -08:00
Kenneth Graunke 23fc845f81 i965: Zero out {point_sprite,flat}_enables in calculate_attr_overrides.
calculate_attr_overrides is responsible for computing the point sprite
and flat-shading enable bitfields.  It does so by OR'ing in a bunch of
bits.  However, it relied on the caller to set the initial value to
zero.  This is pretty fragile - if the caller neglects to zero out those
variables, then the enable bitfields end up full of garbage, which shows
up as random things being flat-shaded.

This patch moves the zero-initialization into calculate_attr_overrides,
so that the computation is completely in one place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-12-20 12:25:33 -08:00
Kenneth Graunke da872ddcc6 i965: Delete bogus BRW_REGISTER_TYPE_HF define.
git blame ascribes this to the initial commit of the driver.

No released hardware has ever supported half float, according to the
documentation for SrcType in the ISA reference.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-12-20 12:25:33 -08:00
Kevin Rogovin 3b1195f8a6 Report that no function found if signature lookup is empty
If no function signature is found for a function name, report that the
function is not found instead of printing an empty list of candidates.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-12-20 09:03:54 -08:00
Kevin Rogovin 23d294bb60 Use line number information from entire function expression
This patch changes the error reporting behavior for incorrect function
invocation (triggered by match_function_by_name() unable to find a
matching function call) from using the line number information
associated to the function name term to using the line number
information of the entire function expression. Fixes bug #72264.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72264
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
2013-12-20 09:03:54 -08:00
Michel Dänzer d580905000 radeonsi: Only scan pixel shaders for TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS
It's not relevant for other shader types.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-12-20 18:51:09 +09:00
Aaron Watry 8252847b7b r600g: Fix spelling error
Trivial change, testing commit access
2013-12-19 14:30:51 -06:00
Quanxian Wang 1413a09f34 egl: break instead of looping after driver is found
Stop searching for a driver after success.

Signed-off-by: Quanxian Wang <quanxian.wang@intel.com>
Reviewed-By: Gong, Zhigang <zhigang.gong@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 12:44:11 -07:00
Juha-Pekka Heikkila 22bf0f3eb4 mesa: Assert variable coming from get_variable() in get_current_attrib
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 08:26:17 -07:00
Juha-Pekka Heikkila a7d8607d9e mesa: Add asserts into emit_fog_instructions
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 08:25:58 -07:00
Juha-Pekka Heikkila cd6aaf2920 glx: Fix two identical null check errors in driSet/GetInterval
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-19 08:25:45 -07:00
Dave Airlie 149140e922 st_glsl_to_tgsi: add support for prim id fragment shader input
For GLSL 1.50 we can get frag shaders with primitive id as an
input, add support to the translator for this.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-12-18 22:46:29 +00:00
Juha-Pekka Heikkila 28b552bf6b mesa: add asserts in load_texunit_bumpmap
In load_texunit_bumpmap tc_array is asserted so lets assert
rot_mat_0 and rot_mat_1 also which are coming from same path.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:40:29 -07:00
Juha-Pekka Heikkila c02f6c26d3 glx: add missing null check in dri2_bind_tex_image
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:40:19 -07:00
Brian Paul a9bf5999d1 mesa: minor simplification in _mesa_es3_error_check_format_and_type()
The type_valid local was set to true and never changed.
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila ca3df5eeda glx: Add missing null check in dri2CreateDrawable
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila 56c5ba8f92 mesa: Verify memory allocations success in _mesa_PushAttrib
Check for malloc() returning null to fix Klocwork warnings.
Minor clean-ups by BrianP.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila 2a83e4182c mesa: Verify memory allocations success in _mesa_PushClientAttrib
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Juha-Pekka Heikkila d08ac826c5 mesa: Change save_attrib_data() to return boolean
Change save_attrib_data() to return true/false depending on success.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Brian Paul aa4001b607 mesa: add API/extension checks for 3-component texture buffer formats
The GL_RGB32F, GL_RGB32UI and GL_RGB32I texture buffer formats are
only supposed to be allowed if the GL_ARB_texture_buffer_object_rgb32
extension is supported.  Note that the texture buffer extensions
require a core profile.  This patch adds those checks.

Fixes the soon-to-be-added
arb_clear_buffer_object-negative-bad-internalformat piglit test.
2013-12-18 09:06:52 -07:00
Brian Paul eaaa9695b2 mesa: 78-column wrapping in extensions.c 2013-12-18 09:06:52 -07:00
Pi Tabred 4bf3afdde9 mesa: Cleanup mesa/main/bufferobj.h
Column wrapping and space between lines.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Pi Tabred 3b0f5fc084 Modify release notes to include ARB_clear_buffer_object extension
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:52 -07:00
Pi Tabred 78216fb485 Add ARB_clear_buffer_object to list of supported extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Brian Paul 787dadbeea st/mesa: plug in default buffer object driver functions
In particular, this plugs in the new ClearBufferSubData() fallback
driver function.
2013-12-18 09:06:51 -07:00
Pi Tabred 5f7bc0c759 mesa: Implement functions for clear_buffer_object extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 7d94653052 mesa: Modify get_buffer() to allow for a variable error code
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 84c4ea571d mesa: Add bufferobj_range_mapped function
Add function to test if the buffer is already mapped and if so,
if the mapped range overlaps the given range.
Modify the _mesa_InvalidateBufferSubData function to use
the new function.

Enable buffer_object_subdata_range_good() to use bufferobj_range_mapped

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 72d872ad82 mesa: get_texbuffer_format(): differentiate between core and compat context
alpha, lumincance and intensity formats are illegal in a core context.
Add a check to return MESA_FORMAT_NONE if one of those is requested within
a core context.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 1ec2d0a9a8 mesa: Modify format validation to check for extension not context version
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred d5e6fe4d29 mesa: Make validate_texbuffer_format function available externally
- change storage class from static to extern
 - rename validate_texbuffer_format to _mesa_validate_texbuffer_format

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Pi Tabred 1f7c3e541f mesa: Add infrastructure for GL_ARB_clear_buffer_object
- add xml file for extension
 - add reference in gl_API.xml
 - add pointer to device driver function table (dd.h)
 - update dispatch_sanity.cpp

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-18 09:06:51 -07:00
Jan Vesely 56647c5d8f clover: Append buffers that use CL_MEM_USE_HOST_PTR.
Specs say it's legal for implementations to use internal copies, and
the write synchronization seems to work.  Fixes clCreateBuffer
(together with previous patches) and buffer-flags piglits.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
2013-12-18 16:21:59 +01:00
Jan Vesely 21f82188ce clover: Add parameter checks to clCreateBuffer.
v2: Use fewer if statements and functional tricks instead of single-use method,
    suggested by Francisco Jerez.
    Squash two small patches into one.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-18 16:18:15 +01:00
Markus Trippelsdorf 78fcc31d4a configure.ac: remove -fcolor-diagnostics from LLVM flags
When LLVM is build with Clang, "llvm-config --cxxflags" contains the
-fcolor-diagnostics flag. It is not recognized by gcc and the build
fails. Fix by removing the flag.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2013-12-18 07:12:13 -07:00
Thomas Hellstrom 00cf048b12 st/dri: Check for kernel support before enabling fd sharing v2
The dri2 state tracker is checking for driver support before enabling
dri2ImageExtension version 7. This commit adds a check that also the
kernel driver supports fd sharing through prime.

Note that this adds a libdrm dependency on dri2.c.

v2: Removed unnecessary clamping of bool expression

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2013-12-18 09:11:24 +01:00
Marek Olšák 37c24e6d86 radeonsi: set CB_DISABLE if the color mask is 0
Also needed for the DB in-place decompression according to hw docs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-18 01:20:11 +01:00
Marek Olšák 3352ff97c2 radeonsi: add the htile buffer to the CS ioctl buffer list
This may fix the GPU crashes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-18 01:20:11 +01:00
Paul Berry 7963fde37b glsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.
These enums were redundant.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-17 12:31:36 -08:00
Paul Berry abab438543 main: Move MESA_SHADER_TYPES outside of gl_shader_type enum.
This will avoid spurious compiler warnings in the patch that follows.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-17 12:31:36 -08:00