Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a41f8c2 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4810559 from 31b85c23 to pi-release

Change-Id: I7c5b515f0c34242228b2db5681c76fa15e79d7aa
parents 382b5c64 31b85c23
Loading
Loading
Loading
Loading
+17 −19
Original line number Diff line number Diff line
@@ -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, &param) != 0) {
+8 −8
Original line number Diff line number Diff line
@@ -1268,21 +1268,21 @@ 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) {
            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) {
        swapchain->~Swapchain();