blob: c361c7ebf426b54c114ea00d694cde642f27fcd8 [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_TILING_TYPE_X_TILED uint32 = 1;
const IMAGE_TILING_TYPE_Y_LEGACY_TILED uint32 = 2;
const IMAGE_TILING_TYPE_YF_TILED uint32 = 3;
@transport("Banjo")
@banjo_layout("ddk-callback")
closed protocol IntelGpuCoreInterrupt {
strict Callback(struct {
master_interrupt_control uint32;
timestamp uint64;
}) -> ();
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
closed protocol IntelGpuCore {
/// Reads 16 bits from pci config space; returned in |value_out|.
strict 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|.
strict MapPciMmio(struct {
pci_bar uint32;
}) -> (struct {
s zx.Status;
@buffer
@callee_allocated
buf vector<uint8>:MAX;
});
/// Unmaps the given |pci_bar|.
strict UnmapPciMmio(struct {
pci_bar uint32;
}) -> (struct {
s zx.Status;
});
/// Returns a bus transaction initiator.
strict 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|.
strict RegisterInterruptCallback(resource struct {
callback client_end:IntelGpuCoreInterrupt;
interrupt_mask uint32;
}) -> (struct {
s zx.Status;
});
/// Un-registers a previously registered interrupt callback.
strict UnregisterInterruptCallback() -> (struct {
s zx.Status;
});
/// Returns the size of the GTT (global translation table) in bytes.
strict GttGetSize() -> (struct {
size uint64;
});
/// Allocates a region of the GTT of the given |page_count|, returning the page-aligned virtual
/// address in |addr_out|.
strict GttAlloc(struct {
page_count uint64;
}) -> (struct {
s zx.Status;
addr uint64;
});
/// Frees the GTT allocation given by |addr|.
strict GttFree(struct {
addr uint64;
}) -> (struct {
s zx.Status;
});
/// Clears the page table entries for the GTT allocation given by |addr|.
strict 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|.
strict GttInsert(resource struct {
addr uint64;
buffer zx.Handle:VMO;
page_offset uint64;
page_count uint64;
}) -> (struct {
s zx.Status;
});
};