summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/freedreno
AgeCommit message (Collapse)AuthorFilesLines
2014-08-25android: gallium/freedreno: add preliminary buildEmil Velikov1-0/+44
For all the people interested in testing the freedreno driver on their Android devices. The next commit will hook these up within the libEGL driver (via the gallium-egl backend). There may be some rough edges but those can be sorted when a willing builder/tester comes along. v2: - s/freefreno/freedreno/. Spotted by Matt Turner. - Use the installed libdrm headers. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Cc: Rob Clark <robclark@freedesktop.org> Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit bf05e067577a8d8e87a377dfb357806b67b6afca)
2014-08-25automake: gallium/freedreno: drop spurious include dirsEmil Velikov2-4/+2
Rather than including two extra folders only for two headers, just prefix the headers and be done with it. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Cc: Rob Clark <robclark@freedesktop.org> Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> (cherry picked from commit 458d03a4a4cebe7b9e9ea265d18bfc547bc4b49c) Conflicts: src/gallium/drivers/freedreno/Makefile.am
2014-07-07freedreno/a3xx: vtx formatsRob Clark6-79/+102
Add support for more vertex buffer formats. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 06e9536e5f5f0cc280385bcf813ecdcf6573401b) Squashed with: freedreno: update generated headers Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit ba6a490bbc81380fdffcb080752682b7f38b95e6)
2014-07-07freedreno: fix for null texturesRob Clark2-6/+10
Some apps seem to give us a null sampler/view for texture slots which come before the last used texture slot. In particular 0ad triggers this. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 6aeeb706d218be030b39e431e53ec07edb974564)
2014-07-07freedreno/a3xx: texture fixesRob Clark5-6/+10
Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit aa78c4586d42856dcc86b143c2e72c05a1422016) Squashed with: freedreno: update generated headers Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 2456be63e9cdc3c811a799caf51a56871ff6119c)
2014-07-07freedreno: few caps fixesRob Clark2-4/+8
Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 286863939f9b0896db1b382c967d0d92b14729c9)
2014-07-07freedreno/a3xx: fix blend opcodeRob Clark8-54/+83
Seems the opcodes are slightly different from a2xx. Resync headers and move blend_func() helper into hw generation specific code. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit a4d229b0992806f759ab4c71fc5712e8ab2e1c9d)
2014-07-07freedreno/a3xx: fix depth/stencil gmem restoreRob Clark1-1/+1
We already multiply by bytes per pixel for this, so f3ba7611 broke mem2gmem for depth/stencil. Drop the now-redundant mutiply by cpp. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit b81de5352dc8f3db01888175561b816c0d92716b)
2014-07-07freedreno/a3xx: fix depth/stencil GMEM positioningRob Clark5-17/+23
In cases where there was no color buf bound, there were inconsistancies in register settings related to position of depth/stencil inside GMEM. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit f3ba761129e39c299fe39fa91b542f459cad9f83) Squashed with: freedreno: update generated headers Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 4da8267c36c30577dbcf9e4f89aef3a306e9c91d)
2014-07-03freedreno: use OUT_RELOCW when buffer is writtenRob Clark1-4/+4
These aren't buffers we ever read back from CPU, so using incorrect reloc fxn wasn't really harming anything. But might as well be correct. Signed-off-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 0d54904c04842517c98b82ba7510e022eb8d5ce9)
2014-05-20freedreno: don't advertise texture arrays for nowRob Clark1-1/+1
I think a3xx and later should support (it is part of GLES3), but this isn't needed for the time being and still needs to be reversed. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: shadow sampler supportRob Clark2-3/+46
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: refactor trans_samp()Rob Clark1-47/+90
Split it up into some smaller fxns so it doesn't grow into a huge monster as we add things. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-4/+10
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: use util_format_compose_swizzles()Rob Clark1-9/+9
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: 1D texturesRob Clark1-4/+25
Gallium already gives us height==1 for these, so the texture state is already setup correctly to emulate 1D textures as a Nx1 2D texture. We just need to supply the .y coord. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: fix capsRob Clark1-2/+2
In particular, we want mesa to emulate primitive restart for us. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: fix index buffer offsetRob Clark1-1/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: add sRBG texture supportRob Clark2-0/+15
That was easy. Turns out it is just a matter of setting one bit. Enable sampling from sRGB texture, and therefore enable GL 2.1 :-) Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-20/+21
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: fix write to bogus registerRob Clark1-2/+2
The loops for updating the multiple packed fields in SP_VS_OUT[] and SP_VS_VPC_DST[] will zero out one register beyond the last that on required. Which is normally not a problem (and is kinda convenient when looking at cmdstream dumps) unless we have maximum (16) varyings. Fix loop termination condition so that this does not happen. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: account for special inputs/outputsRob Clark1-2/+2
We need to size input/output tables big enough for special inputs/ outputs (gl_Position, gl_FrontFacing, etc) which, while they don't count towards the hw limit of 16 attributes or 16 varyings, we do still need to track them all the same. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: fix MAX_INPUTS shader capRob Clark3-1/+9
Hardware only supports 16. Which fd3_shader_variant properly reflected, but the pipe cap did not, leading to array overflow (and shaders that could not possibly work). Also a bunch of asserts to make problems like this easier to see. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: add KILL_IFRyan Houdek1-1/+35
The KILL_IF opcode could potentially be merged in to the regular KILL opcode function. It was a pain to do so, so I've left is separated for cleanliness. Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: start adding integer supportRyan Houdek1-0/+169
Adds a large sum of TGSI opcodes to the a3xx compiler. For integer opcodes we have 28 opcodes added. Adds 4 floating point compare opcodes If GLSL 1.30 is enabled, this allows the GLSL 1.30 piglits to have a completion amount of 432/641. Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: occlusion query supportRob Clark5-3/+185
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: add support for hw queriesRob Clark10-8/+734
Real GPU queries need some infrastructure to track samples per tile and accumulate the results. But fortunately this can be shared across GPU generation. See: https://github.com/freedreno/freedreno/wiki/Queries#hardware-queries Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/query: allow multiple query implementationsRob Clark6-107/+269
Split out fd_query into an abstract base class, to allow multiple implementations. The current sw based queries are moved into fd_sw_query. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: add point-sizeRob Clark1-4/+14
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-54/+252
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a2xx: fix compiler warningRob Clark1-1/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-26gallium: add basic support for ARB_sample_shadingIlia Mirkin1-0/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-25gallium/util: use ui[4] instead of ui in union util_colorRoland Scheidegger1-1/+1
util_color often merely represents a collection of bytes, however it is inconvenient if those bytes can only be accessed as floats/doubles for int formats exceeding 32bits. (Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and short member were left as is.)
2014-04-23freedreno/a3xx: fix TOTALATTRTOVSRob Clark4-1/+7
In cases where varying fetches are optimized away (just pass-through in vertex shader, but unused in fragment shader) we need to calculate the correct TOTALATTROVS based on the actual number of varyings fetched, otherwise lockup. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-10gallium: add a way to query min/max texture gather offsetsIlia Mirkin1-0/+2
Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For nvc0, the offset can be -32/31. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-09freedreno/a3xx: assert() -> debug_assert()Rob Clark1-1/+1
We hit this assert with some piglit tests. Which appears to be a bug outside of freedreno. Previously we were relying on assert() being redefined to debug_assert() so that we didn't crash in release builds. Somehow that stopped working. So just use debug_assert() directly. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09freedreno/a3xx/compiler: add CEILRob Clark1-0/+1
fixes piglit glsl-fs-ceil Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09freedreno/a3xx/compiler: fix neg mov'sRob Clark1-20/+1
create_mov() was fixed up to handle neg/abs properly for interal mov's, using absneg.f, but forgot to fix it for TGSI MOV's. The problem with using add.f to handle negated mov's is that we can only take a single const reg src. So: MOV TEMP[n], -CONST[m] would turn into: add.f Rdst, (neg)CONST[m], 0.0 which would not work. Anyways, just remove the extra code and always use create_mov() which DTRT. This fixes piglit vs-op-neg-int test. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-08freedreno/a3xx: deal with optimized tex instructionsRob Clark7-25/+41
Keep track of whether we actually have any sam instructions in the resulting shader, rather than using TGSI SAMP declarations. If the sam instruction is optimized out, because the result is not used, we don't want to emit texture state, etc. In fact emitting sampler state and/or setting PIXLODENABLE bit when there are no texture fetches seems to cause lockup. In theory this should never happen for a "normal" shader, unless the state tracker is wonky. But it is a very real possibility for binning pass shaders. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-07gallium: add support for LODQ opcodes.Dave Airlie1-0/+1
This opcode provide support for GL_ARB_texture_query_lod, Signed-off-by: Dave Airlie <airlied@redhat.com> [imirkin: rebase, docs update] Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-02mesa/soft/llvmpipe: add fake MSAA supportDave Airlie1-0/+1
This adds a gallium cap that allows us to fake GL3.0 by not exposing MSAA on sw rendering. It also forces the extra extensions needed for GL3.2. Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-30freedreno/a3xx/compiler: fix RECT texturesRob Clark1-7/+24
Whether or not the coords are normalized is handled in the texture state. But we otherwise need to treat RECT sample instructions as 2D. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30freedreno/a3xx/compiler: avoid negative register idsRob Clark1-2/+2
In some cases, we need a register to be assigned up to three components before the base. Since we can't have negative register #'s, just shift everything up. May increase register usage for trivial shaders, but I don't think we are shader limited in those cases. A proper solution is going to require a better register assignment algorithm (which is on the TODO list), this is just a hack to get us by until then. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30freedreno/a3xx: missing wfiRob Clark4-3/+20
RB_FRAME_BUFFER_DIMENSION is not a banked context register, so we need to wait for the GPU to idle before updating it. But we'd rather not have unnecessary WFI's, so actually keep track if we need to emit it or not. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30freedreno/a3xx: little extra debugRob Clark2-0/+5
Catch things which should not happen in debug builds. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30freedreno: handle null samplerRob Clark2-3/+8
This is something that XA triggers. In some cases it will only use SAMP[1] (composite mask) but not SAMP[0] (composite src). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05WIP: freedreno/a3xx: incorrect scissor for binning passRob Clark3-8/+35
If scissor optimization is used (to avoid bringing scissored portions of the render target into GMEM and then back out to system memory) in combination with hw binning pass, the result would be a scissor mismatch between binning pass and rendering pass. This would cause rendering bugs in some scenarios with (for example) gnome-shell. I would have expected that simply using the correct screen-scissor during the binning pass would be enough, but seems like there is something else missing. So for now disable binning pass if scissor optimization is used.
2014-03-02freedreno/a3xx/compiler: overflow in trans_endifRob Clark1-13/+5
The logic to count number of block outputs was out of sync with the actual array construction. But to simplify / make things less fragile, we can just allocate the arrays for worst case size. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02freedreno/a3xx/compiler: fix for resolving PHI'sRob Clark1-18/+33
A value may be assigned on only one side of an if/else. In this case we can simply substitute a mov.f32f32. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02freedreno/lowering: two-sided-colorRob Clark5-57/+269
Add option to generate fragment shader to emulate two sided color. Additional inputs are added to shader for BCOLOR's (on corresponding to each COLOR input). CMP instructions are used to select whether to use COLOR or BCOLOR. Signed-off-by: Rob Clark <robclark@freedesktop.org>