blob: d2d77f3b034dba4fba2db5e8dad65ba40153710d [file] [log] [blame] [edit]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// AGIS - Android GPU Inspector Service
library fuchsia.gpu.agis;
using zx;
/// AGIS provides FIDL services that facilitate Vulkan command tracing.
/// It acts as an intermediary between gapii, the Android GPU Inspector
/// interposing shared library and Vulkan layer, and the host Android GPU
/// Inspector application.
type Connection = resource table {
1: process_id zx.koid;
2: process_name string:zx.MAX_NAME_LEN;
3: port uint16;
};
/// Max connections that may be registered.
const MAX_CONNECTIONS uint32 = 128;
type Status = strict enum {
OK = 0;
NOT_FOUND = 1;
ALREADY_REGISTERED = 2;
CONNECTIONS_EXCEEDED = 3;
INTERNAL_ERROR = 4;
UNIMPLEMENTED = 5;
};
/// The AGIS Session protocol allows traceable components to register their
/// presence upon launch and to retrieve sockets for communication to
/// gapis, the host service module of AGI.
@discoverable
protocol Session {
/// Register a process as traceable and retrieve its bound socket.
/// For AGI, gapii will be the only client of this Register interface.
Register(struct {
process_id zx.koid;
process_name string:zx.MAX_NAME_LEN;
}) -> (resource struct {
gapii_socket zx.handle:optional;
}) error Status;
/// Remove an entry from the registry.
Unregister(struct {
process_id zx.koid;
}) -> (struct {}) error Status;
/// gapis-side interface to retrieve available connections.
Connections() -> (resource struct {
connections vector<Connection>:MAX_CONNECTIONS;
}) error Status;
};