| // Copyright 2023 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.gpu.mali; |
| |
| using zx; |
| |
| type MaliProperties = table { |
| 1: supports_protected_mode bool; |
| |
| /// If true, the driver should use Enter/StartExit/FinishExit protected mode |
| /// callbacks rather than entering protected mode directly with register |
| /// writes. |
| 2: use_protected_mode_callbacks bool; |
| }; |
| |
| /// Low-level protocol between ARM Mali GPU driver and low-level SoC driver. |
| @discoverable |
| @transport("Driver") |
| closed protocol ArmMali { |
| strict GetProperties() -> (struct { |
| properties MaliProperties; |
| }); |
| |
| /// Cause the GPU to enter protected mode. All buses must be idle and the L2 |
| /// cache cleared before executing this command. |
| strict EnterProtectedMode() -> () error zx.Status; |
| |
| /// Start the process of exiting protected mode. All buses must be idle and |
| /// the L2 cache cleared before executing this command. The GPU will not be |
| /// able to access any memory after this command is complete and will be |
| /// reset. The driver must wait for the reset to complete then call |
| /// FinishExitProtectedMode(). |
| strict StartExitProtectedMode() -> () error zx.Status; |
| |
| /// Allows the GPU to access non-protected memory. Must only be called after |
| /// StartExitProtectedMode. The RESET_COMPLETED bit in the GPU_IRQ_RAWSTAT |
| /// register must be set while this is called. |
| strict FinishExitProtectedMode() -> () error zx.Status; |
| }; |
| |
| /// Low-level protocol exposed by the ARM Mali GPU driver to allow fine-grained management. Used |
| /// mainly for testing and debugging the driver. |
| closed protocol MaliUtils { |
| /// Set whether the GPU is powered on or off. Returns after the transition is complete. |
| strict SetPowerState(struct { |
| enabled bool; |
| }) -> () error zx.Status; |
| }; |
| |
| service Service { |
| arm_mali client_end:ArmMali; |
| }; |