Skip to content

Commit

Permalink
[PRIVILIGEDREQUEST] Interface changes, adapted the compositor for it. (
Browse files Browse the repository at this point in the history
  • Loading branch information
pwielders authored Feb 12, 2025
1 parent c7db50c commit 5b0c8af
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
54 changes: 39 additions & 15 deletions Compositor/lib/Mesa/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,30 @@ namespace Plugin {
}; // class Client

class Bridge : public Core::PrivilegedRequest {
private:
class Callback : public Core::PrivilegedRequest::ICallback {
public:
Callback() = delete;
Callback(Callback&&) = delete;
Callback(const Callback&) = delete;
Callback& operator=(Callback&&) = delete;
Callback& operator=(const Callback&) = delete;

Callback(Bridge& parent) : _parent(parent) {}
~Callback() override = default;

public:
void Request(const uint32_t id, Container& descriptors) override {
_parent.Request(id, descriptors);
}
void Offer(const uint32_t id, Container&& descriptors) override {
_parent.Offer(id, std::move(descriptors));
}

private:
Bridge& _parent;
};

public:
Bridge() = delete;
Bridge(Bridge&&) = delete;
Expand All @@ -358,30 +382,30 @@ namespace Plugin {
Close();
}

public:
uint8_t Service(const uint32_t id, const uint8_t maxSize, int container[]) override
{
uint8_t result(0);

ASSERT(maxSize > 0);

private:
void Request(const uint32_t id, Container& descriptors) {
if (id == DisplayId) {
container[0] = _parent.Native();
result = 1;
} else {
descriptors.emplace_back(static_cast<int>(_parent.Native()));
}
else {
Core::ProxyType<Client> client = _parent.ClientById(id);

if (client.IsValid() == false) {
TRACE(Trace::Information, (_T("Bridge for Id [%d] not found"), id));
} else {
result = client->Descriptors(maxSize, container);
}
else {
int container[Core::PrivilegedRequest::MaxDescriptorsPerRequest];
uint8_t result = client->Descriptors(sizeof(container), container);

for (uint8_t index = 0; index < result; index++) {
descriptors.emplace_back(container[index]);
}
}
}

return result;
}
void Offer(const uint32_t id, Container&& descriptors) {
}

private:
CompositorImplementation& _parent;
}; // class Bridge

Expand Down
2 changes: 0 additions & 2 deletions Compositor/lib/Mesa/backend/src/DRM/Legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ namespace Thunder {

uint32_t result = Core::ERROR_NONE;

ASSERT(connector != nullptr);
ASSERT(connector.CrtController() != nullptr);
ASSERT(connector.Plane() != nullptr);

uint32_t connectorId(connector.Properties().Id());
const uint32_t crtcId(connector.CrtController().Id());
Expand Down

0 comments on commit 5b0c8af

Please sign in to comment.