summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* st/dri: Add definitions to allow importing 16-bit surfacesMark Thompson2017-10-131-0/+14
| | | | | | | Necessary to support P010/P016 surfaces for video. Signed-off-by: Mark Thompson <[email protected]> Acked-by: Leo Liu <[email protected]>
* i965: Complete 'expose RGBA visuals only on Android'Mario Kleiner2017-10-131-2/+2
| | | | | | | | | | | | | | | | Commit 731ba6924a2ed6cdf47a78fd637a91a19ddcf9ed "expose RGBA visuals only on Android" replaced ARRAY_SIZE(formats) by num_formats, but there are 3 loops which add configs, and only one was updated to num_formats. Also update loops for configs with accumulation buffer and multisample configs. Fixes: 731ba6924a2 "i965: expose RGBA visuals only on Android" Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* configure.ac: add missing LLVM components for OpenCLEmil Velikov2017-10-131-0/+3
| | | | | | | | | | | Coverage and LTO seems to be hard requirements for Clang, while coroutines is needed as of LLVM/Clang 4.0. Mark the last one as "optional" so we handle every case. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]>
* configure.ac: add llvm_add_optional_component helperEmil Velikov2017-10-131-3/+10
| | | | | | | | | | | | | | We want to add "optional" components, which have been added with later LLVM versions. One such in-tree example is inteljitevents. Others are to follow shortly. v2: Use the correct function, add blank line between functions (Tobias) Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]>
* Travis: add binutils 2.26 for a few more LLVM 3.9 buildsEmil Velikov2017-10-131-0/+9
| | | | | | | | | | | | | Otherwise we error out at link stage as follows: /usr/lib/llvm-3.9/lib/libLLVMAMDGPUCodeGen.a(R600OptimizeVectorRegisters.cpp.o): unrecognized relocation (0x2a) in section `.text._ZNK12_GLOBAL__N_119R600VectorRegMerger16getAnalysisUsageERN4llvm13AnalysisUsageE' /usr/bin/ld: final link failed: Bad value Cc: [email protected] Cc: Jan Vesely <[email protected] Signed-off-by: Emil Velikov <[email protected]>
* configure.ac: rework llvm libs handling for 3.9+Emil Velikov2017-10-131-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier versions need different quirks, but as of LLVM 3.9 llvm-config provides --link-shared/link-static toggles. The output of which seems to be reliable - looking at LLVM 3.9, 4.0 and 5.0. Note that there are earlier code will be used for pre LLVM 3.9 and is unchanged. This effectively fixes LLVM static linking, while providing a clearer and more robust solution for future versions. Mildly interesting side notes: - build-mode (introduced with 3.8) was buggy with 3.8 It shows "static" when build with -DLLVM_LINK_LLVM_DYLIB=ON, yet it was consistent with --libs. The latter shows the static libraries. - libnames and libfiles are broken with LVM 3.9 The library prefix and extension is printed twice liblibLLVM-3.9.so.so v2: Invoke llvm-config twice, instead of using sed, to combine the two lines into one (Tobias) Cc: [email protected] Cc: Dieter Nützel <[email protected]> Cc: Michel Dänzer <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]>
* configure.ac: factor out detection for old and buggy llvmEmil Velikov2017-10-131-29/+34
| | | | | | | | | | As of LLVM 3.9 one could use consistent ways to handle the component. Factor out the current handling, as it will be used for older versions. Cc: [email protected] Cc: Michel Dänzer <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]>
* configure.ac: remove no longer necessary llvm-config --libs checkEmil Velikov2017-10-131-3/+0
| | | | | | | | | | | Prior to the refactor/cleanup by Tobias one could add an invalid component to LLVM_COMPONENTS. Since that's no longer the case we can drop the current check. Cc: Tobias Droste <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tobias Droste <[email protected]>
* eglmesaext: add forward declaration for struct wl_buffersEmil Velikov2017-10-131-0/+1
| | | | | | | | | | | | | | | The user does not need to know the specifics of the struct, as only a pointer to it is used. Just forward declare the struct making the header self-contained. v2: Remove deprecation warning text/bugzilla - patch does no help there. Cc: Greg V <[email protected]> Fixes: 5cddb1ce3c9 ("wayland: Add an extension to create wl_buffers from EGLImages") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1)
* configure.ac: bump Clover LLVM requirement to 3.9Emil Velikov2017-10-132-39/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The only driver that utilises Clover already depends on LLVM 3.9. Close to every supported distribution has said version. Additionally libclc also requires LLVM 3.9. With this in mind, we can safely bump the requirement. There is a handful of dead code that we could remove, which will be resolved with later commits. Note: this drops the LLVM 3.6 build from the Travis build. LLVM 3.9 (and later) are already covered in there. https://lists.freedesktop.org/archives/mesa-dev/2017-September/170028.html v2: Add reference to discussion thread (Eric), adjust libclc LLVM req. (Jan). Cc: Aaron Watry <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Jan Vesely <[email protected]> Acked-by: Francisco Jerez <[email protected]>
* wayland-drm: constify the callbacks struct, take 2Emil Velikov2017-10-133-11/+7
| | | | | | | | | | | Now that wayland-drm (correctly) keeps a local copy of the callbacks, this should not longer cause explosions. After all the symbol is a local, constant data. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Tested-by: Derek Foreman <[email protected]>
* wayland-drm: use a copy of the wayland_drm_callbacks structEmil Velikov2017-10-131-5/+5
| | | | | | | | | | | The callbacks may be called even when they are no longer valid. Say, the user is dlclose(ing) libEGL while the buffers are being destroyed. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Tested-by: Derek Foreman <[email protected]>
* egl/dri: don't crash when createImageFromRenderbuffer2 is NULLEmil Velikov2017-10-131-1/+2
| | | | | | | | | | | The __DRI_IMAGE version can be 17 or over, while the function pointer is NULL. Guard for that instead of crashing. Fixes: bad24395d91 ("egl/dri: use createImageFromRenderbuffer2 when available") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* meson: Build i915Ville Syrjälä2017-10-134-1/+108
| | | | | | | | | | | Build i915 with meson. More or less copied from i965, with all the unneeded cruft removed, and the libdrm_intel dependency added. Cc: Dylan Baker <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* meson: Fix xf86vm depVille Syrjälä2017-10-131-1/+1
| | | | | | | | | | The pkg-config file is called xxf86vm.pc not xf86vm.pc. Cc: Dylan Baker <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* intel/cs: Make thread_local_id a regular builtin paramJason Ekstrand2017-10-125-40/+37
| | | | | | | | | This is a lot more natural than special casing it all over the place. We still have to do a bit of special-casing in assign_constant_locations but it's not special-cased quite as bad as it was before. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Allocate pull_param in assign_constant_locationsJason Ekstrand2017-10-123-8/+14
| | | | | | | | | | | Now that everything is nicely ralloc'd, we can allocate the pull_param array in assign_constant_locations instead of higher up. We can also re-allocate the param array so that it's exactly the needed size. This should save us some memory because we're not allocating the total needed param space for both push and pull. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Allocate prog_data::[pull_]param deeper inside the compilerJason Ekstrand2017-10-129-88/+55
| | | | | | | | | | | | | Now that we're always growing the param array as-needed, we can allocate the param array in common code and stop repeating the allocation everywere. In order to keep things sane, we ralloc the [pull_]param array off of the compile context and then steal it back to a NULL context later. This doesn't get us all the way to where prog_data::[pull_]param is purely an out parameter of the back-end compiler but it gets us a lot closer. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ralloc: Allow reparenting to a NULL contextJason Ekstrand2017-10-121-1/+1
| | | | | | | Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Refactor setup of the prog_data::param arrayJason Ekstrand2017-10-121-14/+9
| | | | | | | | Now that the only thing we put in the array up-front are client push constants, we can simplify anv_pipeline_compile a bit. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Grow the param array for imagesJason Ekstrand2017-10-122-7/+5
| | | | | | | | Before, we were calculating up-front and then filling in later. Now we just grow as needed in anv_nir_apply_pipeline_layout. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Whack nir->num_uniforms to MAX_PUSH_CONSTANT_SIZEJason Ekstrand2017-10-121-4/+2
| | | | | | | | | | | | This way any image uniforms end up having locations higher than MAX_PUSH_CONSTANT_SIZE. There's no bug here at the moment, but this consistency will make the next commit easier. Also, because nir_apply_pipeline_layout properly increments nir->num_uniforms when it expands the param array, we no longer need to stomp it to match prog_data::nr_params because it already does. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/vs: Grow the param array for clip planesJason Ekstrand2017-10-123-5/+14
| | | | | | | | Instead of requiring the caller of brw_compile_vs to figure it out, just grow the param array on-demand. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/cs: Grow prog_data::param on-demand for thread_local_id_indexJason Ekstrand2017-10-124-22/+9
| | | | | | | | | | Instead of making the caller of brw_compile_cs add something to the param array for thread_local_id_index, just add it on-demand in brw_nir_intrinsics and grow the array. This is now safe to do because everyone is now using ralloc for prog_data::param. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Make brw_nir_lower_intrinsics compute-specificJason Ekstrand2017-10-125-19/+13
| | | | | | | | | It's already only ever called from brw_compile_cs and only handles compute intrinsics. Let's just make it CS-specific. We can always make it handle other stages again later if we want. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Add a helper for growing the prog_data::param arrayJason Ekstrand2017-10-121-0/+13
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Stop adding params for texture sizesJason Ekstrand2017-10-122-6/+0
| | | | | | | | We haven't needed this ever since we started using NIR for lowering rectangle textures. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Only add the wpos state reference if we lowered somethingJason Ekstrand2017-10-121-6/+6
| | | | | | | | | | | | Otherwise, in the ARB program case _mesa_add_state_reference may grow the parameter array which will cause brw_nir_setup_arb_uniforms to write past the end of the param array because it only looks at the parameter list length but the parma array is allocated based on nir->num_uniforms. The only reason this hasn't caused us problems is because we are padding out the param array for fragment programs unnecessarily. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Add a flag for pull constant supportJason Ekstrand2017-10-125-2/+13
| | | | | | | | | | | The Vulkan driver does not support pull constants. It simply limits things such that we can always push everything. Previously, we were determining whether or not to push things based on whether or not the prog_data::pull_param array is non-null. This is rather hackish and about to stop working. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Ralloc prog_data::param of the compile mem_ctxJason Ekstrand2017-10-121-2/+1
| | | | | | | | | This way we stop leaking it. This is completely safe because, when we hand it off to anv_shader_bin_create or anv_pipeline_cache_upload_kernel, they make a copy of the entire param array. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Add a mem_ctx parameter to anv_pipeline_compileJason Ekstrand2017-10-121-33/+39
| | | | | | | | This lets us avoid some of the manual ralloc stealing and prepares for future commits in which we will want to ralloc prog_data::param. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Store image_param in brw_context instead of prog_dataJason Ekstrand2017-10-1214-49/+17
| | | | | | | | | | This burns an extra 10k of memory or so in the case where you don't have any images. However, if you have several shaders which use images, this should be much less memory. It also gets rid of a part of prog_data that really has nothing to do with the compiler. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use prog->info.num_images for needs_dc computationJason Ekstrand2017-10-121-2/+3
| | | | | | | | This should be just as good as looking in prog_data but removes our one state setup dependency on brw_stage_prog_data::nr_image_param. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Rewrite the world of push/pull paramsJason Ekstrand2017-10-1223-151/+288
| | | | | | | | | | | | | | | | | This moves us away to the array of pointers model and onto a model where each param is represented by a generic uint32_t handle. We reserve 2^16 of these handles for builtins that get generated by somewhere inside the compiler and have well-defined meanings. Generic params have handles whose meanings are defined by the driver. The primary downside to this new approach is that it moves a little bit of the work that we would normally do at compile time to draw time. On my laptop this hurts OglBatch6 by no more than 1% and doesn't seem to have any measurable affect on OglBatch7. So, while this may come back to bite us, it doesn't look too bad. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Get rid of gen7_cs_state.cJason Ekstrand2017-10-126-177/+145
| | | | | | | | | The only thing it was handling was push constants. We pull the actual constant upload code into gen6_constant_state.c and the atoms into genX_state_upload.c. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a helper for populating constant buffersJason Ekstrand2017-10-123-12/+33
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Move brw_upload_pull_constants to gen6_constant_state.cJason Ekstrand2017-10-123-64/+65
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Get rid of the variable on vote intrinsicsJason Ekstrand2017-10-122-5/+3
| | | | | | | | This looks like a copy+paste error. They don't actually write into that variable as would be implied by putting the return there. Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected]
* nir/opcodes: Fix constant-folding of ufind_msbJason Ekstrand2017-10-121-1/+1
| | | | | | | | | We didn't fold correctly in the case of 0x1 because we never let the loop counter hit 0. Switching it to bit >= 0 solves this problem. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Cc: [email protected]
* meta: Delete the PBO texsubimage path for realJason Ekstrand2017-10-122-496/+0
| | | | Acked-by: Kenneth Graunke <[email protected]>
* anv/pipeline_cache: Rework to use multialloc and blobJason Ekstrand2017-10-122-159/+141
| | | | | | | | | This gets rid of all of our hand-rolled size calculation and serialization code and replaces it with safe "standards" that are used elsewhere in anv and mesa. This should be significantly safer than rolling our own. Reviewed-by: Jordan Justen <[email protected]>
* anv/pipeline: Declare bind maps closer to their useJason Ekstrand2017-10-121-12/+6
| | | | | | This is just a trivial cleanup. Reviewed-by: Jordan Justen <[email protected]>
* anv/multialloc: Add new add_size helperJason Ekstrand2017-10-121-2/+4
| | | | Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Make some parameters void instead of uint8_tJason Ekstrand2017-10-122-5/+5
| | | | | | | | | There are certain advantages to using uint8_t internally such as well-defined arithmetic on all platforms. However, interfaces that work in terms of raw data should use a void* type. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Constify the readerJason Ekstrand2017-10-123-11/+11
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Add (reserve|overwrite)_(uint32|intptr) helpersJason Ekstrand2017-10-122-2/+61
| | | | | | | | These helpers not only call blob_reserve_bytes but also make sure that the blob is properly aligned as if blob_write_* were called. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: make blob_reserve_bytes() more usefulConnor Abbott2017-10-123-20/+12
| | | | | | | | | | | | | | | | Despite the name, it could only be used if you immediately wrote to the pointer. Noboby was using it outside of one test, so clearly this behavior wasn't that useful. Instead, make it return an offset into the data buffer so that the result isn't invalidated if you later write to the blob. In conjunction with blob_overwrite_bytes(), this will be useful for leaving a placeholder and then filling it in later, which we'll need to do for handling phi nodes when serializing NIR. v2 (Jason Ekstrand): - Detect overflow in the offset + to_write computation Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Allow for fixed-size blobs with a NULL data pointerJason Ekstrand2017-10-122-3/+10
| | | | | | | | These can be used to easily count up the number of bytes that will be required by "writing" it into the NULL blob. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Add a concept of a fixed-allocation blobJason Ekstrand2017-10-122-1/+37
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* compiler/blob: Switch to init/finish instead of create/destroyJason Ekstrand2017-10-125-87/+80
| | | | | | | | | There's no reason why that tiny bit of memory needs to be on the heap. We always put blob_reader on the stack, so why not do the same with the writable blob. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>