mesa.git
10 years agoi965: Rework 3DSTATE_VS for Broadwell.
Kenneth Graunke [Thu, 29 Nov 2012 09:10:19 +0000 (01:10 -0800)]
i965: Rework 3DSTATE_VS for Broadwell.

v2: Remove incorrect MOCS shifts; rename urb_entry_write_offset to
    urb_entry_output_offset to closer match the documentation.

v3: Only emit a non-zero constant buffer read length when active.

v4: Add missing binding table counts (caught by Eric).

v5: Rebase on Paul Berry's changes to CurrentVertexProgram.

v6: Drop bogus SBE read length/offset field code.  We were programming
    the wrong values, and our 3DSTATE_SBE code overrides any value we
    put here anyway with the correct one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v4]
10 years agoi965: Add the new 3DSTATE_PS_BLEND state packet.
Kenneth Graunke [Fri, 30 Nov 2012 02:43:59 +0000 (18:43 -0800)]
i965: Add the new 3DSTATE_PS_BLEND state packet.

v2: Only set GEN8_PS_BLEND_HAS_WRITEABLE_RT if color buffer writes are
    enabled (caught by Eric Anholt).

v3: Set non-blending flags (writeable RT, alpha test, alpha to coverage)
    for integer formats too.  +14 Piglits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
10 years agoi965: Replace DEPTH_STENCIL_STATE with Gen8's 3DSTATE_WM_DEPTH_STENCIL.
Kenneth Graunke [Fri, 30 Nov 2012 01:52:31 +0000 (17:52 -0800)]
i965: Replace DEPTH_STENCIL_STATE with Gen8's 3DSTATE_WM_DEPTH_STENCIL.

v2: Use stencil->_WriteEnabled instead of setting
    GEN8_WM_DS_STENCIL_BUFFER_WRITE_ENABLE twice (suggested by Eric).

v3: Mask stencil->WriteMask and stencil->ValueMask with 0xff.  The field
    is only 8-bits, so we'd trip the new SET_FIELD assertion when core
    Mesa gave us a value like 0xFFFFFFFF.  The Gen7 code uses structure
    field widths to implicitly do this truncation.  Fixes Piglit tests.

v4: Use uint32_t for dw1/dw2, not uint8_t.  Worst. Typo. Ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
10 years agoi965: Update SF, SBE, and RASTER state for Broadwell.
Kenneth Graunke [Fri, 1 Nov 2013 21:37:33 +0000 (14:37 -0700)]
i965: Update SF, SBE, and RASTER state for Broadwell.

The attribute override portion of 3DSTATE_SBE was split out into
3DSTATE_SBE_SWIZ; various bits of 3DSTATE_SF were split out into
3DSTATE_RASTER.

v2: Set Force URB Read Offset bit.  Eventually the URB read offset
    should be set in 3DSTATE_VS, but that will require some refactoring.

v3: Rebase on viewport array changes.

v4: Improve comments about URB read length/offset overrides.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Bump generation assertions on workaround flushes.
Kenneth Graunke [Thu, 29 Nov 2012 09:50:22 +0000 (01:50 -0800)]
i965: Bump generation assertions on workaround flushes.

I haven't investigated whether these are necessary on Broadwell or not,
but for paranoia's sake, we may as well continue doing them for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
10 years agoi965: Duplicate gen7_atoms to gen8_atoms.
Kenneth Graunke [Thu, 29 Nov 2012 05:16:18 +0000 (21:16 -0800)]
i965: Duplicate gen7_atoms to gen8_atoms.

It's going to diverge significantly.  Starting out with a copy allows
future patches to change atoms one by one.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoradeon: move driContextSetFlags(ctx) call after ctx var is initialized
Brian Paul [Sat, 1 Feb 2014 00:09:44 +0000 (17:09 -0700)]
radeon: move driContextSetFlags(ctx) call after ctx var is initialized

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor200: move driContextSetFlags(ctx) call after ctx var is initialized
Brian Paul [Sat, 1 Feb 2014 00:09:44 +0000 (17:09 -0700)]
r200: move driContextSetFlags(ctx) call after ctx var is initialized

Otherwise, ctx was a garbage value.

CC: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agollvmpipe: fix denorm handling for r11g11b10_float format when blending
Roland Scheidegger [Fri, 31 Jan 2014 18:47:37 +0000 (19:47 +0100)]
llvmpipe: fix denorm handling for r11g11b10_float format when blending

The code re-enabling denorms for small float formats did not recognize
this format due to format handling hacks (mainly, the lp_type doesn't have
the floating bit set).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agoglsl: Expand non-expr & non-swizzle scalar rvalues in vectorizing.
Matt Turner [Tue, 28 Jan 2014 22:44:39 +0000 (14:44 -0800)]
glsl: Expand non-expr & non-swizzle scalar rvalues in vectorizing.

10 years agoglcpp: Reject #version after the version has been resolved.
Matt Turner [Wed, 29 Jan 2014 20:48:51 +0000 (12:48 -0800)]
glcpp: Reject #version after the version has been resolved.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74166
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoglcpp: Rename the variable used to enable debugging.
Carl Worth [Wed, 29 Jan 2014 21:25:08 +0000 (13:25 -0800)]
glcpp: Rename the variable used to enable debugging.

The -p option we now use when calling bison means that this variable will be
named glcpp_parser_debug not yydebug. This was not caught when the -p option
was added because this variable isn't used in the code as committed. (I prefer
the declaration to remain since it allows a developer to easily find this
variable name to enable debugging.)

10 years agoglcpp: Add "make check" test for comment-parsing bug
Carl Worth [Wed, 29 Jan 2014 22:19:04 +0000 (14:19 -0800)]
glcpp: Add "make check" test for comment-parsing bug

This is the innocent-looking but killer test case to verify the bug fixed in
the preceding commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agoglcpp: Don't enter lexer's NEWLINE_CATCHUP start state for single-line comments
Carl Worth [Wed, 29 Jan 2014 21:19:39 +0000 (13:19 -0800)]
glcpp: Don't enter lexer's NEWLINE_CATCHUP start state for single-line comments

In commit 6005e9cb28 a new start state of NEWLINE_CATCHUP was added to the
lexer. This start state is used whenever the lexer is emitting a NEWLINE token
to emit additional NEWLINE tokens for any newline characters that were skipped
by an immediately preceding multi-line comment.

However, that commit erroneously entered the NEWLINE_CATCHUP state for
single-line comments. This is not desired since in the case of a single-line
comment, the lexer is not emitting any NEWLINE token. The result is that the
lexer will remain in the NEWLINE_CATCHUP state and proceed to fail to emit a
NEWLINE token for the subsequent newline character, (since the case to match \n expects only the INITIAL start state).

The fix is quite simple, remove the "BEGIN NEWLINE_CATCHUP" code from the
single-line comment case, (preserving it only in exactly the cases where the
lexer is actually emitting a NEWLINE token).

Many thanks to Petri Latvala for reporting this bug and for providing the
minimal test case to exercise it. The bug showed up only with a multi-line
comment which was followed immediately by a single-line comment (without any
intervening newline), such as:

/*
        */ // Kablam!

Since 6005e9cb28, and before this commit, that very innocent-looking
combination of comments would yield a parse failure in the compiler.

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

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa: use _mesa_align_free() in _mesa_delete_buffer_object()
Brian Paul [Fri, 31 Jan 2014 16:52:10 +0000 (09:52 -0700)]
mesa: use _mesa_align_free() in _mesa_delete_buffer_object()

To match _mesa_align_malloc() call in _mesa_buffer_data().
Found by Colin Harrison <colin.harrison@virgin.net>

Signed-off-by: Brian Paul <brianp@vmware.com>
10 years agost/dri: Fix tests for no draw/read buffers in dri_make_current()
Michel Dänzer [Thu, 30 Jan 2014 07:47:28 +0000 (16:47 +0900)]
st/dri: Fix tests for no draw/read buffers in dri_make_current()

Fixes piglit glx/GLX_ARB_create_context/current with no framebuffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agodri3: Track current Present swap mode and adjust buffer counts
Keith Packard [Mon, 27 Jan 2014 00:14:29 +0000 (16:14 -0800)]
dri3: Track current Present swap mode and adjust buffer counts

This automatically adjusts the number of buffers that we want based on
what swapping mode the X server is using and the current swap interval:

        swap mode       interval        buffers
        copy            > 0             1
        copy            0               2
        flip            > 0             2
        flip            0               3

Note that flip with swap interval 0 is currently limited to twice the
underlying refresh rate because of how the kernel manages flipping. Moving
from 3 to 4 buffers would help, but that seems ridiculous.

v2: Just update num_back at the point that the values that change num_back
    change.  This means we'll have the updated value at the point that the
    freeing of old going-to-be-unused backbuffers happens, which might not
    have been the case before (change by anholt, acked by keithp).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
Keith Packard [Fri, 22 Nov 2013 04:08:35 +0000 (20:08 -0800)]
dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888

The __DRIimage createImageFromFds function takes a fourcc code, but there was
no fourcc code that match __DRI_IMAGE_FORMAT_SARGB8. This adds a define for
that format, adds a translation in DRI3 from __DRI_IMAGE_FORMAT_SARGB8 to
__DRI_IMAGE_FOURCC_SARGB8888 and then adds translations *back* to
__IMAGE_FORMAT_SARGB8 in both the i915 and i965 drivers.

I'll refrain from comments on whether I think having two separate sets of
format defines in dri_interface.h is a good idea or not...

Fixes piglit glx-tfp and glx-visuals-depth

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodri3: Flush XCB before blocking for special events
Keith Packard [Tue, 26 Nov 2013 06:57:42 +0000 (22:57 -0800)]
dri3: Flush XCB before blocking for special events

XCB doesn't flush the output buffer automatically, so we have to call
xcb_flush ourselves before waiting.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodri3: Enable GLX_INTEL_swap_event
Keith Packard [Tue, 26 Nov 2013 05:24:54 +0000 (21:24 -0800)]
dri3: Enable GLX_INTEL_swap_event

Now that we're tracking SBC values correctly, and the X server has the
ability to send the GLX swap events from a PresentPixmap request, enable
this extension.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC
Keith Packard [Tue, 26 Nov 2013 05:21:40 +0000 (21:21 -0800)]
dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBC

Eric figured out that glXWaitForSbcOML wanted to block until the requested
SBC had been completed, which means to wait until the
PresentCompleteNotify event for that SBC had been received.

This replaces the simple sleep(1) loop (which was bogus) with a loop that
just checks to see if we've seen the specified SBC value come back in a
PresentCompleteNotify event yet.

The change is a bit larger than that as I've broken out a piece of common
code to wait for and process a single Present event for the target
drawable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agodri3: Track full 64-bit SBC numbers, instead of just 32-bits
Keith Packard [Tue, 26 Nov 2013 05:14:55 +0000 (21:14 -0800)]
dri3: Track full 64-bit SBC numbers, instead of just 32-bits

Tracking the full 64-bit SBC values makes it clearer how those values are
being used, and simplifies the wait_msc code. The only trick is in
re-constructing the full 64-bit value from Present's 32-bit serial number
that we use to pass the SBC value from request to event.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Add warning to _REV pack/unpack functions with incorrect behavior
Mark Mueller [Sun, 26 Jan 2014 18:43:23 +0000 (10:43 -0800)]
mesa: Add warning to _REV pack/unpack functions with incorrect behavior

Signed-off-by: Mark Mueller <MarkKMueller@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agor600g: Removed unnecessary positivity check for unsigned int variable.
Siavash Eliasi [Thu, 12 Dec 2013 14:58:52 +0000 (18:28 +0330)]
r600g: Removed unnecessary positivity check for unsigned int variable.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agost/dri: Allow creating OpenGL 3.3 core contexts
Michel Dänzer [Wed, 29 Jan 2014 09:24:04 +0000 (18:24 +0900)]
st/dri: Allow creating OpenGL 3.3 core contexts

Enables OpenGL 3.3 piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agobuild: Share the all-local rule for linking libraries into the build dir
Kristian Høgsberg [Wed, 29 Jan 2014 19:40:25 +0000 (11:40 -0800)]
build: Share the all-local rule for linking libraries into the build dir

This consolidates how we link the libraries into the build directory.
It works for lib_LTLIBRARIES but not custom shared libraries like DRI
drivers or gallium state trackers which needs special casing (cf dri
mega drivers, for example)

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoloader: do not print the pci id during normal operation
Emil Velikov [Thu, 23 Jan 2014 17:59:39 +0000 (17:59 +0000)]
loader: do not print the pci id during normal operation

Spamming the pci id is not beneficial. Make sure it's printed
only when needed.

v2: Change severity to _LOADER_DEBUG, rather than removing
the message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoloader: print WARNING and FATAL messages using the default logger
Emil Velikov [Tue, 28 Jan 2014 01:20:45 +0000 (01:20 +0000)]
loader: print WARNING and FATAL messages using the default logger

Lower values are used for more severe cases.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: s/_NDEBUG/NDEBUG/
Emil Velikov [Thu, 23 Jan 2014 17:43:16 +0000 (17:43 +0000)]
glsl: s/_NDEBUG/NDEBUG/

The former symbol is never defined within mesa. Based on the code
it seems that the original intent was to use NDEBUG.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodir-locals.el: Set indent-tabs-mode true for makefile-mode
Kristian Høgsberg [Wed, 29 Jan 2014 18:30:23 +0000 (10:30 -0800)]
dir-locals.el: Set indent-tabs-mode true for makefile-mode

Makefiles need hard tabs, let's not make that harder than it needs to be.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agomesa: Return after ScissorArrayv or ScissorIndexed detect a parameter error
Courtney Goeltzenleuchter [Thu, 23 Jan 2014 20:53:42 +0000 (13:53 -0700)]
mesa: Return after ScissorArrayv or ScissorIndexed detect a parameter error

Fixes piglit arb_viewport_array-scissor-ignore.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jon Ashburn <jon@lunarg.com>
10 years agodocs: Add GL_ARB_map_buffer_alignment status to GL3.txt and release notes
Ian Romanick [Thu, 23 Jan 2014 00:17:48 +0000 (16:17 -0800)]
docs: Add GL_ARB_map_buffer_alignment status to GL3.txt and release notes

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: GL_ARB_map_buffer_alignment is not optional
Siavash Eliasi [Thu, 28 Nov 2013 08:56:42 +0000 (12:26 +0330)]
mesa: GL_ARB_map_buffer_alignment is not optional

Every driver supports it.  All current and future Gallium drivers always
support it, and all existing classic drivers support it.

v2: Making GL_ARB_map_buffer_alignment a desktop OpenGL extension only.

v3: Squash two commits together.

v4 (idr): MIN_MAP_BUFFER_ALIGNMENT queries don't have any dependencies.
In previous versions of the patch it depended on EXTRA_API_GL which
would prevent the query from working in core profile contexts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agonouveau: Use gl_constants::MinMapBufferAlignment as the alignment in nouveau_bo_new
Siavash Eliasi [Thu, 28 Nov 2013 08:56:39 +0000 (12:26 +0330)]
nouveau: Use gl_constants::MinMapBufferAlignment as the alignment in nouveau_bo_new

This driver does not support GL_ARB_map_buffer_range, so no special
treatment is needed for unaligned offsets in the mapping.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoradeon / r200: Use gl_constants::MinMapBufferAlignment as the alignment in radeon_bo...
Siavash Eliasi [Thu, 28 Nov 2013 08:56:38 +0000 (12:26 +0330)]
radeon / r200: Use  gl_constants::MinMapBufferAlignment as the alignment in radeon_bo_open

These drivers do not support GL_ARB_map_buffer_range, so no special
treatment is needed for unaligned offsets in the mapping.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Use _mesa_align_malloc in _mesa_buffer_data
Siavash Eliasi [Thu, 28 Nov 2013 08:56:37 +0000 (12:26 +0330)]
mesa: Use _mesa_align_malloc in _mesa_buffer_data

v2: Fixed memory leak.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Set gl_constants::MinMapBufferAlignment to 64 by default
Siavash Eliasi [Thu, 28 Nov 2013 08:56:36 +0000 (12:26 +0330)]
mesa: Set gl_constants::MinMapBufferAlignment to 64 by default

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa/st: Unconditionally enable ARB_map_buffer_alignment.
Siavash Eliasi [Thu, 28 Nov 2013 08:56:35 +0000 (12:26 +0330)]
mesa/st: Unconditionally enable ARB_map_buffer_alignment.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agofreedreno: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Ian Romanick [Wed, 22 Jan 2014 22:02:42 +0000 (14:02 -0800)]
freedreno: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

Allocations actually have page alignment, but 64 is still a reasonable
value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
10 years agoilo: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Siavash Eliasi [Thu, 28 Nov 2013 08:56:34 +0000 (12:26 +0330)]
ilo: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

Ian manually ran the map_buffer_range* tests and the
arb_map_buffer_alignment-* tests, but he did not do a full piglit run.

v2 (idr): Use 64 instead of 4096

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
10 years agosvga: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Siavash Eliasi [Thu, 28 Nov 2013 08:56:33 +0000 (12:26 +0330)]
svga: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi915g: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Siavash Eliasi [Tue, 3 Dec 2013 04:53:06 +0000 (08:23 +0330)]
i915g: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

10 years agoi915g: Use alignment of 64 instead of 16 for buffer allocation
Siavash Eliasi [Tue, 3 Dec 2013 04:50:32 +0000 (08:20 +0330)]
i915g: Use alignment of 64 instead of 16 for buffer allocation

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agollvmpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Siavash Eliasi [Thu, 28 Nov 2013 08:56:30 +0000 (12:26 +0330)]
llvmpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agollvmpipe: Use alignment of 64 instead of 16 for buffer allocation
Siavash Eliasi [Thu, 28 Nov 2013 17:44:31 +0000 (21:14 +0330)]
llvmpipe: Use alignment of 64 instead of 16 for buffer allocation

v2: Changed allocation alignment of llvmpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agosoftpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
Siavash Eliasi [Thu, 28 Nov 2013 08:56:28 +0000 (12:26 +0330)]
softpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64

v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agosoftpipe: Use alignment of 64 instead of 16 for buffer allocation
Siavash Eliasi [Thu, 28 Nov 2013 17:40:29 +0000 (21:10 +0330)]
softpipe: Use alignment of 64 instead of 16 for buffer allocation

v2: Changed allocation alignment in softpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi915g: support more PIPE_CAPs
Stéphane Marchesin [Wed, 29 Jan 2014 02:28:56 +0000 (18:28 -0800)]
i915g: support more PIPE_CAPs

10 years agoradeonsi: Put GS ring buffer descriptors with streamout buffer descriptors
Michel Dänzer [Tue, 28 Jan 2014 06:39:30 +0000 (15:39 +0900)]
radeonsi: Put GS ring buffer descriptors with streamout buffer descriptors

And mark the constant buffers as read only for the GPU again.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Enable OpenGL 3.3
Michel Dänzer [Fri, 24 Jan 2014 08:51:34 +0000 (17:51 +0900)]
radeonsi: Enable OpenGL 3.3

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Geometry shader micro-optimizations
Michel Dänzer [Fri, 24 Jan 2014 07:46:27 +0000 (16:46 +0900)]
radeonsi: Geometry shader micro-optimizations

Move parameter loads out of loops, and use the instruction offset
instead of a VGPR for the vertex attribute offset when writing to the
ESGS ring buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: We don't support indirect addressing of geometry shader inputs
Michel Dänzer [Wed, 22 Jan 2014 09:47:21 +0000 (18:47 +0900)]
radeonsi: We don't support indirect addressing of geometry shader inputs

Fixes piglit spec/glsl-1.50/execution/geometry/dynamic_input_array_index

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Pass VS resource descriptors to the HW ES shader stage as well
Michel Dänzer [Wed, 22 Jan 2014 08:32:09 +0000 (17:32 +0900)]
radeonsi: Pass VS resource descriptors to the HW ES shader stage as well

This makes sure constants and samplers work in the vertex shader even
when a geometry shader is active.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Fix streamout from geometry shader
Michel Dänzer [Wed, 8 Jan 2014 08:48:21 +0000 (17:48 +0900)]
radeonsi: Fix streamout from geometry shader

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Simplify shader PM4 state handling
Michel Dänzer [Fri, 17 Jan 2014 00:53:14 +0000 (09:53 +0900)]
radeonsi: Simplify shader PM4 state handling

Just always bind the current states before drawing.

Besides the simplification, as a bonus this makes sure the VS hardware
shader stage always uses the GS copy shader when a geometry shader is
active, fixing a number of GS related piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Properly match ES outputs to GS inputs
Michel Dänzer [Wed, 15 Jan 2014 06:24:14 +0000 (15:24 +0900)]
radeonsi: Properly match ES outputs to GS inputs

Fixes piglit vs-gs-arrays-within-blocks-pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Really dump TGSI code before any TGSI->LLVM conversion attempt
Michel Dänzer [Wed, 15 Jan 2014 03:31:07 +0000 (12:31 +0900)]
radeonsi: Really dump TGSI code before any TGSI->LLVM conversion attempt

While we're at it, use the local variable 'sel'.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Also export clip distances with geometry shader
Michel Dänzer [Thu, 9 Jan 2014 09:18:26 +0000 (18:18 +0900)]
radeonsi: Also export clip distances with geometry shader

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Take GS into account for VS state in more places
Michel Dänzer [Thu, 9 Jan 2014 07:10:49 +0000 (16:10 +0900)]
radeonsi: Take GS into account for VS state in more places

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Handle adjacency primitives
Michel Dänzer [Thu, 9 Jan 2014 07:35:46 +0000 (16:35 +0900)]
radeonsi: Handle adjacency primitives

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Handle TGSI_SEMANTIC_PRIMID
Michel Dänzer [Thu, 9 Jan 2014 03:55:26 +0000 (12:55 +0900)]
radeonsi: Handle TGSI_SEMANTIC_PRIMID

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Generalize counting of shader parameters
Michel Dänzer [Thu, 9 Jan 2014 06:33:34 +0000 (15:33 +0900)]
radeonsi: Generalize counting of shader parameters

Now it covers ES->GS as well as VS->PS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Fix handling of geometry shader output vertex ID
Michel Dänzer [Wed, 8 Jan 2014 09:45:10 +0000 (18:45 +0900)]
radeonsi: Fix handling of geometry shader output vertex ID

It needs to increment at shader runtime, not at shader compile time, as
the geometry shader can emit vertices in loops. LLVM automagically
converts the ID back to an immediate value if its value can be
determined at compile time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Initial geometry shader support
Michel Dänzer [Thu, 21 Nov 2013 07:45:28 +0000 (16:45 +0900)]
radeonsi: Initial geometry shader support

Partly based on the corresponding r600g work by Vadim Girlin and Dave
Airlie.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: Refactor shader input / output handling code
Michel Dänzer [Mon, 9 Dec 2013 06:33:53 +0000 (15:33 +0900)]
radeonsi: Refactor shader input / output handling code

In preparation for adding geometry shader support.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoi965/fs: Add a saturation propagation optimization pass.
Matt Turner [Thu, 12 Dec 2013 08:30:16 +0000 (00:30 -0800)]
i965/fs: Add a saturation propagation optimization pass.

Transforms, for example,

mul     vgrf3, vgrf2, vgrf1
mov.sat vgrf4, vgrf3

into

mul.sat vgrf3, vgrf2, vgrf1
mov     vgrf4, vgrf3

which gives register_coalescing an opportunity to remove the MOV
instruction.

total instructions in shared programs: 1515039 -> 1504634 (-0.69%)
instructions in affected programs:     798586 -> 788181 (-1.30%)
GAINED:                                0
LOST:                                  4

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agoi965: Add can_do_saturate() method to backend_instruction.
Matt Turner [Thu, 12 Dec 2013 07:07:49 +0000 (23:07 -0800)]
i965: Add can_do_saturate() method to backend_instruction.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agomesa: Generate correct error code in glDrawBuffers()
Anuj Phogat [Tue, 28 Jan 2014 01:23:32 +0000 (17:23 -0800)]
mesa: Generate correct error code in glDrawBuffers()

OpenGL 3.3 spec expects GL_INVALID_OPERATION:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT AND BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID OPERATION."

But OpenGL 4.0 spec changed the error code to GL_INVALID_ENUM:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID_ENUM."

This patch changes the behaviour to match OpenGL 4.0 spec
Fixes Khronos OpenGL CTS draw_buffers_api.test.

V2: Update the comment in code.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoloader: fix running with --disable-egl builds
Dave Airlie [Tue, 28 Jan 2014 05:52:13 +0000 (15:52 +1000)]
loader: fix running with --disable-egl builds

I sometimes build without EGL just for speed purposes, however
it no longer finds my drivers when I do due to the HAVE_LIBUDEV
defines being wrong.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Ignore 'centroid' interpolation qualifier in case of persample shading
Anuj Phogat [Wed, 22 Jan 2014 23:41:58 +0000 (15:41 -0800)]
i965: Ignore 'centroid' interpolation qualifier in case of persample shading

I missed this change in commit f5cfb4a. It fixes the incorrect
rendering caused in Dolphin Emulator.

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

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Markus Wick <wickmarkus@web.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agogbm: Make libgbm.so.1 symlink.
Matt Turner [Tue, 28 Jan 2014 06:17:25 +0000 (22:17 -0800)]
gbm: Make libgbm.so.1 symlink.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Allow depth = 0 parameter for TexImage3D.
Kevin Rogovin [Mon, 27 Jan 2014 10:16:19 +0000 (12:16 +0200)]
mesa: Allow depth = 0 parameter for TexImage3D.

Fixes the tests for the depth parameter for TexImage3D calls when the
target type is GL_TEXTURE_2D_ARRAY or GL_TEXTURE_CUBE_MAP_ARRAY
so that a depth value of 0 is accepted. Previously, the check
incorrectly required the depth argument to be atleast 1.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agor600g,radeonsi: Don't set resource_create in r600_common_screen_init()
Tom Stellard [Tue, 28 Jan 2014 14:51:50 +0000 (06:51 -0800)]
r600g,radeonsi: Don't set resource_create in r600_common_screen_init()

r600g and radeonsi have different implementations of resource_create.

https://bugs.freedesktop.org/show_bug.cgi?id=74139

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoc11: Add missing stdlib.h include.
José Fonseca [Tue, 28 Jan 2014 14:35:04 +0000 (14:35 +0000)]
c11: Add missing stdlib.h include.

For malloc/free.

Silences gcc mingw warnings.

10 years agoloader: include dlfcn.h when building with HAVE_LIBUDEV
Emil Velikov [Tue, 28 Jan 2014 10:15:17 +0000 (10:15 +0000)]
loader: include dlfcn.h when building with HAVE_LIBUDEV

The code depending on the definitions is already wrapped
in the same conditional so go ahead and wrap the include.

Otherwise we'll brake compilation on platforms that are
missing the header. Add assert.h in there as well, as it
is introduced and used in the same fashon.

Cc: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74122
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogallivm: Workaround http://llvm.org/PR18600
José Fonseca [Fri, 24 Jan 2014 14:25:46 +0000 (14:25 +0000)]
gallivm: Workaround http://llvm.org/PR18600

We have code generation paths that carry out swizzles of AoS vectors via
bitwise shifts, as these tend to generate more efficient code than
straightforward byte shuffles.  But when the input is a constant the
additional bitwise arithmetic operations somehow don't really get
constant propagated properly, evenutally causing assertion failure in
InstCombine pass.

Therefore avoid the bug by using the trivial shuffles for constant
inputs.

Although the sample LLVM IR can cause a crash with any LLVM version,
this was only seen in practice with LLVM 3.2.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoglsl: Avoid combining statements from different basic blocks.
Matt Turner [Mon, 27 Jan 2014 18:49:12 +0000 (10:49 -0800)]
glsl: Avoid combining statements from different basic blocks.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74113
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Set proper swizzle when a channel is missing in vectorizing.
Matt Turner [Fri, 24 Jan 2014 23:17:08 +0000 (15:17 -0800)]
glsl: Set proper swizzle when a channel is missing in vectorizing.

Previously, for example if the x channel was missing from a series of
assignments we were attempting to vectorize, the wrong swizzle mask
would be applied.

   a.y = b.y;
   a.z = b.z;
   a.w = b.w;

would be incorrectly transformed into

   a.yzw = b.xyz;

Fixes two transform feedback tests in the ES3 conformance suite.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73978
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73954
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Use bitfieldInsert in ldexp() lowering.
Matt Turner [Mon, 27 Jan 2014 19:56:14 +0000 (11:56 -0800)]
glsl: Use bitfieldInsert in ldexp() lowering.

Shaves a few instructions off of lowered ldexp().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Add constant evaluation of ir_binop_bfm.
Matt Turner [Thu, 23 Jan 2014 23:39:43 +0000 (15:39 -0800)]
glsl: Add constant evaluation of ir_binop_bfm.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglcpp: Resolve implicit GLSL version to 100 if the API is ES.
Matt Turner [Mon, 27 Jan 2014 02:06:18 +0000 (18:06 -0800)]
glcpp: Resolve implicit GLSL version to 100 if the API is ES.

Fixes a regression since b2d1c579 where ES shaders without a #version
declaration would fail to compile if their precision declaration was
wrapped in the standard #ifdef GL_ES check.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74066
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglcpp: Check version_resolved in the proper place.
Matt Turner [Sat, 25 Jan 2014 19:57:02 +0000 (11:57 -0800)]
glcpp: Check version_resolved in the proper place.

The check was in the wrong place, such that if a shader incorrectly put
a preprocessor token before the #version declaration, the version would
be resolved twice, leading to a segmentation fault when attempting to
redefine the __VERSION__ macro.

 #extension GL_ARB_sample_shading: require
 #version 130
 void main() {}

Also, rename glcpp_parser_resolve_version to
             glcpp_parser_resolve_implicit_version to avoid confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agor600g: s/r600_llvm_gpu_string/r600_get_llvm_processor_name/
Michel Dänzer [Tue, 28 Jan 2014 01:12:32 +0000 (10:12 +0900)]
r600g: s/r600_llvm_gpu_string/r600_get_llvm_processor_name/

Fixes build failure introduced by commit
65dc588bfd3b8145131340ffe77f216be58378ac ('r600g,radeonsi: consolidate
get_compute_param'), which consolidated the former into the latter.

10 years agoradeonsi: cleanup includes, add missing license
Marek Olšák [Wed, 22 Jan 2014 17:50:36 +0000 (18:50 +0100)]
radeonsi: cleanup includes, add missing license

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: remove open-coded PS_PARTIAL_FLUSH event
Marek Olšák [Wed, 22 Jan 2014 17:30:21 +0000 (18:30 +0100)]
radeonsi: remove open-coded PS_PARTIAL_FLUSH event

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: move some inline functions from si_pipe.h to si_state.c
Marek Olšák [Wed, 22 Jan 2014 16:30:31 +0000 (17:30 +0100)]
radeonsi: move some inline functions from si_pipe.h to si_state.c

And si_tex_aniso_filter is unused.

v2: remove INLINE occurences

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: remove si_resource.h
Marek Olšák [Wed, 22 Jan 2014 14:37:53 +0000 (15:37 +0100)]
radeonsi: remove si_resource.h

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: remove si.h
Marek Olšák [Wed, 22 Jan 2014 11:45:02 +0000 (12:45 +0100)]
radeonsi: remove si.h

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: move si_upload_const_buffer to a better place
Marek Olšák [Wed, 22 Jan 2014 02:08:50 +0000 (03:08 +0100)]
radeonsi: move si_upload_const_buffer to a better place

This gets rid of another file.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: inline si_translate_index_buffer
Marek Olšák [Wed, 22 Jan 2014 02:05:21 +0000 (03:05 +0100)]
radeonsi: inline si_translate_index_buffer

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: inline si_upload_index_buffer
Marek Olšák [Wed, 22 Jan 2014 01:57:28 +0000 (02:57 +0100)]
radeonsi: inline si_upload_index_buffer

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate remaining obviously duplicated pipe_screen code
Marek Olšák [Wed, 22 Jan 2014 01:49:53 +0000 (02:49 +0100)]
r600g,radeonsi: consolidate remaining obviously duplicated pipe_screen code

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate get_compute_param
Marek Olšák [Wed, 22 Jan 2014 01:42:20 +0000 (02:42 +0100)]
r600g,radeonsi: consolidate get_compute_param

v2: added fprintf to r600_get_llvm_processor_name

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate get_paramf and get_video_param
Marek Olšák [Wed, 22 Jan 2014 01:12:51 +0000 (02:12 +0100)]
r600g,radeonsi: consolidate get_paramf and get_video_param

radeonsi now reports PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE = true if UVD support
isn't available. It's what all the other drivers do.

Also, some #include directives were missing in radeon_uvd.h.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate variables for CS tracing
Marek Olšák [Wed, 22 Jan 2014 01:02:18 +0000 (02:02 +0100)]
r600g,radeonsi: consolidate variables for CS tracing

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate get_timestamp, get_driver_query_info
Marek Olšák [Wed, 22 Jan 2014 00:29:18 +0000 (01:29 +0100)]
r600g,radeonsi: consolidate get_timestamp, get_driver_query_info

This enables more queries for the Gallium HUD with radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate get_name and get_vendor queries
Marek Olšák [Wed, 22 Jan 2014 00:20:21 +0000 (01:20 +0100)]
r600g,radeonsi: consolidate get_name and get_vendor queries

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeon: place context-related functions first in r600_pipe_common.c
Marek Olšák [Wed, 22 Jan 2014 00:14:10 +0000 (01:14 +0100)]
radeon: place context-related functions first in r600_pipe_common.c

To follow the unwritten convention of r600g and radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agor600g,radeonsi: consolidate the contents of r600_resource.c
Marek Olšák [Tue, 21 Jan 2014 23:58:12 +0000 (00:58 +0100)]
r600g,radeonsi: consolidate the contents of r600_resource.c

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agoradeonsi: advertise the pipeline statistics query
Marek Olšák [Tue, 21 Jan 2014 23:08:11 +0000 (00:08 +0100)]
radeonsi: advertise the pipeline statistics query

Implemented by the common code. You can now visualize the statistics
with the HUD, see GALLIUM_HUD=help for all available queries. For example:

GALLIUM_HUD=clipper-primitives-generated

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>