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

Commit 95d45fd5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "VR: Replace sw sync fences with egl sync fences"

parents aec27c30 e13ec188
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -6,13 +6,9 @@ genrule {
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hidl:system/libhidl/transport -randroid.hardware:hardware/interfaces/ -randroid.dvr:frameworks/native/services/vr/vr_window_manager android.dvr.composer@1.0",
    srcs: [
        "IVrComposerClient.hal",
        "IVrComposerView.hal",
        "IVrComposerCallback.hal",
    ],
    out: [
        "android/dvr/composer/1.0/VrComposerClientAll.cpp",
        "android/dvr/composer/1.0/VrComposerViewAll.cpp",
        "android/dvr/composer/1.0/VrComposerCallbackAll.cpp",
    ],
}

@@ -22,8 +18,6 @@ genrule {
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hidl:system/libhidl/transport -randroid.hardware:hardware/interfaces/ -randroid.dvr:frameworks/native/services/vr/vr_window_manager android.dvr.composer@1.0",
    srcs: [
        "IVrComposerClient.hal",
        "IVrComposerView.hal",
        "IVrComposerCallback.hal",
    ],
    out: [
        "android/dvr/composer/1.0/IVrComposerClient.h",
@@ -31,18 +25,6 @@ genrule {
        "android/dvr/composer/1.0/BnHwVrComposerClient.h",
        "android/dvr/composer/1.0/BpHwVrComposerClient.h",
        "android/dvr/composer/1.0/BsVrComposerClient.h",

        "android/dvr/composer/1.0/IVrComposerView.h",
        "android/dvr/composer/1.0/IHwVrComposerView.h",
        "android/dvr/composer/1.0/BnHwVrComposerView.h",
        "android/dvr/composer/1.0/BpHwVrComposerView.h",
        "android/dvr/composer/1.0/BsVrComposerView.h",

        "android/dvr/composer/1.0/IVrComposerCallback.h",
        "android/dvr/composer/1.0/IHwVrComposerCallback.h",
        "android/dvr/composer/1.0/BnHwVrComposerCallback.h",
        "android/dvr/composer/1.0/BpHwVrComposerCallback.h",
        "android/dvr/composer/1.0/BsVrComposerCallback.h",
    ],
}

+0 −18
Original line number Diff line number Diff line
package android.dvr.composer@1.0;

import android.hardware.graphics.composer@2.1::IComposerClient;

interface IVrComposerCallback {
    struct Layer {
        handle buffer;
        handle fence;
        android.hardware.graphics.composer@2.1::IComposerClient.Rect display_frame;
        android.hardware.graphics.composer@2.1::IComposerClient.FRect crop;
        android.hardware.graphics.composer@2.1::IComposerClient.BlendMode blend_mode;
        float alpha;
        uint32_t type;
        uint32_t app_id;
    };

    onNewFrame(vec<Layer> frame);
};
+0 −9
Original line number Diff line number Diff line
package android.dvr.composer@1.0;

import IVrComposerCallback;

interface IVrComposerView {
    registerCallback(IVrComposerCallback callback);

    releaseFrame();
};
+0 −6
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ cc_library_shared {
  name: "libvrhwc",

  srcs: [
    "impl/sync_timeline.cpp",
    "impl/vr_composer_view.cpp",
    "impl/vr_hwc.cpp",
    "impl/vr_composer_client.cpp",
@@ -33,11 +32,6 @@ cc_library_shared {

  export_include_dirs: ["."],

  include_dirs: [
    // Access to software sync timeline.
    "system/core/libsync",
  ],

  cflags: [
    "-DLOG_TAG=\"vrhwc\"",
  ],
+0 −43
Original line number Diff line number Diff line
/*
 * Copyright 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "sync_timeline.h"

#include <sys/cdefs.h>
#include <sw_sync.h>
#include <unistd.h>

namespace android {
namespace dvr {

SyncTimeline::SyncTimeline() {}

SyncTimeline::~SyncTimeline() {}

bool SyncTimeline::Initialize() {
  timeline_fd_.reset(sw_sync_timeline_create());
  return timeline_fd_ >= 0;
}

int SyncTimeline::CreateFence(int time) {
  return sw_sync_fence_create(timeline_fd_.get(), "dummy fence", time);
}

bool SyncTimeline::IncrementTimeline() {
  return sw_sync_timeline_inc(timeline_fd_.get(), 1) == 0;
}

}  // namespace dvr
}  // namespace android
Loading