hle: vi: Integrate new NVFlinger and HosBinderDriverServer service.

This commit is contained in:
bunnei
2021-11-11 19:15:51 -08:00
parent a87812c6a1
commit 7f4165fc05
17 changed files with 286 additions and 723 deletions

View File

@@ -6,7 +6,11 @@
namespace Service::VI {
Layer::Layer(u64 id, NVFlinger::BufferQueue& queue) : layer_id{id}, buffer_queue{queue} {}
Layer::Layer(u64 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
android::BufferQueueProducer& binder_,
std::shared_ptr<android::BufferItemConsumer>&& consumer_)
: layer_id{layer_id_}, binder_id{binder_id_}, core{core_}, binder{binder_}, consumer{std::move(
consumer_)} {}
Layer::~Layer() = default;

View File

@@ -4,11 +4,15 @@
#pragma once
#include <memory>
#include "common/common_types.h"
namespace Service::NVFlinger {
class BufferQueue;
}
namespace android {
class BufferItemConsumer;
class BufferQueueCore;
class BufferQueueProducer;
} // namespace android
namespace Service::VI {
@@ -17,10 +21,13 @@ class Layer {
public:
/// Constructs a layer with a given ID and buffer queue.
///
/// @param id The ID to assign to this layer.
/// @param queue The buffer queue for this layer to use.
/// @param layer_id_ The ID to assign to this layer.
/// @param binder_id_ The binder ID to assign to this layer.
/// @param binder_ The buffer producer queue for this layer to use.
///
Layer(u64 id, NVFlinger::BufferQueue& queue);
Layer(u64 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
android::BufferQueueProducer& binder_,
std::shared_ptr<android::BufferItemConsumer>&& consumer_);
~Layer();
Layer(const Layer&) = delete;
@@ -30,23 +37,47 @@ public:
Layer& operator=(Layer&&) = delete;
/// Gets the ID for this layer.
u64 GetID() const {
u64 GetLayerId() const {
return layer_id;
}
/// Gets the binder ID for this layer.
u32 GetBinderId() const {
return binder_id;
}
/// Gets a reference to the buffer queue this layer is using.
NVFlinger::BufferQueue& GetBufferQueue() {
return buffer_queue;
android::BufferQueueProducer& GetBufferQueue() {
return binder;
}
/// Gets a const reference to the buffer queue this layer is using.
const NVFlinger::BufferQueue& GetBufferQueue() const {
return buffer_queue;
const android::BufferQueueProducer& GetBufferQueue() const {
return binder;
}
android::BufferItemConsumer& GetConsumer() {
return *consumer;
}
const android::BufferItemConsumer& GetConsumer() const {
return *consumer;
}
android::BufferQueueCore& Core() {
return core;
}
const android::BufferQueueCore& Core() const {
return core;
}
private:
u64 layer_id;
NVFlinger::BufferQueue& buffer_queue;
const u64 layer_id;
const u32 binder_id;
android::BufferQueueCore& core;
android::BufferQueueProducer& binder;
std::shared_ptr<android::BufferItemConsumer> consumer;
};
} // namespace Service::VI