summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-12-04Update version to 17.3.0-rc6mesa-17.3.0-rc6Emil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-01i965: Disable regular fast-clears (CCS_D) on gen9+Jason Ekstrand2-25/+43
This partially reverts commit 3e57e9494c2279580ad6a83ab8c065d01e7e634e which caused a bunch of GPU hangs on several Source titles. To date, we have no clue why these hangs are actually happening. This undoes the final effect of 3e57e9494c227 and gets us back to not hanging. Tested with Team Fortress 2. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102435 Fixes: 3e57e9494c2279580ad6a83ab8c065d01e7e634e Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit ee57b15ec764736e2d5360beaef9fb2045ed0f68)
2017-12-01anv: Check if memfd_create is already defined.Vinson Lee3-0/+5
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103909 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit 8c1e4b1afc8d396ccf99c725c59b29a9aa305557) [Emil Velikov: drop NA hunks] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: configure.ac meson.build src/intel/vulkan/anv_allocator.c
2017-12-01intel/blorp: Fix possible NULL pointer dereferencingVadym Shovkoplias1-2/+2
Fix incomplete check of input params in blorp_surf_convert_to_uncompressed() which can lead to NULL pointer dereferencing. Fixes: 5ae8043fed2 ("intel/blorp: Add an entrypoint for doing bit-for-bit copies") Fixes: f395d0abc83 ("intel/blorp: Internally expose surf_convert_to_uncompressed") Reviewed-by: Emil Velikov <emli.velikov@collabora.com> Reviewed-by: Andres Gomez <agomez@igalia.com> (cherry picked from commit cdb3eb7174f84f3200408c4b43c819fb093da9c6)
2017-12-01i965: Reorganize batch/state BO fields into a 'brw_growing_bo' struct.Kenneth Graunke8-96/+102
We're about to add more of them, and need to pass the whole lot of them around together when growing them. Putting them in a struct makes this much easier. brw->batch.batch.bo is a bit of a mouthful, but it's nice to have things labeled 'batch' and 'state' now that we have multiple buffers. Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103101 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 74e38739ca266b8178eaa70e30578aa929b067ab) [Emil Velikov: remove NA blorp_get_surface_base_address hunk] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/drivers/dri/i965/genX_blorp_exec.c
2017-12-01i965: Don't grow batch/state buffer on every emit after an overflow.Kenneth Graunke1-23/+19
Once we reach the intended size of the buffer (BATCH_SZ or STATE_SZ), we try and flush. If we're not allowed to flush, we resort to growing the buffer so that there's space for the data we need to emit. We accidentally got the threshold wrong. The first non-wrappable call beyond (e.g.) STATE_SZ would grow the buffer to floor(1.5 * STATE_SZ), The next call would see we were beyond STATE_SZ and think we needed to grow a second time - when the buffer was already large enough. We still want to flush when we hit STATE_SZ, but for growing, we should use the actual size of the buffer as the threshold. This way, we only grow when actually necessary. v2: Simplify the control flow (suggested by Jordan) Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (cherry picked from commit ca4361658635f2b401e9793c0b982721998ecb70)
2017-12-01i965: Preserve EXEC_OBJECT_CAPTURE when growing the BO.Kenneth Graunke1-0/+3
The original state buffer was marked with EXEC_OBJECT_CAPTURE. When growing it, we want to preserve that flag so we continue to capture it in GPU hang reports. Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 52d32917e1f3f70abcbcff5508f7423e94626b41)
2017-12-01i965: Use old_bo->align when growing batch/state buffer instead of 4096.Kenneth Graunke1-1/+2
The intention here is make the new BO use the same alignment as the old BO. This isn't strictly necessary, but we would have to update the 'alignment' field in the validation list when swapping it out, and we don't bother today. The batch and state buffers use an alignment of 4096, so this should be equivalent - it's just clearer than cut and pasting a magic constant. Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (cherry picked from commit 2af70854609509adf5dc92af2fcf1c30938e2a5d)
2017-12-01i965: Program the dynamic state heap size to MAX_STATE_SIZE.Kenneth Graunke3-10/+10
STATE_BASE_ADDRESS specifies a maximum size of the dynamic state section, beyond which data supposedly reads back as 0. On Gen8+, we were programming it to the size of the buffer. This worked fine until we started growing the state buffer in commit 2dfc119f22f25708. When the state buffer grows, the value in STATE_BASE_ADDRESS becomes too small, and our state beyond STATE_SZ bytes would read back as 0. To avoid having to update the value, we program it to MAX_STATE_SIZE. We used to program the upper bound to the maximum on older hardware anyway, so programming it too large isn't a big deal. Bogus SURFACE_STATE can easily lead to GPU hangs and misrendering. DiRT Rally was hitting the statebuffer growth path, and suffered from bad texture corruption and GPU hangs (usually around the same time). This patch fixes both issues. Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103101 Tested-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit cfc5af588cf8e0cfb41ea907a7da3cca676be1c2)
2017-12-01radeonsi/gfx9: fix importing shared textures with DCCMarek Olšák1-1/+1
VI has 11 dwords at least. GFX9 has 10 dwords. Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit ed4780383cae61e051b3d3d120649222da49feae) [Emil Velikov: s|radeon/r600_texture.c|radeonsi/si_state.c|] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/gallium/drivers/radeon/r600_texture.c
2017-11-29gallium/wgl: fix default pixel format issueFrank Richter1-2/+21
When creating a context without SetPixelFormat() don't blindly take the pixel format reported by GDI. Instead, look for our own closest pixel format. Minor clean-ups added by Brian Paul. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103412 Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com> (cherry picked from commit bf41b2b2627aa3790d380092c28c5d3395cc9cde)
2017-11-29r600: set DX10_CLAMP for compute shader tooRoland Scheidegger1-2/+3
I really intended to set this for all shader stages by 3835009796166968750ff46cf209f6d4208cda86 but missed it for compute shaders (because it's in a different source file...). Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 71e630753ebbee82e8f8709da5488296b2c070c8)
2017-11-29r600: use DX10_CLAMP bit in shader setupRoland Scheidegger2-0/+15
The docs are not very concise in what this really does, however both Alex Deucher and Nicolai Hähnle suggested this only really affects instructions using the CLAMP output modifier, and I've confirmed that with the newly changed piglit isinf_and_isnan test. So, with this bit set, if an instruction has the CLAMP modifier bit (which clamps to [0,1]) set, then NaNs will be converted to zero, otherwise the result will be NaN. D3D10 would require this, glsl doesn't have modifiers (with mesa clamp(x,0,1) would get converted to such a modifier) coupled with a whatever-floats-your-boat specified NaN behavior, but the clamp behavior should probably always be used (this also matches what a decomposition into min(1.0, max(x, 0.0)) would do, if min/max also adhere to the ieee spec of picking the non-nan result). Some apps may in fact rely on this, as this prevents misrenderings in This War of Mine since using ieee muls (ce7a045feeef8cad155f1c9aa07f166e146e3d00), without having to use clamped rcp opcode, which would also fix this bug there. radeonsi also seems to set this bit nowadays if I see that righ (albeit the llvm amdgpu code comment now says "Make clamp modifier on NaN input returns 0" instead of "Do not clamp NAN to 0" since it was changed, which also looks a bit misleading). v2: set it in all shader stages. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103544 Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 3835009796166968750ff46cf209f6d4208cda86)
2017-11-29r600: use min_dx10/max_dx10 instead of min/maxRoland Scheidegger2-6/+9
I believe this is the safe thing to do, especially ever since the driver actually generates NaNs for muls too. The ISA docs are not very helpful here, however the dx10 versions will pick a non-nan result over a NaN one (this is also the ieee754 behavior), whereas the non-dx10 ones will pick the NaN (verified by newly changed piglit isinf-and-isnan test). Other "modern" drivers will most likely do the same. This was shown to make some difference for bug 103544, albeit it is not required to fix it. Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit aab0bfc648bf1be50b81a25224970015f1dc78b8)
2017-11-29glsl: fix interpolateAtXxx(some_vec[idx], ...) with dynamic idxNicolai Hähnle1-1/+30
The dynamic index of a vector (not array!) is lowered to a sequence of conditional assignments. However, the interpolate_at_* expressions require that the interpolant is an l-value of a shader input. So instead of doing conditional assignments of parts of the shader input and then interpolating that (which is nonsensical), we interpolate the entire shader input and then do conditional assignments of the interpolated result. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (cherry picked from commit ca63a5ed3e9efb2bd645b425f7393089f4e132a6)
2017-11-29glsl: allow any l-value of an input variable as interpolant in interpolateAt*Nicolai Hähnle2-5/+32
The intended rule has been clarified in GLSL 4.60, Section 8.13.2 (Interpolation Functions): "For all of the interpolation functions, interpolant must be an l-value from an in declaration; this can include a variable, a block or structure member, an array element, or some combination of these. Component selection operators (e.g., .xy) may be used when specifying interpolant." For members of interface blocks, var->data.must_be_shader_input must be determined on-the-fly after lowering interface blocks, since we don't want to disable varying packing for an entire block just because one input in it is used in interpolateAt*. v2: keep setting must_be_shader_input in ast_function (Ian) v3: follow the relaxed rule of GLSL 4.60 v4: only apply the relaxed rules to desktop GL (the ES WG decided that the relaxed rules may apply in a future version but not retroactively; see also dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid.negative.*) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101378 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1) Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (cherry picked from commit 4f42450b86ea30f9228309e02ca68755c389866f)
2017-11-29i965: Fix Smooth Point Enables.Kenneth Graunke1-1/+1
We want to program the 3DSTATE_RASTER field to the gl_context value, not the other way around. Fixes: 13ac46557ab1 (i965: Port Gen8+ 3DSTATE_RASTER state to genxml.) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (cherry picked from commit 760e0156dfd5cf0281bc964a8090c792fc44ab16)
2017-11-29st_glsl_to_tgsi: check for the tail sentinel in merge_two_dstsNicolai Hähnle1-3/+3
This fixes yet another case where DFRACEXP has only one destination. Found by address sanitizer. Fixes tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-mantissa.shader_test Fixes: 3b666aa74795 ("st/glsl_to_tgsi: fix DFRACEXP with only one destination") Acked-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 7e35bdad1c67d7df2832ac4b39bff471e83812e5)
2017-11-29radeonsi: fix layered DCC fast clearMarek Olšák1-1/+4
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 6863651bbdd7dcfad60bae78d1e17898f49ca08b)
2017-11-29r600/sb: handle jump after target to end of program. (v2)Dave Airlie1-0/+5
This fixes hangs on cayman with tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test This has a single if/else in it, and when this peephole activated, it would set the jump target to NULL if there was no instruction after the final POP. This adds a NOP if we get a jump in this case, and seems to fix the hangs, so we have a valid target for the ELSE instruction to go to, instead of 0 (which causes infinite loops). v2: update last_cf correctly. (I had some other patches hide this) Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 579ec9c311eb5176054b624f39c5c024605b58d6)
2017-11-29docs/llvmpipe.html: Minor editsBen Crocker1-7/+7
Language and spelling fixups in three places. Cc: "17.2" "17.3" <mesa-stable@lists.freedesktop.org> Signed-off-by: Ben Crocker <bcrocker@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> [Eric: move two fixes from the other patch to this one.] Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit b43daf7bf6cb505ece025c718ac6f074c38b2d49)
2017-11-29docs: Point to apt.llvm.org for development snapshot packagesKai Wasserbäch1-0/+6
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit d25123e23a77e216b45f8e1a83ac32805b07be82)
2017-11-29mesa/gles: adjust internal format in glTexSubImage2D error checksTapani Pälli1-1/+55
When floating point textures are created on OpenGL ES 2.0, driver is free to choose used internal format. Mesa makes this decision in adjust_for_oes_float_texture. Error checking for glTexImage2D properly checks that sized formats are not used. We use same error checking path for glTexSubImage2D (since there is lot of overlap), however since those checks include internalFormat checks, we need to pass original internalFormat passed by the client. Patch adds oes_float_internal_format that does reverse adjust_for_oes_float_texture to get that format. Fixes following test failure: ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float (when running test with MESA_GLES_VERSION_OVERRIDE=2.0) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227 Cc: "17.3" <mesa-stable@lists.freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit 1e508e10d9ae649bfe5ab7b1842993be50052b21)
2017-11-27gl_table.py: add extern C guard for the generated glapitable.hEmil Velikov1-0/+8
The header can be included from C++, hence contents should have appropriate notation. Cc: mesa-stable@lists.freedesktop.org Cc: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit c7616ac06973a80c3c6e9def49a3fa6606ba6097)
2017-11-27glsl/linker: Check that re-declared, inter-shader built-in blocks matchEduardo Lima Mitev1-0/+29
>From GLSL 4.5 spec, section "7.1 Built-In Language Variables", page 130 of the PDF states: "If multiple shaders using members of a built-in block belonging to the same interface are linked together in the same program, they must all redeclare the built-in block in the same way, as described in section 4.3.9 “Interface Blocks” for interface-block matching, or a link-time error will result." Fixes: * GL45-CTS.CommonBugs.CommonBug_PerVertexValidation v2 (Neil Roberts): Explicitly look for gl_PerVertex in the symbol tables instead of waiting to find a variable in the interface. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102677 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eduardo Lima Mitev <elima@igalia.com> Signed-off-by: Neil Roberts <nroberts@igalia.com> (cherry picked from commit f9de7f55969e981f6e98a41fce04bc3a2a8280eb)
2017-11-27glsl: Use the utility function to copy symbols between symbol tablesEduardo Lima Mitev2-31/+10
This effectively factorizes a couple of similar routines. v2 (Neil Roberts): Non-trivial rebase on master Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eduardo Lima Mitev <elima@igalia.com> Signed-off-by: Neil Roberts <nroberts@igalia.com> (cherry picked from commit f5fe99ac85e15b705612bd9e7599cc974c2a121b)
2017-11-27glsl_parser_extra: Add utility to copy symbols between symbol tablesEduardo Lima Mitev2-0/+48
Some symbols gathered in the symbols table during parsing are needed later for the compile and link stages, so they are moved along the process. Currently, only functions and non-temporary variables are copied between symbol tables. However, the built-in gl_PerVertex interface blocks are also needed during the linking stage (the last step), to match re-declared blocks of inter-stage shaders. This patch adds a new utility function that will factorize current code that copies functions and variables between two symbol tables, and in addition will copy explicitly declared gl_PerVertex blocks too. The function will be used in a subsequent patch. v2 (Neil Roberts): Allow the src symbol table to be NULL and explicitly copy the gl_PerVertex symbols in case they are not referenced in the exec_list. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Eduardo Lima Mitev <elima@igalia.com> Signed-off-by: Neil Roberts <nroberts@igalia.com> (cherry picked from commit 4c62a270a99d443316e29020377465a90a6968c0)
2017-11-27util: Fix disk_cache index calculation on big endianMatt Turner1-2/+2
The cache-test test program attempts to create a collision (using key_a and key_a_collide) by making the first two bytes identical. The idea is fine -- the shader cache wants to use the first four characters of a SHA1 hex digest as the index. The following program unsigned char array[4] = {1, 2, 3, 4}; int *ptr = (int *)array; for (int i = 0; i < 4; i++) { printf("%02x", array[i]); } printf("\n"); printf("%08x\n", *ptr); prints 01020304 04030201 on little endian, and 01020304 01020304 on big endian. On big endian platforms reading the character array back as an int (as is done in disk_cache.c) does not yield the same results as reading the byte array. To get the first four characters of the SHA1 hex digest when we mask with CACHE_INDEX_KEY_MASK, we need to byte swap the int on big endian platforms. Bugzilla: https://bugs.freedesktop.org/103668 Bugzilla: https://bugs.gentoo.org/637060 Bugzilla: https://bugs.gentoo.org/636326 Fixes: 87ab26b2ab35 ("glsl: Add initial functions to implement an on-disk cache") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit c690a7a8cdfb6425547bbb782020098405851194)
2017-11-27util: Fix SHA1 implementation on big endianMatt Turner1-1/+2
The code defines a macro blk0(i) based on the preprocessor condition BYTE_ORDER == LITTLE_ENDIAN. If true, blk0(i) is defined as a byte swap operation. Unfortunately, if the preprocessor macros used in the test are no defined, then the comparison becomes 0 == 0 and it evaluates as true. Fixes: d1efa09d342b ("util: import sha1 implementation from OpenBSD") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 532674303a92c438cb1c48d224e9dee9dece91ec)
2017-11-24i965/fs: Handle negating immediates on MADs when propagating saturatesMatt Turner1-2/+8
MADs don't take immediate sources, but we allow them in the IR since it simplifies a lot of things. I neglected to consider that case. Fixes: 4009a9ead490 ("i965/fs: Allow saturate propagation to propagate negations into MADs.") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103616 Reported-and-Tested-by: Ruslan Kabatsayev <b7.10110111@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit a05af1f7b8f82a38513bba31f9573cd62d82f18d)
2017-11-24ddebug: fix use-after-free of streamout targetsNicolai Hähnle1-1/+1
Fixes: b47727a83ad6 ("ddebug: implement pipelined hang detection mode") Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 16f8da299700e714fd5aff265b8f28fe2badfa95)
2017-11-24radeonsi/gfx9: fix VM fault with fetched instance divisorsNicolai Hähnle2-5/+12
We need to account for SGPR locations in merged shaders. This case is exercised by KHR-GL45.enhanced_layouts.vertex_attrib_locations Fixes: 79c2e7388c7f ("radeonsi/gfx9: use SPI_SHADER_USER_DATA_COMMON") Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit df5ebe0c261e8d13683f2515be9ce263f5437bcd)
2017-11-24glsl: Catch subscripted calls to undeclared subroutinesGeorge Barrett1-2/+7
generate_array_index fails to check whether the target of a subroutine call exists in the AST, potentially passing around null ir_rvalue pointers eventuating in abort/segfault. Fixes: fd01840c0bd3 ("glsl: add AoA support to subroutines") Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100438 (cherry picked from commit f09c2cefdd53cd61562a994294e9d0630868d2da)
2017-11-24r600: Emit EOP for more CF instruction typesGert Wollny4-7/+16
So far on pre-cayman chipsets the CF instructions CF_OP_LOOP_END, CF_OP_CALL_FS, CF_OP_POP, and CF_OP_GDS an extra CF_NOP instruction was added to add the EOP flag, even though this is not actually needed, because all these instrutions support the EOP flag. This patch removes the fixup code, adds setting the EOP flag for the according instructions as well as others like CF_OP_TEX and CF_OP_VTX, and adds writing out EOP for this type of instruction in the disassembler. This also fixes a bug where shaders were created that didn't actually have the EOP flag set in the last CF instruction, which might have resulted in GPU lockups. [airlied: cleaned up a little] Signed-off-by: Gert Wollny <gw.fossdev@gmail.com> Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1d076aafbc05b0af299826ac0ee63b2fb28e944a)
2017-11-24i965: Mark BOs as external when we export their handleJason Ekstrand3-1/+11
Almost all of our BO export paths were already properly marked the BO as external and added it to the handle table. Most export use-cases go through a prime fd or flink where we have a brw_bo export helper that does the right thing. The one missing one happens when you call queryImage and ask for __DRI_IMAGE_ATTRIB_HANDLE. We just grabbed the gem handle out of the BO (because it's really easy to do that) and handed it off to the client; what could go wrong? As it turns out, this path is used by basically every compositor that wants to turn around and call drmModeAddFB2 on it so it can hand it off to display. The result, as of 4b1e70cc57d7ff5f465544644b2180dee1490cee, is that we no longer set MOCS_PTE on those surfaces and the kernel's attempts to disable caching fail and we scanout gets corruption. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103759 Fixes: 4b1e70cc57d7ff5f465544644b2180dee1490cee Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit 0a6a137eb27129e17298cfe9dd620205588ee4f6)
2017-11-24i965/bufmgr: Add a helper to mark a BO as externalJason Ekstrand1-6/+11
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit 344252a27f8d875572bbe65641a825af8e73845d)
2017-11-20Update version to 17.3.0-rc5mesa-17.3.0-rc5Emil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-11-18i965: Revert Gen8 aspect of VF PIPE_CONTROL workaround.Kenneth Graunke1-1/+5
This apparently causes hangs on Broadwell, so let's back it out for now. I think there are other PIPE_CONTROL workarounds that we're missing. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103787 (cherry picked from commit a01ba366e01b7d1cdfa6b0e6647536b10c0667ef)
2017-11-17anv/cmd_buffer: Take bo_offset into account in fast clear state addressesJason Ekstrand1-1/+1
Otherwise, if the image is not bound to the start of the buffer, we're going to be reading and writing its fast clear state in the wrong spot. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit a07f7b26198ce0f5c8799481a673754968ac5daf)
2017-11-17anv/cmd_buffer: Advance the address when initializing clear colorsJason Ekstrand1-3/+6
Found by inspection Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit a6cc361e5fd2450249847d5ee8093d26ed7ff545)
2017-11-17i965/gen8+: Fix the number of dwords programmed in MI_FLUSH_DWAnuj Phogat2-5/+17
Number of dwords in MI_FLUSH_DW changed from 4 to 5 in gen8+. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 1dc45d75bb3ff3085f7356b8ec658111529ff76d) [Emil Velikov: trivial conflicts] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/drivers/dri/i965/intel_blit.c
2017-11-17i965: Program DWord Length in MI_FLUSH_DWAnuj Phogat3-3/+3
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6165fda59b889de035b38d9a1a08ffe0da19e6a6) Squashed with: i965: Remove DWord length from MI_FLUSH_DW definition Fixes: 6165fda59b8 ("i965: Program DWord Length in MI_FLUSH_DW") Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 822fd2341db49cbbe813114d2d0fc1b66de4807c)
2017-11-17meson: explicitly disable the build system for 17.3.xEmil Velikov1-0/+2
This build system is rather incomplete in the 17.3 branch, with multiple bugs and user facing changes already addressed in master. It's not shipped in the tarball and we don't want to receive bug reports about 17.3, 18.0 is the release that I hope to have the meson build in shape for. Simply error() out, if anyone tries to use it. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-11-17Revert "intel/fs: Use a pure vertical stride for large register strides"Matt Turner1-13/+3
This reverts commit e8c9e65185de3e821e1e482e77906d1d51efa3ec. With the actual bug fixed (by commit 6ac2d1690192), this is not necessary. I'm doubtful of its correctness in any case. (cherry picked from commit a31d0382084c8aa860ffcef9b12592c5c44e192f)
2017-11-17i965/fs: Split all 32->64-bit MOVs on CHV, BXT, GLKMatt Turner1-4/+4
Fixes the following tests on CHV, BXT, and GLK: KHR-GL46.shader_ballot_tests.ShaderBallotFunctionBallot dEQP-VK.spirv_assembly.instruction.compute.uconvert.uint32_to_int64 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103115 (cherry picked from commit cfcfa0b9cd1b1d563a988b1250950057c4612ac9)
2017-11-17i965/fs: Fix extract_i8/u8 to a 64-bit destinationMatt Turner1-2/+23
The MOV instruction can extract bytes to words/double words, and words/double words to quadwords, but not byte to quadwords. For unsigned byte to quadword, we can read them as words and AND off the high byte and extract to quadword in one instruction. For signed bytes, we need to first sign extend to word and the sign extend that word to a quadword. Fixes the following test on CHV, BXT, and GLK: KHR-GL46.shader_ballot_tests.ShaderBallotBitmasks Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103628 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 6ac2d16901927013393f873a34c717ece5014c1a)
2017-11-17tgsi/exec: fix LDEXP in softpipeNicolai Hähnle1-1/+1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103128 Fixes: cad959d90145 ("gallium: add LDEXP TGSI instruction and corresponding cap") Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit f3fa3b0d95c712c00318ca5601433bce1b82432d)
2017-11-17egl/wayland: Add a fallback when fourcc query isn't supportedDerek Foreman1-2/+30
When queryImage doesn't support __DRI_IMAGE_ATTRIB_FOURCC wayland clients will die with a NULL derefence in wl_proxy_add_listener. Attempt to provide a simple fallback to keep ancient systems working. Fixes: 6595c699511 ("egl/wayland: Remove more surface specifics from create_wl_buffer") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103519 Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (cherry picked from commit 0db36caa192b129cb4f22d152f82f38fcf6f06d4) Squashed with: egl: fix var type queryImage() takes an `int*`; compiler is warning about the signed<->unsigned pointer mismatch. Fixes: 0db36caa192b129cb4f2 "egl/wayland: Add a fallback when fourcc query isn't supported" Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (cherry picked from commit ca95d7ad4e1b900eb3d559ed5bda0b96b232961d)
2017-11-17radv: Free temporary syncobj after waiting on it.Bas Nieuwenhuizen1-4/+18
Otherwise we leak it. Fixes: eaa56eab6da "radv: initial support for shared semaphores (v2)" Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit 7c255788637b8fdfc31aca5f7891f39a110c5cb2)
2017-11-17radv: Free syncobj with multiple imports.Bas Nieuwenhuizen1-2/+8
Otherwise we can leak the old syncobj. Fixes: eaa56eab6da "radv: initial support for shared semaphores (v2)" Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit 917d3b43f2b206ccf036542aa1c39f1dbdd84f62)