another try
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/nvdrv/core/container.h"
|
||||
#include "core/hle/service/nvflinger/buffer_item_consumer.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_consumer.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_core.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_producer.h"
|
||||
#include "core/hle/service/nvflinger/hos_binder_driver_server.h"
|
||||
#include "core/hle/service/vi/display/vi_display.h"
|
||||
#include "core/hle/service/vi/layer/vi_layer.h"
|
||||
#include "core/hle/service/vi/vi_results.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
struct BufferQueue {
|
||||
std::shared_ptr<android::BufferQueueCore> core;
|
||||
std::unique_ptr<android::BufferQueueProducer> producer;
|
||||
std::unique_ptr<android::BufferQueueConsumer> consumer;
|
||||
};
|
||||
|
||||
static BufferQueue CreateBufferQueue(KernelHelpers::ServiceContext& service_context,
|
||||
Service::Nvidia::NvCore::NvMap& nvmap) {
|
||||
auto buffer_queue_core = std::make_shared<android::BufferQueueCore>();
|
||||
return {
|
||||
buffer_queue_core,
|
||||
std::make_unique<android::BufferQueueProducer>(service_context, buffer_queue_core, nvmap),
|
||||
std::make_unique<android::BufferQueueConsumer>(buffer_queue_core, nvmap)};
|
||||
}
|
||||
|
||||
Display::Display(u64 id, std::string name_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_,
|
||||
KernelHelpers::ServiceContext& service_context_, Core::System& system_)
|
||||
: display_id{id}, name{std::move(name_)}, hos_binder_driver_server{hos_binder_driver_server_},
|
||||
service_context{service_context_} {
|
||||
vsync_event = service_context.CreateEvent(fmt::format("Display VSync Event {}", id));
|
||||
}
|
||||
|
||||
Display::~Display() {
|
||||
service_context.CloseEvent(vsync_event);
|
||||
}
|
||||
|
||||
Layer& Display::GetLayer(std::size_t index) {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
const Layer& Display::GetLayer(std::size_t index) const {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
ResultVal<Kernel::KReadableEvent*> Display::GetVSyncEvent() {
|
||||
if (got_vsync_event) {
|
||||
return ResultPermissionDenied;
|
||||
}
|
||||
|
||||
got_vsync_event = true;
|
||||
|
||||
return GetVSyncEventUnchecked();
|
||||
}
|
||||
|
||||
Kernel::KReadableEvent* Display::GetVSyncEventUnchecked() {
|
||||
return &vsync_event->GetReadableEvent();
|
||||
}
|
||||
|
||||
void Display::SignalVSyncEvent() {
|
||||
vsync_event->Signal();
|
||||
}
|
||||
|
||||
void Display::CreateLayer(u64 layer_id, u32 binder_id,
|
||||
Service::Nvidia::NvCore::Container& nv_core) {
|
||||
ASSERT_MSG(layers.empty(), "Only one layer is supported per display at the moment");
|
||||
|
||||
auto [core, producer, consumer] = CreateBufferQueue(service_context, nv_core.GetNvMapFile());
|
||||
|
||||
auto buffer_item_consumer = std::make_shared<android::BufferItemConsumer>(std::move(consumer));
|
||||
buffer_item_consumer->Connect(false);
|
||||
|
||||
layers.emplace_back(std::make_unique<Layer>(layer_id, binder_id, *core, *producer,
|
||||
std::move(buffer_item_consumer)));
|
||||
|
||||
hos_binder_driver_server.RegisterProducer(std::move(producer));
|
||||
}
|
||||
|
||||
void Display::CloseLayer(u64 layer_id) {
|
||||
std::erase_if(layers,
|
||||
[layer_id](const auto& layer) { return layer->GetLayerId() == layer_id; });
|
||||
}
|
||||
|
||||
Layer* Display::FindLayer(u64 layer_id) {
|
||||
const auto itr =
|
||||
std::find_if(layers.begin(), layers.end(), [layer_id](const std::unique_ptr<Layer>& layer) {
|
||||
return layer->GetLayerId() == layer_id;
|
||||
});
|
||||
|
||||
if (itr == layers.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return itr->get();
|
||||
}
|
||||
|
||||
const Layer* Display::FindLayer(u64 layer_id) const {
|
||||
const auto itr =
|
||||
std::find_if(layers.begin(), layers.end(), [layer_id](const std::unique_ptr<Layer>& layer) {
|
||||
return layer->GetLayerId() == layer_id;
|
||||
});
|
||||
|
||||
if (itr == layers.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return itr->get();
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/nvdrv/core/container.h"
|
||||
#include "core/hle/service/nvflinger/buffer_item_consumer.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_consumer.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_core.h"
|
||||
#include "core/hle/service/nvflinger/buffer_queue_producer.h"
|
||||
#include "core/hle/service/nvflinger/hos_binder_driver_server.h"
|
||||
#include "core/hle/service/vi/display/vi_display.h"
|
||||
#include "core/hle/service/vi/layer/vi_layer.h"
|
||||
#include "core/hle/service/vi/vi_results.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
struct BufferQueue {
|
||||
std::shared_ptr<android::BufferQueueCore> core;
|
||||
std::unique_ptr<android::BufferQueueProducer> producer;
|
||||
std::unique_ptr<android::BufferQueueConsumer> consumer;
|
||||
};
|
||||
|
||||
static BufferQueue CreateBufferQueue(KernelHelpers::ServiceContext& service_context,
|
||||
Service::Nvidia::NvCore::NvMap& nvmap) {
|
||||
auto buffer_queue_core = std::make_shared<android::BufferQueueCore>();
|
||||
return {
|
||||
buffer_queue_core,
|
||||
std::make_unique<android::BufferQueueProducer>(service_context, buffer_queue_core, nvmap),
|
||||
std::make_unique<android::BufferQueueConsumer>(buffer_queue_core, nvmap)};
|
||||
}
|
||||
|
||||
Display::Display(u64 id, std::string name_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_,
|
||||
KernelHelpers::ServiceContext& service_context_, Core::System& system_)
|
||||
: display_id{id}, name{std::move(name_)}, hos_binder_driver_server{hos_binder_driver_server_},
|
||||
service_context{service_context_} {
|
||||
vsync_event = service_context.CreateEvent(fmt::format("Display VSync Event {}", id));
|
||||
}
|
||||
|
||||
Display::~Display() {
|
||||
service_context.CloseEvent(vsync_event);
|
||||
}
|
||||
|
||||
Layer& Display::GetLayer(std::size_t index) {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
const Layer& Display::GetLayer(std::size_t index) const {
|
||||
return *layers.at(index);
|
||||
}
|
||||
|
||||
ResultVal<Kernel::KReadableEvent*> Display::GetVSyncEvent() {
|
||||
if (got_vsync_event) {
|
||||
return ResultPermissionDenied;
|
||||
}
|
||||
|
||||
got_vsync_event = true;
|
||||
|
||||
return GetVSyncEventUnchecked();
|
||||
}
|
||||
|
||||
Kernel::KReadableEvent* Display::GetVSyncEventUnchecked() {
|
||||
return &vsync_event->GetReadableEvent();
|
||||
}
|
||||
|
||||
void Display::SignalVSyncEvent() {
|
||||
vsync_event->Signal();
|
||||
}
|
||||
|
||||
void Display::CreateLayer(u64 layer_id, u32 binder_id,
|
||||
Service::Nvidia::NvCore::Container& nv_core) {
|
||||
ASSERT_MSG(layers.empty(), "Only one layer is supported per display at the moment");
|
||||
|
||||
auto [core, producer, consumer] = CreateBufferQueue(service_context, nv_core.GetNvMapFile());
|
||||
|
||||
auto buffer_item_consumer = std::make_shared<android::BufferItemConsumer>(std::move(consumer));
|
||||
buffer_item_consumer->Connect(false);
|
||||
|
||||
layers.emplace_back(std::make_unique<Layer>(layer_id, binder_id, *core, *producer,
|
||||
std::move(buffer_item_consumer)));
|
||||
|
||||
hos_binder_driver_server.RegisterProducer(std::move(producer));
|
||||
}
|
||||
|
||||
void Display::CloseLayer(u64 layer_id) {
|
||||
std::erase_if(layers,
|
||||
[layer_id](const auto& layer) { return layer->GetLayerId() == layer_id; });
|
||||
}
|
||||
|
||||
Layer* Display::FindLayer(u64 layer_id) {
|
||||
const auto itr =
|
||||
std::find_if(layers.begin(), layers.end(), [layer_id](const std::unique_ptr<Layer>& layer) {
|
||||
return layer->GetLayerId() == layer_id;
|
||||
});
|
||||
|
||||
if (itr == layers.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return itr->get();
|
||||
}
|
||||
|
||||
const Layer* Display::FindLayer(u64 layer_id) const {
|
||||
const auto itr =
|
||||
std::find_if(layers.begin(), layers.end(), [layer_id](const std::unique_ptr<Layer>& layer) {
|
||||
return layer->GetLayerId() == layer_id;
|
||||
});
|
||||
|
||||
if (itr == layers.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return itr->get();
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,144 +1,144 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
}
|
||||
|
||||
namespace Service::android {
|
||||
class BufferQueueProducer;
|
||||
}
|
||||
|
||||
namespace Service::KernelHelpers {
|
||||
class ServiceContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
}
|
||||
|
||||
namespace Service::Nvidia::NvCore {
|
||||
class Container;
|
||||
class NvMap;
|
||||
} // namespace Service::Nvidia::NvCore
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class Layer;
|
||||
|
||||
/// Represents a single display type
|
||||
class Display {
|
||||
public:
|
||||
YUZU_NON_COPYABLE(Display);
|
||||
YUZU_NON_MOVEABLE(Display);
|
||||
|
||||
/// Constructs a display with a given unique ID and name.
|
||||
///
|
||||
/// @param id The unique ID for this display.
|
||||
/// @param hos_binder_driver_server_ NVFlinger HOSBinderDriver server instance.
|
||||
/// @param service_context_ The ServiceContext for the owning service.
|
||||
/// @param name_ The name for this display.
|
||||
/// @param system_ The global system instance.
|
||||
///
|
||||
Display(u64 id, std::string name_, NVFlinger::HosBinderDriverServer& hos_binder_driver_server_,
|
||||
KernelHelpers::ServiceContext& service_context_, Core::System& system_);
|
||||
~Display();
|
||||
|
||||
/// Gets the unique ID assigned to this display.
|
||||
u64 GetID() const {
|
||||
return display_id;
|
||||
}
|
||||
|
||||
/// Gets the name of this display
|
||||
const std::string& GetName() const {
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Whether or not this display has any layers added to it.
|
||||
bool HasLayers() const {
|
||||
return !layers.empty();
|
||||
}
|
||||
|
||||
/// Gets a layer for this display based off an index.
|
||||
Layer& GetLayer(std::size_t index);
|
||||
|
||||
/// Gets a layer for this display based off an index.
|
||||
const Layer& GetLayer(std::size_t index) const;
|
||||
|
||||
std::size_t GetNumLayers() const {
|
||||
return layers.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the internal vsync event.
|
||||
*
|
||||
* @returns The internal Vsync event if it has not yet been retrieved,
|
||||
* VI::ResultPermissionDenied otherwise.
|
||||
*/
|
||||
[[nodiscard]] ResultVal<Kernel::KReadableEvent*> GetVSyncEvent();
|
||||
|
||||
/// Gets the internal vsync event.
|
||||
Kernel::KReadableEvent* GetVSyncEventUnchecked();
|
||||
|
||||
/// Signals the internal vsync event.
|
||||
void SignalVSyncEvent();
|
||||
|
||||
/// Creates and adds a layer to this display with the given ID.
|
||||
///
|
||||
/// @param layer_id The ID to assign to the created layer.
|
||||
/// @param binder_id The ID assigned to the buffer queue.
|
||||
///
|
||||
void CreateLayer(u64 layer_id, u32 binder_id, Service::Nvidia::NvCore::Container& core);
|
||||
|
||||
/// Closes and removes a layer from this display with the given ID.
|
||||
///
|
||||
/// @param layer_id The ID assigned to the layer to close.
|
||||
///
|
||||
void CloseLayer(u64 layer_id);
|
||||
|
||||
/// Resets the display for a new connection.
|
||||
void Reset() {
|
||||
layers.clear();
|
||||
got_vsync_event = false;
|
||||
}
|
||||
|
||||
/// Attempts to find a layer with the given ID.
|
||||
///
|
||||
/// @param layer_id The layer ID.
|
||||
///
|
||||
/// @returns If found, the Layer instance with the given ID.
|
||||
/// If not found, then nullptr is returned.
|
||||
///
|
||||
Layer* FindLayer(u64 layer_id);
|
||||
|
||||
/// Attempts to find a layer with the given ID.
|
||||
///
|
||||
/// @param layer_id The layer ID.
|
||||
///
|
||||
/// @returns If found, the Layer instance with the given ID.
|
||||
/// If not found, then nullptr is returned.
|
||||
///
|
||||
const Layer* FindLayer(u64 layer_id) const;
|
||||
|
||||
private:
|
||||
u64 display_id;
|
||||
std::string name;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
KernelHelpers::ServiceContext& service_context;
|
||||
|
||||
std::vector<std::unique_ptr<Layer>> layers;
|
||||
Kernel::KEvent* vsync_event{};
|
||||
bool got_vsync_event{false};
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Kernel {
|
||||
class KEvent;
|
||||
}
|
||||
|
||||
namespace Service::android {
|
||||
class BufferQueueProducer;
|
||||
}
|
||||
|
||||
namespace Service::KernelHelpers {
|
||||
class ServiceContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
}
|
||||
|
||||
namespace Service::Nvidia::NvCore {
|
||||
class Container;
|
||||
class NvMap;
|
||||
} // namespace Service::Nvidia::NvCore
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class Layer;
|
||||
|
||||
/// Represents a single display type
|
||||
class Display {
|
||||
public:
|
||||
YUZU_NON_COPYABLE(Display);
|
||||
YUZU_NON_MOVEABLE(Display);
|
||||
|
||||
/// Constructs a display with a given unique ID and name.
|
||||
///
|
||||
/// @param id The unique ID for this display.
|
||||
/// @param hos_binder_driver_server_ NVFlinger HOSBinderDriver server instance.
|
||||
/// @param service_context_ The ServiceContext for the owning service.
|
||||
/// @param name_ The name for this display.
|
||||
/// @param system_ The global system instance.
|
||||
///
|
||||
Display(u64 id, std::string name_, NVFlinger::HosBinderDriverServer& hos_binder_driver_server_,
|
||||
KernelHelpers::ServiceContext& service_context_, Core::System& system_);
|
||||
~Display();
|
||||
|
||||
/// Gets the unique ID assigned to this display.
|
||||
u64 GetID() const {
|
||||
return display_id;
|
||||
}
|
||||
|
||||
/// Gets the name of this display
|
||||
const std::string& GetName() const {
|
||||
return name;
|
||||
}
|
||||
|
||||
/// Whether or not this display has any layers added to it.
|
||||
bool HasLayers() const {
|
||||
return !layers.empty();
|
||||
}
|
||||
|
||||
/// Gets a layer for this display based off an index.
|
||||
Layer& GetLayer(std::size_t index);
|
||||
|
||||
/// Gets a layer for this display based off an index.
|
||||
const Layer& GetLayer(std::size_t index) const;
|
||||
|
||||
std::size_t GetNumLayers() const {
|
||||
return layers.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the internal vsync event.
|
||||
*
|
||||
* @returns The internal Vsync event if it has not yet been retrieved,
|
||||
* VI::ResultPermissionDenied otherwise.
|
||||
*/
|
||||
[[nodiscard]] ResultVal<Kernel::KReadableEvent*> GetVSyncEvent();
|
||||
|
||||
/// Gets the internal vsync event.
|
||||
Kernel::KReadableEvent* GetVSyncEventUnchecked();
|
||||
|
||||
/// Signals the internal vsync event.
|
||||
void SignalVSyncEvent();
|
||||
|
||||
/// Creates and adds a layer to this display with the given ID.
|
||||
///
|
||||
/// @param layer_id The ID to assign to the created layer.
|
||||
/// @param binder_id The ID assigned to the buffer queue.
|
||||
///
|
||||
void CreateLayer(u64 layer_id, u32 binder_id, Service::Nvidia::NvCore::Container& core);
|
||||
|
||||
/// Closes and removes a layer from this display with the given ID.
|
||||
///
|
||||
/// @param layer_id The ID assigned to the layer to close.
|
||||
///
|
||||
void CloseLayer(u64 layer_id);
|
||||
|
||||
/// Resets the display for a new connection.
|
||||
void Reset() {
|
||||
layers.clear();
|
||||
got_vsync_event = false;
|
||||
}
|
||||
|
||||
/// Attempts to find a layer with the given ID.
|
||||
///
|
||||
/// @param layer_id The layer ID.
|
||||
///
|
||||
/// @returns If found, the Layer instance with the given ID.
|
||||
/// If not found, then nullptr is returned.
|
||||
///
|
||||
Layer* FindLayer(u64 layer_id);
|
||||
|
||||
/// Attempts to find a layer with the given ID.
|
||||
///
|
||||
/// @param layer_id The layer ID.
|
||||
///
|
||||
/// @returns If found, the Layer instance with the given ID.
|
||||
/// If not found, then nullptr is returned.
|
||||
///
|
||||
const Layer* FindLayer(u64 layer_id) const;
|
||||
|
||||
private:
|
||||
u64 display_id;
|
||||
std::string name;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
KernelHelpers::ServiceContext& service_context;
|
||||
|
||||
std::vector<std::unique_ptr<Layer>> layers;
|
||||
Kernel::KEvent* vsync_event{};
|
||||
bool got_vsync_event{false};
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/vi/layer/vi_layer.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
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;
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/vi/layer/vi_layer.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
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;
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Service::android {
|
||||
class BufferItemConsumer;
|
||||
class BufferQueueCore;
|
||||
class BufferQueueProducer;
|
||||
} // namespace Service::android
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
/// Represents a single display layer.
|
||||
class Layer {
|
||||
public:
|
||||
/// Constructs a layer with a given ID and buffer queue.
|
||||
///
|
||||
/// @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 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
|
||||
android::BufferQueueProducer& binder_,
|
||||
std::shared_ptr<android::BufferItemConsumer>&& consumer_);
|
||||
~Layer();
|
||||
|
||||
Layer(const Layer&) = delete;
|
||||
Layer& operator=(const Layer&) = delete;
|
||||
|
||||
Layer(Layer&&) = default;
|
||||
Layer& operator=(Layer&&) = delete;
|
||||
|
||||
/// Gets the ID for this layer.
|
||||
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.
|
||||
android::BufferQueueProducer& GetBufferQueue() {
|
||||
return binder;
|
||||
}
|
||||
|
||||
/// Gets a const reference to the buffer queue this layer is using.
|
||||
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:
|
||||
const u64 layer_id;
|
||||
const u32 binder_id;
|
||||
android::BufferQueueCore& core;
|
||||
android::BufferQueueProducer& binder;
|
||||
std::shared_ptr<android::BufferItemConsumer> consumer;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Service::android {
|
||||
class BufferItemConsumer;
|
||||
class BufferQueueCore;
|
||||
class BufferQueueProducer;
|
||||
} // namespace Service::android
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
/// Represents a single display layer.
|
||||
class Layer {
|
||||
public:
|
||||
/// Constructs a layer with a given ID and buffer queue.
|
||||
///
|
||||
/// @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 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
|
||||
android::BufferQueueProducer& binder_,
|
||||
std::shared_ptr<android::BufferItemConsumer>&& consumer_);
|
||||
~Layer();
|
||||
|
||||
Layer(const Layer&) = delete;
|
||||
Layer& operator=(const Layer&) = delete;
|
||||
|
||||
Layer(Layer&&) = default;
|
||||
Layer& operator=(Layer&&) = delete;
|
||||
|
||||
/// Gets the ID for this layer.
|
||||
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.
|
||||
android::BufferQueueProducer& GetBufferQueue() {
|
||||
return binder;
|
||||
}
|
||||
|
||||
/// Gets a const reference to the buffer queue this layer is using.
|
||||
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:
|
||||
const u64 layer_id;
|
||||
const u32 binder_id;
|
||||
android::BufferQueueCore& core;
|
||||
android::BufferQueueProducer& binder;
|
||||
std::shared_ptr<android::BufferItemConsumer> consumer;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +1,60 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
enum class DisplayResolution : u32 {
|
||||
DockedWidth = 1920,
|
||||
DockedHeight = 1080,
|
||||
UndockedWidth = 1280,
|
||||
UndockedHeight = 720,
|
||||
};
|
||||
|
||||
/// Permission level for a particular VI service instance
|
||||
enum class Permission {
|
||||
User,
|
||||
System,
|
||||
Manager,
|
||||
};
|
||||
|
||||
/// A policy type that may be requested via GetDisplayService and
|
||||
/// GetDisplayServiceWithProxyNameExchange
|
||||
enum class Policy {
|
||||
User,
|
||||
Compositor,
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
void GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, Core::System& system,
|
||||
NVFlinger::NVFlinger& nv_flinger,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server,
|
||||
Permission permission);
|
||||
} // namespace detail
|
||||
|
||||
/// Registers all VI services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system,
|
||||
NVFlinger::NVFlinger& nv_flinger,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server);
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
enum class DisplayResolution : u32 {
|
||||
DockedWidth = 1920,
|
||||
DockedHeight = 1080,
|
||||
UndockedWidth = 1280,
|
||||
UndockedHeight = 720,
|
||||
};
|
||||
|
||||
/// Permission level for a particular VI service instance
|
||||
enum class Permission {
|
||||
User,
|
||||
System,
|
||||
Manager,
|
||||
};
|
||||
|
||||
/// A policy type that may be requested via GetDisplayService and
|
||||
/// GetDisplayServiceWithProxyNameExchange
|
||||
enum class Policy {
|
||||
User,
|
||||
Compositor,
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
void GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, Core::System& system,
|
||||
NVFlinger::NVFlinger& nv_flinger,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server,
|
||||
Permission permission);
|
||||
} // namespace detail
|
||||
|
||||
/// Registers all VI services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system,
|
||||
NVFlinger::NVFlinger& nv_flinger,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server);
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_m.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_M::VI_M(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:m"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{2, &VI_M::GetDisplayService, "GetDisplayService"},
|
||||
{3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_M::~VI_M() = default;
|
||||
|
||||
void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::Manager);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_m.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_M::VI_M(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:m"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{2, &VI_M::GetDisplayService, "GetDisplayService"},
|
||||
{3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_M::~VI_M() = default;
|
||||
|
||||
void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::Manager);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_M final : public ServiceFramework<VI_M> {
|
||||
public:
|
||||
explicit VI_M(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_M() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_M final : public ServiceFramework<VI_M> {
|
||||
public:
|
||||
explicit VI_M(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_M() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
constexpr Result ResultOperationFailed{ErrorModule::VI, 1};
|
||||
constexpr Result ResultPermissionDenied{ErrorModule::VI, 5};
|
||||
constexpr Result ResultNotSupported{ErrorModule::VI, 6};
|
||||
constexpr Result ResultNotFound{ErrorModule::VI, 7};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
constexpr Result ResultOperationFailed{ErrorModule::VI, 1};
|
||||
constexpr Result ResultPermissionDenied{ErrorModule::VI, 5};
|
||||
constexpr Result ResultNotSupported{ErrorModule::VI, 6};
|
||||
constexpr Result ResultNotFound{ErrorModule::VI, 7};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_s.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_S::VI_S(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:s"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{1, &VI_S::GetDisplayService, "GetDisplayService"},
|
||||
{3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_S::~VI_S() = default;
|
||||
|
||||
void VI_S::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::System);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_s.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_S::VI_S(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:s"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{1, &VI_S::GetDisplayService, "GetDisplayService"},
|
||||
{3, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_S::~VI_S() = default;
|
||||
|
||||
void VI_S::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::System);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_S final : public ServiceFramework<VI_S> {
|
||||
public:
|
||||
explicit VI_S(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_S() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_S final : public ServiceFramework<VI_S> {
|
||||
public:
|
||||
explicit VI_S(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_S() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_u.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_U::VI_U(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:u"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &VI_U::GetDisplayService, "GetDisplayService"},
|
||||
{1, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_U::~VI_U() = default;
|
||||
|
||||
void VI_U::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::User);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_u.h"
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
VI_U::VI_U(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "vi:u"}, nv_flinger{nv_flinger_}, hos_binder_driver_server{
|
||||
hos_binder_driver_server_} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &VI_U::GetDisplayService, "GetDisplayService"},
|
||||
{1, nullptr, "GetDisplayServiceWithProxyNameExchange"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
VI_U::~VI_U() = default;
|
||||
|
||||
void VI_U::GetDisplayService(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
detail::GetDisplayServiceImpl(ctx, system, nv_flinger, hos_binder_driver_server,
|
||||
Permission::User);
|
||||
}
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_U final : public ServiceFramework<VI_U> {
|
||||
public:
|
||||
explicit VI_U(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_U() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class HosBinderDriverServer;
|
||||
class NVFlinger;
|
||||
} // namespace Service::NVFlinger
|
||||
|
||||
namespace Service::VI {
|
||||
|
||||
class VI_U final : public ServiceFramework<VI_U> {
|
||||
public:
|
||||
explicit VI_U(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_,
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server_);
|
||||
~VI_U() override;
|
||||
|
||||
private:
|
||||
void GetDisplayService(Kernel::HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nv_flinger;
|
||||
NVFlinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
Reference in New Issue
Block a user