aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
Commit message (Collapse)AuthorAgeFilesLines
* mesa: treat Color._AdvancedBlendMode as enumErik Faye-Lund2020-07-172-2/+4
| | | | | | | Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>
* mesa: add bool param to _mesa_free_context_dataPierre-Eric Pelloux-Prayer2020-07-154-4/+4
| | | | | | | | The param controls whether _mesa_destroy_debug_output should be called or not. No functional changes; this will be used by the next commit. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5789>
* nouveau: fix pointer-sign warningTimothy Arceri2020-07-041-1/+1
| | | | | | Fixes: e630271e0ec3 ("mesa: don't ever set NullBufferObj in gl_vertex_array_binding") Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5730>
* radeon: add missing fallthrough commentsTimothy Arceri2020-07-021-0/+3
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* i965: add and fix fallthrough commentsTimothy Arceri2020-07-024-6/+6
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>
* i965: Explicitly cast value to uint64_tEmmanuel2020-07-011-4/+4
| | | | | | | | | | | In FreeBSD x86 and aarch64 __u64 is typedef to unsigned long and is the same size as unsigned long long. Since we are explicitly specifying the format, cast the value to the proper type. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Emmanuel <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559>
* util: rename xmlpool.h to driconf.hEric Engestrom2020-06-2212-12/+12
| | | | | | | To make it clearer what it is and does. Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* driconf: drop now unused translation facilityEric Engestrom2020-06-229-25/+24
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* mesa: Add PrimitiveRestartFixedIndex to gl_constantsNeil Roberts2020-06-221-0/+2
| | | | | | | | | | | | This is a fine-grained subset of the NV_primitive_restart extension that only uses the fixed indices provided by GLES 3.0. There’s no public extension to advertise this behaviour so the bool is added to gl_constants instead of gl_extensions. Reviewed-by: Eric Anholt <[email protected]> Reviewed by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5559>
* intel/compiler: Always apply sample mask on Vulkan.Arcady Goldmints-Orlov2020-06-191-0/+2
| | | | | | | | | | | With OpenGL, shader writes to the sample mask are ignored when not rendering to a multisample render target. However, on Vulkan, writes to the sample mask have still have their effect in that case. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3016 Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5156>
* i965: replace all dup() with os_dupfd_cloexec()Eric Engestrom2020-06-182-3/+5
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
* i965: drop dead #include "config.h"Eric Engestrom2020-06-131-4/+0
| | | | | | | | | | There hasn't been a config.h in a long time (it was an artifact of the autotool build). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5350>
* i965: Work around incorrect usage of glDrawRangeElements in UE4Danylo Piliaiev2020-06-091-0/+20
| | | | | | | | | | | | | | | | | | | | | | | Unreal Engine 4 has a bug in usage of glDrawRangeElements, causing it to be called with a number of vertices in place of "end" parameter (which specifies the maximum array index contained in indices). Since there is unknown amount of games affected and we could not identify that a game is built with UE4 - we are forced to make a blanket workaround, disregarding max_index in range calculations. Fortunately all such calls look like: glDrawRangeElements(GL_TRIANGLES, 0, 3, 3, ...); So we are able to narrow down this workaround. This was uncovered after b684030c3a656ffdbc93581856034e0982db46fd broke a bunch of UE4 games. Cc: 20.1 <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2917 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5203>
* i965: fix export of GEM handlesLionel Landwerlin2020-06-044-5/+152
| | | | | | | | | | | | | | | | | | | | | | | | We reuse DRM file descriptors internally. Therefore when we export a GEM handle we must do so in the file descriptor used externally. v2: Fix dmabuf leak Fix GEM handle leaks by tracking exported handles v3: Check os_same_file_description error (Michel) Don't create multiple exports for a given GEM table v4: Add WARN_ONCE (Ken) v5: Remove blank line (Ian) Remove unused field (Ian) Signed-off-by: Lionel Landwerlin <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2882 Fixes: 4094558e8643 ("i965: share buffer managers across screens") Tested-by: Eric Engestrom <[email protected]> Tested-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4861>
* i965: don't forget to set screen on duped imageLionel Landwerlin2020-06-041-0/+1
| | | | | | | | | | We'll start using this field more for querying image properties. Without it we run into a crash. Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4861>
* i965: call brw_nir_lower_uniforms() after uniform linking is completeTimothy Arceri2020-06-031-2/+1
| | | | | | | | | | | | | | | | i965 currently uses the NIR uniform linker for spirv support. Until now the only reason there has been no issue with calling the lowering pass before the linker is because no garbage collection is done between the calls. An upcoming change to the linker will add an optimisation to resize unform arrays where possible. Because lowering causes the array defs to no longer be used the new optimisation ends up resizing the arrays to 0. To fix this we move the lowering call after the linking calls. Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4910>
* nir: add callback to nir_remove_dead_variables()Timothy Arceri2020-06-031-1/+2
| | | | | | | | | | | | This allows us to do API specific checks before removing variable without filling nir_remove_dead_variables() with API specific code. In the following patches we will use this to support the removal of dead uniforms in GLSL. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4797>
* meson: use gnu_symbol_visibility argumentDylan Baker2020-06-017-14/+15
| | | | | | | | | | This uses a meson builtin to handle -fvisibility=hidden. This is nice because we don't need to track which languages are used, if C++ is suddenly added meson just does the right thing. Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
* intel: Add helper to calculate GPGPU_WALKER::RightExecutionMaskCaio Marcelo de Oliveira Filho2020-05-271-5/+2
| | | | | | | Suggested by Jason. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
* iris, i965: Update limits for ARB_compute_variable_group_sizeCaio Marcelo de Oliveira Filho2020-05-271-15/+6
| | | | | | | | | The CS compiler now produces multiple SIMD variants, so the previous trade-off between "always using SIMD32" and "having a smaller max invocations" is now gone. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
* iris, i965: Drop max_variable_local_sizeCaio Marcelo de Oliveira Filho2020-05-271-9/+0
| | | | | | | | | This was used to decide which SIMD width to generate code for ARB_compute_variable_group_size. Now that compiler will generate multiple SIMD widths, this information is unused. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
* i965: Use new helper functions to pick SIMD variant for CSCaio Marcelo de Oliveira Filho2020-05-274-31/+43
| | | | | | | | Also expand the existing i965 helper to return the other CS related paramters. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
* i965: Use SATURATEAlyssa Rosenzweig2020-05-261-1/+1
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
* i965: replace fnv1a hash function with xxhashDmitriy Nester2020-05-251-3/+5
| | | | | | | | | xxhash is faster than fnv1a in almost all circumstances, so we're switching to it globally. Signed-off-by: Dmytro Nester <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4020>
* dri_util: Update internal_format to GL_RGB8 for MESA_FORMAT_R8G8B8X8_UNORMNataraj Deshpande2020-05-211-1/+1
| | | | | | | | | | | | | | | | The commit helps to resolve GL_INVALID_OPERATION error returned during CTS test when Android format RGBX8888 fallback to RGBA8888 and then set color with glTexSubImage2D(format=GL_RGB). Fixes android.hardware.nativehardware.cts.AHardwareBufferNativeTests: #SingleLayer_ColorTest_GpuSampledImageCanBeSampled_R8G8B8X8_UNORM Cc: <[email protected]> Fixes: bf576772ab4d ("dri_util: add driImageFormatToSizedInternalGLFormat function") Signed-off-by: Nataraj Deshpande <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5034>
* i965: add identifier BOLionel Landwerlin2020-05-203-1/+42
| | | | | | | | | | A buffer added to all execbufs so that we can attribute a batch that caused a hang to a particular driver. v2: Reuse workaround BO Signed-off-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3203>
* i965: store workaround_bo offsetLionel Landwerlin2020-05-204-5/+13
| | | | | | | | | This offset store the location where we read/write into the workaround_bo. It will allow to select a different address later, leaving the beginning of the buffer to some other use. Signed-off-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3203>
* blorp: rename workaround address functionLionel Landwerlin2020-05-201-1/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3203>
* intel/perf: make pipeline statistic query loading optionalLionel Landwerlin2020-05-201-1/+2
| | | | | | | | | On Vulkan most of those are already covered by standard queries so add the ability to skip them. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775>
* intel: Store the aperture size in devinfo.Rafael Antognolli2020-05-151-12/+1
| | | | | | | | | | | | We will later use the devinfo from iris_bufmgr, where we don't have access to the screen pointer. And since we are moving it, we can reuse it in Anv and i965. v2: return error code and check for it on Anv (Lionel). v3: Remove anv_gem_get_aperture() from anv_private.h and stubs (Lionel). Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5043>
* i965: Assert that blorp always handles color blitsIan Romanick2020-05-142-0/+5
| | | | | | Reviewed-by: Paulo Zanoni <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/856>
* i965: Fix out-of-bounds access to brw_stage_state::surf_offsetDanylo Piliaiev2020-05-061-23/+29
| | | | | | | | | | | | | | ../src/mesa/drivers/dri/i965/brw_wm_surface_state.c:1378:32: runtime error: index 3503345872 out of bounds for type 'uint32_t [149]' brw_assign_common_binding_table_offsets has the following comment: "Unused groups are initialized to 0xd0d0d0d0 to make it obvious that they're unused but also make sure that addition of small offsets to them will trigger some of our asserts that surface indices are < BRW_MAX_SURFACES." Cc: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4350>
* mesa: extend GLSLZeroInit semanticsPierre-Eric Pelloux-Prayer2020-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new way to zero-init variables but keep the old one to not break any existing behavior. With this change GLSLZeroInit becomes an integer, with the following possible values: - 0: no 0 init - 1: current behavior - 2: new behavior. Similar to 1, except ir_var_function_out type are 0 initialized but ir_var_shader_out. The rationale behind 2 is: zero initializing ir_var_shader_out can prevent some optimization where out variables are completely eliminated when not written to. On the other hand, zero initializing "ir_var_function_out" has no effect on correct shaders but typically helps shadertoy since the main function is: void mainImage(out vec4 fragColor) { ... } So with this change we're sure that fragColor will always get a value. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
* i965: disable shadow batches when batch debugging.Dave Airlie2020-05-031-1/+5
| | | | | | | | | | If you want to dump batch state, it needs to have the relocs processed but the relocs don't get processed on the shadow batch. Choose debugging over speed here. Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4846>
* intel: Let drivers call brw_nir_lower_cs_intrinsics()Caio Marcelo de Oliveira Filho2020-05-011-0/+2
| | | | | | | | | | | | | | The motivating factor is: this lowering may cause nir_intrinsic_load_local_group_size intrinsics to be added to the shader, and by moving this around we make possible for the drivers to lower that intrinsic by themselves. Iris will do just that in a later patch for implementing variable group size. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4794>
* intel/fs: Add an option to lower variable group size in backendCaio Marcelo de Oliveira Filho2020-05-011-0/+1
| | | | | | | | | Adding this since Iris will handle variable group size parameters by itself. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4794>
* intel/fs: Clean up variable group size handling in backendCaio Marcelo de Oliveira Filho2020-05-011-3/+0
| | | | | | | | Just use the information from NIR shader_info. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4794>
* i965: remove unused variableMarcin Ślusarz2020-04-291-2/+0
| | | | | | | | Last use was removed in 54525808aa58. Signed-off-by: Marcin Ślusarz <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4809>
* i965: Use correct constant for max_variable_local_sizeCaio Marcelo de Oliveira Filho2020-04-291-1/+1
| | | | | | Fixes: 5664bd6db38 ("i965: Implement ARB_compute_variable_group_size") Reviewed-by: Jordan Justen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4799>
* mesa: replace GLenum target with gl_shader_stage in NewProgramMarek Olšák2020-04-273-16/+18
| | | | | | | | So that the GLSL compiler doesn't have to use the GLenum conversion functions. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4756>
* mesa: replace _NEW_EVAL with vbo_exec_update_eval_mapsMarek Olšák2020-04-271-1/+0
| | | | | Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* meta,i965: Rip GL_EXT_texture_multisample_blit_scaled support out of metaJason Ekstrand2020-04-223-69/+0
| | | | | | | | | | | i965 is the only driver that ever linked to this code and it's been doing it in BLORP for a long time now. The only possible case where it would have fallen back to meta was for depth/stencil but that should have ended starting with 6cec618e82aa2. Rip out the dead code. Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4622>
* remove final imports.h and imports.c bitsDylan Baker2020-04-2152-399/+359
| | | | | | | | | | | This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* dri/nouveau: replace assert with unreachableDylan Baker2020-04-211-1/+3
| | | | | | | | | | | I don't know why removing imports.h suddenly makes clang realize that this function can not return in a non-debug build, but it does. Unreachable is better because it doesn't have this problem. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace imports memory functions with utils memory functionsDylan Baker2020-04-213-19/+20
| | | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace malloc macros in imports.h with u_memory.h versionsDylan Baker2020-04-2125-0/+25
| | | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace _mesa_logbase2 with util_logbase2Dylan Baker2020-04-213-3/+3
| | | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace _mesa_next_pow_two_* with util_next_power_of_two_*Dylan Baker2020-04-211-1/+1
| | | | | | | | | | The 64 bit variant in imports.h isn't even used. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace _mesa_is_pow_two with util_is_power_of_two_*Dylan Baker2020-04-213-4/+4
| | | | | | | | | | | | | Mostly this uses util_is_power_of_two_or_zero, which has the same behavior as _mesa_is_pow_two when the input is zero. In cases where the value is known to be != 0 ahead of time I used the _nonzero variant as it may be faster on some platforms. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* glsl: Hard-code noise to zero in builtin_functions.cppJason Ekstrand2020-04-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 4.4 of the GLSL spec changed the definition of noise*() to always return zero and earlier versions of the spec allowed zero as a valid implementation. All drivers, as far as I can tell, unconditionally call lower_noise() today which turns ir_unop_noise into zero. We've got a 10-year-old comment in there saying "In the future, ir_unop_noise may be replaced by a call to a function that implements noise." Well, it's the future now and we've not yet gotten around to that. In the mean time, the GLSL spec has made doing so illegal. To make things worse, we then pretend to handle the opcode in glsl_to_nir, ir_to_mesa, and st_glsl_to_tgsi even though it should never get there given the lowering. The lowering in st_glsl_to_tgsi defines noise*() to be 0.5 which is an illegal implementation of the noise functions according to pre-4.4 specs. We also have opcodes for this in NIR which are never used because, again, we always call lower_noise(). Let's just kill the whole opcode and make builtin_builder.cpp build a bunch of functions that just return zero. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4624>