History

drm/i915/gen9: Clean up MOCS table definitions

Use named struct initializers for clarity. Also fix the target cache definition to reflect its role in GEN9 onwards. On GEN8 a TC value of 0 meant ELLC but on GEN9+ it means the TC and LRU controls are taken from the PTE. No functional change, igt/gem_mocs_settings still passing after this change. v2: (Chris) - Add back the hexa literals for the entries. Add note that igt/gem_mocs_settings still passes.

Imre Deak committed 10 years ago

Commit e4198991 parent 62f90b31 file · +61 −27Browse files

Unified · Split

drivers/gpu/drm/i915/intel_mocs.c+61−27
@@ -66,9 +66,10 @@ struct drm_i915_mocs_table { · 65 unmodified lines
66#define L3_WB 366#define L3_WB 3
67 67
68/* Target cache */68/* Target cache */
69#define ELLC 069#define LE_TC_PAGETABLE 0
70#define LLC 170#define LE_TC_LLC 1
71#define LLC_ELLC 271#define LE_TC_LLC_ELLC 2
72#define LE_TC_LLC_ELLC_ALT 3
72 73
73/*74/*
74 * MOCS tables75 * MOCS tables
@@ -96,34 +97,67 @@ struct drm_i915_mocs_table { · 21 unmodified lines
96 * end.97 * end.
97 */98 */
98static const struct drm_i915_mocs_entry skylake_mocs_table[] = {99static const struct drm_i915_mocs_entry skylake_mocs_table[] = {
99 /* { 0x00000009, 0x0010 } */100 { /* 0x00000009 */
100 { (LE_CACHEABILITY(LE_UC) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(0) |101 .control_value = LE_CACHEABILITY(LE_UC) |
101 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),102 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
102 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC)) },103 LE_LRUM(0) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
103 /* { 0x00000038, 0x0030 } */104 LE_PFM(0) | LE_SCF(0),
104 { (LE_CACHEABILITY(LE_PAGETABLE) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |105
105 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),106 /* 0x0010 */
106 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) },107 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC),
107 /* { 0x0000003b, 0x0030 } */108 },
108 { (LE_CACHEABILITY(LE_WB) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |109 {
109 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),110 /* 0x00000038 */
110 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) }111 .control_value = LE_CACHEABILITY(LE_PAGETABLE) |
112 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
113 LE_LRUM(3) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
114 LE_PFM(0) | LE_SCF(0),
115 /* 0x0030 */
116 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB),
117 },
118 {
119 /* 0x0000003b */
120 .control_value = LE_CACHEABILITY(LE_WB) |
121 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
122 LE_LRUM(3) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
123 LE_PFM(0) | LE_SCF(0),
124 /* 0x0030 */
125 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB),
126 },
111};127};
112 128
113/* NOTE: the LE_TGT_CACHE is not used on Broxton */129/* NOTE: the LE_TGT_CACHE is not used on Broxton */
114static const struct drm_i915_mocs_entry broxton_mocs_table[] = {130static const struct drm_i915_mocs_entry broxton_mocs_table[] = {
115 /* { 0x00000009, 0x0010 } */131 {
116 { (LE_CACHEABILITY(LE_UC) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(0) |132 /* 0x00000009 */
117 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),133 .control_value = LE_CACHEABILITY(LE_UC) |
118 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC)) },134 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
119 /* { 0x00000038, 0x0030 } */135 LE_LRUM(0) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
120 { (LE_CACHEABILITY(LE_PAGETABLE) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |136 LE_PFM(0) | LE_SCF(0),
121 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),137
122 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) },138 /* 0x0010 */
123 /* { 0x0000003b, 0x0030 } */139 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC),
124 { (LE_CACHEABILITY(LE_WB) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |140 },
125 LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),141 {
126 (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) }142 /* 0x00000038 */
143 .control_value = LE_CACHEABILITY(LE_PAGETABLE) |
144 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
145 LE_LRUM(3) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
146 LE_PFM(0) | LE_SCF(0),
147
148 /* 0x0030 */
149 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB),
150 },
151 {
152 /* 0x0000003b */
153 .control_value = LE_CACHEABILITY(LE_WB) |
154 LE_TGT_CACHE(LE_TC_LLC_ELLC) |
155 LE_LRUM(3) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
156 LE_PFM(0) | LE_SCF(0),
157
158 /* 0x0030 */
159 .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB),
160 },
127};161};
128 162
129/**163/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t