blob: 3f9a475b6e799cfb87844067c1f0ce1e2320666b [file] [log] [blame]
// Copyright 2018 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.intelgpucore;
using zx;
const IMAGE_TYPE_X_TILED uint32 = 1;
const IMAGE_TYPE_Y_LEGACY_TILED uint32 = 2;
const IMAGE_TYPE_YF_TILED uint32 = 3;
@transport("Banjo")
@banjo_layout("ddk-callback")
protocol IntelGpuCoreInterrupt {
Callback(struct {
master_interrupt_control uint32;
timestamp uint64;
}) -> ();
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
protocol IntelGpuCore {
/// Reads 16 bits from pci config space; returned in |value_out|.
ReadPciConfig16(struct {
addr uint16;
}) -> (struct {
s zx.status;
value uint16;
});
/// Maps the given |pci_bar|; address returned in |addr_out|, size in bytes returned in
/// |size_out|.
MapPciMmio(struct {
pci_bar uint32;
}) -> (struct {
s zx.status;
@buffer
@callee_allocated
buf vector<uint8>:MAX;
});
/// Unmaps the given |pci_bar|.
UnmapPciMmio(struct {
pci_bar uint32;
}) -> (struct {
s zx.status;
});
/// Returns a bus transaction initiator.
GetPciBti(struct {
index uint32;
}) -> (resource struct {
s zx.status;
bti zx.handle:BTI;
});
/// Registers the given |callback| to be invoked with parameter |data| when an interrupt occurs
/// matching |interrupt_mask|.
RegisterInterruptCallback(resource struct {
callback client_end:IntelGpuCoreInterrupt;
interrupt_mask uint32;
}) -> (struct {
s zx.status;
});
/// Un-registers a previously registered interrupt callback.
UnregisterInterruptCallback() -> (struct {
s zx.status;
});
/// Returns the size of the GTT (global translation table) in bytes.
GttGetSize() -> (struct {
size uint64;
});
/// Allocates a region of the GTT of the given |page_count|, returning the page-aligned virtual
/// address in |addr_out|.
GttAlloc(struct {
page_count uint64;
}) -> (struct {
s zx.status;
addr uint64;
});
/// Frees the GTT allocation given by |addr|.
GttFree(struct {
addr uint64;
}) -> (struct {
s zx.status;
});
/// Clears the page table entries for the GTT allocation given by |addr|.
GttClear(struct {
addr uint64;
}) -> (struct {
s zx.status;
});
/// Inserts page tables entries for the GTT allocation given by |addr| for the vmo represented by
/// handle |buffer|, at the given |page_offset| and |page_count|. Takes ownership of |buffer|.
GttInsert(resource struct {
addr uint64;
buffer zx.handle:VMO;
page_offset uint64;
page_count uint64;
}) -> (struct {
s zx.status;
});
};