Skip to content

Commit b79e8fd

Browse files
lucasdemarchirodrigovivi
authored andcommitted
drm/xe: Remove dependency on intel_engine_regs.h
Create regs/xe_engine_regs.h file with all the registers and bit definitions used by the xe driver. Eventually the registers may be defined in a different way and since xe doesn't supported below gen12, the number of registers touched is much smaller, so create a new header. The definitions themselves are direct copy from the gt/intel_engine_regs.h file, just sorting the registers by address. Cleaning those up and adhering to a common coding style is left for later. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent ea9f879 commit b79e8fd

File tree

9 files changed

+107
-8
lines changed

9 files changed

+107
-8
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2023 Intel Corporation
4+
*/
5+
6+
#ifndef _XE_ENGINE_REGS_H_
7+
#define _XE_ENGINE_REGS_H_
8+
9+
#include <asm/page.h>
10+
11+
#include "i915_reg_defs.h"
12+
13+
#define RING_TAIL(base) _MMIO((base) + 0x30)
14+
15+
#define RING_HEAD(base) _MMIO((base) + 0x34)
16+
#define HEAD_ADDR 0x001FFFFC
17+
18+
#define RING_START(base) _MMIO((base) + 0x38)
19+
20+
#define RING_CTL(base) _MMIO((base) + 0x3c)
21+
#define RING_CTL_SIZE(size) ((size) - PAGE_SIZE) /* in bytes -> pages */
22+
#define RING_CTL_SIZE(size) ((size) - PAGE_SIZE) /* in bytes -> pages */
23+
24+
#define RING_PSMI_CTL(base) _MMIO((base) + 0x50)
25+
#define GEN8_RC_SEMA_IDLE_MSG_DISABLE REG_BIT(12)
26+
#define GEN12_WAIT_FOR_EVENT_POWER_DOWN_DISABLE REG_BIT(7)
27+
28+
#define RING_ACTHD_UDW(base) _MMIO((base) + 0x5c)
29+
#define RING_DMA_FADD_UDW(base) _MMIO((base) + 0x60)
30+
#define RING_IPEIR(base) _MMIO((base) + 0x64)
31+
#define RING_IPEHR(base) _MMIO((base) + 0x68)
32+
#define RING_ACTHD(base) _MMIO((base) + 0x74)
33+
#define RING_DMA_FADD(base) _MMIO((base) + 0x78)
34+
#define RING_HWS_PGA(base) _MMIO((base) + 0x80)
35+
#define IPEIR(base) _MMIO((base) + 0x88)
36+
#define IPEHR(base) _MMIO((base) + 0x8c)
37+
#define RING_HWSTAM(base) _MMIO((base) + 0x98)
38+
#define RING_MI_MODE(base) _MMIO((base) + 0x9c)
39+
#define RING_NOPID(base) _MMIO((base) + 0x94)
40+
41+
#define RING_IMR(base) _MMIO((base) + 0xa8)
42+
#define RING_MAX_NONPRIV_SLOTS 12
43+
44+
#define RING_EIR(base) _MMIO((base) + 0xb0)
45+
#define RING_EMR(base) _MMIO((base) + 0xb4)
46+
#define RING_ESR(base) _MMIO((base) + 0xb8)
47+
#define RING_BBADDR(base) _MMIO((base) + 0x140)
48+
#define RING_BBADDR_UDW(base) _MMIO((base) + 0x168)
49+
#define RING_EXECLIST_STATUS_LO(base) _MMIO((base) + 0x234)
50+
#define RING_EXECLIST_STATUS_HI(base) _MMIO((base) + 0x234 + 4)
51+
52+
#define RING_CONTEXT_CONTROL(base) _MMIO((base) + 0x244)
53+
#define CTX_CTRL_INHIBIT_SYN_CTX_SWITCH REG_BIT(3)
54+
#define CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT REG_BIT(0)
55+
56+
#define RING_MODE_GEN7(base) _MMIO((base) + 0x29c)
57+
#define GEN11_GFX_DISABLE_LEGACY_MODE (1 << 3)
58+
59+
#define RING_TIMESTAMP(base) _MMIO((base) + 0x358)
60+
61+
#define RING_TIMESTAMP_UDW(base) _MMIO((base) + 0x358 + 4)
62+
#define RING_VALID_MASK 0x00000001
63+
#define RING_VALID 0x00000001
64+
#define STOP_RING REG_BIT(8)
65+
#define TAIL_ADDR 0x001FFFF8
66+
67+
#define RING_CTX_TIMESTAMP(base) _MMIO((base) + 0x3a8)
68+
69+
#define RING_FORCE_TO_NONPRIV(base, i) _MMIO(((base) + 0x4d0) + (i) * 4)
70+
#define RING_FORCE_TO_NONPRIV_DENY REG_BIT(30)
71+
#define RING_FORCE_TO_NONPRIV_ADDRESS_MASK REG_GENMASK(25, 2)
72+
#define RING_FORCE_TO_NONPRIV_ACCESS_RW (0 << 28)
73+
#define RING_FORCE_TO_NONPRIV_ACCESS_RD (1 << 28)
74+
#define RING_FORCE_TO_NONPRIV_ACCESS_WR (2 << 28)
75+
#define RING_FORCE_TO_NONPRIV_ACCESS_INVALID (3 << 28)
76+
#define RING_FORCE_TO_NONPRIV_ACCESS_MASK (3 << 28)
77+
#define RING_FORCE_TO_NONPRIV_RANGE_1 (0 << 0)
78+
#define RING_FORCE_TO_NONPRIV_RANGE_4 (1 << 0)
79+
#define RING_FORCE_TO_NONPRIV_RANGE_16 (2 << 0)
80+
#define RING_FORCE_TO_NONPRIV_RANGE_64 (3 << 0)
81+
#define RING_FORCE_TO_NONPRIV_RANGE_MASK (3 << 0)
82+
#define RING_FORCE_TO_NONPRIV_MASK_VALID (RING_FORCE_TO_NONPRIV_RANGE_MASK | \
83+
RING_FORCE_TO_NONPRIV_ACCESS_MASK | \
84+
RING_FORCE_TO_NONPRIV_DENY)
85+
#define RING_MAX_NONPRIV_SLOTS 12
86+
87+
#define RING_EXECLIST_SQ_CONTENTS(base) _MMIO((base) + 0x510)
88+
89+
#define RING_EXECLIST_CONTROL(base) _MMIO((base) + 0x550)
90+
#define EL_CTRL_LOAD REG_BIT(0)
91+
92+
#define VDBOX_CGCTL3F10(base) _MMIO((base) + 0x3f10)
93+
#define IECPUNIT_CLKGATE_DIS REG_BIT(22)
94+
95+
#define VDBOX_CGCTL3F18(base) _MMIO((base) + 0x3f18)
96+
#define ALNUNIT_CLKGATE_DIS REG_BIT(13)
97+
98+
#endif

drivers/gpu/drm/xe/xe_execlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <drm/drm_managed.h>
99

10+
#include "regs/xe_engine_regs.h"
1011
#include "xe_bo.h"
1112
#include "xe_device.h"
1213
#include "xe_engine.h"
@@ -19,7 +20,6 @@
1920
#include "xe_ring_ops_types.h"
2021
#include "xe_sched_job.h"
2122

22-
#include "gt/intel_engine_regs.h"
2323
#include "gt/intel_gpu_commands.h"
2424
#include "gt/intel_gt_regs.h"
2525
#include "gt/intel_lrc_reg.h"

drivers/gpu/drm/xe/xe_guc_ads.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <drm/drm_managed.h>
99

10+
#include "regs/xe_engine_regs.h"
1011
#include "xe_bo.h"
1112
#include "xe_gt.h"
1213
#include "xe_guc.h"
@@ -17,9 +18,9 @@
1718
#include "xe_mmio.h"
1819
#include "xe_platform_types.h"
1920

20-
#include "gt/intel_engine_regs.h"
2121
#include "gt/intel_gt_regs.h"
2222

23+
2324
/* Slack of a few additional entries per engine */
2425
#define ADS_REGSET_EXTRA_MAX 8
2526

drivers/gpu/drm/xe/xe_hw_engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <drm/drm_managed.h>
99

10+
#include "regs/xe_engine_regs.h"
1011
#include "xe_bo.h"
1112
#include "xe_device.h"
1213
#include "xe_execlist.h"
@@ -21,7 +22,6 @@
2122
#include "xe_sched_job.h"
2223
#include "xe_wa.h"
2324

24-
#include "gt/intel_engine_regs.h"
2525
#include "gt/intel_gt_regs.h"
2626
#include "i915_reg.h"
2727

drivers/gpu/drm/xe/xe_lrc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "xe_lrc.h"
77

8+
#include "regs/xe_engine_regs.h"
89
#include "xe_bo.h"
910
#include "xe_device.h"
1011
#include "xe_engine_types.h"
@@ -13,7 +14,6 @@
1314
#include "xe_map.h"
1415
#include "xe_vm.h"
1516

16-
#include "gt/intel_engine_regs.h"
1717
#include "gt/intel_gpu_commands.h"
1818
#include "gt/intel_gt_regs.h"
1919
#include "gt/intel_lrc_reg.h"

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#include <drm/drm_managed.h>
99
#include <drm/xe_drm.h>
1010

11+
#include "regs/xe_engine_regs.h"
1112
#include "xe_device.h"
1213
#include "xe_gt.h"
1314
#include "xe_gt_mcr.h"
1415
#include "xe_macros.h"
1516
#include "xe_module.h"
1617

17-
#include "gt/intel_engine_regs.h"
1818
#include "gt/intel_gt_regs.h"
1919
#include "i915_reg.h"
2020

drivers/gpu/drm/xe/xe_reg_sr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <drm/drm_managed.h>
1313
#include <drm/drm_print.h>
1414

15+
#include "regs/xe_engine_regs.h"
1516
#include "xe_device_types.h"
1617
#include "xe_force_wake.h"
1718
#include "xe_gt.h"
@@ -20,7 +21,6 @@
2021
#include "xe_mmio.h"
2122
#include "xe_rtp_types.h"
2223

23-
#include "gt/intel_engine_regs.h"
2424
#include "gt/intel_gt_regs.h"
2525

2626
#define XE_REG_SR_GROW_STEP_DEFAULT 16

drivers/gpu/drm/xe/xe_reg_whitelist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
#include "xe_reg_whitelist.h"
77

8+
#include "regs/xe_engine_regs.h"
89
#include "xe_gt_types.h"
910
#include "xe_platform_types.h"
1011
#include "xe_rtp.h"
1112

12-
#include "gt/intel_engine_regs.h"
1313
#include "gt/intel_gt_regs.h"
1414

1515
#undef _MMIO

drivers/gpu/drm/xe/xe_wa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/compiler_types.h>
99

10+
#include "regs/xe_engine_regs.h"
1011
#include "xe_device_types.h"
1112
#include "xe_force_wake.h"
1213
#include "xe_gt.h"
@@ -16,7 +17,6 @@
1617
#include "xe_rtp.h"
1718
#include "xe_step.h"
1819

19-
#include "gt/intel_engine_regs.h"
2020
#include "gt/intel_gt_regs.h"
2121
#include "i915_reg.h"
2222

0 commit comments

Comments
 (0)