brintos

brintos / linux-shallow public Read only

0
0
Text · 2.6 KiB · 1c2c4eb Raw
79 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only OR MIT */2/* Copyright (c) 2023 Imagination Technologies Ltd. */3 4#ifndef PVR_ROGUE_FWIF_STREAM_H5#define PVR_ROGUE_FWIF_STREAM_H6 7/**8 * DOC: Streams9 *10 * Commands are submitted to the kernel driver in the form of streams.11 *12 * A command stream has the following layout :13 *  - A 64-bit header containing:14 *    * A u32 containing the length of the main stream inclusive of the length of the header.15 *    * A u32 for padding.16 *  - The main stream data.17 *  - The extension stream (optional), which is composed of:18 *    * One or more headers.19 *    * The extension stream data, corresponding to the extension headers.20 *21 * The main stream provides the base command data. This has a fixed layout based on the features22 * supported by a given GPU.23 *24 * The extension stream provides the command parameters that are required for BRNs & ERNs for the25 * current GPU. This stream is comprised of one or more headers, followed by data for each given26 * BRN/ERN.27 *28 * Each header is a u32 containing a bitmask of quirks & enhancements in the extension stream, a29 * "type" field determining the set of quirks & enhancements the bitmask represents, and a30 * continuation bit determining whether any more headers are present. The headers are then followed31 * by command data; this is specific to each quirk/enhancement. All unused / reserved bits in the32 * header must be set to 0.33 *34 * All parameters and headers in the main and extension streams must be naturally aligned.35 *36 * If a parameter appears in both the main and extension streams, then the extension parameter is37 * used.38 */39 40/*41 * Stream extension header definition42 */43#define PVR_STREAM_EXTHDR_TYPE_SHIFT 29U44#define PVR_STREAM_EXTHDR_TYPE_MASK (7U << PVR_STREAM_EXTHDR_TYPE_SHIFT)45#define PVR_STREAM_EXTHDR_TYPE_MAX 8U46#define PVR_STREAM_EXTHDR_CONTINUATION BIT(28U)47 48#define PVR_STREAM_EXTHDR_DATA_MASK ~(PVR_STREAM_EXTHDR_TYPE_MASK | PVR_STREAM_EXTHDR_CONTINUATION)49 50/*51 * Stream extension header - Geometry 052 */53#define PVR_STREAM_EXTHDR_TYPE_GEOM0 0U54 55#define PVR_STREAM_EXTHDR_GEOM0_BRN49927 BIT(0U)56 57#define PVR_STREAM_EXTHDR_GEOM0_VALID PVR_STREAM_EXTHDR_GEOM0_BRN4992758 59/*60 * Stream extension header - Fragment 061 */62#define PVR_STREAM_EXTHDR_TYPE_FRAG0 0U63 64#define PVR_STREAM_EXTHDR_FRAG0_BRN47217 BIT(0U)65#define PVR_STREAM_EXTHDR_FRAG0_BRN49927 BIT(1U)66 67#define PVR_STREAM_EXTHDR_FRAG0_VALID PVR_STREAM_EXTHDR_FRAG0_BRN4992768 69/*70 * Stream extension header - Compute 071 */72#define PVR_STREAM_EXTHDR_TYPE_COMPUTE0 0U73 74#define PVR_STREAM_EXTHDR_COMPUTE0_BRN49927 BIT(0U)75 76#define PVR_STREAM_EXTHDR_COMPUTE0_VALID PVR_STREAM_EXTHDR_COMPUTE0_BRN4992777 78#endif /* PVR_ROGUE_FWIF_STREAM_H */79