blob: 1c8baa8d3e79bf3d86be62313f5d80130321c3eb [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.sysmem;
// An interface for accessing a collection of buffers which were allocated
// together as a group by an |Allocator| on behalf of one of its clients.
//
// Individual buffers within the collection are identified by their zero-based
// index. All of the buffers have the same characteristics.
interface BufferCollection {
// Gets information about the buffer collection, including its handles.
1: GetInfo() -> (BufferCollectionInfo info);
};
// Information about a buffer collection and its buffers.
// TODO(ZX-2260): change struct to table
struct BufferCollectionInfo {
// The number of buffers in the collection.
uint32 bufferCount;
// Describes how the contents of buffers are represented.
// All buffers within the collection have the same format.
BufferFormat format;
// VMO handles for each buffer in the collection.
// This vector is only present when the buffers are backed by VMOs.
//
// If present, the count of this vector equals |numBuffers|.
// All buffer VMO handles have identical size and access rights.
// The VMO access rights are determined based on the usages which the
// client specified when allocating the buffer collection. For example,
// a client which expressed a read-only usage will receive VMOs without
// write rights.
vector<handle<vmo>>:64 vmos;
// The size of each VMO provided.
// This property is only present when the buffers are backed by VMOs.
uint64 vmoSize = 0;
};