summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-10-05anv: Use blorp for VkCmdFillBufferJason Ekstrand2-130/+96
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
2016-10-05egl: Implement EGL_KHR_debug (v2)Kyle Brenneman2-0/+146
Wire up the debug entrypoints to EGL dispatch, and add the extension string to the client extension list. v2: - Lots of style fixes - Fix missing EGLAPIENTRYs - Factor out valid attribute check - Lock display in eglLabelObjectKHR as needed, and use RETURN_EGL_* - Move "EGL_KHR_debug" into asciibetical order in client extension string Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.veliko@collabora.com>
2016-10-05egl: Track EGL_KHR_debug state when going through EGL API calls (v3)Kyle Brenneman4-12/+257
This decorates every EGL entrypoint with _EGL_FUNC_START, which records the function name and primary dispatch object label in the current thread state. It also adds debug report functions and calls them when appropriate. This would be useful enough for debugging on its own, if the user set a breakpoint when the report function was called. We will also need this state tracked in order to expose EGL_KHR_debug. v2: - Clear the object label in more cases in _eglSetFuncName - Pass draw surface (if any) to _EGL_FUNC_START in eglSwapInterval v3: - Set dummy thread's CurrentAPI to EGL_OPENGL_ES_API not zero - Less ?: in _eglSetFuncName Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.veliko@collabora.com>
2016-10-05intel: aubinator: pack supported generations into an arrayLionel Landwerlin1-53/+35
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-05i965/l3: Add explicit way size calculation for bxtBen Widawsky1-1/+3
There should be no functional change here because Broxton and CHV are both gt1. Without this code however, it might seem like broxton support is missing. While here, put the gt1 check in front to hopefully short-circuit the condition for the mobile cases. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-10-05virgl: Fix build regression of commit 8a943564Nicolai Hähnle1-1/+1
2016-10-05st/mesa: enable GL_KHR_robustnessNicolai Hähnle3-1/+4
The difference to the virtually identical ARB_robustness (which is already enabled unconditionally) is miniscule and handled elsewhere, but this cap seems like the right thing to require for this extension. v2: drop the device reset cap requirement (Ilia) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-10-05gallium/radeon: implement set_device_reset_callbackNicolai Hähnle4-0/+40
Check for device reset on flush. It would be nicer if the kernel just reported this as an error on the submit ioctl (and similarly for fences), but this will do for now. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05st/mesa: set a device reset callback when availableNicolai Hähnle4-2/+38
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05st/mesa: extract conversion from pipe_reset_status to GLenumNicolai Hähnle1-11/+18
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05ddebug: add pass-through of set_device_reset_callbackNicolai Hähnle1-0/+10
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05gallium: add pipe_context::set_device_reset_callbackNicolai Hähnle3-0/+42
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05virgl: use the new parent/child pools for transfersNicolai Hähnle6-8/+14
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05vc4: use the new parent/child pools for transfersNicolai Hähnle5-6/+11
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05freedreno: use the new parent/child pools for transfersNicolai Hähnle5-6/+12
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05r300: use the new parent/child pools for transfers (v2)Nicolai Hähnle5-7/+11
v2: slab_alloc_st -> slab_alloc Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05gallium/radeon: use the new parent/child pools for transfersNicolai Hähnle3-6/+11
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97894 Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-05util/slab: re-design to allow migration between pools (v3)Nicolai Hähnle2-89/+258
This is basically a re-write of the slab allocator into a design where multiple child pools are linked to a parent pool. The intention is that every (GL, pipe) context has its own child pool, while the corresponding parent pool is held by the winsys or screen, or possibly the GL share group. The fast path is still used when objects are freed by the same child pool that allocated them. However, it is now also possible to free an object in a different pool, as long as they belong to the same parent. Objects also survive the destruction of the (child) pool from which they were allocated. The slow path will return freed objects to the child pool from which they were originally allocated. If that child pool was destroyed, the corresponding page is considered an orphan and will be freed once all objects in it have been freed. This allocation pattern is required for pipe_transfers that correspond to (GL) buffer object mappings when the mapping is created in one context which is later destroyed while other contexts of the same share group live on -- see the bug report referenced below. Note that individual drivers do need to migrate to the new interface in order to benefit and fix the bug. v2: use singly-linked lists everywhere v3: use p_atomic_set for page->u.num_remaining Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97894
2016-10-05util: use GCC atomic intrinsics with explicit memory modelNicolai Hähnle2-0/+32
This is motivated by the fact that p_atomic_read and p_atomic_set may somewhat surprisingly not do the right thing in the old version: while stores and loads are de facto atomic at least on x86, the compiler may apply re-ordering and speculation quite liberally. Basically, the old version uses the "relaxed" memory ordering. The new ordering always uses acquire/release ordering. This is the strongest possible memory ordering that doesn't require additional fence instructions on x86. (And the only stronger ordering is "sequentially consistent", which is usually more than you need anyway.) I would feel more comfortable if p_atomic_set/read in the old implementation were at least using volatile loads and stores, but I don't see a way to get there without typeof (which we cannot use here since the code is compiled with -std=c99). Eventually, we should really just move to something that is based on the atomics in C11 / C++11. Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-05i965: use L3 data cache for SSBOsLionel Landwerlin1-1/+2
Anv programs the hardware to use L3 data cache if we use either SSBOs or images in the shaders, we can program i965 the same way. gl_shader_program has a bit of a confusing named field with 'NumAtomicBuffers'. It doesn't tell how many buffers are accessed by the shader in an atomic way but instead the number of atomic counters manipulated by the shader. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2016-10-04mesa: Raise INVALID_ENUM in FramebufferTexture*D for unknown textargets.Kenneth Graunke1-2/+3
ES3-CTS.functional.negative_api.buffer.framebuffer_texture2d expects glFramebufferTexture[123]D to raise GL_INVALID_ENUM when supplied a completely bogus textarget parameter (i.e. 0xffffffff). This is at odds with the spec. GLES 3.1 says: "An INVALID_OPERATION error is generated if texture is not zero and textarget is not one of TEXTURE_2D, TEXTURE_2D_MULTISAMPLE, or one of the cube map face targets from table 8.21." (and GLES 3.0 and GL 4.5 both have similar text). However, GL has a general guideline that says: "If a command that requires an enumerated value is passed a symbolic constant that is not one of those specified as allowable for that command, an INVALID_ENUM error is generated." Apparently other vendors reconcile these two rules as follows: GL should raise INVALID_OPERATION for actual texture target enumeration values which are not allowed for this particular glFramebufferTexture*D call. Any value that is not a texture target should result in GL_INVALID_ENUM. For example, glFramebufferTexture2D with GL_TEXTURE_1D would result in INVALID_OPERATION because it is a real texture target, but not allowed for the 2D version of the function. But calling it with GL_FRONT would result in INVALID_ENUM, as that isn't even a texture target. Fixes: - {ES3-CTS,dEQP-GLES3}.functional.negative_api.buffer.framebuffer_texture2d - {ES31-CTS,ES32-CTS,dEQP-GLES31}.functional.debug.negative_coverage.get_error.buffer.framebuffer_texture2d References: https://gitlab.khronos.org/opengl/cts/merge_requests/387 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-04mesa: Reorganize check_textarget().Kenneth Graunke1-43/+37
Having one top-level switch statement covering all known texture targets will make the next change easier to implement. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-04aubinator: use the correct format specifier for printing ptrdiff_t.Kenneth Graunke1-1/+1
Fixes more warnings in 32-bit builds. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-04aubinator: Use less -RS instead of -r for the implicit pager.Kenneth Graunke1-4/+3
From the less man page: "Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place." Lines which are too long to fit in the terminal would be word wrapped, but unfortunately less would get confused about which line it was on, and text would be drawn on top of other text. The most noticable case was shader assembly, which is frequently too wide for an 80 character terminal, and thus would be drawn on top of the following state packets, making them completely unreadable. Using -R instead of -r fixes this problem by only allowing color escape sequences. (Notably, Git's implicit pager invocation uses -R.) Unfortunately, it means our "clear to the end of the line" hack for extending the blue bar headers won't work anymore. Word wrapping usually isn't terribly readable, anyway, so we also add the -S option (chop long lines) to restrict it to the terminal width. (You can hit the left and right arrow keys to scroll sideways.) Then, for a new blue bar hack, we can use a printf specifier to pad the command packet names to be 80 characters long (arbitrarily), which extends them "far enough" to look good, and doesn't require us to use ioctls to determine the terminal width. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Sirisha Gandikota <sirisha.gandikota@intel.com>
2016-10-04i965: Drop _NEW_TRANSFORM from 3DSTATE_VS atom on Gen7.Kenneth Graunke1-1/+1
The atom that uploads push constants listens to _NEW_TRANSFORM for legacy clip plane handling. On Sandybridge, the gen6_vs_state atom emits 3DSTATE_CONSTANT_VS as well as 3DSTATE_VS, so it needs to listen to the same set of conditions. However, it looks like Gen7 doesn't need this. The push constant atom emits 3DSTATE_CONSTANT_VS directly, and the gen7_vs_state atom that emits 3DSTATE_VS doesn't have a dependency on ctx->Transform. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Fix brw_clear_cache to clean up TCS/TES shaders.Kenneth Graunke1-0/+2
We need to free prog_data for TCS/TES too. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arcero@collabora.com>
2016-10-04i965: Add missing BRW_CS_PROG_DATA to CS work group surface atom.Kenneth Graunke1-2/+5
Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Add missing BRW_NEW_CS_PROG_DATA to compute constant atom.Kenneth Graunke1-1/+2
CACHE_NEW_CS_PROG hasn't existed in quite a long time...the old comment was there, but not the actual bit. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Add missing BRW_NEW_FS_PROG_DATA to render target reads.Kenneth Graunke1-1/+3
Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Move BRW_NEW_FRAGMENT_PROGRAM from 3DSTATE_PS to PS_EXTRA.Kenneth Graunke1-1/+1
3DSTATE_PS doesn't need this. 3DSTATE_PS_EXTRA however does, for brw_color_buffer_write_enabled(). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Add missing BRW_NEW_VS_PROG_DATA to 3DSTATE_CLIP.Kenneth Graunke1-0/+2
Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Fix missing _NEW_TRANSFORM in Gen8+ 3DSTATE_DS atom.Kenneth Graunke1-1/+2
Needed for user clip plane enables. Broken since this code was introduced. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-04i965: Enable ARB_shader_atomic_counter_opsIan Romanick4-6/+50
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-04i965: Refactor emission of atomic counter operationsIan Romanick4-30/+27
This will make it easier to add more operations. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-04nir/intrinsics: Add more atomic_counter opsIan Romanick3-5/+110
v2: Delete some stray debug code notice by Iago. v3: Massive rebase on new ir_function_signature::intrinsic_id mechanism. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> [v1] Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04nir/intrinsics: Include atomic_counter_ in the names used in macro invocationsIan Romanick1-5/+5
Otherwise grepping for where atomic_counter_inc and friends are defined is a very frustrating experience. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Kill __intrinsic_atomic_subIan Romanick3-19/+46
Just generate an __intrinsic_atomic_add with a negated parameter. Some background on the non-obvious reasons for the the big change to builtin_builder::call()... this is cribbed from some discussion with Ilia on mesa-dev. Why change builtin_builder::call() to allow taking dereferences and create them here rather than just feeding in the ir_variables directly? The problem is the neg_data ir_variable node would have to be in two lists at the same time: the instruction stream and parameters. The ir_variable node is automatically added to the instruction stream by the call to make_temp. Restructuring the code so that the ir_variables could be in parameters then move them to the instruction stream would have been pretty terrible. ir_call in the instruction stream has an exec_list that contains ir_dereference_variable nodes. The builtin_builder::call method previously took an exec_list of ir_variables and created a list of ir_dereference_variable. All of the original users of that method wanted to make a function call using exactly the set of parameters passed to the built-in function (i.e., call __intrinsic_atomic_add using the parameters to atomicAdd). For these users, the list of ir_variables already existed: the list of parameters in the built-in function signature. This new caller doesn't do that. It wants to call a function with a parameter from the function and a value calculated in the function. So, I changed builtin_builder::call to take a list that could either be a list of ir_variable or a list of ir_dereference_variable. In the former case it behaves just as it previously did. In the latter case, it uses (and removes from the input list) the ir_dereference_variable nodes instead of creating new ones. text data bss dec hex filename 6036395 283160 28608 6348163 60dd83 lib64/i965_dri.so before 6036923 283160 28608 6348691 60df93 lib64/i965_dri.so after Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Remove ir_function_signature::_is_intrinsic fieldIan Romanick6-17/+5
text data bss dec hex filename 6036491 283160 28608 6348259 60dde3 lib64/i965_dri.so before 6036395 283160 28608 6348163 60dd83 lib64/i965_dri.so after Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Add ir_function_signature::is_intrinsic() methodIan Romanick7-16/+22
This necessetated renaming the is_intrinsic field to _is_intrinsic. The next commit will remove the field. text data bss dec hex filename 6036507 283160 28608 6348275 60ddf3 lib64/i965_dri.so before 6036491 283160 28608 6348259 60dde3 lib64/i965_dri.so after Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Use the ir_intrinsic_* enums instead of the __intrinsic_* name stringsIan Romanick4-219/+276
text data bss dec hex filename 6038043 283160 28608 6349811 60e3f3 lib64/i965_dri.so before 6036507 283160 28608 6348275 60ddf3 lib64/i965_dri.so after v2: s/ir_intrinsic_atomic_sub/ir_intrinsic_atomic_counter_sub/. Noticed by Ilia. v3: Silence unhandled enum in switch warnings in st_glsl_to_tgsi. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Track a unique intrinsic ID with each intrinsic functionIan Romanick7-73/+280
text data bss dec hex filename 6037483 283160 28608 6349251 60e1c3 lib64/i965_dri.so before 6038043 283160 28608 6349811 60e3f3 lib64/i965_dri.so after Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-04glsl: Don't emit ir_binop_carry during ir_binop_imul_high loweringIan Romanick1-5/+17
st_glsl_to_tgsi only calls lower_instructions once (instead of in a loop), so the ir_binop_carry generated would not get lowered. Fixes assertion failure state_tracker/st_glsl_to_tgsi.cpp:2265: void glsl_to_tgsi_visitor::visit_expression(ir_expression*, st_src_reg*): Assertion `!"Invalid ir opcode in glsl_to_tgsi_visitor::visit()"' failed. on softpipe in 16 piglit tests: mesa_shader_integer_functions/execution/built-in-functions/fs-imulExtended-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-imulExtended-only-msb-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-imulExtended-only-msb.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-imulExtended.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-umulExtended-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-umulExtended-only-msb-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-umulExtended-only-msb.shader_test mesa_shader_integer_functions/execution/built-in-functions/fs-umulExtended.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-imulExtended-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-imulExtended-only-msb-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-imulExtended-only-msb.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-imulExtended.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-umulExtended-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-umulExtended-only-msb-nonuniform.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-umulExtended-only-msb.shader_test mesa_shader_integer_functions/execution/built-in-functions/vs-umulExtended.shader_test Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-05i965: fix unused variable warning in brw_emit_gpgpu_walker()Timothy Arceri1-2/+1
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-05i965: add MAYBE_UNUSED to assert paramTimothy Arceri1-1/+1
Fixes unused variable warning in release build. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-05i965: wrap unused function in #ifndef NDEBUGTimothy Arceri1-0/+2
This function is only ever used by an assert() this fixes an unused function warning in release builds. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-05i965: fix unused variable warning in gen7_block_read_scratch()Timothy Arceri1-2/+1
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-05i965: add MAYBE_UNUSED to assert paramTimothy Arceri1-1/+1
This fixes an unused variable warning on release builds. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-10-04gallivm: Use AVX2 gather instrinsics.Jose Fonseca1-0/+95
v2: Use AVX2 gather for non aligned loads too. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-10-04gallivm: Use 8 wide AoS sampling on AVX2.Roland Scheidegger1-5/+6
v2: Make sure that with num_lods > 1 and min_filter != mag_filter we still enter the splitting path. So this case would still use 4-wide aos path (as a side note, the 4-wide aos sampling path could actually be improved quite a bit if we have avx2, by just doing the filtering with 256bit vectors). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-10-04gallivm: Basic AVX2 support.José Fonseca4-28/+98
v2: pblendb -> pblendvb Reviewed-by: Roland Scheidegger <sroland@vmware.com>