OSDN Git Service
Rob Clark [Tue, 14 Jan 2014 12:35:23 +0000 (07:35 -0500)]
freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 14 Jan 2014 14:54:02 +0000 (09:54 -0500)]
freedreno/a3xx: fix const confusion
Gallium can leave const buffers bound above what is used by the current
shader. Which can have a couple bad effects:
1) write beyond const space assigned, which can trigger HLSQ lockup
2) double emit of immed consts, first with bound const buffer vals
followed by with actual immed vals. This seems to be a sort of
undefined condition.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sun, 10 Nov 2013 23:29:46 +0000 (18:29 -0500)]
freedreno/a3xx/compiler: compiler cleanups
Drop color/pos/psize_regid, plus a few compiler and IR cleanups.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 13 Jan 2014 23:03:42 +0000 (18:03 -0500)]
freedreno/compiler/a3xx: remove lowered instructions
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Wed, 15 Jan 2014 13:08:18 +0000 (08:08 -0500)]
freedreno: add tgsi lowering pass
Currently lowers the following instructions:
DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG, DP4,
DP3, DPH, DP2
translating these into equivalent simpler TGSI instructions.
This probably should be moved to util so other drivers can use
it, but just adding under freedreno for now so that I can clear
out a lot of the lowering code in a3xx compiler before beginning
to add new compiler.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Wed, 15 Jan 2014 13:07:27 +0000 (08:07 -0500)]
freedreno/a3xx/compiler: add CLAMP
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sun, 12 Jan 2014 18:55:05 +0000 (13:55 -0500)]
freedreno/a3xx/compiler: various fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Sat, 11 Jan 2014 15:34:36 +0000 (10:34 -0500)]
freedreno: ctx should hold ref to dev
The ctx should hold ref to dev to avoid problems if screen is destroyed
before ctx. Doesn't really fix the egl/glx issues, but at least it
prevents things from getting much worse.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Tue, 14 Jan 2014 12:34:41 +0000 (07:34 -0500)]
freedreno: add prims-emitted driver query
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Kenneth Graunke [Sat, 1 Feb 2014 05:40:05 +0000 (21:40 -0800)]
i965: Silence unused variable 'ctx' warning.
Somehow I missed this before pushing the Broadwell PS state upload code.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Fri, 31 Jan 2014 01:50:02 +0000 (17:50 -0800)]
i965: Fix math instruction hstride assertions on Broadwell.
In the final revision of my gen8_generator patch, I updated the MATH
instruction's assertion from (dst.hstride == 1) to check that source and
destination hstride matched. Unfortunately, I didn't test this enough,
and many Piglit tests fail this test.
The documentation indicates that "scalar source is also supported",
which we believe means <0,1,0> access mode (hstride == 0). If hstride
is non-zero, then it must match the destination register.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Fri, 1 Nov 2013 18:41:34 +0000 (11:41 -0700)]
i965: Add (disabled) Broadwell PCI IDs.
This puts the PCI IDs in place so it's easy to enable support. However,
it doesn't actually enable support since it's very preliminary still,
and a few crucial pieces (such as BLORP) are still missing.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 6 Dec 2013 11:07:54 +0000 (03:07 -0800)]
i965: Disable 3DSTATE_WM_HZ_OP fields.
Eric believes this to be wrong and unnecessary, as the command is
supposed to emit an implicit rectangle primitive. However, empirically
the pixel pipeline is completely unreliable without it. So for now, it
stays until someone comes up with a better solution.
We'll need to do better than this when we implement multisampling, HiZ,
or fast clears...but for now, this will do.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 5 Nov 2013 07:19:55 +0000 (23:19 -0800)]
i965: Update GS state for Broadwell.
This is quite similar to the Gen7 code. The main changes:
- 48-bit relocations
- Thread count is specified as U/2-1 instead of U-1.
- An extra DWord (DW9) with clip planes, URB entry output length/offsets
- We need to program the "Expected Vertex Count" (VerticesIn)
v2: Set the number of binding table entries so they can be prefetched
(requested by Eric Anholt).
v3: Add a WARN_ONCE for a missing workaround.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Mon, 3 Dec 2012 23:20:37 +0000 (15:20 -0800)]
i965: Update multisampling state for Broadwell.
On previous platforms, 3DSTATE_MULTISAMPLE contained the number of
samples, pixel location, and the positions of each sample within a pixel
for each multisampling mode (4x and 8x). It was also a non-pipelined
command, presumably since changing the sample positions is fairly
drastic.
Broadwell improves upon this by splitting the sample positions out into
a separate non-pipelined state packet, 3DSTATE_SAMPLE_PATTERN. With
that removed, 3DSTATE_MULTISAMPLE becomes a pipelined state packet.
Broadwell also supports 2x and 16x multisampling, in addition to the 4x
and 8x supported by Gen7. This patch, however, does not implement 2x
and 16x.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 14 Dec 2012 11:58:30 +0000 (03:58 -0800)]
i965: Update 3DSTATE_{DEPTH,STENCIL,...}_BUFFER and such for Broadwell.
The amount of cut and paste from Gen7 is rather ugly, and should
probably be cleaned up in the future. Even the Gen7 code is in need of
some tidying though; many of the function parameters aren't used on
platforms that use level/layer rather than tile offsets. Tidying both
can be left to a future patch series. This at least gets things going.
v2: Rebase on Paul's rename of NumLayers -> MaxNumLayers.
v3: Shift QPitch by 2 when storing it in the packet. Bits 14:0 store
bits 16:2 of the actual value. Fixes tests.
v4: Add missing stencil buffer QPitch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 6 Dec 2012 03:30:26 +0000 (19:30 -0800)]
i965: Update BLEND_STATE for Broadwell.
v2: Allow logic ops on all surface types. The UNORM restriction was
lifted with Haswell and I simply hadn't noticed. Also, add missing
BRW_NEW_STATE_BASE_ADDRESS dirty bit. Both caught by Eric Anholt.
v3: Fix swapped per-RT DWord pairs. Eliminates bizarre hacks.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Wed, 5 Dec 2012 23:34:34 +0000 (15:34 -0800)]
i965: Update SF_CLIP_VIEWPORT for Broadwell.
It has additional fields to support clipping to the viewport even if
guardband clipping is enabled.
v2: Update for viewport array changes.
v3: No, seriously, update for viewport array changes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Kenneth Graunke [Wed, 5 Dec 2012 00:39:03 +0000 (16:39 -0800)]
i965: Rework SURFACE_STATE entries for Broadwell.
v2: Add missing SCS setting in gen8_emit_buffer_surface_state (caught by
Eric Anholt).
v3: Use stored QPitch rather than recomputing it.
v4: Shift QPitch by 2 when setting it in the packet; bits 14:0 store
bits 16:2 of the actual value (fixes myriads of cube and array
texturing tests). Also, only enable cube face bits for cubemaps
(matches Chris Forbes' commit on master). Port to use offset64.
v5: s/gl_format/mesa_format/g
v6: Fix DW5 of renderbuffer state, which neglected to subtract
irb->mt->first_level. Use vertical_alignment() rather than
hardcoding 4. Use ffs for multisample counts rather than a
large switch statement (all caught/suggested by Eric).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 4 Dec 2012 22:45:19 +0000 (14:45 -0800)]
i965: Update SOL state for Broadwell.
Unlike on Gen7, we can directly set the offset via the state packet.
We also -have- to: the kernel SOL reset code won't work anymore.
v2: Fix copy and paste mistake in buffer stride setup; drop stale
comment (caught by Eric Anholt). Add a perf_debug for missing
MOCS setup.
v3: Rebase on Paul Berry's changes to CurrentVertexProgram.
v4: Fix SO Write Offset handling. We need to set bits 20 and 21 so the
hardware both loads and saves the offset. There's also a
restriction that 3DSTATE_SO_BUFFER can only be programmed once per
buffer between primitives, so the "reset to zero" code needed
reworking. Fixes most of the transform feedback Piglit tests.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
Kenneth Graunke [Thu, 29 Nov 2012 05:39:19 +0000 (21:39 -0800)]
i965: Update the code that disables unused shader stages for Broadwell.
v2: Also disable 3DSTATE_WM_CHROMAKEY for safety.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Kenneth Graunke [Fri, 1 Nov 2013 23:29:33 +0000 (16:29 -0700)]
i965: Update 3DSTATE_CLIP for Broadwell.
Broadwell's winding order, polygon fill, and viewport Z test fields have
moved to DWord 1 of 3DSTATE_RASTER.
v2: Add a perf_debug for a future optimization and improve commit
message (both suggested by Eric Anholt).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 4 Dec 2012 02:28:29 +0000 (18:28 -0800)]
i965: Rework vertex uploads for Broadwell.
v2: Emit a dummy 3DSTATE_VF_SGVS packet when not needed.
v3: Add WARN_ONCE and perf_debugs requested by Eric Anholt.
v4: Program 3DSTATE_SGVS even in the no-elements case so gl_VertexID
continues working. Fix 3DSTATE_VF_INSTANCING to not use an
element index to access the buffers array. Some ARB_draw_indirect
prep work.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Mon, 3 Dec 2012 21:53:40 +0000 (13:53 -0800)]
i965: Update STATE_BASE_ADDRESS for Broadwell.
v2: Fix missing "change" bit on instruction state base address
(caught by Haihao Xiang).
v3: Add a perf_debug for missing MOCS setup, requested by Eric.
v4: Fix buffer sizes. The value, specified at bit 12 and up, is
actually measured in 4k pages. We need to round up to the
next multiple of 4k.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
Reviewed-by: Matt Turner <mattst88@gmail.com> [v4]
Kenneth Graunke [Fri, 30 Nov 2012 05:00:27 +0000 (21:00 -0800)]
i965: Update 3DSTATE_PS, 3DSTATE_WM, and add 3DSTATE_PS_EXTRA.
v2: Fix setting of GEN8_PSX_ATTRIBUTE_ENABLE after rebases.
v3: Add missing binding table entry counts. Don't worry about alpha
testing or alpha to coverage when setting the "Kill Pixel" bit;
those are specified in 3DSTATE_PS_BLEND (caught by Eric Anholt).
Drop unused _NEW_BUFFERS. Tidy comments.
v4: Rebase on Paul Berry's changes to CurrentFragmentProgram.
v5: Re-enable line stippling. It doesn't crash or anything.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
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]
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]
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]
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>
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>
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>
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>
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>
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>
Matt Turner [Tue, 28 Jan 2014 22:44:39 +0000 (14:44 -0800)]
glsl: Expand non-expr & non-swizzle scalar rvalues in vectorizing.
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>
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.)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
Stéphane Marchesin [Wed, 29 Jan 2014 02:28:56 +0000 (18:28 -0800)]
i915g: support more PIPE_CAPs
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>