Skip to content
Snippets Groups Projects
Commit ddd0606a authored by David Reveman's avatar David Reveman Committed by Roman Kiryanov
Browse files

Use VMO memory instead of cookie

Use VMO memory instead of cookie for association between
VMOs and color buffers.

Test: none
Bug: 111137294
Change-Id: If07c76f818cdeaab97d812bfb1d472e014a42d91
Merged-In: I86b20e10a1c0a6ae4ec61b436b81e776f9aa3583
parent 6832185d
Branches
No related tags found
No related merge requests found
...@@ -1698,10 +1698,17 @@ public: ...@@ -1698,10 +1698,17 @@ public:
} }
if (vmo_handle != ZX_HANDLE_INVALID) { if (vmo_handle != ZX_HANDLE_INVALID) {
uint64_t cb = 0; uint32_t cb = 0;
#ifdef VK_USE_PLATFORM_FUCHSIA #ifdef VK_USE_PLATFORM_FUCHSIA
zx_object_get_cookie(vmo_handle, vmo_handle, &cb); // TODO(reveman): Remove use of zx_vmo_read. Goldfish FIDL interface
// should provide a mechanism to query the color buffer ID associated
// with a VMO.
zx_status_t status = zx_vmo_read(vmo_handle, &cb, 0, sizeof(cb));
if (status != ZX_OK) {
ALOGE("failed to read color buffer name");
return VK_ERROR_INITIALIZATION_FAILED;
}
#endif #endif
if (cb) { if (cb) {
...@@ -2377,11 +2384,12 @@ public: ...@@ -2377,11 +2384,12 @@ public:
abort(); abort();
} }
} }
status = zx_object_set_cookie(memoryInfo.vmoHandle, // TODO(reveman): Remove use of zx_vmo_write. Sysmem
memoryInfo.vmoHandle, // and goldfish pipe driver should manage this association.
imageInfo.cbHandle); status = zx_vmo_write(memoryInfo.vmoHandle, &imageInfo.cbHandle,
0, sizeof(imageInfo.cbHandle));
if (status != ZX_OK) { if (status != ZX_OK) {
ALOGE("%s: failed to set color buffer cookie", __func__); ALOGE("%s: failed writing color buffer id to vmo", __func__);
abort(); abort();
} }
// Color buffer backed images are already bound. // Color buffer backed images are already bound.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment