summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* anv/cmd_buffer: fix host memory leakCraig Stout2017-03-291-1/+9
| | | | | | | | push_constants must be free'd. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100452 Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/batch_chain: Handle another OOM in cmd_buffer_execbufJason Ekstrand2017-03-291-2/+4
| | | | | | Found by inspection while rebasing other patches. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: expose BRW_OPCODE_[F32TO16/F16TO32] name on gen8+Alejandro Piñeiro2017-03-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | Technically those hw operations are only available on gen7, as gen8+ support the conversion on the MOV. But, when using the builder to implement nir operations (example: nir_op_fquantize2f16), it is not needed to do the gen check. This check is done later, on the final emission at brw_F32TO16 (brw_eu_emit), choosing between the MOV or the specific operation accordingly. So in the middle, during optimization phases those hw operations can be around for gen8+ too. Without this patch, several (at least 95) vulkan-cts quantize tests crashes when using INTEL_DEBUG=optimizer. For example: dEQP-VK.spirv_assembly.instruction.graphics.opquantize.too_small_vert v2: simplify the code using GEN_GE (Ilia Mirkin) v3: tweak brw_instruction_name instead of changing opcode_descs table, that is used for validation (Matt Turner) Reviewed-by: Matt Turner <[email protected]>
* anv/cmd_buffer: Refactor flush_pipeline_select_*Jason Ekstrand2017-03-281-26/+16
| | | | | | | While having the _3d and _gpgpu versions is nice, there's no reason why we need to have duplicated logic for tracking the current pipeline. Reviewed-by: Iago Toral Quiroga <[email protected]>
* anv: Flush caches prior to PIPELINE_SELECT on all gensJason Ekstrand2017-03-281-2/+1
| | | | | | | | | | | | | | | | The programming note that says we need to do this still exists in the SkyLake PRM and, from looking at the bspec, seems like it may apply to all hardware generations SNB+. Unfortunately, this isn't particularly clear cut since there is also language in the bspec that says you can skip the flushing and stall to get better throughput. Experimentation with the "Car Chase" benchmark in GL seems to indicate that some form of flushing is still needed. This commit makes us do the full set of flushes regardless of hardware generation. We can always reduce the flushing later. Reported-by: Topi Pohjolainen <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/cmd_buffer: Fix bad indentationJason Ekstrand2017-03-281-24/+25
| | | | | | | | A bunch of code was indented in such a way that it looked like it went with the if statement above but it definitely didn't. Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/cmd_buffer: Apply flush operations prior to executing secondariesJason Ekstrand2017-03-281-0/+5
| | | | | | | This fixes rendering issues in the Vulkan port of skia on some hardware. Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
* anv/blorp: Use anv_get_layerCount everywhereJason Ekstrand2017-03-281-8/+12
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
* anv: Make anv_get_layerCount a macroJason Ekstrand2017-03-281-7/+7
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
* isl: Drop unused isl_surf_init_info::min_pitchChad Versace2017-03-282-13/+3
| | | | | | Reviewed-by: Nanley Chery <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel: Fix requests for exact surface row pitch (v2)Chad Versace2017-03-283-18/+21
| | | | | | | | | | | | | | All callers of isl_surf_init() that set 'min_row_pitch' wanted to request an *exact* row pitch, as evidenced by nearby asserts, but isl lacked API for doing so. Now that isl has an API for that, update the code to use it. v2: Assert that isl_surf_init() succeeds because the callers assume it. [for jekstrand] Reviewed-by: Nanley Chery <[email protected]> (v1) Reviewed-by: Anuj Phogat <[email protected]> (v1) Reviewed-by: Jason Ekstrand <[email protected]> (v2)
* isl: Let isl_surf_init's caller set the exact row pitch (v2)Chad Versace2017-03-282-1/+19
| | | | | | | | | The caller does so by setting the new field isl_surf_init_info::row_pitch. v2: Validate the requested row_pitch. Reviewed-by: Jason Ekstrand <[email protected]> (v2)
* isl: Validate the calculated row pitch (v45)Chad Versace2017-03-281-6/+64
| | | | | | | | | | | | | | | | | | | | | | | | Validate that isl_surf::row_pitch fits in the below bitfields, if applicable based on isl_surf::usage. RENDER_SURFACE_STATE::SurfacePitch RENDER_SURFACE_STATE::AuxiliarySurfacePitch 3DSTATE_DEPTH_BUFFER::SurfacePitch 3DSTATE_HIER_DEPTH_BUFFER::SurfacePitch v2: -Add a Makefile dependency on generated header genX_bits.h. v3: - Test ISL_SURF_USAGE_STORAGE_BIT too. [for jekstrand] - Drop explicity dependency on generated header. [for emil] v4: - Rebase for new gen_bits_header.py script. - Replace gen_10x with gen_device_info*. v5: - Drop FINISHME for validation of GEN9 1D row pitch. [for jekstrand] - Reformat bit tests. [for jekstrand] Reviewed-by: Jason Ekstrand <[email protected]> (v4)
* genxml: New generated header genX_bits.h (v6)Chad Versace2017-03-285-3/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | genX_bits.h contains the sizes of bitfields in genxml instructions, structures, and registers. It also defines some functions to query those sizes. isl_surf_init() will use the new header to validate that requested pitches fit in their destination bitfields. What's currently in genX_bits.h: - Each CONTAINER::Field from gen*.xml that has a bitsize has a macro in genX_bits.h: #define GEN{N}_CONTAINER_Field_bits {bitsize} - For each set of macros whose name, after stripping the GEN prefix, is the same, genX_bits.h contains a query function: static inline uint32_t __attribute__((pure)) CONTAINER_Field_bits(const struct gen_device_info *devinfo); v2 (Chad Versace): - Parse the XML instead of scraping the generated gen*_pack.h headers. v3 (Dylan Baker): - Port to Mako. v4 (Jason Ekstrand): - Make the _bits functions take a gen_device_info. v5 (Chad Versace): - Fix autotools out-of-tree build. - Fix Android build. Tested with git://github.com/android-ia/manifest. - Fix macro names. They were all missing the "_bits" suffix. - Fix macros names more. Remove all double-underscores. - Unindent all generated code. (It was floating in a sea of whitespace). - Reformat header to appear human-written not machine-generated. - Sort gens from high to low. Newest gens should come first because, when we read code, we likely want to read the gen8/9 code and ignore the gen4 code. So put the gen4 code at the bottom. - Replace 'const' attributes with 'pure', because the functions now have a pointer parameter. - Add --cpp-guard flag. Used by Android. - Kill class FieldCollection. After Jason's rewrite, it was just a dict. v6 (Chad Versace): - Replace `key not in d.keys()` with `key not in d`. [for dylan] Co-authored-by: Dylan Baker <[email protected]> Co-authored-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> (v5) Reviewed-by: Dylan Baker <[email protected]> (v6)
* i965/fs: Don't emit SEL instructions for type-converting MOVs.Matt Turner2017-03-271-0/+2
| | | | | | | | | | SEL can only convert between a few integer types, which we basically never do. Fixes fs/vs-double-uniform-array-direct-indirect-non-uniform-control-flow Cc: [email protected] Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Acked-by: Francisco Jerez <[email protected]>
* anv/blorp: Fix a crash in CmdClearColorImageXu Randy2017-03-271-2/+2
| | | | | | | | | | | | | We should use anv_get_layerCount() to access layerCount of VkImageSub- resourceRange in anv_CmdClearColorImage and anv_CmdClearDepthStencil- Image, which handles the VK_REMAINING_ARRAY_LAYERS (~0) case. Test: Sample multithreadcmdbuf from LunarG can run without crash Signed-off-by: Xu Randy <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
* anv: enable sampling from fast-cleared images on SKLSamuel Iglesias Gonsálvez2017-03-271-2/+2
| | | | | | | | A resolve is not needed on Skylake in this case. We were forcing a resolve because we set the input_aux_usage to ISL_AUX_USAGE_NONE. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* genxml: Add 3DSTATE_DEPTH_BUFFER to gen5.xmlChad Versace2017-03-241-0/+56
| | | | | | isl will use this for validating the depth buffer pitch. Reviewed-by: Jason Ekstrand <[email protected]>
* genxml: Whitespace fixesJason Ekstrand2017-03-245-39/+39
| | | | | | | Some field names had extra spaces and some had places where we should have had a space but didn't. Reviewed-by: Chad Versace <[email protected]>
* genxml: Replace "[N]" with "N"Jason Ekstrand2017-03-243-15/+15
| | | | Reviewed-by: Chad Versace <[email protected]>
* genxml/gen6: Remove a couple of bogus valuesJason Ekstrand2017-03-241-6/+2
| | | | Reviewed-by: Chad Versace <[email protected]>
* genxml/gen8: Remove BLACK_LEVEL_CORRECTION_STATEJason Ekstrand2017-03-241-6/+0
| | | | | | | We've never used it, it only exists on gen8, and the name of the struct contains piles of bad characters. Reviewed-by: Chad Versace <[email protected]>
* genxml: Rename two MCS fields to Auxiliary Surface on gen7Jason Ekstrand2017-03-243-8/+7
| | | | | | This makes gen7 more consistent with gen8+ Reviewed-by: Chad Versace <[email protected]>
* genxml: Fix gen_zipped_file.py dependencyChad Versace2017-03-241-1/+1
| | | | | | | The gen*_xml.h files depend on gen_zipped_file.py, not the gen*_pack.h files. Reviewed-by: Emil Velikov <[email protected]>
* genxml: Define GENXML_XML_FILES in Makefile.sourcesChad Versace2017-03-242-8/+11
| | | | | | The future header genX_bits.h will depend on GENXML_XML_FILES. Reviewed-by: Emil Velikov <[email protected]>
* anv: automake: ensure that the destination directory is createdEmil Velikov2017-03-241-0/+1
| | | | | | | | | | | | | Earlier commit unintentionally dropped the mkdir, as it was rebased. Some versions of autotools will not create the output directory for generated sources. Thus the issue went unnoticed by the original author. Cc: Dylan Baker <[email protected]> Cc: Steven Newbury <[email protected]> Reported-by: Steven Newbury <[email protected]> Fixes: Fixes: 1610b3dede1 ("anv: don't pass xmlfile via stdin anv_entrypoints_gen.py") Signed-off-by: Emil Velikov <[email protected]>
* 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]>