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
6666 #define L3_WB 3
6767
6868 /* Target cache */
69−#define ELLC 0
70−#define LLC 1
71−#define LLC_ELLC 2
69+#define LE_TC_PAGETABLE 0
70+#define LE_TC_LLC 1
71+#define LE_TC_LLC_ELLC 2
72+#define LE_TC_LLC_ELLC_ALT 3
7273
7374 /*
7475 * MOCS tables
@@ -96,34 +97,67 @@ struct drm_i915_mocs_table { · 21 unmodified lines
9697 * end.
9798 */
9899 static const struct drm_i915_mocs_entry skylake_mocs_table[] = {
99− /* { 0x00000009, 0x0010 } */
100− { (LE_CACHEABILITY(LE_UC) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(0) |
101− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
102− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC)) },
103− /* { 0x00000038, 0x0030 } */
104− { (LE_CACHEABILITY(LE_PAGETABLE) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |
105− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
106− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) },
107− /* { 0x0000003b, 0x0030 } */
108− { (LE_CACHEABILITY(LE_WB) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |
109− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
110− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) }
100+ { /* 0x00000009 */
101+ .control_value = LE_CACHEABILITY(LE_UC) |
102+ LE_TGT_CACHE(LE_TC_LLC_ELLC) |
103+ LE_LRUM(0) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
104+ LE_PFM(0) | LE_SCF(0),
105+
106+ /* 0x0010 */
107+ .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC),
108+ },
109+ {
110+ /* 0x00000038 */
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+ },
111127 };
112128
113129 /* NOTE: the LE_TGT_CACHE is not used on Broxton */
114130 static const struct drm_i915_mocs_entry broxton_mocs_table[] = {
115− /* { 0x00000009, 0x0010 } */
116− { (LE_CACHEABILITY(LE_UC) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(0) |
117− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
118− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC)) },
119− /* { 0x00000038, 0x0030 } */
120− { (LE_CACHEABILITY(LE_PAGETABLE) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |
121− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
122− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) },
123− /* { 0x0000003b, 0x0030 } */
124− { (LE_CACHEABILITY(LE_WB) | LE_TGT_CACHE(LLC_ELLC) | LE_LRUM(3) |
125− LE_AOM(0) | LE_RSC(0) | LE_SCC(0) | LE_PFM(0) | LE_SCF(0)),
126− (L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_WB)) }
131+ {
132+ /* 0x00000009 */
133+ .control_value = LE_CACHEABILITY(LE_UC) |
134+ LE_TGT_CACHE(LE_TC_LLC_ELLC) |
135+ LE_LRUM(0) | LE_AOM(0) | LE_RSC(0) | LE_SCC(0) |
136+ LE_PFM(0) | LE_SCF(0),
137+
138+ /* 0x0010 */
139+ .l3cc_value = L3_ESC(0) | L3_SCC(0) | L3_CACHEABILITY(L3_UC),
140+ },
141+ {
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+ },
127161 };
128162
129163 /**

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