diff options
author | Doug Horn <doughorn@google.com> | 2021-05-05 18:31:57 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-05 18:31:57 +0000 |
commit | b69f8ceb1fd0bf2862a45609239619bd18e91554 (patch) | |
tree | 1c9a7c1914005f11a851c026fd4540a7dbae7ed0 | |
parent | 7f6d161578542139e29457cc60f76f71cb8fec00 (diff) | |
parent | be2b9139779024ea02aa4a340d58943f6a9583ea (diff) | |
download | vulkan-cereal-b69f8ceb1fd0bf2862a45609239619bd18e91554.tar.gz |
Use EGL validation by default. am: e43ad77c4f am: f70c52dc0b am: be2b913977
Original change: https://android-review.googlesource.com/c/device/generic/vulkan-cereal/+/1697387
Change-Id: I99d0f66615a43b7022e4900a777b69b5cbf5ff57
-rw-r--r-- | stream-servers/GfxStreamAgents.cpp | 82 | ||||
-rw-r--r-- | stream-servers/glestranslator/EGL/EglOsApi_egl.cpp | 4 |
2 files changed, 46 insertions, 40 deletions
diff --git a/stream-servers/GfxStreamAgents.cpp b/stream-servers/GfxStreamAgents.cpp index 74c1651f..716f9f04 100644 --- a/stream-servers/GfxStreamAgents.cpp +++ b/stream-servers/GfxStreamAgents.cpp @@ -26,6 +26,12 @@ #include "host-common/window_agent.h" // for WindowMes... #include "host-common/misc.h" +#ifdef _DEBUG +#define DEBUG_LOG(fd, fmt, ...) fprintf(fd, fmt, __VA_ARGS__); +#else +#define DEBUG_LOG(fd, fmt, ...) +#endif + std::map<uint32_t, android::MultiDisplayInfo> mMultiDisplay; using namespace android; @@ -39,7 +45,7 @@ static const QAndroidMultiDisplayAgent sMultiDisplayAgent = { uint32_t dpi, uint32_t flag, bool add) -> int { - fprintf(stderr, + DEBUG_LOG(stderr, "setMultiDisplay (mock): %d, x: %d, y: %d, w: %d, h: %d, " "dpi: %d, flag: %d\n", id, x, y, w, h, dpi, flag); @@ -53,7 +59,7 @@ static const QAndroidMultiDisplayAgent sMultiDisplayAgent = { uint32_t* dpi, uint32_t* flag, bool* enabled) -> bool { - fprintf(stderr, "getMultiDisplay (mock) id %u\n", id); + DEBUG_LOG(stderr, "getMultiDisplay (mock) id %u\n", id); if (mMultiDisplay.find(id) == mMultiDisplay.end()) { if (enabled) { *enabled = false; @@ -92,7 +98,7 @@ static const QAndroidMultiDisplayAgent sMultiDisplayAgent = { uint32_t* dpi, uint32_t* flag, uint32_t* cb) -> bool { - fprintf(stderr, "getNextMultiDisplay (mock) start_id %u\n", + DEBUG_LOG(stderr, "getNextMultiDisplay (mock) start_id %u\n", start_id); uint32_t key; std::map<uint32_t, android::MultiDisplayInfo>::iterator i; @@ -251,34 +257,34 @@ static bool sIsFolded = false; static const QAndroidEmulatorWindowAgent sQAndroidEmulatorWindowAgent = { .getEmulatorWindow = [](void) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: " ".getEmulatorWindow\n"); return (EmulatorWindow*)nullptr; }, .rotate90Clockwise = [](void) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: " ".rotate90Clockwise\n"); return true; }, .rotate = [](int rotation) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: " ".rotate90Clockwise\n"); return true; }, .getRotation = [](void) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .getRotation\n"); return (int)SKIN_ROTATION_0; }, .showMessage = [](const char* message, WindowMessageType type, int timeoutMs) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .showMessage %s\n", message); }, @@ -289,29 +295,29 @@ static const QAndroidEmulatorWindowAgent sQAndroidEmulatorWindowAgent = { void* context, void (*func)(void*), int timeoutMs) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: " ".showMessageWithDismissCallback %s\n", message); }, .fold = [](bool is_fold) -> bool { - fprintf(stderr, "window-agent-GfxStream-impl: .fold %d\n", + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .fold %d\n", is_fold); sIsFolded = is_fold; return true; }, .isFolded = [](void) -> bool { return sIsFolded; }, .getFoldedArea = [](int* x, int* y, int* w, int* h) -> bool { - fprintf(stderr, "window-agent-GfxStream-impl: .getFoldedArea\n"); + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .getFoldedArea\n"); return true; }, .updateFoldablePostureIndicator = [](bool) { - fprintf(stderr, "window-agent-GfxStream-impl: updateFoldablePostureIndicator\n"); + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: updateFoldablePostureIndicator\n"); }, .setUIDisplayRegion = [](int x_offset, int y_offset, int w, int h) { - fprintf(stderr, + DEBUG_LOG(stderr, "window-agent-GfxStream-impl: .setUIDisplayRegion " "%d %d %dx%d\n", x_offset, y_offset, w, h); @@ -321,7 +327,7 @@ static const QAndroidEmulatorWindowAgent sQAndroidEmulatorWindowAgent = { .restoreSkin = [](void) {}, .updateUIMultiDisplayPage = [](uint32_t id) { - fprintf(stderr, "updateMultiDisplayPage\n"); + DEBUG_LOG(stderr, "updateMultiDisplayPage\n"); }, .getMonitorRect = [](uint32_t* w, uint32_t* h) -> bool { @@ -335,116 +341,116 @@ static const QAndroidEmulatorWindowAgent sQAndroidEmulatorWindowAgent = { static const QAndroidVmOperations sQAndroidVmOperations = { .vmStop = []() -> bool { - fprintf(stderr, "goldfish-opengl vm ops: vm stop\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm stop\n"); return true; }, .vmStart = []() -> bool { - fprintf(stderr, "goldfish-opengl vm ops: vm start\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm start\n"); return true; }, .vmReset = - []() { fprintf(stderr, "goldfish-opengl vm ops: vm reset\n"); }, + []() { DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm reset\n"); }, .vmShutdown = - []() { fprintf(stderr, "goldfish-opengl vm ops: vm reset\n"); }, + []() { DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm reset\n"); }, .vmPause = []() -> bool { - fprintf(stderr, "goldfish-opengl vm ops: vm pause\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm pause\n"); return true; }, .vmResume = []() -> bool { - fprintf(stderr, "goldfish-opengl vm ops: vm resume\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm resume\n"); return true; }, .vmIsRunning = []() -> bool { - fprintf(stderr, "goldfish-opengl vm ops: vm is running\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: vm is running\n"); return true; }, .snapshotList = [](void*, LineConsumerCallback, LineConsumerCallback) -> bool { - fprintf(stderr, "goldfish-opengl vm ops: snapshot list\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot list\n"); return true; }, .snapshotSave = [](const char* name, void* opaque, LineConsumerCallback) -> bool { - fprintf(stderr, "gfxstream vm ops: snapshot save\n"); + DEBUG_LOG(stderr, "gfxstream vm ops: snapshot save\n"); return true; }, .snapshotLoad = [](const char* name, void* opaque, LineConsumerCallback) -> bool { - fprintf(stderr, "gfxstream vm ops: snapshot load\n"); + DEBUG_LOG(stderr, "gfxstream vm ops: snapshot load\n"); return true; }, .snapshotDelete = [](const char* name, void* opaque, LineConsumerCallback errConsumer) -> bool { - fprintf(stderr, "goldfish-opengl vm ops: snapshot delete\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot delete\n"); return true; }, .snapshotRemap = [](bool shared, void* opaque, LineConsumerCallback errConsumer) -> bool { - fprintf(stderr, "goldfish-opengl vm ops: snapshot remap\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot remap\n"); return true; }, .snapshotExport = [](const char* snapshot, const char* dest, void* opaque, LineConsumerCallback errConsumer) -> bool { - fprintf(stderr, "goldfish-opengl vm ops: snapshot export image\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: snapshot export image\n"); return true; }, .setSnapshotCallbacks = [](void* opaque, const SnapshotCallbacks* callbacks) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: set snapshot callbacks\n"); }, .mapUserBackedRam = [](uint64_t gpa, void* hva, uint64_t size) { - fprintf(stderr, "%s: map user backed ram\n", __func__); + DEBUG_LOG(stderr, "%s: map user backed ram\n", __func__); }, .unmapUserBackedRam = [](uint64_t gpa, uint64_t size) { - fprintf(stderr, "%s: unmap user backed ram\n", __func__); + DEBUG_LOG(stderr, "%s: unmap user backed ram\n", __func__); }, .getVmConfiguration = [](VmConfiguration* out) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: get vm configuration\n"); }, .setFailureReason = [](const char* name, int failureReason) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: set failure reason\n"); }, .setExiting = []() { - fprintf(stderr, "goldfish-opengl vm ops: set exiting\n"); + DEBUG_LOG(stderr, "goldfish-opengl vm ops: set exiting\n"); }, .allowRealAudio = [](bool allow) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: allow real audio\n"); }, .physicalMemoryGetAddr = [](uint64_t gpa) { - fprintf(stderr, "%s: physmemGetAddr\n", __func__); + DEBUG_LOG(stderr, "%s: physmemGetAddr\n", __func__); return (void*)nullptr; }, .isRealAudioAllowed = [](void) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: is real audiop allowed\n"); return true; }, .setSkipSnapshotSave = [](bool used) { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: set skip snapshot save\n"); }, .isSnapshotSaveSkipped = []() { - fprintf(stderr, + DEBUG_LOG(stderr, "goldfish-opengl vm ops: is snapshot save " "skipped\n"); return false; diff --git a/stream-servers/glestranslator/EGL/EglOsApi_egl.cpp b/stream-servers/glestranslator/EGL/EglOsApi_egl.cpp index 61be1793..c14d3161 100644 --- a/stream-servers/glestranslator/EGL/EglOsApi_egl.cpp +++ b/stream-servers/glestranslator/EGL/EglOsApi_egl.cpp @@ -472,8 +472,8 @@ EglOsEglDisplay::createContext(EGLint profileMask, std::vector<EGLint> attributes = { EGL_CONTEXT_CLIENT_VERSION, 3 }; auto exts = mDispatcher.eglQueryString(mDisplay, EGL_EXTENSIONS); - bool useValidation = android::base::getEnvironmentVariable("ANDROID_EMUGL_EGL_VALIDATION") == "1"; - if (exts != nullptr && emugl::hasExtension(exts, "EGL_KHR_create_context_no_error") && !useValidation) { + bool disableValidation = android::base::getEnvironmentVariable("ANDROID_EMUGL_EGL_VALIDATION") == "0"; + if (exts != nullptr && emugl::hasExtension(exts, "EGL_KHR_create_context_no_error") && disableValidation) { attributes.push_back(EGL_CONTEXT_OPENGL_NO_ERROR_KHR); attributes.push_back(EGL_TRUE); } |