summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau
AgeCommit message (Collapse)AuthorFilesLines
2014-09-27nv50/ir: avoid deleting pseudo instructions too earlyIlia Mirkin1-1/+10
What happens is that a SPLIT operation is part of the spill node, and as a pseudo op, the instruction gets erased after processing its first def. However the later defs still need to refer to it, so instead delay deleting until after that whole RA node is done processing. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79462 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0147c10c5f00b43696ba660aab604d674a75e83c)
2014-09-17nouveau: remove unneeded assertMaarten Lankhorst1-1/+0
No idea why it was added, but the code runs fine even on videos where it triggers. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8ab85bfcd5ddd44c50e5b384222731cb2a1a1496)
2014-09-17nouveau: rework reference frame handlingMaarten Lankhorst3-4/+37
Fixes a regression from "nouveau/vdec: small fixes to h264 handling" New picking order for frames: 1. Vidbuf pointer matches. 2. Take the first kicked ref. 3. If that fails, take a ref that has a different last_used. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a41aad843108cec1901c88a76d5ceb4ede2e062b)
2014-09-17nouveau: fix MPEG4 hw decodingMaarten Lankhorst1-3/+3
Reorder some fields to make I-frame decoding work correctly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 121ceb38f45daacc938349d9d5aa82776b78dbab)
2014-09-17nouveau: re-allocate bo's on overflowMaarten Lankhorst4-11/+87
The BSP bo might be too small to contain all of the bsp data, bump its size on overflow. Also bump inter_bo when this happens, it might be too small otherwise. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit f6afed7076a6ef446dbec7cb10c8f8c60efafccd)
2014-09-09nv50/ir: avoid array overrun when checking for supported modsIlia Mirkin2-2/+2
Reported by Coverity Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 874a9396c5adfdcff63139bf6ababb55c1253402)
2014-09-09nvc0/ir: clarify recursion fix to finding first tex usesChristoph Bumiller1-9/+7
This is a simple shader for reproducing the case mentioned: FRAG DCL IN[0], GENERIC[0], PERSPECTIVE DCL OUT[0], COLOR DCL SAMP[0] DCL CONST[0] DCL TEMP[0..1], LOCAL IMM[0] FLT32 { 0.0000, -1.0000, 1.0000, 0.0000} 0: MOV TEMP[0].x, CONST[0].wwww 1: MOV TEMP[1].x, CONST[0].wwww 2: BGNLOOP 3: IF TEMP[0].xxxx 4: BRK 5: ENDIF 6: ADD TEMP[0].x, TEMP[0], IMM[0].zzzz 7: IF CONST[0].xxxx 8: TEX TEMP[1].x, CONST[0], SAMP[0], 2D 9: ENDIF 10: IF CONST[0].zzzz 11: MOV TEMP[1].x, CONST[0].zzzz 12: ENDIF 13: ENDLOOP 14: MOV OUT[0], TEMP[1].xxxx 15: END Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit ca9ab05d45ebf407485af2daa3742b897ff99162)
2014-09-09nv50/ir/util: fix BitSet issuesChristoph Bumiller3-3/+10
BitSet::allocate() is being used with the expectation that it would leave the bitfield untouched if its size hasn't changed, however, the function always zeroed the last word, which led to obscure bugs with live set computation. This also fixes BitSet::resize(), which was broken, but luckily not being used. Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit b9f9e3ce03dbd8d044a72a00e1e8856a500b5f72)
2014-09-02nv50: attach the buffer bo to the miptree structuresIlia Mirkin1-8/+5
The current code... makes no sense. Use nouveau_bo_ref to attach the bo to the exposed resource so as to have the proper lifetime guarantees. Tested-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2c440433130d3c64635684355a3667d145a188e3)
2014-09-02nv50: mt address may not be the underlying bo's start addressIlia Mirkin3-12/+14
With VP2, nv50_miptree is faked because the underlying bo's have to be laid out in a certain way. This is done by adjusting the address. Make sure that blits (and everything else for consistency) use the mt address rather than the bo address as a base. This fixes retrieving chroma plane with VDPAU. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82255 Tested-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9d52e551a5874e54bc80f306bf3cacbad2441315)
2014-09-02nv50: set the miptree address when clearing bo's in vp2 initIlia Mirkin1-0/+2
The mt address is about to be used more, make sure it's set appropriately. Reported-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2528d402b9e35601d4631cd80a301bacd87dfc95)
2014-09-02nv50/ir: avoid creating instructions that can't be emittedIlia Mirkin1-0/+4
When constant folding a MAD operation, we first fold the multiply and generate an ADD. However we do so without making sure that the immediate can be handled in the saturate case. If it can't, load the immediate in a separate instruction. Reported-by: Tiziano Bacocco <tizbac2@gmail.com> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6c2b079231f84b09b3f35183930afe522baee168)
2014-09-02nvc0: don't make 1d staging textures linearIlia Mirkin1-1/+0
Experimentally, the sampler doesn't appear to like these, neither as buffer nor as rect textures. So remove 1D from the list of texture types to make linear when used for staging. This fixes the OSD in mplayer for VDPAU. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 115d9a5525e74573ced9209063a1d4a551e6eaa4)
2014-09-02nv50: zero out unbound samplersIlia Mirkin1-2/+5
Samplers are only defined up to num_samplers, so set all samplers above nr to NULL so that we don't try to read them again later. Tested-by: Christian Ruppert <idl0r@qasl.de> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 362cd26960aff2e997584064443dcc0418516ae6)
2014-09-02nvc0/ir: avoid infinite recursion when finding first uses of texIlia Mirkin1-8/+28
In certain circumstances, findFirstUses could end up doubling back on instructions it had already processed, resulting in an infinite recursion. Avoid this by keeping track of already-visited instructions. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83079 Tested-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit c4bb436f7660c951cd27e52660cf825da68793e5) Conflicts: src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
2014-08-25android: gallium/nouveau: fix include folders, link against libstlportEmil Velikov1-4/+5
nouveau uses STL for a while now thus we need to include external/stlport/libstlport.mk in order to get the build at least partially working. v2: Use the installed libdrm headers over the DRM_TOP ones. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 6b510c63383a421eabe0d6e7b0249dbab85cffde)
2014-07-30nvc0: make sure that the local memory allocation is aligned to 0x10Ilia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 47e5a8d7a24b80fe1738d88bfffcb04431d612e8)
2014-07-30nv50: fix build failure on m68k due to invalid struct alignment assumptionsThorsten Glaser1-0/+5
Make alignment assumptions explicit by inserting correct padding with unknown struct members. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3cfe6bc9cc369b29e5475b1bb0c60bbb37a6a1a2)
2014-07-10nvc0/ir: use manual TXD when offsets are involvedIlia Mirkin1-1/+2
Something about how we're implementing offsets for TXD is wrong, just flip to the generic quadop-based implementation in that case. This is the minimal fix appropriate for backporting. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 114d46829d10c826927cabc1ca14884a4ee249f7)
2014-07-10nvc0/ir: do quadops on the right texture coordinates for TXDIlia Mirkin1-2/+3
handleTEX moves the layer as the first argument. This makes sure that the quadops deal with the texture coordinates. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit afea9bae67208cdb00b27a60c9cb013bf7d6de52)
2014-07-10nv50/ir: ignore bias for samplerCubeShadow on nv50Ilia Mirkin1-0/+10
Unfortunately there's no good way to do this on the nv50 shader isa. Dropping the bias seems preferable to doing the compare post-filtering. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1065aa92f4e448fbfe47c074f08dded1933a7f1f)
2014-07-10nv50/ir: retrieve shadow compare from first argIlia Mirkin1-1/+1
This can only happen with texture(samplerCubeShadow, bias), where the compare will be in the first argument. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 30d91e0eecfe79e0d8515189a59051ee4f21f3da)
2014-07-03nvc0: add a memory barrier when there are persistent UBOsIlia Mirkin5-4/+57
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9a37eb8adb6558a4abf47774b583cb582a0ae116)
2014-07-03nv50: do an explicit flush on draw when there are persistent buffersIlia Mirkin3-2/+50
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 5d4f5218bb71cb387f1a57ea08125245e5039e94)
2014-07-03nv50: disable dedicated ubo upload methodIlia Mirkin1-0/+7
The hardware allows multiple simultaneous renders with the same memory-backed constbufs but with each invocation having different values. However in order for that to work, the data has to be streamed in via the right constbuf slot. We weren't doing that for UBOs. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.1" <mesa-stable@lists.freedesktop.org> (cherry picked from commit b2b7c651221037266abee7c3ede1ca7b3cb2da33)
2014-07-03nv50/ir: allow gl_ViewportIndex to work on non-provoking verticesTobias Klausmann2-2/+30
Previously, if we had something like: gl_ViewportIndex = idx; for(int i = 0; i < gl_in.length(); i++) { gl_Position = gl_in[i].gl_Position; EmitVertex(); } EndPrimitive(); The right viewport index would not be set on the primitive because the last vertex is the provoking one. However blob drivers appear to move the gl_ViewportIndex write into the for loop, allowing the application to be ignorant of this detail. While the application is technically wrong here, because the blob does it and other drivers appear to implicitly work this way as well, we add a buffer register that viewport index writes go into, which is then exported before every EmitVertex() call. This fixes the remaining piglit tests in ARB_viewport_array for nv50/nvc0. Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (cherry picked from commit 98a86f61a8d17eaafaf5907debc7735aa20610d5)
2014-06-23nv30: hack to avoid errors on unexpected color/zeta combinationsIlia Mirkin1-0/+17
This is just a hack, it should be possible to create a temporary zeta surface and render to that instead. However that's more complicated and this avoids the render being entirely broken and errors being reported by the card. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 25182e249e50b0fce41d975ae2b3c9cbdb8d0ef3)
2014-06-23nv30: avoid dangling references to deleted contextsIlia Mirkin1-0/+3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit c092c46b27c6f6a6674e8d67fb3afdb684811819)
2014-06-23nv30: plug some memory leaks on screen destroy and shader compileIlia Mirkin2-0/+7
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 5af80f62680b8321c3af565bb57138a71429502c)
2014-06-23nv50: make sure to mark first scissor dirty after blitIlia Mirkin1-0/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit af05270ccfaa15fde9845a2250922caa8902c0fe)
2014-06-23gk110/ir: fix bfind emissionIlia Mirkin1-1/+1
There is a short-immediate version as well, but it should never end up getting used since it would have gotten folded earlier. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit bd7dd3ed06ea9e88a9f6e18f45338bd99fde86f1)
2014-06-23gk110/ir: fix emitting constbuf file indexIlia Mirkin1-2/+3
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7a673187948b38d2d80aa48d9fc09176fa3547e8)
2014-06-23gk110/ir: emit saturate flag on fadd when neededIlia Mirkin1-0/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 4a3a71a183eba60539ca3c556938344bcf180d70)
2014-06-06gk110/ir: fix slct emissionIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9fef8b3d811000146b989a101ad0e26ae6530fe4)
2014-06-06gk110/ir: fix interp mode emissionIlia Mirkin1-1/+2
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d588a4919b732246b7aa26685ef65545929a4f7b)
2014-06-06nvc0: don't bother trying to set up compute for gk110+Ilia Mirkin1-3/+4
The nouveau fw currently prints a bunch of errors. No point in seeing those all the time, esp since compute doesn't really work in the first place. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Conflicts: src/gallium/drivers/nouveau/nvc0/nvc0_screen.c (cherry picked from commit ca65fc418f756496d480a9a4566543837a582826)
2014-06-06gk110: add in forgotten code for gk110 isaIlia Mirkin1-0/+13
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Conflicts: src/gallium/drivers/nouveau/nvc0/nvc0_surface.c (cherry picked from commit b9ec766bd02d55c20ff7ce5b95207ea7f6ed1de5)
2014-06-06gk110/ir: fix ISAD emission with register argsIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ed1b9e5721f6c7a74e042eadb31fc5dcb2fc3552)
2014-06-06gk110/ir: fix quadon opcode emissionIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6e046508a17b7eee24285e94f144a42ded3ebcdc)
2014-06-06gk110/ir: emit texbar the same way that the blob doesIlia Mirkin1-1/+1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 73eec47ef81954f7c2bf7c8bf03b300d11d05b82)
2014-06-06nv50/ir: clear subop when folding constant expressionsTobias Klausmann1-0/+1
Some operations (e.g. OP_MUL/OP_MAD/OP_EXTBF) might have a subop set. After folding, make sure that it is cleared Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3164bfc73418e2e046c7a750eaac8a6d66dfe02d)
2014-05-30nvc0: revert mistaken logic to collapse color outputs to the beginningIlia Mirkin1-9/+4
In commit af38ef907, I added a "fix" to color outputs not being assigned correctly when sample mask was being output. This was totally wrong -- the color indices (i.e. "si" values) were the ones that were wrong. Undo that hunk. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 0d699530ff9fe68a1898f875b889422536bfc8e5) Requested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-29nv50/ir/tgsi: optimize KILChristoph Bumiller1-0/+5
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d479713d25699c168af807ad36068691af11d0e0)
2014-05-29nv50/ir: fix lowering of predicated instructions (without defs)Christoph Bumiller1-1/+4
Note that predicated instructions with defs are still not supported because transformation to SSA doesn't handle them yet. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 452a4151aa1eebbc12b621a465fc452fdb95a08b)
2014-05-29nv50/ir/opt: fix constant folding with saturate modifierChristoph Bumiller1-1/+3
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3b0867f35b5b294eb0d40524a6bc4c8de888a96f)
2014-05-29nv50/ir/tgsi: TGSI_OPCODE_POW replicates its resultChristoph Bumiller1-1/+5
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2f2d1b3d9b090aeba316d6c425c23e92340b5502)
2014-05-29nv50,nvc0: set constbufs dirty on pipe context switchChristoph Bumiller2-0/+5
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 49eccef06b0b4ca7d7cef0d76c2c251dd679c3bc)
2014-05-29nv50: setup scissors on clear_render_target/depth_stencilChristoph Bumiller1-2/+18
[imirkin: add logic to also clear the "regular" scissors] Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 200382be8576c43a668724c77b0f1b5a80b3adba)
2014-05-29nv50,nvc0: always pull out bufctx on context destructionChristoph Bumiller2-9/+7
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7d11b761f248ebf5cc2c6732e67656f828afb110)
2014-05-23nv50,nvc0: fix 3d blits with mipmap levelsIlia Mirkin2-11/+19
Make sure to normalize the z coordinates as well as the x/y ones when there are mipmaps present. Fixes 3d mipmap generation, which now uses the blit path. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit 28360fcad75a6917db6af42fb17b81572850ec0d)