blob: 2e7c39b25cc6aa01d033ed8789b332bb2e0cf697 [file] [log] [blame]
// Copyright 2019 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.
library fuchsia.hardware.goldfish;
using zx;
/// Color buffer formats.
enum ColorBufferFormatType : uint32 {
RGBA = 0x1908;
BGRA = 0x80E1;
};
/// Interface for the Goldfish control driver providing color buffers.
[Layout = "Simple"]
protocol ControlDevice {
/// Create shared color buffer. Color buffer is automatically freed when
/// all references to `vmo` have been closed. Fails if VMO is not
/// associated with goldfish heap memory.
/// Returns ZX_ERR_ALREADY_EXISTS if color buffer has already been created.
CreateColorBuffer(handle<vmo> vmo,
uint32 width,
uint32 height,
ColorBufferFormatType format)
-> (zx.status res);
/// Get color buffer for VMO. Fails if VMO is not associated with a color
/// buffer.
GetColorBuffer(handle<vmo> vmo) -> (zx.status res, uint32 id);
};