diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-30 07:24:46 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-30 07:24:46 +0000 |
commit | 8a41f8c28090945101f4f8b76bb0ab5679c374c1 (patch) | |
tree | 905282a37c329ad29c68dc4eaca8c9478bb2252d | |
parent | 382b5c6462fb0394a7b92f0ec28bec30956cb3a0 (diff) | |
parent | 31b85c2326ea082733a848d47b630f44c7888549 (diff) | |
download | native-8a41f8c28090945101f4f8b76bb0ab5679c374c1.tar.gz |
Snap for 4810559 from 31b85c2326ea082733a848d47b630f44c7888549 to pi-release
Change-Id: I7c5b515f0c34242228b2db5681c76fa15e79d7aa
-rw-r--r-- | services/surfaceflinger/main_surfaceflinger.cpp | 36 | ||||
-rw-r--r-- | vulkan/libvulkan/swapchain.cpp | 16 |
2 files changed, 25 insertions, 27 deletions
diff --git a/services/surfaceflinger/main_surfaceflinger.cpp b/services/surfaceflinger/main_surfaceflinger.cpp index 2a924ae1c7..8255b41596 100644 --- a/services/surfaceflinger/main_surfaceflinger.cpp +++ b/services/surfaceflinger/main_surfaceflinger.cpp @@ -35,6 +35,13 @@ using namespace android; static status_t startGraphicsAllocatorService() { + using android::hardware::configstore::getBool; + using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs; + if (!getBool<ISurfaceFlingerConfigs, + &ISurfaceFlingerConfigs::startGraphicsAllocatorService>(false)) { + return OK; + } + using android::hardware::graphics::allocator::V2_0::IAllocator; status_t result = @@ -47,27 +54,12 @@ static status_t startGraphicsAllocatorService() { return OK; } -static status_t startHidlServices() { +static status_t startDisplayService() { using android::frameworks::displayservice::V1_0::implementation::DisplayService; using android::frameworks::displayservice::V1_0::IDisplayService; - using android::hardware::configstore::getBool; - using android::hardware::configstore::getBool; - using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs; - hardware::configureRpcThreadpool(1 /* maxThreads */, - false /* callerWillJoin */); - - status_t err; - - if (getBool<ISurfaceFlingerConfigs, - &ISurfaceFlingerConfigs::startGraphicsAllocatorService>(false)) { - err = startGraphicsAllocatorService(); - if (err != OK) { - return err; - } - } sp<IDisplayService> displayservice = new DisplayService(); - err = displayservice->registerAsService(); + status_t err = displayservice->registerAsService(); if (err != OK) { ALOGE("Could not register IDisplayService service."); @@ -77,9 +69,13 @@ static status_t startHidlServices() { } int main(int, char**) { - startHidlServices(); - signal(SIGPIPE, SIG_IGN); + + hardware::configureRpcThreadpool(1 /* maxThreads */, + false /* callerWillJoin */); + + startGraphicsAllocatorService(); + // When SF is launched in its own process, limit the number of // binder threads to 4. ProcessState::self()->setThreadPoolMaxThreadCount(4); @@ -112,6 +108,8 @@ int main(int, char**) { sp<GpuService> gpuservice = new GpuService(); sm->addService(String16(GpuService::SERVICE_NAME), gpuservice, false); + startDisplayService(); // dependency on SF getting registered above + struct sched_param param = {0}; param.sched_priority = 2; if (sched_setscheduler(0, SCHED_FIFO, ¶m) != 0) { diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp index c42e81132c..3db8a3962e 100644 --- a/vulkan/libvulkan/swapchain.cpp +++ b/vulkan/libvulkan/swapchain.cpp @@ -1268,19 +1268,19 @@ VkResult CreateSwapchainKHR(VkDevice device, // // TODO(jessehall): The error path here is the same as DestroySwapchain, // but not the non-error path. Should refactor/unify. - if (!swapchain->shared) { - for (uint32_t i = 0; i < num_images; i++) { - Swapchain::Image& img = swapchain->images[i]; - if (img.dequeued) { + for (uint32_t i = 0; i < num_images; i++) { + Swapchain::Image& img = swapchain->images[i]; + if (img.dequeued) { + if (!swapchain->shared) { surface.window->cancelBuffer(surface.window.get(), img.buffer.get(), img.dequeue_fence); img.dequeue_fence = -1; img.dequeued = false; } - if (result != VK_SUCCESS) { - if (img.image) - dispatch.DestroyImage(device, img.image, nullptr); - } + } + if (result != VK_SUCCESS) { + if (img.image) + dispatch.DestroyImage(device, img.image, nullptr); } } |