pvr_rogue_fwif_stream.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
  2. /* Copyright (c) 2023 Imagination Technologies Ltd. */
  3. #ifndef PVR_ROGUE_FWIF_STREAM_H
  4. #define PVR_ROGUE_FWIF_STREAM_H
  5. /**
  6. * DOC: Streams
  7. *
  8. * Commands are submitted to the kernel driver in the form of streams.
  9. *
  10. * A command stream has the following layout :
  11. * - A 64-bit header containing:
  12. * * A u32 containing the length of the main stream inclusive of the length of the header.
  13. * * A u32 for padding.
  14. * - The main stream data.
  15. * - The extension stream (optional), which is composed of:
  16. * * One or more headers.
  17. * * The extension stream data, corresponding to the extension headers.
  18. *
  19. * The main stream provides the base command data. This has a fixed layout based on the features
  20. * supported by a given GPU.
  21. *
  22. * The extension stream provides the command parameters that are required for BRNs & ERNs for the
  23. * current GPU. This stream is comprised of one or more headers, followed by data for each given
  24. * BRN/ERN.
  25. *
  26. * Each header is a u32 containing a bitmask of quirks & enhancements in the extension stream, a
  27. * "type" field determining the set of quirks & enhancements the bitmask represents, and a
  28. * continuation bit determining whether any more headers are present. The headers are then followed
  29. * by command data; this is specific to each quirk/enhancement. All unused / reserved bits in the
  30. * header must be set to 0.
  31. *
  32. * All parameters and headers in the main and extension streams must be naturally aligned.
  33. *
  34. * If a parameter appears in both the main and extension streams, then the extension parameter is
  35. * used.
  36. */
  37. /*
  38. * Stream extension header definition
  39. */
  40. #define PVR_STREAM_EXTHDR_TYPE_SHIFT 29U
  41. #define PVR_STREAM_EXTHDR_TYPE_MASK (7U << PVR_STREAM_EXTHDR_TYPE_SHIFT)
  42. #define PVR_STREAM_EXTHDR_TYPE_MAX 8U
  43. #define PVR_STREAM_EXTHDR_CONTINUATION BIT(28U)
  44. #define PVR_STREAM_EXTHDR_DATA_MASK ~(PVR_STREAM_EXTHDR_TYPE_MASK | PVR_STREAM_EXTHDR_CONTINUATION)
  45. /*
  46. * Stream extension header - Geometry 0
  47. */
  48. #define PVR_STREAM_EXTHDR_TYPE_GEOM0 0U
  49. #define PVR_STREAM_EXTHDR_GEOM0_BRN49927 BIT(0U)
  50. #define PVR_STREAM_EXTHDR_GEOM0_VALID PVR_STREAM_EXTHDR_GEOM0_BRN49927
  51. /*
  52. * Stream extension header - Fragment 0
  53. */
  54. #define PVR_STREAM_EXTHDR_TYPE_FRAG0 0U
  55. #define PVR_STREAM_EXTHDR_FRAG0_BRN47217 BIT(0U)
  56. #define PVR_STREAM_EXTHDR_FRAG0_BRN49927 BIT(1U)
  57. #define PVR_STREAM_EXTHDR_FRAG0_VALID PVR_STREAM_EXTHDR_FRAG0_BRN49927
  58. /*
  59. * Stream extension header - Compute 0
  60. */
  61. #define PVR_STREAM_EXTHDR_TYPE_COMPUTE0 0U
  62. #define PVR_STREAM_EXTHDR_COMPUTE0_BRN49927 BIT(0U)
  63. #define PVR_STREAM_EXTHDR_COMPUTE0_VALID PVR_STREAM_EXTHDR_COMPUTE0_BRN49927
  64. #endif /* PVR_ROGUE_FWIF_STREAM_H */