pvr_stream.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
  2. /* Copyright (c) 2023 Imagination Technologies Ltd. */
  3. #ifndef PVR_STREAM_H
  4. #define PVR_STREAM_H
  5. #include <linux/bits.h>
  6. #include <linux/limits.h>
  7. #include <linux/types.h>
  8. struct pvr_device;
  9. struct pvr_job;
  10. enum pvr_stream_type {
  11. PVR_STREAM_TYPE_GEOM = 0,
  12. PVR_STREAM_TYPE_FRAG,
  13. PVR_STREAM_TYPE_COMPUTE,
  14. PVR_STREAM_TYPE_TRANSFER,
  15. PVR_STREAM_TYPE_STATIC_RENDER_CONTEXT,
  16. PVR_STREAM_TYPE_STATIC_COMPUTE_CONTEXT,
  17. PVR_STREAM_TYPE_MAX
  18. };
  19. enum pvr_stream_size {
  20. PVR_STREAM_SIZE_8 = 0,
  21. PVR_STREAM_SIZE_16,
  22. PVR_STREAM_SIZE_32,
  23. PVR_STREAM_SIZE_64,
  24. PVR_STREAM_SIZE_ARRAY,
  25. };
  26. #define PVR_FEATURE_NOT BIT(31)
  27. #define PVR_FEATURE_NONE U32_MAX
  28. struct pvr_stream_def {
  29. u32 offset;
  30. enum pvr_stream_size size;
  31. u32 array_size;
  32. u32 feature;
  33. };
  34. struct pvr_stream_ext_def {
  35. const struct pvr_stream_def *stream;
  36. u32 stream_len;
  37. u32 header_mask;
  38. u32 quirk;
  39. };
  40. struct pvr_stream_ext_header {
  41. const struct pvr_stream_ext_def *ext_streams;
  42. u32 ext_streams_num;
  43. u32 valid_mask;
  44. };
  45. struct pvr_stream_cmd_defs {
  46. enum pvr_stream_type type;
  47. const struct pvr_stream_def *main_stream;
  48. u32 main_stream_len;
  49. u32 ext_nr_headers;
  50. const struct pvr_stream_ext_header *ext_headers;
  51. size_t dest_size;
  52. };
  53. int
  54. pvr_stream_process(struct pvr_device *pvr_dev, const struct pvr_stream_cmd_defs *cmd_defs,
  55. void *stream, u32 stream_size, void *dest_out);
  56. void
  57. pvr_stream_create_musthave_masks(struct pvr_device *pvr_dev);
  58. #endif /* PVR_STREAM_H */