intel_lrc_reg.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * SPDX-License-Identifier: MIT
  3. *
  4. * Copyright © 2014-2018 Intel Corporation
  5. */
  6. #ifndef _INTEL_LRC_REG_H_
  7. #define _INTEL_LRC_REG_H_
  8. #include <linux/types.h>
  9. /* GEN8+ Reg State Context */
  10. #define CTX_LRI_HEADER_0 0x01
  11. #define CTX_CONTEXT_CONTROL 0x02
  12. #define CTX_RING_HEAD 0x04
  13. #define CTX_RING_TAIL 0x06
  14. #define CTX_RING_BUFFER_START 0x08
  15. #define CTX_RING_BUFFER_CONTROL 0x0a
  16. #define CTX_BB_HEAD_U 0x0c
  17. #define CTX_BB_HEAD_L 0x0e
  18. #define CTX_BB_STATE 0x10
  19. #define CTX_SECOND_BB_HEAD_U 0x12
  20. #define CTX_SECOND_BB_HEAD_L 0x14
  21. #define CTX_SECOND_BB_STATE 0x16
  22. #define CTX_BB_PER_CTX_PTR 0x18
  23. #define CTX_RCS_INDIRECT_CTX 0x1a
  24. #define CTX_RCS_INDIRECT_CTX_OFFSET 0x1c
  25. #define CTX_LRI_HEADER_1 0x21
  26. #define CTX_CTX_TIMESTAMP 0x22
  27. #define CTX_PDP3_UDW 0x24
  28. #define CTX_PDP3_LDW 0x26
  29. #define CTX_PDP2_UDW 0x28
  30. #define CTX_PDP2_LDW 0x2a
  31. #define CTX_PDP1_UDW 0x2c
  32. #define CTX_PDP1_LDW 0x2e
  33. #define CTX_PDP0_UDW 0x30
  34. #define CTX_PDP0_LDW 0x32
  35. #define CTX_LRI_HEADER_2 0x41
  36. #define CTX_R_PWR_CLK_STATE 0x42
  37. #define CTX_GPGPU_CSR_BASE_ADDRESS 0x44
  38. #define CTX_REG(reg_state, pos, reg, val) do { \
  39. u32 *reg_state__ = (reg_state); \
  40. const u32 pos__ = (pos); \
  41. (reg_state__)[(pos__) + 0] = i915_mmio_reg_offset(reg); \
  42. (reg_state__)[(pos__) + 1] = (val); \
  43. } while (0)
  44. #define ASSIGN_CTX_PDP(ppgtt, reg_state, n) do { \
  45. u32 *reg_state__ = (reg_state); \
  46. const u64 addr__ = i915_page_dir_dma_addr((ppgtt), (n)); \
  47. (reg_state__)[CTX_PDP ## n ## _UDW + 1] = upper_32_bits(addr__); \
  48. (reg_state__)[CTX_PDP ## n ## _LDW + 1] = lower_32_bits(addr__); \
  49. } while (0)
  50. #define ASSIGN_CTX_PML4(ppgtt, reg_state) do { \
  51. u32 *reg_state__ = (reg_state); \
  52. const u64 addr__ = px_dma(&ppgtt->pml4); \
  53. (reg_state__)[CTX_PDP0_UDW + 1] = upper_32_bits(addr__); \
  54. (reg_state__)[CTX_PDP0_LDW + 1] = lower_32_bits(addr__); \
  55. } while (0)
  56. #define GEN8_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x17
  57. #define GEN9_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x26
  58. #define GEN10_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x19
  59. #define GEN11_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x1A
  60. #endif /* _INTEL_LRC_REG_H_ */