aboutsummaryrefslogtreecommitdiff
path: root/system/OpenglSystemCommon/HostConnection.cpp
AgeCommit message (Collapse)Author
2022-07-28goldfish-opengl: nuke use std::optionalGurchetan Singh
Although this builds, we could also use the fact DRM_FORMAT_INVALID is zero and eventually refactor the gralloc helper out of the HostConnection. BUG=None TEST=meson amd64-build/ ninja -C amd64-build/ Change-Id: I5801abe78fee472652f507be07f27c761dd4dd94
2022-07-25goldfish-opengl: HostConnection: fix compile bugGurchetan Singh
Sometimes I get: ../system/OpenglSystemCommon/HostConnection.cpp:267:73: error: cannot bind packed field ‘((cros_gralloc_handle*)handle)->cros_gralloc_handle::format’ to ‘unsigned int&’ 267 | return std::optional<uint32_t>(((cros_gralloc_handle *)handle)->format); BUG=202552093 TEST= meson amd64-build/ ninja -C amd64-build/ Change-Id: I754dd3d61d147088fbacb01ed88efc86290e387c
2022-06-30Merge "Use DRM format to handle needed YUV swizzling"Jason Macnak
2022-06-29Use DRM format to handle needed YUV swizzlingJason Macnak
Bug: b/236169330 Test: launch_cvd --gpu_mode=gfxstream (with WIP ANGLE + Gfxstream VK) open camera open youtube Change-Id: I1ab5c5aa294be07896e9ade8e9887b9f1bd72b2f
2022-06-27Reduce logcat spammingYahan Zhou
Bug: 236999174 Test: build Change-Id: I95af7bf962706f0bf5322efaf020fb03f1b151cb
2022-05-09goldfish-opengl: don't de-duplicate rendernode fd for non-ASG streamsGurchetan Singh
Change-Id: I9066d3ef0500d2706af9cc2565dd6102a92534c1
2022-03-24goldfish-opengl: always use local virtgpu_drm.hGurchetan Singh
This seems to work without even modiying an Android.mk file, since eveything includes system/include already. BUG=202552093 TEST=compile Change-Id: I581e99edbe0ab2d8702170abcd39d2034ad7e254
2022-03-23goldfish-opengl: remove retrying rendernode logicGurchetan Singh
This should always work pretty consistently, for example minigbm does not retry. BUG=202552093 TEST=compile Change-Id: I7622b5a4ec2f2007543a733e5a5bd19e99661413
2022-03-23goldfish-opengl: open rendernode in HostConnectionGurchetan Singh
In the long-term, it makes sense to separate the concept of a "device" from a "stream". The virtio-gpu device may be used to create a stream via memory management options, but also does a few other things (like fence creation). This is one incremental refactor towards that concept. BUG=202552093 TEST=run gfxstream Change-Id: I4988a15135659777bd68892ab71c3e4912c83850
2022-03-21goldfish-opengl: one virtgpu instance per HostConnectionGurchetan Singh
When in virtio mode -- even with ASG -- gfxstream opens an ancillary rendernode fd to perform the process pipe logic. Reuse the already existing one from the stream. BUG=202552093 TEST=compile Change-Id: I32d2f42afa744ca681aff815d00b3e85158c347b
2022-03-18Wait until host resource is created when using virtio-gpuKaiyi Li
Bug: b/213230001 Change-Id: Ie119145838dec6a58d1836293c260966cadda3af
2022-03-09goldfish-opengl: assume PLATFORM_SDK_VERSION greater than 16Gurchetan Singh
Should be safe to do. BUG=202552093 TEST=run gfxstream Change-Id: Ibd3cc501814b0879097fe9a1ce539dcc2e019b8c
2022-03-09goldfish-opengl: nuke getOrCreateRendernodeFd()Gurchetan Singh
All virtio connection types (VIRTIO_GPU, VIRTIO_GPU_PIPE, VIRTIO_GPU_ADDRESS_SPACE) set m_rendernodeFd on creation. BUG=202552093 TEST=run gfxstream Change-Id: I70523ce56f39745fe1f4ff5a3282d1a89f1822c1
2022-02-24goldfish-opengl: plumb capset_id to creation of virtio-gpu deviceGurchetan Singh
The introduction of virtio-gpu context types allows for separation and composition of previously mixed functionality. For example, one may compose with Ranchu and run virgl (crazy example, but it's theoretically possible) for GL. BUG=b:202552093 TEST=compile Change-Id: If6f2a09475d4a4de99b2645a79f88654e35c4523
2022-02-17goldfish-opengl: Remove extra exclamation pointsGurchetan Singh
As gfxstream becomes a very serious project (TM), it makes sense to do this. BUG=202552093 TEST=None Change-Id: Idfe502ced2c81a431e54c21ea4e999c17dd3307d
2022-01-20Build fixYahan Zhou
Test: build emulator and run unittests Change-Id: If6bb7f36e8612078f105e91a46e010263582f6eb
2022-01-18goldfish-opengl: use virtio-gpu address space on LinuxGurchetan Singh
Probably is a requirement at this point. BUG=202552093 TEST=run vulkaninfo Change-Id: I369645a8be1e94dd4306aeaa3173895b0ad6e564
2022-01-05goldfish-opengl: reference <virtgpu_drm.h>, not <drm/virtgpu_drm.h>Gurchetan Singh
Helps with Meson build. BUG=202552093 TEST=compile Change-Id: I7f1b032f16232ec1e3381492939649bc637708a1
2022-01-05goldfish-opengl: Linux stream fixGurchetan Singh
Linux or Fuchsia guests don't have socket_loopback_server in cutils or an equivalent. Until that is added, disable for now. BUG=202552093 TEST=compile Change-Id: Iacbafc6f4f44e277f32af440d00e442daabfc2f6
2022-01-05goldfish-opengl: more compatGurchetan Singh
- Define the cros_gralloc_handle when not building Android - Define <vulkan_android.h> headers when building for Linux and Fuchsia. * Long-term, we should import the vulkan_android.h headers inside goldfish-opengl and not define them in goldfish_vk_private_defs.h BUG=202552093 TEST=compile Change-Id: Ie1e0aeda88bf8ce192de9a4f7a203b3c0a6df99c
2021-09-21Support multiple display configs for default displayHuan Song
Bug: 196986384 Test: run emulator with multiple display configs, switch config using 'service call SurfaceFlinger 1035 i32 <configId>' Change-Id: I14b43323df1f598dd04b3bb36039a67d78e4be66
2021-08-05Add feature flag for rcReadColorBufferDmaLingfeng Yang
Bug: 189960317 Change-Id: Iad24faadf5487280eeac3f49f257474ce114cad0
2021-07-15vulkan: feature flag for async QSRI (guest)Lingfeng Yang
Bug: 193809913 Change-Id: Idba4b405b114eef306edadeab35d6d3a42f2fffe
2021-05-05Try to get the transport type from `ro.boot.qemu.gltransport.name`Roman Kiryanov
bootconfig does not support setting key=value and key.subkey=value simultaneously. Bug: 182291166 Test: boot with AndroidbootProps enabled Signed-off-by: Roman Kiryanov <rkir@google.com> Change-Id: I75b079fa7c72e2c783774983224c5ea8bddbba30
2021-04-25rc: Call rcGetRendererVersion when initializing rcEncoder.Yilong Li
rcGetRendererVersion() call sets up the goldfish sync device on host; We need to call this rc method when initializing rcEncoder and vkEncoder, so that host goldfish sync device will work correctly. Change-Id: Ic1260372bef5ae4f3a3e53c44e85ef593d246eb1
2021-04-22fuchsia: Fix buildYilong Li
Change-Id: Ib6a753a7bc28cc85b1df42746fca5545dc0b11f0
2021-04-21Synchronized glBufferDataKaiyi Li
Check if ANDROID_EMU_sync_buffer_data is provided, if so, use glBufferDataSyncAEMU when glBufferData is called. glBufferDataSyncAEMU won't return until the glBufferData returns on the host. Test: run the emulator Change-Id: Ifa57f8c6181960b894a7ec3e0789f7f344f498b7
2021-04-12Minor cleanup in getGrallocTypeFromPropertyRoman Kiryanov
Bug: 182291166 Test: presubmit Signed-off-by: Roman Kiryanov <rkir@google.com> Change-Id: Ied66072402039e256b9d300c94e1064f8b26641d
2021-04-12Migrate HostConnection to `ro.boot`Roman Kiryanov
Bug: 182291166 Test: presubmit Change-Id: I64819a8328bf1279bd0769f8481eddbc623921e0 Signed-off-by: Roman Kiryanov <rkir@google.com>
2021-02-17[5/n] Add feature flag for batched descriptor set update (guest)Lingfeng Yang
Bug: 177241396 Change-Id: I7e3ce61f27312ab15d666a014a7ebd0edb97b480
2021-01-22[3/n] Add VulkanQueueSubmitWithCommands feature to guestLingfeng Yang
Bug: 177241396 + Also make sure rcEncoder() is active for each Vulkan thread. It looks like we don't always ensure that, which allows leaking of render threads on host after guest process shutdown, since the host needs the process id info for each guest thread. Change-Id: I121be5fc144699493a96f034bd2de697f1770a6d
2020-11-06Add awareness of and support for ANDROID_EMU_async_frame_cmdsLingfeng Yang
Bug: 168844225 Change-Id: Ie3f8a0d6d7cb6ea40f3c0cc64b4eb482c197e128
2020-10-21vulkan: Add functions to test unclean exit of vulkan guest processesLingfeng Yang
Bug: 168811024 Change-Id: If1584a166777919971d32daa3eedcfd1665e799c
2020-10-08tracing prototype: guest-side changes for gfxstreamLingfeng Yang
Bug: 168843698 Change-Id: I22a7568bb8b28b8b3bafda7100dee4c2d7a6fe50
2020-10-07(reland) Make it easier to locally unit test guest/host combined tracingLingfeng Yang
Bug: 168843698 Change-Id: Icad71e200d1a2382519a270b77340cc1276f69b6
2020-10-02Revert "Make it easier to locally unit test guest/host combined tracing"Lingfeng Yang
This reverts commit 9ee90ceb9715808f7d28a360d7f3ed9aede2714d. Reason for revert: build breakage on mac Change-Id: If2d9e39f782ae0b60f27317c25f8135e98702867
2020-09-28Make it easier to locally unit test guest/host combined tracingLingfeng Yang
Change-Id: If7c24e1ac9fa50dba8b85fc12274ecd75fea0e01
2020-09-10Merge "Move host validation to guest"Lingfeng Yang
2020-09-10Move host validation to guestLingfeng Yang
Test: dEQP-GLES3 no failures when not using host-side glGetError Change-Id: If602d7c784ea12c5ae47ce56a91669e14a9ac62f
2020-08-27intrusive refcount for encoders so we dont need cleanup callbackLingfeng Yang
and its more reliable? Also we need to convert IOStream to refcounted in HostConnection.cpp and VulkanStreamGuest.cpp. Change-Id: Ic114ce5955a36665a289bdbf3e0be59ea9bfc18a
2020-08-19Change GOLDFISH_VULKAN macro to GFXSTREAM macroLingfeng Yang
The macro's true purpose seems to be a general "modern" specifier like "vulkan support exists" and "this is an env where c++11 is available" etc. Change-Id: I9fa61c80f71be1c6d521b4963d03b6192f14c85e
2020-07-28HostConnection: skip VIRTIO_GPU_ADDRESS_SPACE on FuchsiaYilong Li
We don't implement virtio gpu address space stream for Fuchsia, so this code path should be skipped at build time; otherwise it will cause a build error when using -O0. TEST=fx set workstation.x64 --args 'optimize = "none"' Change-Id: I92c889fcae0d6596dd874a20a7faeddaeaf14d21
2020-07-16remove encoder lock, change to atomic and thread local checkLingfeng Yang
Test: Run dEQP-VK.synchronization.internally_synchronized_objects.pipeline_cache_compute 20x, no failures/crashes/hangs Change-Id: I5d4440149fc1d0780b935495a784500de7988756
2020-07-15async queue submit (guest)Lingfeng Yang
Bug: 160996822 Change-Id: Ifeabf3de305ce35234cc191b905411f32c19cba7
2020-07-15HostConnection: remove the use of the stream pointer after movedKaiyi Li
Bug: b/161364729 Test: Run the image with crosvm Change-Id: I1ca8db974b661c34ccf2fc3f265b53184bcaa128
2020-07-13HostConnection: Use unique_ptr for HostConnection objects.Yilong Li
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=46839 Bug: 142677230 Change-Id: I7b8a27942b1309862413ec8563148523c5e0717c
2020-07-13HostConnection: Use unique_ptr in HostConnection class members.Yilong Li
Fuchsia LeakSanitizer has found a memory leak in goldfish ICD due to not deleting "m_vkEnc" in dtor of HostConnection. Using smart pointers instead of "new" and "delete" will help us prevent bugs like this. This change removes most new/delete usages within HostConnection, and use std::unique_ptr instead. Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=46839 TEST=fuchsia escher_tests, scenic_tests with LSan turned on. Change-Id: I42b46ee4a25c872e7eb493bf55228f9e017b5887
2020-07-07VK_KHR_shader_float16_int8, don't skip unknown ext. structsLingfeng Yang
Bug: 160277060 Change-Id: I07a9ccdfa10f79308c88db36fdc70912c2585c7a
2020-06-29reland: virtio-gpu-asg transportLingfeng Yang
Requires ro.boot.hardware.gltransport=virtio-gpu-asg or ro.kernel.qemu.gltransport=virtio-gpu-asg Bug: 160181061 Change-Id: Ia7865320ad7b3a9ec3f6971ead1cabe3fff36d27
2020-06-24Revert "virtio-gpu-asg transport"Lingfeng Yang
This reverts commit 7ceae4f920c59c0110c4347a21dec3d5066453cc. Reason for revert: build break Change-Id: Icad5325c97d6cb7b2a227173fc7bb47841058cbb