Ian Romanick [Wed, 13 Nov 2013 22:15:11 +0000 (14:15 -0800)]
mesa: Clean up bad code formatting left from previous commit
Also s/_EXT// on enums that are now part of core.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Wed, 13 Nov 2013 22:10:34 +0000 (14:10 -0800)]
mesa: GL_EXT_packed_depth_stencil is not optional
Every driver supports it. All current and future Gallium drivers always
support it, and all existing classic drivers support it.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Wed, 13 Nov 2013 21:24:14 +0000 (13:24 -0800)]
radeon: Sort list of enabled extensions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Wed, 13 Nov 2013 21:17:28 +0000 (13:17 -0800)]
r200: Sort list of enabled extensions
Note that ARB_occlusion_query was previously enabled twice.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Lauri Kasanen [Sun, 15 Dec 2013 10:37:55 +0000 (12:37 +0200)]
glx: Simplify __glxGetMscRate, it only needs the screen, not a drawable
Useful in its own right, but also needed for adaptive vsync.
No regressions in the piglit glx-oml-sync-control-getmscrate test.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Keith Packard [Sun, 24 Nov 2013 05:58:14 +0000 (21:58 -0800)]
dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACK
It is the maximum number of back buffers, but the name is confusing and is
easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make
the intended usage a bit clearer.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Fri, 22 Nov 2013 13:41:38 +0000 (05:41 -0800)]
i965: Set fast color clear mcs_state on newly allocated image miptrees
Just copying code from the dri2 path to set up the fast color clear state.
This also removes a couple of bogus intel_region_reference calls.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Fri, 22 Nov 2013 13:39:15 +0000 (05:39 -0800)]
i965: Correct check for re-bound buffer in intel_update_image_buffer
The buffer-object is the persistent thing passed through the loader, so when
updating an image buffer, check to see if it is already bound to the provided
bo. The region, on the other hand, is allocated separately for the miptree,
and so will never be the same as that passed back from the loader.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Tue, 26 Nov 2013 05:10:02 +0000 (21:10 -0800)]
dri3: Clean up struct dri3_drawable
Move the depth field up with width and height.
Remove unused previous_time and frames fields.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Fri, 22 Nov 2013 05:30:07 +0000 (21:30 -0800)]
dri3: Free resources when drawable is destroyed.
Always nice to clean up after ourselves.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Keith Packard [Fri, 22 Nov 2013 04:22:16 +0000 (20:22 -0800)]
dri3: Switch to libxshmfence version 1.1
libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which
works when the fence is a linux futex. However, version 1.1
changes the exported datatype to 'struct xshmfence *'
Require libxshmfence version 1.1 and switch the API around.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Wed, 27 Nov 2013 07:15:39 +0000 (23:15 -0800)]
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>
Chad Versace [Fri, 20 Dec 2013 12:39:03 +0000 (04:39 -0800)]
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
https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/
8bc07bb70163c3706fb4ba5f980e57dc942f56dd
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>
Kenneth Graunke [Sat, 14 Dec 2013 00:10:02 +0000 (16:10 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 09:53:26 +0000 (01:53 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 09:49:18 +0000 (01:49 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 08:33:56 +0000 (00:33 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 09:36:37 +0000 (01:36 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 09:21:54 +0000 (01:21 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 09:18:34 +0000 (01:18 -0800)]
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>
Kenneth Graunke [Wed, 18 Dec 2013 20:30:06 +0000 (12:30 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 00:06:51 +0000 (16:06 -0800)]
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>
Kenneth Graunke [Mon, 9 Dec 2013 23:58:35 +0000 (15:58 -0800)]
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>
Kenneth Graunke [Tue, 10 Dec 2013 08:06:12 +0000 (00:06 -0800)]
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>
Kevin Rogovin [Mon, 9 Dec 2013 09:18:26 +0000 (11:18 +0200)]
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>
Kevin Rogovin [Mon, 9 Dec 2013 08:38:35 +0000 (10:38 +0200)]
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>
Michel Dänzer [Thu, 19 Dec 2013 02:36:52 +0000 (11:36 +0900)]
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>
Aaron Watry [Thu, 19 Dec 2013 18:40:13 +0000 (12:40 -0600)]
r600g: Fix spelling error
Trivial change, testing commit access
Quanxian Wang [Thu, 19 Dec 2013 05:11:00 +0000 (22:11 -0700)]
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>
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
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>
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
mesa: Add asserts into emit_fog_instructions
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Juha-Pekka Heikkila [Thu, 19 Dec 2013 12:27:00 +0000 (05:27 -0700)]
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>
Dave Airlie [Wed, 18 Dec 2013 08:00:33 +0000 (18:00 +1000)]
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>
Juha-Pekka Heikkila [Wed, 18 Dec 2013 13:58:00 +0000 (06:58 -0700)]
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>
Juha-Pekka Heikkila [Wed, 18 Dec 2013 13:58:00 +0000 (06:58 -0700)]
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>
Brian Paul [Tue, 17 Dec 2013 23:20:29 +0000 (16:20 -0700)]
mesa: minor simplification in _mesa_es3_error_check_format_and_type()
The type_valid local was set to true and never changed.
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
glx: Add missing null check in dri2CreateDrawable
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
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>
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
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>
Juha-Pekka Heikkila [Mon, 16 Dec 2013 14:04:00 +0000 (07:04 -0700)]
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>
Brian Paul [Mon, 16 Dec 2013 16:41:09 +0000 (09:41 -0700)]
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.
Brian Paul [Mon, 16 Dec 2013 16:40:03 +0000 (09:40 -0700)]
mesa: 78-column wrapping in extensions.c
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Cleanup mesa/main/bufferobj.h
Column wrapping and space between lines.
Reviewed-by: Brian Paul <brianp@vmware.com>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
Modify release notes to include ARB_clear_buffer_object extension
Reviewed-by: Brian Paul <brianp@vmware.com>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
Add ARB_clear_buffer_object to list of supported extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Mon, 16 Dec 2013 16:06:17 +0000 (09:06 -0700)]
st/mesa: plug in default buffer object driver functions
In particular, this plugs in the new ClearBufferSubData() fallback
driver function.
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Implement functions for clear_buffer_object extensions
Reviewed-by: Brian Paul <brianp@vmware.com>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Modify get_buffer() to allow for a variable error code
Reviewed-by: Brian Paul <brianp@vmware.com>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
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>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
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>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
mesa: Modify format validation to check for extension not context version
Reviewed-by: Brian Paul <brianp@vmware.com>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
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>
Pi Tabred [Sat, 14 Dec 2013 17:32:00 +0000 (10:32 -0700)]
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>
Jan Vesely [Sun, 15 Dec 2013 22:28:16 +0000 (17:28 -0500)]
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>
Jan Vesely [Tue, 17 Dec 2013 16:19:09 +0000 (11:19 -0500)]
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>
Markus Trippelsdorf [Fri, 13 Dec 2013 09:59:42 +0000 (10:59 +0100)]
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>
Thomas Hellstrom [Tue, 17 Dec 2013 13:44:38 +0000 (05:44 -0800)]
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>
Marek Olšák [Tue, 17 Dec 2013 12:27:56 +0000 (13:27 +0100)]
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>
Marek Olšák [Tue, 17 Dec 2013 11:45:03 +0000 (12:45 +0100)]
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>
Paul Berry [Mon, 16 Dec 2013 21:09:20 +0000 (13:09 -0800)]
glsl: Replace _mesa_glsl_parser_targets enum with gl_shader_type.
These enums were redundant.
Reviewed-by: Brian Paul <brianp@vmware.com>
Paul Berry [Mon, 16 Dec 2013 21:05:09 +0000 (13:05 -0800)]
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>
Paul Berry [Mon, 16 Dec 2013 20:58:55 +0000 (12:58 -0800)]
glsl: Don't return bad values from _mesa_shader_type_to_index.
This will avoid compiler warnings in the patch that follows. There
should be no user-visible effect because the change only affects the
behaviour when an invalid enum is passed to
_mesa_shader_type_to_index(), and that can only happen if there is a
bug elsewhere in Mesa.
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Fri, 13 Dec 2013 23:55:28 +0000 (15:55 -0800)]
swrast: silence driContextSetFlags() parameter type warning
Brian Paul [Fri, 13 Dec 2013 23:54:45 +0000 (15:54 -0800)]
st/dri: fix compiler warning for driCopySubBufferExtension
Marek Olšák [Tue, 17 Dec 2013 02:11:30 +0000 (03:11 +0100)]
radeonsi: improve HiZ precision for less and lequal depth functions
r600g needs this too.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Tue, 17 Dec 2013 02:06:44 +0000 (03:06 +0100)]
radeonsi: make DB_RENDER_OVERRIDE an invariant register
All this cruft was ported from r600g and isn't needed on SI and later
according to hw docs. If we implemented HiS, we would set it to 0.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Mon, 16 Dec 2013 23:46:45 +0000 (00:46 +0100)]
radeonsi: flush HTILE when appropriate
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Thomas Hellstrom [Thu, 20 Sep 2012 09:41:23 +0000 (11:41 +0200)]
st/xa: Add new map flags
Replicate some of the gallium pipe transfer functionality.
Also bump minor to signal availability of this feature.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Alexander von Gluck IV [Sat, 14 Dec 2013 17:46:05 +0000 (11:46 -0600)]
Haiku: Add in public GL kit headers
* These make up the base of what C++ GL Haiku applications
use for 3D rendering.
* Not placed in includes/GL to prevent Haiku headers from
getting installed on non-Haiku systems.
Acked-by: Brian Paul <brianp@vmware.com>
Rob Clark [Sat, 14 Dec 2013 17:13:28 +0000 (12:13 -0500)]
freedreno: dummy-draw workaround for a320
Fixes gpu lockups in supertuxkart.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Marek Olšák [Thu, 12 Dec 2013 16:22:52 +0000 (17:22 +0100)]
r600g: expose 32-bit integer vertex formats
This advertises GL_ARB_texture_buffer_object_rgb32.
Marek Olšák [Thu, 5 Dec 2013 18:39:36 +0000 (19:39 +0100)]
radeonsi: move invariant regs to si_init_config
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 12 Dec 2013 17:09:08 +0000 (18:09 +0100)]
r600g: use shader-based MSAA resolving when hw-based one cannot be used
This fixes some MSAA integer tests.
Marek Olšák [Sat, 7 Dec 2013 16:57:10 +0000 (17:57 +0100)]
radeonsi: use shader-based MSAA resolving when hw-based one cannot be used
This fixes MSAA resolving for 32-bit integer colorbuffers, which isn't
implemented by the hardware.
It also fixes VM protection faults when resolving MSAA 2D array textures.
This may be a CB bug, because shader-based resolving works fine.
It may also be faster for upside-down and scaled blits.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 7 Dec 2013 16:32:22 +0000 (17:32 +0100)]
gallium/u_blitter: implement shader-based MSAA resolve with bilinear filtering
For scaled resolve. The filter is only good for magnification.
If somebody has an idea how to implement a good filter for minification,
I'm all ears. I'd have to use derivatives probably.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 6 Dec 2013 22:55:05 +0000 (23:55 +0100)]
gallium/u_blitter: implement shader-based MSAA resolve
We need this for integer formats and upside-down blits, which Radeons don't
support for MSAA resolving.
It can be used by calling util_blitter_blit.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 6 Dec 2013 21:39:48 +0000 (22:39 +0100)]
gallium/u_blitter: remove useless parameters from some functions
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Tue, 10 Dec 2013 16:46:41 +0000 (17:46 +0100)]
st/dri: resolve sRGB buffers in linear colorspace
Reviewed-by: Brian Paul <brianp@vmware.com>
Roland Scheidegger [Fri, 13 Dec 2013 20:20:05 +0000 (21:20 +0100)]
gallivm: fix pointer type for stmxcsr/ldmxcsr
The argument is a i8 pointer not a i32 pointer (even though the value actually
stored/loaded IS i32). Older llvm versions didn't care but 3.2 and newer do
leading to crashes.
Reviewed-by: Zack Rusin <zackr@vmware.com>
Roland Scheidegger [Fri, 13 Dec 2013 17:31:07 +0000 (18:31 +0100)]
llvmpipe: get rid of barycentric calculation of a0
Didn't really work as well as hoped (in particular it was not generally
more accurate), will solve this differently.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Fri, 13 Dec 2013 00:09:35 +0000 (01:09 +0100)]
llvmpipe: (trivial) get rid of triangle subdivision code
This code was always problematic, and with 64bit rasterization we no longer
need it at all.
Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Wed, 8 May 2013 21:38:25 +0000 (14:38 -0700)]
i965: Treat Haswell as 75 in the surface format table.
Much like we do for G45.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Chris Forbes [Sun, 8 Dec 2013 06:04:40 +0000 (19:04 +1300)]
mesa: fix texture view use of _mesa_get_tex_image()
The target parameter to _mesa_get_tex_image() is a target enum, not an index.
When we're setting up faces for a cubemap, it should be
CUBE_MAP_POSITIVE_X .. CUBE_MAP_NEGATIVE_Z; for all other targets it
should be the same as the texobj's target.
Fixes broken cubemaps [had only +X face but claimed to have all] produced by
glTextureView, which then caused various crashes in the driver when we
tried to use them.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Chris Forbes [Sun, 8 Dec 2013 07:29:43 +0000 (20:29 +1300)]
i965/fs: add support for gl_SampleMaskIn[]
v2: - add assert so we don't run into trouble on Gen6.
- adjust for Tapani's rearrangement of ir_variable
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Sun, 8 Dec 2013 07:03:25 +0000 (20:03 +1300)]
glsl: add gl_SampleMaskIn[] builtin
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Sun, 8 Dec 2013 07:01:24 +0000 (20:01 +1300)]
mesa: add SYSTEM_VALUE_SAMPLE_MASK_IN
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Sat, 14 Dec 2013 00:02:43 +0000 (17:02 -0700)]
mesa: document _mesa_texstore() return value
Brian Paul [Fri, 13 Dec 2013 16:52:15 +0000 (09:52 -0700)]
st/mesa: only set up sampler compare mode for depth textures
The GL_ARB_shadow spec says the shadow compare mode should have no
effect when sampling a color texture. As it was, it was up to
drivers to check for that (softpipe, llvmpipe, svga and probably
the rest don't do that). Note: it looks like DX10 allows shadow
compare with some non-depth formats, so this case really should be
handled in the state tracker.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Brian Paul [Fri, 13 Dec 2013 16:33:49 +0000 (09:33 -0700)]
st/mesa: add const qualifiers in sampler validation code
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Brian Paul [Fri, 13 Dec 2013 16:28:07 +0000 (09:28 -0700)]
st/mesa: add const qualifier to st_translate_color()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Brian Paul [Fri, 13 Dec 2013 16:26:24 +0000 (09:26 -0700)]
st/mesa: simplify integer texture check
Just use the gl_texture_object::_IsInteger field instead of
computing it from scratch.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Brian Paul [Thu, 12 Dec 2013 21:55:33 +0000 (14:55 -0700)]
mesa: update glext.h to version
20131212
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Mon, 9 Dec 2013 20:50:44 +0000 (12:50 -0800)]
svga: don't emit extraneous fs shadow code
Depending on the depth texture format, we may or may not have to
emit explicit fs code to do the shadow comparison. Before, we
were emitting it more often than needed.
v2: check the actual texture format rather than the screen->depth.z16
field. The screen->depth.z16, x8z24, s8z24 fields may not all be set
to a consistent set of depth formats.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Brian Paul [Fri, 13 Dec 2013 19:51:10 +0000 (12:51 -0700)]
mesa: s/uint/GLuint/ to fix MSVC error
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:31:37 +0000 (13:31 -0700)]
mesa: Update TexStorage to support ARB_texture_view
Call TextureView helper function to set TextureView state
appropriately for the TexStorage calls.
Misc updates from review feedback.
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Courtney Goeltzenleuchter [Wed, 6 Nov 2013 21:40:31 +0000 (14:40 -0700)]
mesa: add texture_view helper function for TexStorage
Add helper function to set texture_view state from TexStorage calls.
Include review feedback.
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Courtney Goeltzenleuchter [Wed, 6 Nov 2013 21:34:09 +0000 (14:34 -0700)]
mesa: Fill out ARB_texture_view entry points
Add Mesa TextureView logic.
Incorporate feedback on ARB_texture_view:
- Add S3TC VIEW_CLASSes to compatibility table
- Use existing _mesa_get_tex_image
- Clean up error strings
- Use bool instead of GLboolean for internal functions
- Split compound level & layer test into individual tests
- eliminate helper macro for VIEW_CLASS table
- do not call driver if ptr null.
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Courtney Goeltzenleuchter [Mon, 25 Nov 2013 23:31:26 +0000 (16:31 -0700)]
mesa: consolidate multiple next_mipmap_level_size
Refactor to make next_mipmap_level_size defined in mipmap.c a
_mesa_ helper function that can then be used by texture_view
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 21:09:22 +0000 (14:09 -0700)]
mesa: Add driver entry point for ARB_texture_view
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Courtney Goeltzenleuchter [Mon, 4 Nov 2013 20:29:48 +0000 (13:29 -0700)]
mesa: ARB_texture_view get parameters
Add support for ARB_texture_view get parameters:
GL_TEXTURE_VIEW_MIN_LEVEL
GL_TEXTURE_VIEW_NUM_LEVELS
GL_TEXTURE_VIEW_MIN_LAYER
GL_TEXTURE_VIEW_NUM_LAYERS
Incorporate feedback regarding when to allow query of
GL_TEXTURE_IMMUTABLE_LEVELS.
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Brian Paul <brianp@vmware.com>