summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* anv/query: handle out of host memory without crashing in compute_query_result()Iago Toral Quiroga2017-03-241-0/+5
| | | | | | | | | | | | We don't need to make the caller (CmdCopyQueryPoolResults) aware of the problem since compute_query_result() only emits state. The caller is also expected to hit OOM in this scenario right after calling this function, but it is already handling it safely. Fixes: dEQP-VK.api.out_of_host_memory.cmd_copy_query_pool_results Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/pipeline: make FragCoord include sample positions when sample shadingIago Toral Quiroga2017-03-243-8/+20
| | | | | | | | | | | | | | | | | | | | | | We need to know if sample shading has been requested during shader compilation since that affects the way fragment coordinates are computed. Notice that the semantics of fragment coordinates only depend on whether sample shading has been requested, not on whether more than one sample will actually be produced (that is, minSampleShading and rasterizationSamples do not affect this behavior). Because this setting affects the code we generate for the shader, we also need to include it in the WM prog key. Notice we don't need to alter the OpenGL code because it doesn't ever use this behavior, so they key's value is always false (the default). Fixes: dEQP-VK.glsl.builtin_var.fragcoord_msaa.* Reviewed-by: Jason Ekstrand <[email protected]>
* nir/lower_wpos_center: support adding sample position to fragment coordinateIago Toral Quiroga2017-03-241-1/+1
| | | | | | | | | | | | | According to section 14.6 of the Vulkan specification: "When sample shading is enabled, the x and y components of FragCoord reflect the location of the sample corresponding to the shader invocation." So add a boolean parameter to the lowering pass to select this behavior when we need it. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: return VK_ERROR_DEVICE_LOST immeditely when device is known to be lostIago Toral Quiroga2017-03-242-1/+24
| | | | | | | | If we know the device has been lost we should return this error code for any command that can report it before we attempt to do anything with the device. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/device: keep track of 'device lost' stateIago Toral Quiroga2017-03-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | The Vulkan specs say: "A logical device may become lost because of hardware errors, execution timeouts, power management events and/or platform-specific events. This may cause pending and future command execution to fail and cause hardware resources to be corrupted. When this happens, certain commands will return VK_ERROR_DEVICE_LOST (see Error Codes for a list of such commands). After any such event, the logical device is considered lost. It is not possible to reset the logical device to a non-lost state, however the lost state is specific to a logical device (VkDevice), and the corresponding physical device (VkPhysicalDevice) may be otherwise unaffected. In some cases, the physical device may also be lost, and attempting to create a new logical device will fail, returning VK_ERROR_DEVICE_LOST." This means that we need to track if a logical device has been lost so we can have the commands referenced by the spec return VK_ERROR_DEVICE_LOST immediately. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/device: return VK_ERROR_DEVICE_LOST for errors during queue submissionsIago Toral Quiroga2017-03-241-0/+25
| | | | | | | | | | | So that we don't have to do things like rolling back address relocations in case that we ran into OOM after computing them, etc Also, make sure that if the queue submission comes with a fence, we set it up correctly so it behaves according to the spec after returning VK_ERROR_DEVICE_LOST. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Replace OPT_V() with OPT().Matt Turner2017-03-231-23/+19
| | | | | | | We want to be able to check the progress of each pass and dump the NIR for debugging purposes if it changed. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Return progress from demote_sample_qualifiers().Matt Turner2017-03-231-1/+6
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Return progress from move_interpolation_to_top().Matt Turner2017-03-231-1/+6
| | | | | | And mark as static at the same time. Reviewed-by: Jason Ekstrand <[email protected]>
* intel: move gen_decoder.* to DECODER_FILESTapani Pälli2017-03-232-3/+5
| | | | | | | | | | patch adds DECODER_FILES for libintel_common, this is so that platforms such as Android not currently using this functionality can opt out. Fixes: 7d84bb3 ("intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* android: fix vulkan build issues with anv_entrypointsTapani Pälli2017-03-231-6/+12
| | | | | | | | | | | | Patch fixes entrypoint generation for libmesa_anv_entrypoints that still used old style of calling generator script. Also small fixes to libmesa_vulkan_common where there was a typo in target name (vulknan) and files were generated to wrong folder. Fixes: 8211e3e6 ("anv: Generate anv_entrypoints header and code in one command") Signed-off-by: Tapani Pälli <[email protected]> Acked-by: Emil Velikov <[email protected]>
* android: rename Intel Vulkan library to match desktop oneTapani Pälli2017-03-231-2/+2
| | | | | | | | Original naming was following Vulkan HAL naming scheme for no good purpose and we need same binary name for build-id code. Signed-off-by: Tapani Pälli <[email protected]> Acked-by: Emil Velikov <[email protected]>
* anv: Remove dead prototype from entrypointsDylan Baker2017-03-221-1/+0
| | | | | | | | Spotted by Emil. v2: - Add this patch Signed-off-by: Dylan Baker <[email protected]>
* anv: use cElementTree in anv_entrypoints_gen.pyDylan Baker2017-03-221-1/+1
| | | | | | | It's written in C rather than pure python and is strictly faster, the only reason not to use it that it's classes cannot be subclassed. Signed-off-by: Dylan Baker <[email protected]>
* anv: don't use Element.get in anv_entrypoints_gen.pyDylan Baker2017-03-221-6/+7
| | | | | | | | | | | | | This has the potential to mask errors, since Element.get works like dict.get, returning None if the element isn't found. I think the reason that Element.get was used is that vulkan has one extension that isn't really an extension, and thus is missing the 'protect' field. This patch changes the behavior slightly by replacing get with explicit lookup in the Element.attrib dictionary, and using xpath to only iterate over extensions with a "protect" attribute. Signed-off-by: Dylan Baker <[email protected]>
* anv: use dict.get in anv_entrypoints_gen.pyDylan Baker2017-03-221-4/+1
| | | | | | | Instead of using an if and a check, use dict.get, which does the same thing, but more succinctly. Signed-off-by: Dylan Baker <[email protected]>
* anv: anv_entrypoints_gen.py: use reduce function.Dylan Baker2017-03-221-5/+3
| | | | | | Reduce is it's own reward. Signed-off-by: Dylan Baker <[email protected]>
* anv: anv-entrypoints_gen.py: rename hash to cal_hash.Dylan Baker2017-03-221-3/+4
| | | | | | | hash is reserved name in python, it's the interface to access an object's hash protocol. Signed-off-by: Dylan Baker <[email protected]>
* anv: Generate anv_entrypoints header and code in one commandDylan Baker2017-03-223-18/+17
| | | | | | | This produces the header and the code in one command, saving the need to call the same script twice, which parses the same XML file. Signed-off-by: Dylan Baker <[email protected]>
* anv: anv_entrypoints_gen.py: directly write files instead of pipingDylan Baker2017-03-223-18/+22
| | | | | | | | | | | | | | This changes the output to be written as a file rather than being piped. This had one critical advantage, it encapsulates the encoding. This prevents bugs where a symbol (generally unicode like © [copyright]) is printed and the system being built on doesn't have a unicode locale. v2: - Update Android.mk v3: - Don't generate both files at once - Fix Android.mk - drop --outdir, since the filename is passed in as an argument Signed-off-by: Dylan Baker <[email protected]>
* anv: convert C generation to template in anv_entrypoints_gen.pyDylan Baker2017-03-221-173/+167
| | | | | | | | | This produces a file that is identical except for whitespace, there is a table that has 8 columns in the original and is easy to do with prints, but is ugly using mako, so it doesn't have columns; the data is not inherently tabular. Signed-off-by: Dylan Baker <[email protected]>
* anv: convert header generation in anv_entrypoints_gen.py to makoDylan Baker2017-03-221-35/+42
| | | | | | This produces an identical file except for whitespace. Signed-off-by: Dylan Baker <[email protected]>
* anv: Update "do not edit" comments with proper filenameDylan Baker2017-03-221-5/+7
| | | | | | | | | | | | | | This does two things, first it updates both the .h and the .c file to have the same do not edit string. Second, it uses __file__ to ensure that even if the file is moved or renamed that the name will be correct. One thing to note is the use of '{{' and '}}' in the C template. This is to instruct python to print a literal '{' and '}' respectively, rather than treating the contents as a formatter specifier. v3: - add this patch Signed-off-by: Dylan Baker <[email protected]>
* anv: split main into two functions in anv_entrypoints_gen.pyDylan Baker2017-03-221-52/+56
| | | | | | | | This is groundwork for the next patches, it will allows porting the header and the code to mako separately, and will also allow both to be run simultaneously. Signed-off-by: Dylan Baker <[email protected]>
* anv: don't pass xmlfile via stdin anv_entrypoints_gen.pyDylan Baker2017-03-223-23/+16
| | | | | | | | | It's slow, and has the potential for encoding issues. v2: - pass xml file location via argument - update Android.mk Signed-off-by: Dylan Baker <[email protected]>
* anv: make constants capitals in anv_entrypoints_gen.pyDylan Baker2017-03-221-19/+19
| | | | | | Again, it's standard python style. Signed-off-by: Dylan Baker <[email protected]>
* anv: Use python style in anv_entrypoints_gen.pyDylan Baker2017-03-221-31/+36
| | | | | | | | | | | | | | | | | | These are all fairly small cleanups/tweaks that don't really deserve their own patch. - Prefer comprehensions to map() and filter(), since they're faster - replace unused variables with _ - Use 4 spaces of indent - drop semicolons from the end of lines - Don't use parens around if conditions - don't put spaces around brackets - don't import modules as caps (ET -> et) - Use docstrings instead of comments v2: - Replace comprehensions with multiplication Signed-off-by: Dylan Baker <[email protected]>
* anv: anv_entrypoints_gen.py: use a main functionDylan Baker2017-03-221-225/+233
| | | | | | This is just good practice. Signed-off-by: Dylan Baker <[email protected]>
* intel/compiler: consistently use ifndef guards over pragma onceEmil Velikov2017-03-228-5/+31
| | | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* intel/common: consistently use ifndef guards over pragma onceEmil Velikov2017-03-221-1/+5
| | | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* i965: make brw_setup_image_uniform_values staticEmil Velikov2017-03-221-5/+0
| | | | | | | | | | Used only internally. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* anv/device: Move push descriptor query handlingJason Ekstrand2017-03-221-8/+8
| | | | | | | The query is a properties query so it needs to be handled in GetPhysicalDeviceProperties2, not GetPhysicalDeviceFeatures2. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/image: Return early when unbinding an imageJason Ekstrand2017-03-221-4/+5
| | | | | | | | Found by inspection. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv: android: remove unused include/vulkan includeEmil Velikov2017-03-221-1/+0
| | | | | | | Spotted while skimming through similar hunks for the Autotools build. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* anv: automake: use the local headers over any system provided onesEmil Velikov2017-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | At the moment, we would honour any system headers - vulkan_intel.h in particular over the ones in-tree. Thus, if one does incremental build of mesa, without the vulkan.h already installed (or at least not in the same directory as vulkan_intel.h) the build will fail. In the future we might want to upstream the vulkan_intel.h within vulkan.h or use other ways to make vulkan_intel.h obsolete. In either case, the more robust thing is to rely on our own copy. v2: Move AM_CPPFLAGS just above LIBDRM_CFLAGS (Grazvydas, Jason) Tested-by: Grazvydas Ignotas <[email protected]> Fixes: ee8044fd "intel/vulkan: Get rid of recursive make" Suggested-by: Jason Ekstrand <[email protected]> Reported-by: Grazvydas Ignotas <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* isl: Refactor row pitch calculation (v2)Chad Versace2017-03-211-33/+89
| | | | | | | | | | | | | | | | | The calculations of row_pitch, the row pitch's alignment, surface size, and base_alignment were mixed together. This patch moves the calculation of row_pitch and its alignment to occur before the calculation of surface_size and base_alignment. This simplifies a follow-on patch that adds a new member, 'row_pitch', to struct isl_surf_init_info. v2: - Also extract the row pitch alignment. - More helper functions that will later help validate the row pitch. Reviewed-by: Nanley Chery <[email protected]> (v2) Reviewed-by: Jason Ekstrand <[email protected]> (v2)
* isl: Drop misplaced comment about paddingChad Versace2017-03-211-46/+0
| | | | | | | | | | | | | isl has a giant comment that explains the hardware's padding requirements. (Hint: Cache lines and page faults). But the comment is in the wrong place, in isl_calc_linear_row_pitch(), which is unrelated to padding. The important parts of that comment were copied to isl_apply_surface_padding() long ago. So drop the misplaced comment. Reviewed-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Drop AUB_TRACE_* stuff.Kenneth Graunke2017-03-212-8/+5
| | | | | | | | | | | | This was used for aubdumping (deleted a while ago) and INTEL_DEBUG=bat decoding (deleted recently). While we're changing parameters, delete the wrapper macro and make the actual function brw_state_batch instead of __brw_state_batch. This subsumes a patch by Emil Velikov to drop this from BLORP. Reviewed-by: Emil Velikov <[email protected]>
* intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].Kenneth Graunke2017-03-215-7/+7
| | | | | | | This way they become part of libintel_common.la so I can use them in the i965 driver. Reviewed-by: Emil Velikov <[email protected]>
* intel: Add a INTEL_DEBUG=color option.Kenneth Graunke2017-03-212-0/+2
| | | | | | | This will be used for color output in debug messages. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* aubinator: Move the guts of decode_group() to decoder.c.Kenneth Graunke2017-03-203-31/+42
| | | | | | This lets us use it outside of the aubinator binary itself. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop spec parameter to decode_group().Kenneth Graunke2017-03-201-13/+12
| | | | | | No longer necessary - the iterator gets it from the group. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Make the iterator store a pointer to structure descriptions.Kenneth Graunke2017-03-203-27/+11
| | | | | | | | | | | When the iterator encounters a structure field, it now looks up the gen_group for that structure definition and saves a pointer to it. This lets us drop a lot of ridiculous code in the caller, which looked at item->value (<struct NAME dword>), strtok'd the structure name back out, and looked it up itself. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Track the current field's starting dword offset.Kenneth Graunke2017-03-203-26/+18
| | | | | | | | | | The iterator code already computed this value, then we stored it in the structure name, strtok'd it back out, and also manually computed it when printing dword headers. Just put the value in the struct and use it. Way simpler. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop decode_structure() helper.Kenneth Graunke2017-03-201-16/+9
| | | | | | | It made more sense when decode_group() took a bunch of extra options, but now that there's only one...we may as well pass 0 and call it a day. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop unused print_dword_headers flag.Kenneth Graunke2017-03-201-5/+4
| | | | | | | | | I added this flag in 65a9d5eabb05e4925c1c9a17836cad57304210d6 but it was completely unused. Both callers appear to have printed dword headers, so we can just drop the flag and continue doing it unconditionally. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Store a pointer from gen_group back to gen_spec.Kenneth Graunke2017-03-202-0/+2
| | | | | | | When decoding a structure field within a group, we may want to look up that structure type. Having a gen_spec pointer makes it easy to do so. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Store enum textual name in iter->value.Kenneth Graunke2017-03-203-19/+15
| | | | | | | | | | | | | | | gen_field_iterator_next() produces a string representing the value of the field. For enum values, it also produced a separate "description" string containing the textual name of the enum. The only caller of this function combines the two, printing enums as "<numeric value> (<texture enum name>)". We may as well just store that in item->value directly, eliminating the description field, and a layer of wrapping. v2: Use non-overlapping source and destination strings in snprintf. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: Correct the BDW surface state sizeNanley Chery2017-03-201-1/+1
| | | | | | | | | | | The PRMs state that this packet is 16 DWORDS long. Ensure that the last three DWORDS are zeroed as required by the hardware when allocating a null surface state. Cc: <[email protected]> Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* anv/genX: Solve the vkCreateGraphicsPipelines crashXu,Randy2017-03-201-2/+2
| | | | | | | | | | | | The crash is due to NULL pColorBlendState, which is legal if the pipeline has rasterization disabled or if the subpass of the render pass the pipeline is created against does not use any color attachments. Test: Sample subpasses from LunarG can run without crash Signed-off-by: Xu,Randy <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0 13.0" <[email protected]>