summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-05-01CHROMIUM: egl/android: Implement EGL_KHR_mutable_render_bufferChad Versace3-7/+206
Specifically, implement the extension DRI_MutableRenderBufferLoader. However, the loader enables EGL_KHR_mutable_render_buffer only if the DRI driver implements its half of the extension, DRI_MutableRenderBufferDriver. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: I7fe68a5a674d1707b1e7251d900b3affd5dd7660
2018-05-01CHROMIUM: egl/main: Add bits for EGL_KHR_mutable_render_bufferChad Versace5-4/+93
A follow-up patch enables EGL_KHR_mutable_render_buffer for Android. This patch is separate from the Android patch because I think it's easier to review the platform-independent bits separately. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: I07470f2862796611b141f69f47f935b97b0e04a1
2018-05-01CHROMIUM: dri: Add param driCreateConfigs(mutable_render_buffer)Chad Versace8-13/+19
If set, then the config will have __DRI_ATTRIB_MUTABLE_RENDER_BUFFER, which translates to EGL_MUTABLE_RENDER_BUFFER_BIT_KHR. Not used yet. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: Icdf35794f3e9adf31e1f85740b87ce155efe1491
2018-05-01CHROMIUM: dri: Define DRI_MutableRenderBuffer extensionsChad Versace4-0/+10
Define extensions DRI_MutableRenderBufferDriver and DRI_MutableRenderBufferLoader. These are the two halves for EGL_KHR_mutable_render_buffer. Outside the DRI code there is one additional change. Add gl_config::mutableRenderBuffer to match __DRI_ATTRIB_MUTABLE_RENDER_BUFFER. Neither are used yet. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: I4ca03d81e4557380b19c44d8d799a7cc9365d928
2018-05-01CHROMIUM: egl/dri2: In dri2_make_current, return early on failureChad Versace1-14/+15
This pulls an 'else' block into the function's main body, making the code easier to follow. Without this change, the upcoming EGL_KHR_mutable_render_buffer patch transforms dri2_make_current() into spaghetti. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: I26be2b7a8e78a162dcd867a44f62d6f48b9a8e4d
2018-05-01CHROMIUM: egl: Drop _EGLContext::WindowRenderBufferChad Versace5-20/+85
Replace it with two fields in _EGLSurface, RequestedRenderBuffer and ActiveRenderBuffer. (_EGLSurface::RequestedRenderBuffer replaces _EGLSurface::RenderBuffer). There exist *two* queryable EGL_RENDER_BUFFER states in EGL: eglQuerySurface(EGL_RENDER_BUFFER) and eglQueryContext(EGL_RENDER_BUFFER). _EGLContext::WindowRenderBuffer was related to eglQueryContext but not eglQuerySurface. Post-patch, RequestedRenderBuffer is related to eglQuerySurface and ActiveRenderBuffer is related to eglQueryContext. The implementation of eglQuerySurface(EGL_RENDER_BUFFER) contained abstruse logic which required comprehending the specification complexities of how the two EGL_RENDER_BUFFER states interact. Sometimes it returned _EGLContext::WindowRenderBuffer, sometimes _EGLSurface::RenderBuffer. Why? The function tried to encode the actual logic in the EGL spec. When did the function return which variable? Go study the EGL spec, hope you understand it, then hope Mesa mutated the EGL_RENDER_BUFFER state in all the correct places. Have fun. I got a headache from the mental gymnastics. To simplify eglQuerySurface(EGL_RENDER_BUFFER), and to improve confidence in its correctness, flatten its indirect logic. For pixmap and pbuffer surfaces, return a hard-coded literal value, as the spec suggests. For window surfaces, simply return ActiveRenderBuffer. Nothing difficult here. These changes eliminate potentially very fragile code in the upcoming EGL_KHR_mutable_render_buffer implementation. BUG=b:77899911 TEST=No android-cts-7.1 regressions on Eve. Change-Id: Ic5f2ab1952f26a87081bc4f78bc7fa96734c8f2a
2018-04-17UPSTREAM: virgl: also remove dimension on indirect.Dave Airlie1-1/+0
This fixes some dEQP tests that generated bad shaders. Fixes: b6f6ead19 (virgl: drop const dimensions on first block.) Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 49c61d8b841538e09b8c2b2d2f409147fd7b549a) BUG=b:78132369 TEST=play war robots under arc++ in Chrome OS for 1 hour. Change-Id: I7d8de9e2a8289e9119f839b1d1aa99012bdbd6e8 Reviewed-on: https://chromium-review.googlesource.com/1013329 Commit-Ready: Lepton Wu <lepton@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2018-04-11CHROMIUM: platform_android: use general fallback.Lepton Wu1-16/+9
Instead of handling software fallback inside platform_android, just let EGL framework to handle it. With this, we still can fall back to software driver when hardware driver actually doesn't work. BUG=b:77302150 TEST=manual - make sure betty still boot without virgl driver. Change-Id: I5d514f67c9dc6f68661e03fd9fc9546acd7277bd Reviewed-on: https://chromium-review.googlesource.com/1004006 Commit-Ready: Lepton Wu <lepton@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2018-04-11UPSTREAM: egl/android: Provide an option for the backend to expose KHR_imageHarish Krupo3-1/+4
From android cts 8.0_r4, a new test case checks if all the required egl extensions are exposed. In the current implementation we expose KHR_image if KHR_image_base and KHR_image_pixmap are supported but KHR_image spec does not mandate the existence of both the extensions. This patch preserves the current check and also provides the backend with an option to expose the KHR_image extension. Test: run cts -m CtsOpenGLTestCases -t \ android.opengl.cts.OpenGlEsVersionTest#testRequiredEglExtensions Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com> Reviewed-by: Tapani Plli <tapani.palli@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 96fc5fbf232b6bc7f3db0b5037df9f120704980f) Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> BUG=b:77786960 TEST=android.opengl.cts.OpenGlEsVersionTest#testRequiredEglExtensions passes on CTS 8.1 Change-Id: I7c057ea4aa00f99885259ca0a97cac4554551c80 Reviewed-on: https://chromium-review.googlesource.com/1002796 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2018-04-10UPSTREAM: egl: let each platform decided how to handle LIBGL_ALWAYS_SOFTWAREEric Engestrom3-4/+8
My refactor in 47273d7312cb5b5b6b0b9 missed this early return; because of it, setting UseFallback one layer above actually prevented the software path from being used. Remove this early return and let each platform's dri2_initialize_*() decide what it can do with the LIBGL_ALWAYS_SOFTWARE restriction. platform_{surfaceless,x11,wayland} were already handling it themselves. Fixes: 47273d7312cb5b5b6b0b9 "egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is set" Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reported-by: Brendan King <Brendan.King@imgtec.com> (cherry picked from commit 2f421651aca9c0a308c8a632d1847bbd0598e294) BUG=b:77302150 TEST=manual - make sure betty still boots without virgl driver. Change-Id: I5e2ddfbd7a72bf04d83cac8f08fafbe81a77e66c Reviewed-on: https://chromium-review.googlesource.com/1004005 Commit-Ready: Lepton Wu <lepton@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2018-03-14UPSTREAM: radv: Signal fence correctly after sparse binding.Bas Nieuwenhuizen1-14/+32
It did not signal syncobjs in the fence, and also signalled too early if there was work on the queue already, as we have to wait till that work is done. Fixes: d27aaae4d2 "radv: Add external fence support." Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry picked from commit 0347a83bbfd8d993742e125335c6ae46a6aa5a15) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I887768385833112effa1e8d414bf171640bb3564 Reviewed-on: https://chromium-review.googlesource.com/913504 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-14UPSTREAM: radv: Implement VK_ANDROID_native_buffer.Bas Nieuwenhuizen7-5/+410
Passes dEQP-VK.api.smoke.* dEQP-VK.wsi.android.* with android-cts-7.1_r12 . Unlike the initial anv implementation this does use syncobjs instead of waiting on the CPU. This is missing meson build coverage for now. One possible todo is that linux 4.15 now has a sycall that allows us to export amdgpu fence to a sync_file, which allows us not to force all fences and semaphores to use syncobjs. However, I had trouble with my kernel crashing regularly with NULL pointers, and I'm not sure how beneficial it is in the first place given that intel uses syncobjs for all fences if available. Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b1444c9ccb06661d932969302d19166df442818c) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I002abe9e44ceba89c15f503d8c9fa3419aa2803e Reviewed-on: https://chromium-review.googlesource.com/913503 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-13CHROMIUM: virgl: Fix crash on destruction.Lepton Wu1-0/+2
We need to set surface/sampler_view destruction callbacks for surface and sampler_view after https://chromium-review.googlesource.com/558120 BUG=b:70179880 TEST=Run android apps on bettyvirgl (rendering only works sometimes.) Change-Id: I85cedb53a3dd86caba1d8cf890f63a0a5dfce4bd Reviewed-on: https://chromium-review.googlesource.com/959231 Commit-Ready: Lepton Wu <lepton@chromium.org> Tested-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Joe Kniss <djmk@google.com>
2018-03-13UPSTREAM: radv: Add create image flag to not use DCC/CMASK.Bas Nieuwenhuizen2-19/+25
If we import an image, we might not have space in the buffer for CMASK, even though it is compatible. Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit a3e241ed07feae592d1fd83db388252816a32849) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I4a5d6634e89ea8ec4ac200405e5c84d6f30dcb2f Reviewed-on: https://chromium-review.googlesource.com/913502 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-08UPSTREAM: radv: Generate VK_ANDROID_native_buffer.Bas Nieuwenhuizen3-2/+9
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit e344cd81783255eb5de762e5bd56bd4dfe8ae0c2) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: Ia0957ef39597416bf3750e8138047c0c748a1d1b Reviewed-on: https://chromium-review.googlesource.com/913501 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-08UPSTREAM: radv: reset semaphores & fences on sync_file export.Bas Nieuwenhuizen1-0/+16
Per spec: "Additionally, exporting a fence payload to a handle with copy transference has the same side effects on the source fences payload as executing a fence reset operation. If the fence was using a temporarily imported payload, the fences prior permanent payload will be restored." And similar for semaphores: "Additionally, exporting a semaphore payload to a handle with copy transference has the same side effects on the source semaphores payload as executing a semaphore wait operation. If the semaphore was using a temporarily imported payload, the semaphores prior permanent payload will be restored." Fixes: 42bc25a79c "radv: Advertise sync fd import and export." Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b9f4c615f860b1fb00dec2917fcec4df84f6427e) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I5c79d6b69bb76b8f97018a4726d10f6b0d740350 Reviewed-on: https://chromium-review.googlesource.com/913500 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-08UPSTREAM: ac: rename has_syncobj_wait -> has_syncobj_wait_for_submitMarek Olšák4-7/+7
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (cherry picked from commit 4f19cc82f9a6113a76a3bc7a848c98d0eb693991) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I1b78fb53ac25131117c6ac2bf78f9f4f964eed3d Reviewed-on: https://chromium-review.googlesource.com/913499 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-07UPSTREAM: radv: Advertise sync fd import and export.Bas Nieuwenhuizen1-4/+15
Passes dEQP-VK.*.sync_fd.* Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 42bc25a79ca87a1fc3420fa8e8edb1667f0cbd1b) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: Icf0b6516fb015a2639bff9fd29050896f04f8980 Reviewed-on: https://chromium-review.googlesource.com/913498 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-07UPSTREAM: radv: Implement sync file import/export for fences & semaphores.Bas Nieuwenhuizen1-28/+87
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 52b3f50df8a20064f38e45d2abe6030feac4f055) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I6ed541af269ceaefad15565f52b95c2e33f73a0d Reviewed-on: https://chromium-review.googlesource.com/913497 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-06UPSTREAM: radv/amdgpu: wrap sync fd import/export.Bas Nieuwenhuizen2-0/+26
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b98bbdf4906882f056478d7b99c1959081f46490) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I0e84a9df34ab22e6dd54b894e245c8df3c254c3f Reviewed-on: https://chromium-review.googlesource.com/913496 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-06UPSTREAM: radv: Add external fence support.Bas Nieuwenhuizen2-0/+22
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit d27aaae4d25f50581525d49df73c2201fbeabefe) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I77a8313fc5728c0fec30f2e61695b0e3e935a3e9 Reviewed-on: https://chromium-review.googlesource.com/913495 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-06UPSTREAM: radv: Implement VK_KHR_external_fence_fd.Bas Nieuwenhuizen2-0/+48
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 6abfa378796131317c5b983e2273047bf28a69b0) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: Ie185825c75dc0b45dba4b17b7edbcce5309c3dfc Reviewed-on: https://chromium-review.googlesource.com/913494 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-03-05UPSTREAM: radv: Implement fences based on syncobjs.Bas Nieuwenhuizen3-31/+127
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 969421b7dab414313c2ec9ba6f2d193b4c117cec) Added WSI code for this, as the upstream WSI got a rework. BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: I0f96630935b61f9d927ea7e1d1ea0e6c71d56796 Reviewed-on: https://chromium-review.googlesource.com/913493 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-02-23UPSTREAM: amd/common: Add detection of the syncobj wait/signal/reset ioctls.Bas Nieuwenhuizen2-0/+2
First amdgpu bump after inclusion was 20 (which was done for local BOs). Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b308bb8773492b0a7868cddb8f0b056af8032966) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: If2cede07cd2779d1d526aecee0b4c0f1d5bb5a4a Reviewed-on: https://chromium-review.googlesource.com/913492 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-02-23UPSTREAM: radv: Add syncobj signal/reset/wait to winsys.Bas Nieuwenhuizen2-0/+44
Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1c3cda7d27750be0804137f9a9222828e57354b8) BUG=b:73102056 TEST=run nougat-mr1-cts-dev deqp vulkan tests. Change-Id: Ieb018369d1bf588a27b4912475c05230c557b815 Reviewed-on: https://chromium-review.googlesource.com/913491 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org>
2018-02-16UPSTREAM: i965: Call prepare_external after implicit window-system MSAA resolvesJason Ekstrand1-0/+15
This fixes some rendering corruption in a couple of Android apps that use window-system MSAA. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104741 Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Tapani Plli <tapani.palli@intel.com> (cherry picked from commit 2f7205be47bbb730cdfa0a037224b9ebd5224fd1) Fix for Telegram and KineMaster graphic corruption BUG=b:71872728 TEST=Telegram and KineMaster work without corruption Change-Id: If8c489abe2d26a0c639dfe6d5f10f8fd4c3719c4 Signed-off-by: Dmytro Chystiakov <dmytro.chystiakov@intel.com> Reviewed-on: https://chromium-review.googlesource.com/915190 Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
2018-02-02FROMLIST: gallium/winsys/kms: Add support for multi-planesLepton Wu1-53/+126
Add a new struct kms_sw_plane which delegate a plane and use it in place of sw_displaytarget. Multiple planes share same underlying kms_sw_displaytarget. For map request, we only hold 2 pointers for ro map and rw map and return different pointers with offset. Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-December/180761.html (am from https://patchwork.freedesktop.org/patch/195118/) TEST=play video with youtube android app inside emulator. BUG=b:62836711 Signed-off-by: Lepton Wu <lepton@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Change-Id: I0863f522976cc8863d6e95492d9346df35c066ec Reviewed-on: https://chromium-review.googlesource.com/843934
2018-01-31UPSTREAM: radeonsi: Export signalled sync file instead of -1.Bas Nieuwenhuizen3-0/+30
-1 is considered an error for EGL_ANDROID_native_fence_sync, so we need to actually create a sync file. Fixes: f536f45250 "radeonsi: implement sync_file import/export" Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 5a3404d443e0c6e8e9a44d7f8dccf96c5ac18f0f) BUG=b:72449616 TESTED=Try play store in ARC with 4.14 kernel on Kahlee. Change-Id: Ib053b640e70a0fe529e5cea84fd4144f93c8c588 Reviewed-on: https://chromium-review.googlesource.com/886703 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
2018-01-18FROMLIST: intel/fs: Optimize and simplify the copy propagation dataflow logic.Francisco Jerez1-24/+11
Previously the dataflow propagation algorithm would calculate the ACP live-in and -out sets in a two-pass fixed-point algorithm. The first pass would update the live-out sets of all basic blocks of the program based on their live-in sets, while the second pass would update the live-in sets based on the live-out sets. This is incredibly inefficient in the typical case where the CFG of the program is approximately acyclic, because it can take up to 2*n passes for an ACP entry introduced at the top of the program to reach the bottom (where n is the number of basic blocks in the program), until which point the algorithm won't be able to reach a fixed point. The same effect can be achieved in a single pass by computing the live-in and -out sets in lock-step, because that makes sure that processing of any basic block will pick up the updated live-out sets of the lexically preceding blocks. This gives the dataflow propagation algorithm effectively O(n) run-time instead of O(n^2) in the acyclic case. The time spent in dataflow propagation is reduced by 30x in the GLES31.functional.ssbo.layout.random.all_shared_buffer.5 dEQP test-case on my CHV system (the improvement is likely to be of the same order of magnitude on other platforms). This more than reverses an apparent run-time regression in this test-case from my previous copy-propagation undefined-value handling patch, which was ultimately caused by the additional work introduced in that commit to account for undefined values being multiplied by a huge quadratic factor. According to Chad this test was failing on CHV due to a 30s time-out imposed by the Android CTS (this was the case regardless of my undefined-value handling patch, even though my patch substantially exacerbated the issue). On my CHV system this patch reduces the overall run-time of the test by approximately 12x, getting us to around 13s, well below the time-out. v2: Initialize live-out set to the universal set to avoid rather pessimistic dataflow estimation in shaders with cycles (Addresses performance regression reported by Eero in GpuTest Piano). Performance numbers given above still apply. No shader-db changes with respect to master. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104271 Reported-by: Chad Versace <chadversary@chromium.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-December/180489.html (am from https://patchwork.freedesktop.org/patch/194420/) BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Fixes timeouts in dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.5 on Brasswell boards. Change-Id: I0d666c23693246b8d4fe8988f228f8c4ed7425f6 Reviewed-on: https://chromium-review.googlesource.com/862007 Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org>
2018-01-17UPSTREAM: intel/cfg: Represent divergent control flow paths caused by ↵Francisco Jerez1-6/+69
non-uniform loop execution. This addresses a long-standing back-end compiler bug that could lead to cross-channel data corruption in loops executed non-uniformly. In some cases live variables extending through a loop divergence point (e.g. a non-uniform break) into a convergence point (e.g. the end of the loop) wouldn't be considered live along all physical control flow paths the SIMD thread could possibly have taken in between due to some channels remaining in the loop for additional iterations. This patch fixes the problem by extending the CFG with physical edges that don't exist in the idealized non-vectorized program, but represent valid control flow paths the SIMD EU may take due to the divergence of logical threads. This makes sense because the i965 IR is explicitly SIMD, and it's not uncommon for instructions to have an influence on neighboring channels (e.g. a force_writemask_all header setup), so the behavior of the SIMD thread as a whole needs to be considered. No changes in shader-db. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 4d1959e69328cf0d59f0ec7aeea5a2b704ef0c5f) This patch is a prerequisite for 4cbe48f5 "intel/fs: Optimize and simplify the copy propagation dataflow logic". BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Change-Id: I949f6f4e0127fec93d890e7669f870872f097a58 Reviewed-on: https://chromium-review.googlesource.com/862006 Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org> Commit-Queue: Chad Versace <chadversary@chromium.org>
2018-01-17UPSTREAM: intel/fs: Don't let undefined values prevent copy propagation.Francisco Jerez1-3/+47
This makes the dataflow propagation logic of the copy propagation pass more intelligent in cases where the destination of a copy is known to be undefined for some incoming CFG edges, building upon the definedness information provided by the last patch. Helps a few programs, and avoids a handful shader-db regressions from the next patch. shader-db results on ILK: total instructions in shared programs: 6541547 -> 6541523 (-0.00%) instructions in affected programs: 360 -> 336 (-6.67%) helped: 8 HURT: 0 LOST: 0 GAINED: 10 shader-db results on BDW: total instructions in shared programs: 8174323 -> 8173882 (-0.01%) instructions in affected programs: 7730 -> 7289 (-5.71%) helped: 5 HURT: 2 LOST: 0 GAINED: 4 shader-db results on SKL: total instructions in shared programs: 8185669 -> 8184598 (-0.01%) instructions in affected programs: 10364 -> 9293 (-10.33%) helped: 5 HURT: 2 LOST: 0 GAINED: 2 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 9355116bdad6ee9914554de8e48ba271bd36a8eb) This patch is a prerequisite for 4cbe48f5 "intel/fs: Optimize and simplify the copy propagation dataflow logic". BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Change-Id: I8719e67ac14d3db8a7d6989d127ca4222cbdbfe4 Reviewed-on: https://chromium-review.googlesource.com/862005 Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org> Commit-Queue: Chad Versace <chadversary@chromium.org>
2018-01-17UPSTREAM: intel/fs: Restrict live intervals to the subset possibly reachable ↵Francisco Jerez2-4/+42
from any definition. Currently the liveness analysis pass would extend a live interval up to the top of the program when no unconditional and complete definition of the variable is found that dominates all of its uses. This can lead to a serious performance problem in shaders containing many partial writes, like scalar arithmetic, FP64 and soon FP16 operations. The number of oversize live intervals in such workloads can cause the compilation time of the shader to explode because of the worse than quadratic behavior of the register allocator and scheduler when running out of registers, and it can also cause the running time of the shader to explode due to the amount of spilling it leads to, which is orders of magnitude slower than GRF memory. This patch fixes it by computing the intersection of our current live intervals with the subset of the program that can possibly be reached from any definition of the variable. Extending the storage allocation of the variable beyond that is pretty useless because its value is guaranteed to be undefined at a point that cannot be reached from any definition. According to Jason, this improves performance of the subgroup Vulkan CTS tests significantly (e.g. the runtime of the dvec4 broadcast test improves by nearly 50x). No significant change in the running time of shader-db (with 5% statistical significance). shader-db results on IVB: total cycles in shared programs: 61108780 -> 60932856 (-0.29%) cycles in affected programs: 16335482 -> 16159558 (-1.08%) helped: 5121 HURT: 4347 total spills in shared programs: 1309 -> 1288 (-1.60%) spills in affected programs: 249 -> 228 (-8.43%) helped: 3 HURT: 0 total fills in shared programs: 1652 -> 1597 (-3.33%) fills in affected programs: 262 -> 207 (-20.99%) helped: 4 HURT: 0 LOST: 2 GAINED: 209 shader-db results on BDW: total cycles in shared programs: 67617262 -> 67361220 (-0.38%) cycles in affected programs: 23397142 -> 23141100 (-1.09%) helped: 8045 HURT: 6488 total spills in shared programs: 1456 -> 1252 (-14.01%) spills in affected programs: 465 -> 261 (-43.87%) helped: 3 HURT: 0 total fills in shared programs: 1720 -> 1465 (-14.83%) fills in affected programs: 471 -> 216 (-54.14%) helped: 4 HURT: 0 LOST: 2 GAINED: 162 shader-db results on SKL: total cycles in shared programs: 65436248 -> 65245186 (-0.29%) cycles in affected programs: 22560936 -> 22369874 (-0.85%) helped: 8457 HURT: 6247 total spills in shared programs: 437 -> 437 (0.00%) spills in affected programs: 0 -> 0 helped: 0 HURT: 0 total fills in shared programs: 870 -> 854 (-1.84%) fills in affected programs: 16 -> 0 helped: 1 HURT: 0 LOST: 0 GAINED: 107 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit c3c1aa5aeb921caa2ec18c2320ceb94854e0f47c) This patch is a prerequisite for 4cbe48f5 "intel/fs: Optimize and simplify the copy propagation dataflow logic". BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Change-Id: Icbe71f099618e45098a61502b79f3694bcc49877 Reviewed-on: https://chromium-review.googlesource.com/862004 Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org> Commit-Queue: Chad Versace <chadversary@chromium.org>
2018-01-16UPSTREAM: intel/fs: Teach instruction scheduler about GRF bank conflict cycles.Francisco Jerez3-2/+23
This should allow the post-RA scheduler to do a slightly better job at hiding latency in presence of instructions incurring bank conflicts. The main purpuse of this patch is not to improve performance though, but to get conflict cycles to show up in shader-db statistics in order to make sure that regressions in the bank conflict mitigation pass don't go unnoticed. Acked-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit acf98ff933d338c521d7c6a57c17a010149eb344) This patch is a prerequisite for 4cbe48f5 "intel/fs: Optimize and simplify the copy propagation dataflow logic". BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Change-Id: Ie10e8bf2116b28a637fd7a3829a44a00b2867f11 Reviewed-on: https://chromium-review.googlesource.com/862003 Commit-Ready: Chad Versace <chadversary@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2018-01-16UPSTREAM: intel/fs: Implement GRF bank conflict mitigation pass.Francisco Jerez5-0/+898
Unnecessary GRF bank conflicts increase the issue time of ternary instructions (the overwhelmingly most common of which is MAD) by roughly 50%, leading to reduced ALU throughput. This pass attempts to minimize the number of bank conflicts by rearranging the layout of the GRF space post-register allocation. It's in general not possible to eliminate all of them without introducing extra copies, which are typically more expensive than the bank conflict itself. In a shader-db run on SKL this helps roughly 46k shaders: total conflicts in shared programs: 1008981 -> 600461 (-40.49%) conflicts in affected programs: 816222 -> 407702 (-50.05%) helped: 46234 HURT: 72 The running time of shader-db itself on SKL seems to be increased by roughly 2.52%1.13% with n=20 due to the additional work done by the compiler back-end. On earlier generations the pass is somewhat less effective in relative terms because the hardware incurs a bank conflict anytime the last two sources of the instruction are duplicate (e.g. while trying to square a value using MAD), which is impossible to avoid without introducing copies. E.g. for a shader-db run on SNB: total conflicts in shared programs: 944636 -> 623185 (-34.03%) conflicts in affected programs: 853258 -> 531807 (-37.67%) helped: 31052 HURT: 19 And on BDW: total conflicts in shared programs: 1418393 -> 987539 (-30.38%) conflicts in affected programs: 1179787 -> 748933 (-36.52%) helped: 47592 HURT: 70 On SKL GT4e this improves performance of GpuTest Volplosion by 3.64% 0.33% with n=16. NOTE: This patch intentionally disregards some i965 coding conventions for the sake of reviewability. This is addressed by the next squash patch which introduces an amount of (for the most part boring) boilerplate that might distract reviewers from the non-trivial algorithmic details of the pass. The following patch is squashed in: SQUASH: intel/fs/bank_conflicts: Roll back to the nineties. Acked-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit af2c320190f3c73180f1610c8df955a7fa2a4d09) This patch is a prerequisite for 4cbe48f5 "intel/fs: Optimize and simplify the copy propagation dataflow logic". BUG=b:67394445 TEST=No regressions in Android CTS, GLES tests. Change-Id: I21b0563b3855434a702989fbc947b786c486f7e3 Reviewed-on: https://chromium-review.googlesource.com/862002 Commit-Ready: Chad Versace <chadversary@chromium.org> Tested-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Ilja H. Friedel <ihf@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2017-12-15UPSTREAM: radv: Don't advertise VK_EXT_debug_report.Bas Nieuwenhuizen1-1/+0
We never supported it. Missed during copy and pasting. Fixes: 17201a2eb0b "radv: port to using updated anv entrypoint/extension generator." Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (cherry-picked from 4eb0dca46bf481258443bb76fb542613c3a260d1) BUG=b:67506532 TEST=run vkinfo on kahlee Change-Id: I09f5053383cc9eded33510c24f953b496383f798 Reviewed-on: https://chromium-review.googlesource.com/827017 Commit-Ready: Bas Nieuwenhuizen <basni@chromium.org> Tested-by: Bas Nieuwenhuizen <basni@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: anv: Add support for the variablePointers featureJason Ekstrand2-4/+3
Not to be confused with variablePointersStorageBuffer which is the subset of VK_KHR_variable_pointers required to enable the extension. This means we now have "full" support for variable pointers. Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173537.html (am from https://patchwork.freedesktop.org/patch/183830/) Needed for SPIR-V VariablePointers capability. Testing: Tests for this feature were released in Vulkan CTS 1.0.2.4 on 2017-07-11, and were later merged into the oreo branches of deqp. But in that release some testcases were buggy, causing some drivers to crash. In particular, the bugs crashed Anvil. All but one of the required fixes have landed in vk-gl-cts master@e52de55c. The last fix is still under review in Khronos's internal Gerrit as https://gerrit.khronos.org/#/c/1864/. I've pushed a public vk-gl-cts branch[1] containing the remaining fix, and tagged[2] the vk-gl-cts commit I tested against. Likewise for Mesa, I tagged[3] the commit I tested, based on branch cros/arc-17.3. Android is hard. Running the Oreo CTS on Nougat is even harder. I confirmed that some testcases for this feature passed when running the Oreo CTS on ARC++ Nougat, though the CTS eventually crashed due to the reasons explained above. I verified everything on Fedora instead. All 949 of the following tests passed: dEQP-VK.spirv_assembly.instruction.compute.variable_pointers.* dEQP-VK.spirv_assembly.instruction.graphics.variable_pointers.* [1]: http://git.kiwitree.net/cgit/~chadv/vk-gl-cts/log/?h=fixes/spirv-variable-pointers [2]: http://git.kiwitree.net/cgit/~chadv/vk-gl-cts/log/?h=chadv/test/spirv-variable-pointers-2017-11-29 [3]: http://git.kiwitree.net/cgit/~chadv/mesa/log/?h=chadv/test/arc-17.3-anv-variable-pointers-2017-11-29 BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I93f94a0d5f976575826397d60b42d3b11a919269 Reviewed-on: https://chromium-review.googlesource.com/799681 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Add support for lowering workgroup access to offsetsJason Ekstrand4-19/+190
Before, we always left workgroup variables as shared nir_variables and let the driver call nir_lower_io. This adds an option to do the lowering directly in spirv_to_nir. To do this, we implicitly assign the variables a std430 layout and then treat them like a UBO or SSBO and immediately lower all the way to an offset. As a side-effect, the spirv_to_nir pass now handles variable pointers for workgroup variables. Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173534.html (am from https://patchwork.freedesktop.org/patch/183827/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: Ibdfb71194fd43fe899a71e7da162ee0633d2d11a Reviewed-on: https://chromium-review.googlesource.com/799680 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Rename get_shared_nir_atomic_op to get_var_nir_atomic_opJason Ekstrand1-2/+2
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173536.html (am from https://patchwork.freedesktop.org/patch/183829/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I096da96d15e7536b5536aa9f5d527ce8c47e9eaa Reviewed-on: https://chromium-review.googlesource.com/799679 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Add theoretical support for single component pointersJason Ekstrand1-6/+24
Up until now, all pointers have been ivec2s. We're about to add support for pointers to workgroup storage and those are going to be uints. Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173532.html (am from https://patchwork.freedesktop.org/patch/183825/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: Id8fc176fc1179d492dee77e5f018db8c67d884aa Reviewed-on: https://chromium-review.googlesource.com/799678 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Use offset_pointer_dereference to instead of ↵Jason Ekstrand1-35/+21
get_vulkan_resource_index There is no good reason why we should have the same logic repeated in get_vulkan_resource_index and vtn_ssa_offset_pointer_dereference. If we're a bit more careful about how we do things, we can just use the one function and get rid of the other entirely. This also makes the push constant special case a lot more clear. Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173535.html (am from https://patchwork.freedesktop.org/patch/183828/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I338bf2214e916c779b86628c684e434ece81b4a5 Reviewed-on: https://chromium-review.googlesource.com/799677 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Refactor a couple of pointer query helpersJason Ekstrand2-21/+21
This commit moves them both into vtn_variables.c towards the top, makes them take a vtn_builder, and replaces a hand-rolled instance of is_external_block with a function call. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173531.html (am from https://patchwork.freedesktop.org/patch/183826/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: If060e901394e8eb6a34a39a4f9b6b12aaf519c57 Reviewed-on: https://chromium-review.googlesource.com/799676 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Convert the supported_extensions struct to spirv_optionsJason Ekstrand5-37/+44
This is a bit more general and lets us pass additional options into the spirv_to_nir pass beyond what capabilities we support. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173529.html (am from https://patchwork.freedesktop.org/patch/183823/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I47f5272b801c1d642025242993e97befd1d918ce Reviewed-on: https://chromium-review.googlesource.com/799675 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Refactor the base case of offset_pointer_dereferenceJason Ekstrand1-15/+23
This makes us key off of !offset instead of !block_index. It also puts the guts inside a switch statement so that we can handle more than just UBOs and SSBOs. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173533.html (am from https://patchwork.freedesktop.org/patch/183824) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I5ec31e019875613ac192383b264bb08e0318ca60 Reviewed-on: https://chromium-review.googlesource.com/799674 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Add a switch statement for the block store opcodeJason Ekstrand1-1/+10
This parallels what we do for vtn_block_load except that we don't yet support anything except SSBO loads through this path. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173530.html (am from https://patchwork.freedesktop.org/patch/183822/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I6269c0fc7802276d8e0b030b9a68802f09c7226c Reviewed-on: https://chromium-review.googlesource.com/799673 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Use a dereference instead of vtn_variable_resource_indexJason Ekstrand1-7/+10
This is equivalent and means we don't have resource index code scattered about. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173528.html (am from https://patchwork.freedesktop.org/patch/183821/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I847aa91fe096c71dc88b229c72d60eb3c9a3fcc5 Reviewed-on: https://chromium-review.googlesource.com/799672 Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Only emit functions which are actually usedJason Ekstrand3-8/+26
Instead of emitting absolutely everything, just emit the few functions that are actually referenced in some way by the entrypoint. This should save us quite a bit of time when handed large shader modules containing many entrypoints. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173527.html (am from https://patchwork.freedesktop.org/patch/183820/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I259660c64c6bb9b88af26f90b2a8b2f43f5138db Reviewed-on: https://chromium-review.googlesource.com/799671 Tested-by: Chad Versace <chadversary@chromium.org> Trybot-Ready: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-30FROMLIST: spirv: Drop the impl field from vtn_builderJason Ekstrand4-8/+6
We have a nir_builder and it has an impl field. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Archived-At: https://lists.freedesktop.org/archives/mesa-dev/2017-October/173526.html (am from https://patchwork.freedesktop.org/patch/183819/) Needed for SPIR-V VariablePointers capability. BUG=b:68708929 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I1b8c8678e510cffd1dd897bc2b642e9c0d54c1de Reviewed-on: https://chromium-review.googlesource.com/799670 Tested-by: Chad Versace <chadversary@chromium.org> Trybot-Ready: Chad Versace <chadversary@chromium.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org> Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-11-22HACK: egl/android: Partially handle HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINEDTomasz Figa1-2/+37
There is no API available to properly query the IMPLEMENTATION_DEFINED format. As a workaround we rely here on gralloc allocating either an arbitrary YCbCr 4:2:0 or RGBX_8888, with the latter being recognized by lock_ycbcr failing. (replaces commmit b0147e6603835a2cc64a99c5a6caa3316d6c2172 from arc-12.1.0-pre2 branch / CL:367216) BUG=b:28671744 BUG=b:33533853 BUG=b:37615277 TEST=android.view.cts.WindowTest#testSetLocalFocus TEST=No CTS regressions on cyan and reef. TEST=Camera preview on Poppy looks correctly Change-Id: Ifca4a7f82a6d04ccb50e0ee17f1998ffb243f85f Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/566793 Reviewed-by: Chad Versace <chadversary@chromium.org> (cherry picked from commit 8e0cdc96548416708890eee94b6cff6cd68e5ca5) BUG=b:69553386 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I226caf644e34312628a7606fbcf65b567cf338d9 Reviewed-on: https://chromium-review.googlesource.com/780840 Commit-Queue: Chad Versace <chadversary@chromium.org> Tested-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2017-11-22FROMLIST: egl/android: remove HAL_PIXEL_FORMAT_BGRA_8888 supportEmil Velikov1-1/+0
As said in the EGL_KHR_platform_android extensions For each EGLConfig that belongs to the Android platform, the EGL_NATIVE_VISUAL_ID attribute is an Android window format, such as WINDOW_FORMAT_RGBA_8888. Although it should be applicable overall. Even though we use HAL_PIXEL_FORMAT here, those are numerically identical to the WINDOW_FORMAT_ and AHARDWAREBUFFER_FORMAT_ ones. Barring the said format of course. That one is only listed in HAL. Keep in mind that even if we try to use the said format, you'll get caught by droid_create_surface(). The function compares the format of the underlying window, against the NATIVE_VISUAL_ID of the config. Unfortunatelly it only prints a warning, rather than error out, likely leading to visual corruption. While SDL will even call ANativeWindow_setBuffersGeometry() with the wrong format, and conviniently ignore the [expected] failure. Cc: mesa-stable@lists.freedesktop.org Cc: Chad Versace <chadversary@google.com> Cc: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Tomasz Figa <tfiga@chromium.org> (am from https://patchwork.freedesktop.org/patch/166176/) (tfiga: Remove only respective EGL config, leave EGL image as is.) BUG=b:33533853 TEST=dEQP-EGL.functional.*.rgba8888_window tests pass on eve Change-Id: I8eacfe852ede88b24c1a45bff1445aacd86f6992 Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/582263 Reviewed-by: Chad Versace <chadversary@chromium.org> (cherry picked from commit cc1bc630a2b17693a6e8b93a6193b415b3859297) BUG=b:69553386 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I04bc06eeffcd4bd0cee64c55f10f0a039b6f2d73 Reviewed-on: https://chromium-review.googlesource.com/780798 Tested-by: Chad Versace <chadversary@chromium.org> Commit-Queue: Chad Versace <chadversary@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
2017-11-22CHROMIUM: egl/android: Support opening render nodes from within EGLTomasz Figa5-26/+131
This patch adds support for opening render nodes directly from within display initialization, Instead of relying on private interfaces provided by gralloc. In addition to having better separation from gralloc and being able to use different render nodes for allocation and rendering, this also fixes problems encountered when using the same DRI FD for gralloc and Mesa, when both stepped each over another because of shared GEM handle namespace. BUG=b:29036398 TEST=No significant regressions in dEQP inside the container Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367215 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> (cherry picked from commit 4471713aa71d83943eb195868707ebe4e6515bb6) BUG=b:32077712 BUG=b:33533853 TEST=No CTS regressions on cyan and reef. Change-Id: I7f901eb9dadbfc2200484666fdc6a2bc0ca42a0c Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/558138 Reviewed-by: Chad Versace <chadversary@chromium.org> (cherry picked from commit d4c3c3b5b0a9a834736323dbcd43a424e9033fa2) BUG=b:69553386 TEST=No regressions on Eve in `cts-tradefed run cts -m CtsDeqpTestCases`. Change-Id: I050b5ba258f175d3d2543582963e4296c56df5ee Reviewed-on: https://chromium-review.googlesource.com/780797 Tested-by: Chad Versace <chadversary@chromium.org> Commit-Queue: Chad Versace <chadversary@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>