summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* intel/isl: Don't align the height of the last array sliceJason Ekstrand2017-08-071-1/+2
| | | | | | | | | | | | | We were calculating the total height of 2D surfaces by multiplying the row pitch by the number of slices. This means that we actually request slightly more space than actually needed since the padding on the last slice is unnecessary. For tiled surfaces this is not likely to make a difference. For linear surfaces, on the other hand, this means we may require additional memory. In particular, this makes the i965 driver reject EGL imports of buffers which do not have this extra padding. Reviewed-by: Jordan Justen <[email protected]> Cc: "17.2" <[email protected]>
* intel/isl: Stop padding surfacesJason Ekstrand2017-08-071-117/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The docs contain a bunch of commentary about the need to pad various surfaces out to multiples of something or other. However, all of those requirements are about avoiding GTT errors due to missing pages when the data port or sampler accesses slightly out-of-bounds. However, because the kernel already fills all the empty space in our GTT with the scratch page, we never have to worry about faulting due to OOB reads. There are two caveats to this: 1) There is some potential for issues with caches here if extra data ends up in a cache we don't expect due to OOB reads. However, because we always trash the entire cache whenever we need to move anything between cache domains, this shouldn't be an issue. 2) There is a potential issue if a surface gets placed at the very top of the GTT by the kernel. In this case, the hardware could potentially end up trying to read past the top of the GTT. If it nicely wraps around at the 48-bit (or 32-bit) boundary, then this shouldn't be an issue thanks to the scratch page. If it doesn't, then we need to come up with something to handle it. Up until some of the GL move to ISL, having the padding code in there just caused us to harmlessly use a bit more memory in Vulkan. However, now that we're using ISL sizes to validate external dma-buf images, these padding requirements are causing us to reject otherwise valid images due to the size of the BO being too small. Acked-by: Kenneth Graunke <[email protected]> Tested-by: Tapani Pälli <[email protected]> Tested-by: Tomasz Figa <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: "17.2" <[email protected]>
* anv/formats: Allow sampling on depth-only formats on gen7Jason Ekstrand2017-08-071-1/+2
| | | | | | | | | We can't sample from depth-stencil formats but on gen7 but we can sample from depth-only formats. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102024 Reviewed-by: Juan A. Suarez Romero <[email protected]> Cc: [email protected]
* i965: Reduce passing 2x32b of reloc_domains to 2 bitsChris Wilson2017-08-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel only cares about whether the object is to be written to or not, only reduces (reloc.read_domains, reloc.write_domain) down to just !!reloc.write_domain. When we use NO_RELOC, the kernel doesn't even read those relocs and instead userspace has to pass that information in the execobject.flags. We can simplify our reloc api by also removing the unused read/write domains and only pass the resultant flags. The caveat to the above are when we need to make the kernel aware that certain objects need to take into account different work arounds. Previously, this was done using the magic (INSTRUCTION, INSTRUCTION) reloc domains. NO_RELOC requires this to be passed in the execobject flags as well, and now we push that up the callstack. The API is more compact, more expressive of what happens underneath, but unfortunately requires more knowledge of the system at the point of use. Conversely it also means that knowledge is specific and not generally applied and so not overused. text data bss dec hex filename 8502991 356912 424944 9284847 8dacef lib/i965_dri.so (before) 8500455 356912 424944 9282311 8da307 lib/i965_dri.so (after) v2: (by Ken) Rebase. Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Makefile.vulkan.am: ICD json files are now generated with pythonJuan A. Suarez Romero2017-08-041-2/+1
| | | | | | | | | Commit 0ab04ba979b7 (anv: Use python to generate ICD json files) changed the way ICD json files are created. Remove the old .in files from extra dist, and add the python script. Reviewed-by: Emil Velikov <[email protected]>
* anv: put anv_extensions.c in gitignoreLionel Landwerlin2017-08-031-0/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* android: anv_extensions.c is generated to libmesa_vulkan_commonTapani Pälli2017-08-031-1/+1
| | | | | | | | | Fixes build error with anv_extensions.c not found for libmesa_anv_entrypoints. Fixes: d62063c "anv: Autogenerate extension query and lookup" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* intel/vec4/gs: reset nr_pull_param if DUAL_INSTANCED compile failed.Dave Airlie2017-08-031-0/+1
| | | | | | | | | | | | | | | If dual object compile fails (as seems to happen with virgl a fair bit, and does piglit even have any tests for it?), we end up not restarting the pull params, so we call vec4_visitor::move_uniform_array_access_to_pull_constant a second time and it runs over the ends of the alloc. Fixes: tests/spec/glsl-1.50/execution/geometry/max-input-components.shader_test running inside virgl on ivybridge. Reviewed-by: Kenneth Graunke <[email protected]> Cc: <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: Fix indentationMatt Turner2017-08-022-8/+8
|
* anv: Advertise VK_KHR_relaxed_block_layoutJason Ekstrand2017-08-021-0/+1
| | | | | | | There is literally no work for us to do here. It already just works in our driver. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Bump the advertised version to 1.0.57Jason Ekstrand2017-08-021-1/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Pull the API version from anv_extensions.pyJason Ekstrand2017-08-023-1/+13
| | | | | | | This way everything stays in sync and we only have the one version number. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use python to generate ICD json filesJason Ekstrand2017-08-024-23/+54
| | | | | | | | This is more lines of code but the python is far easier to read than the sed expressions we were using before. Also, this allows us to pull the API version from anv_entrypoints.py so it never gets out-of-sync. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Add MAX_API_VERSION to anv_extensions.pyJason Ekstrand2017-08-022-3/+44
| | | | | | | | The VkVersion class is probably overkill but it makes it really easy to compare versions in a way that's safe without the caller having to think about patch vs. no patch. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Make some bits of anv_extensions module-privateJason Ekstrand2017-08-022-6/+6
| | | | | | | This way we can use "from anv_extensions import *" in the entrypoint generator without worrying too much about pollution Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: move gen_decoder.* back to COMMON_FILESTapani Pälli2017-08-022-5/+3
| | | | | | | | this change reverts commit 4f695731, we want to be able to build with -DDEBUG and gen_decoder on Android. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* android: link libmesa_intel_common with zlib and expatTapani Pälli2017-08-021-0/+5
| | | | | | | | Makes it possible to build Mesa on Android with -DDEBUG with the next patch that reverts 4f695731. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* anv: Autogenerate extension query and lookupJason Ekstrand2017-08-016-154/+142
| | | | | | | | | | | | | | | | | | | | | | | As time goes on, extension advertising is going to get more complex. Today, we either implement an extension or we don't. However, in the future, whether or not we advertise an extension will depend on kernel or hardware features. This commit introduces a python codegen framework that generates the anv_EnumerateFooExtensionProperties functions as well as a pair of anv_foo_extension_supported functions for querying for the support of a given extension string. Each extension has an "enable" predicate that is any valid C expression. For device extensions, the physical device is available as "device" so the expression could be something such as "device->has_kernel_feature". For instance extensions, the only option is VK_USE_PLATFORM defines. This mechanism also means that we have a single one-line-per-entry table for all extension declarations instead of the two tables we had in anv_device.c and the one we had in anv_entrypoints_gen.py. The Python code is smart and uses the XML to determine whether an extension is an instance extension or device extension. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Add a new centralized extensions fileJason Ekstrand2017-08-013-26/+72
| | | | | | | | This will allow us to keep everything in one place when it comes to declaring what extensions are supported. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: only expose up to 28 vertex attributesIago Toral Quiroga2017-07-261-1/+1
| | | | | | | | | | | | The EU limit of 128 GRFs should allow 32 vertex elements of 4 GRFs. However, the maximum allowed value of "Vertex URB Entry Read Length" in SIMD8 is 15. And 15 * 8 = 120 gives us a limit of 30 vertex elements. Because we also need to reserve a vertex buffer to upload VertexIndex/InstanceIndex and another to upload DrawID when needed, we can only expose 28. Cc: "17.2" <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/cmd_buffer: fix off by one error in assertionIago Toral Quiroga2017-07-261-1/+1
| | | | | Cc: "17.2" <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/decoder: Reuse the gen_make_gen() helper.Eric Anholt2017-07-251-3/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/decoder: Reuse the MAX2 macro instead of defining another one.Eric Anholt2017-07-251-3/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/blorp: ship blorp_genX_exec.h within the tarballEmil Velikov2017-07-241-0/+1
| | | | | Fixes: c9cb37b2a6c ("intel/blorp: Add a partial resolve pass for MCS") Signed-off-by: Emil Velikov <[email protected]>
* anv/image: zalloc image viewsJason Ekstrand2017-07-221-7/+1
| | | | | | This allows us to avoid some extra zeroing. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/image: Use vk_zalloc instead of an explicit memsetJason Ekstrand2017-07-221-3/+2
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Separate surface states by layout instead of aux_usageJason Ekstrand2017-07-224-53/+58
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/isl: Add some sanity checks for compressed surfacesJason Ekstrand2017-07-221-0/+18
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/isl: Add a helper to get a subimage surfaceJason Ekstrand2017-07-223-30/+76
| | | | | | | We already have a helper for doing this in BLORP, this just moves the logic into ISL where we can share it with other components. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Get rid of some unused function declarationsJason Ekstrand2017-07-221-7/+0
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/isl: Add a helper for determining if a color is 0/1Jason Ekstrand2017-07-222-0/+30
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/blorp: Allow blorp_copy on sRGB formatsJason Ekstrand2017-07-221-2/+16
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/isl/format: Add an srgb_to_linear helperJason Ekstrand2017-07-222-1/+53
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/isl/format: Dedent the template in gen_format_layout.pyJason Ekstrand2017-07-221-58/+57
| | | | | | | This makes it much easier to edit the template and doesn't really dirty the python all that much. Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/isl: Add an aux state for "partial clear"Jason Ekstrand2017-07-221-35/+53
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/blorp: Add a partial resolve pass for MCSJason Ekstrand2017-07-224-1/+213
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: Predicate fast-clear resolvesNanley Chery2017-07-223-16/+120
| | | | | | | | | | | | | | | Image layouts only let us know that an image *may* be fast-cleared. For this reason we can end up with redundant resolves. Testing has shown that such resolves can measurably hurt performance and that predicating them can avoid the penalty. v2: - Introduce additional resolve state management function (Jason Ekstrand). - Enable easy retrieval of fast clear state fields. v3: Use more descriptive field enums (Jason) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp: Allow BLORP calls to be predicatedNanley Chery2017-07-222-0/+6
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Skip some input attachment transitionsNanley Chery2017-07-221-5/+26
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Stop resolving CCS implicitlyNanley Chery2017-07-223-169/+5
| | | | | | | | | With an earlier patch from this series, resolves are additionally performed on layout transitions. Remove the now unnecessary implicit resolves within render passes. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Transition more color buffer layoutsNanley Chery2017-07-222-28/+169
| | | | | | | | | | | v2: Expound on comment for the pipe controls (Jason Ekstrand). v3: - Cast base_layer to uint64_t to avoid overflow. - Remove "seems" from the pipe control comment. - Fix clamp of layer_count (Jason Ekstrand). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Warn about not enabling CCS_ENanley Chery2017-07-221-5/+7
| | | | | | | | Use the performance warning infrastructure to provide helpful information when testing applications. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Move aux_usage assignment upNanley Chery2017-07-221-32/+30
| | | | | | | | For readability, bring the assignment of CCS closer to the assignment of NONE and MCS. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Always enable CCS_D in render passesNanley Chery2017-07-222-11/+20
| | | | | | | | | | | | The lifespan of the fast-clear data will surpass the render pass scope. We need CCS_D to be enabled in order to invalidate blocks previously marked as cleared and to sample cleared data correctly. v2: Avoid refactoring. v3: Allow CCS_D for subpass resolves. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Disable CCS on gen7 color attachments upfrontNanley Chery2017-07-221-11/+5
| | | | | | | | | The next patch enables the use of CCS_D even when the color attachment will not be fast-cleared. Catch the gen7 case early to simplify the changes required. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Ensure fast-clear values are currentNanley Chery2017-07-221-0/+114
| | | | | | | v2: Rewrite functions, change location of synchronization. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/gpu_memcpy: Add a lighter-weight GPU memcpy functionNanley Chery2017-07-222-0/+45
| | | | | | | | | | | | | | | | We'll be performing a GPU memcpy in more places to copy small amounts of data. Add an alternate function that thrashes less state. v2: - Make a new function (Jason Ekstrand). - Move the #define into the function. v3: - Update the function name (Jason). - Update comments. v4: Use an indirect drawing register as TEMP_REG (Jason Ekstrand). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Restrict fast clears in the GENERAL layoutNanley Chery2017-07-223-0/+40
| | | | | | | | | v2: Remove ::first_subpass_layout assertion (Jason Ekstrand). v3: Allow some fast clears in the GENERAL layout. v4: Remove extra '||' and adjust line break (Jason Ekstrand). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Don't partially fast clear image layersNanley Chery2017-07-221-8/+23
| | | | | | | | v2: Don't pass in the command buffer (Jason Ekstrand). v3: Remove an incorrect assertion and an if condition for gen7. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/cmd_buffer: Initialize the clear values bufferNanley Chery2017-07-221-1/+78
| | | | | | | | | | v2: Rewrite functions. v3 (Jason Ekstrand): - Don't set ResourceMinLOD. - Fix clamp of level_count. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>