Tiger Lake: MOCS table handling
Subsystems (2)
v3 cover Tiger Lake: MOCS table handling
v3 of https://patchwork.freedesktop.org/series/64275/
Changes:
- Fix checkpatch warning on commit message
- Minor change on "drm/i915/tgl: stop using ERROR_GEN6 and DONE_REG"
- Rebase again to be able to apply
Lucas De Marchi (2):
drm/i915/tgl: Move fault registers to their new offset drm/i915/tgl: stop using ERROR_GEN6 and DONE_REG
Michel Thierry (1):
drm/i915/tgl: Tigerlake only has global MOCS registers
Tomasz Lis (1):
drm/i915/tgl: Define MOCS entries for Tigerlake
Tvrtko Ursulin (1):
drm/i915: Move MOCS setup to intel_mocs.c
drivers/gpu/drm/i915/gt/intel_gt.c | 24 ++++- drivers/gpu/drm/i915/gt/intel_mocs.c | 121 ++++++++++++++++++++--- drivers/gpu/drm/i915/gt/intel_mocs.h | 2 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_gpu_error.c | 29 ++++-- drivers/gpu/drm/i915/i915_pci.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 5 + drivers/gpu/drm/i915/intel_device_info.h | 1 + 9 files changed, 159 insertions(+), 30 deletions(-)
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/5 drm/i915/tgl: Move fault registers to their new offset
The fault registers moved to another offset. The old location is now taken by the global MOCS registers, to be added in a follow up change.
Based on previous patches by Michel Thierry <[email protected]>.
--- drivers/gpu/drm/i915/gt/intel_gt.c | 24 ++++++++++++++++++++---- drivers/gpu/drm/i915/i915_gpu_error.c | 12 ++++++++++-- drivers/gpu/drm/i915/i915_reg.h | 3 +++ 3 files changed, 33 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gt/intel_gt.c +20 -4
@@ -79,7 +79,10 @@ intel_gt_clear_error_registers(struct intel_gt *gt, I915_MASTER_ERROR_INTERRUPT); } -if (INTEL_GEN (i915) >=8 ) { +if (INTEL_GEN (i915) >=12 ) { +rmw_clear (uncore,GEN12_RING_FAULT_REG ,RING_FAULT_VALID ); +intel_uncore_posting_read (uncore,GEN12_RING_FAULT_REG ); + }else if (INTEL_GEN (i915) >=8 ) {rmw_clear (uncore,GEN8_RING_FAULT_REG ,RING_FAULT_VALID );intel_uncore_posting_read (uncore,GEN8_RING_FAULT_REG ); }else if (INTEL_GEN (i915) >=6 ) {
@@ -117,14 +120,27 @@ static void gen6_check_faults(struct intel_gt *gt)static void gen8_check_faults (struct intel_gt *gt) {struct intel_uncore *uncore = gt->uncore; -u32 fault =intel_uncore_read (uncore,GEN8_RING_FAULT_REG ); +i915_reg_t fault_reg, fault_data0_reg, fault_data1_reg; +u32 fault; + +if (INTEL_GEN (gt->i915) >=12 ) { + fault_reg =GEN12_RING_FAULT_REG ; + fault_data0_reg =GEN12_FAULT_TLB_DATA0 ; + fault_data1_reg =GEN12_FAULT_TLB_DATA1 ; + }else { + fault_reg =GEN8_RING_FAULT_REG ; + fault_data0_reg =GEN8_FAULT_TLB_DATA0 ; + fault_data1_reg =GEN8_FAULT_TLB_DATA1 ; + } + fault =intel_uncore_read (uncore, fault_reg);if (fault &RING_FAULT_VALID ) {u32 fault_data0, fault_data1;u64 fault_addr; - fault_data0 =intel_uncore_read (uncore,GEN8_FAULT_TLB_DATA0 ); - fault_data1 =intel_uncore_read (uncore,GEN8_FAULT_TLB_DATA1 ); + fault_data0 =intel_uncore_read (uncore, fault_data0_reg); + fault_data1 =intel_uncore_read (uncore, fault_data1_reg); + fault_addr = ((u64)(fault_data1 &FAULT_VA_HIGH_BITS ) <<44 ) | ((u64 )fault_data0 <<12 );
drivers/gpu/drm/i915/i915_gpu_error.c +10 -2
@@ -1106,7 +1106,10 @@ static void error_record_engine_registers(struct i915_gpu_state *error,if (INTEL_GEN (dev_priv) >=6 ) { ee->rc_psmi =ENGINE_READ (engine,RING_PSMI_CTL ); -if (INTEL_GEN (dev_priv) >=8 ) + +if (INTEL_GEN (dev_priv) >=12 ) + ee->fault_reg =I915_READ (GEN12_RING_FAULT_REG ); +else if (INTEL_GEN (dev_priv) >=8 ) ee->fault_reg =I915_READ (GEN8_RING_FAULT_REG );else ee->fault_reg =GEN6_RING_FAULT_REG_READ (engine);
@@ -1542,7 +1545,12 @@ static void capture_reg_state(struct i915_gpu_state *error)if (IS_GEN (i915,7 )) error->err_int =intel_uncore_read (uncore,GEN7_ERR_INT ); -if (INTEL_GEN (i915) >=8 ) { +if (INTEL_GEN (i915) >=12 ) { + error->fault_data0 =intel_uncore_read (uncore, +GEN12_FAULT_TLB_DATA0 ); + error->fault_data1 =intel_uncore_read (uncore, +GEN12_FAULT_TLB_DATA1 ); + }else if (INTEL_GEN (i915) >=8 ) { error->fault_data0 =intel_uncore_read (uncore,GEN8_FAULT_TLB_DATA0 ); error->fault_data1 = intel_uncore_read(uncore,
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -2490,6 +2490,7 @@ enum i915_power_well_id {#define RENDER_HWS_PGA_GEN7 _MMIO(0x04080)#define RING_FAULT_REG (engine) _MMIO(0x4094 + 0x100 * (engine)->hw_id)#define GEN8_RING_FAULT_REG _MMIO(0x4094) +#define GEN12_RING_FAULT_REG _MMIO(0xcec4)#define GEN8_RING_FAULT_ENGINE_ID (x) (((x) >> 12) & 0x7)#define RING_FAULT_GTTSEL_MASK (1 << 11)#define RING_FAULT_SRCID (x) (((x) >> 3) & 0xff)
@@ -2633,6 +2634,8 @@ enum i915_power_well_id {#define GEN8_FAULT_TLB_DATA0 _MMIO(0x4b10)#define GEN8_FAULT_TLB_DATA1 _MMIO(0x4b14) +#define GEN12_FAULT_TLB_DATA0 _MMIO(0xceb8) +#define GEN12_FAULT_TLB_DATA1 _MMIO(0xcebc)#define FAULT_VA_HIGH_BITS (0xf << 0)#define FAULT_GTT_SEL (1 << 4)
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 2/5 drm/i915/tgl: stop using ERROR_GEN6 and DONE_REG
In reply to Lucas De MarchiThese registers have been removed on gen12.
v2: merge common branch for IS_GEN_RANGE(i915, 6, 11)
--- drivers/gpu/drm/i915/i915_gpu_error.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gpu_error.c +9 -8
@@ -745,16 +745,15 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,for (i =0 ; i < error->nfence; i++)err_printf (m," fence[%d] = %08llx\n" , i, error->fence[i]); -if (INTEL_GEN (m->i915) >=6 ) { +if (IS_GEN_RANGE (m->i915,6 ,11 )) {err_printf (m,"ERROR: 0x%08x\n" , error->error); - -if (INTEL_GEN (m->i915) >=8 ) -err_printf (m,"FAULT_TLB_DATA: 0x%08x 0x%08x\n" , - error->fault_data1, error->fault_data0); -err_printf (m,"DONE_REG: 0x%08x\n" , error->done_reg); } +if (INTEL_GEN (m->i915) >=8 ) +err_printf (m,"FAULT_TLB_DATA: 0x%08x 0x%08x\n" , + error->fault_data1, error->fault_data0); +if (IS_GEN (m->i915,7 ))err_printf (m,"ERR_INT: 0x%08x\n" , error->err_int);
@@ -1569,8 +1568,10 @@ static void capture_reg_state(struct i915_gpu_state *error)if (INTEL_GEN (i915) >=6 ) { error->derrmr =intel_uncore_read (uncore,DERRMR ); - error->error =intel_uncore_read (uncore,ERROR_GEN6 ); - error->done_reg =intel_uncore_read (uncore,DONE_REG ); +if (INTEL_GEN (i915) <12 ) { + error->error =intel_uncore_read (uncore,ERROR_GEN6 ); + error->done_reg =intel_uncore_read (uncore,DONE_REG ); + } }if (INTEL_GEN (i915) >=5 )
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 3/5 drm/i915/tgl: Define MOCS entries for Tigerlake
In reply to Lucas De MarchiFrom: Tomasz Lis <[email protected]>
The MOCS table is published as part of bspec, and versioned. Entries are supposed to never be modified, but new ones can be added. Adding entries increases table version. The patch includes version 1 entries.
Two of the 3 legacy entries used for gen9 are no longer expected to work. Although we are changing the gen11 table, those changes are supposed to be backward compatible since we are only touching previously undefined entries.
v2: Add the missing entries in 49-51 range and replace "HW reserved"
terminology to what it actually is: L1 is implicitly enabled (from Daniele)
v3: Use a different table for Tiger Lake since entries 0 and 1 are not
the same (from Daniele)
--- drivers/gpu/drm/i915/gt/intel_mocs.c | 68 +++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/gt/intel_mocs.c +57 -11
@@ -62,6 +62,10 @@ struct drm_i915_mocs_table {#define GEN11_NUM_MOCS_ENTRIES 64/* 63-64 are reserved, but configured. */ /* (e)LLC caching options */ +/* +* Note: LE_0_PAGETABLE works only up to Gen11; for newer gens it means +* the same as LE_UC +*/ #define LE_0_PAGETABLE _LE_CACHEABILITY(0)#define LE_1_UC _LE_CACHEABILITY(1)#define LE_2_WT _LE_CACHEABILITY(2)
@@ -100,8 +104,9 @@ struct drm_i915_mocs_table {* of bspec. * * Entries not part of the following tables are undefined as far as -* userspace is concerned and shouldn't be relied upon. For the time -* being they will be initialized to PTE. +* userspace is concerned and shouldn't be relied upon. For Gen < 12 +* they will be initialized to PTE. Gen >= 12 onwards don't have a setting for +* PTE and will be initialized to an invalid value. * * The last two entries are reserved by the hardware. For ICL+ they * should be initialized according to bspec and never used, for older
@@ -137,14 +142,7 @@ static const struct drm_i915_mocs_entry broxton_mocs_table[] = { };#define GEN11_MOCS_ENTRIES \ -/* Base - Uncached (Deprecated) */ \ - MOCS_ENTRY(I915_MOCS_UNCACHED, \ - LE_1_UC | LE_TC_1_LLC, \ - L3_1_UC), \ -/* Base - L3 + LeCC:PAT (Deprecated) */ \ -MOCS_ENTRY (I915_MOCS_PTE , \ -LE_0_PAGETABLE |LE_TC_1_LLC , \ -L3_3_WB ), \ +/* Entries 0 and 1 are defined per-platform */ \/* Base - L3 + LLC */ \ MOCS_ENTRY(2, \ LE_3_WB | LE_TC_1_LLC | LE_LRUM(3), \
@@ -242,7 +240,50 @@ static const struct drm_i915_mocs_entry broxton_mocs_table[] = { LE_3_WB | LE_TC_1_LLC | LE_LRUM(3), \ L3_1_UC) +static const struct drm_i915_mocs_entry tigerlake_mocs_table[] = { +/* Base - Error (Reserved for Non-Use) */ +MOCS_ENTRY (0 ,0x0 ,0x0 ), +/* Base - Reserved */ +MOCS_ENTRY (1 ,0x0 ,0x0 ), + +GEN11_MOCS_ENTRIES , + +/* Implicitly enable L1 - HDC:L1 + L3 + LLC */ +MOCS_ENTRY (48 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_3_WB ), +/* Implicitly enable L1 - HDC:L1 + L3 */ +MOCS_ENTRY (49 , +LE_1_UC |LE_TC_1_LLC , +L3_3_WB ), +/* Implicitly enable L1 - HDC:L1 + LLC */ +MOCS_ENTRY (50 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_1_UC ), +/* Implicitly enable L1 - HDC:L1 */ +MOCS_ENTRY (51 , +LE_1_UC |LE_TC_1_LLC , +L3_1_UC ), +/* HW Special Case (CCS) */ +MOCS_ENTRY (60 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_1_UC ), +/* HW Special Case (Displayable) */ +MOCS_ENTRY (61 , +LE_1_UC |LE_TC_1_LLC |LE_SCF (1 ), +L3_3_WB ), +}; +static const struct drm_i915_mocs_entry icelake_mocs_table[] = { +/* Base - Uncached (Deprecated) */ +MOCS_ENTRY (I915_MOCS_UNCACHED , +LE_1_UC |LE_TC_1_LLC , +L3_1_UC ), +/* Base - L3 + LeCC:PAT (Deprecated) */ +MOCS_ENTRY (I915_MOCS_PTE , +LE_0_PAGETABLE |LE_TC_1_LLC , +L3_3_WB ), +GEN11_MOCS_ENTRIES };
@@ -264,7 +305,12 @@ static bool get_mocs_settings(struct intel_gt *gt,struct drm_i915_private *i915 = gt->i915;bool result = false; -if (INTEL_GEN (i915) >=11 ) { +if (INTEL_GEN (i915) >=12 ) { + table->size =ARRAY_SIZE (tigerlake_mocs_table); + table->table = tigerlake_mocs_table; + table->n_entries =GEN11_NUM_MOCS_ENTRIES ; + result = true; + }else if (IS_GEN (i915,11 )) { table->size =ARRAY_SIZE (icelake_mocs_table); table->table = icelake_mocs_table; table->n_entries =GEN11_NUM_MOCS_ENTRIES ;
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v3 3/5] drm/i915/tgl: Define MOCS entries for Tigerlake
Quoted 15 lines · Lucas De Marchi
From: Tomasz Lis <[email protected]>
The MOCS table is published as part of bspec, and versioned. Entries are supposed to never be modified, but new ones can be added. Adding entries increases table version. The patch includes version 1 entries.
Two of the 3 legacy entries used for gen9 are no longer expected to work.
Although we are changing the gen11 table, those changes are supposed to
be backward compatible since we are only touching previously undefined
entries.
Quoted 7 lines
v2: Add the missing entries in 49-51 range and replace "HW reserved"
terminology to what it actually is: L1 is implicitly enabled (from Daniele)
v3: Use a different table for Tiger Lake since entries 0 and 1 are not
the same (from Daniele)
Quoted 127 lines
Cc Joonas Lahtinen <[email protected]>Cc Mika Kuoppala <[email protected]>Signed-off-by Tomasz Lis <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>Reviewed-by Daniele Ceraolo Spurio <[email protected]>--- drivers/gpu/drm/i915/gt/intel_mocs.c | 68 +++++++++++++++++++++++--- -- 1 file changed, 57 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/gt/intel_mocs.c +0
-0@@ -62,6 +62,10 @@ struct drm_i915_mocs_table {#define GEN11_NUM_MOCS_ENTRIES 64/* 63-64 are reserved, but configured. */
/* (e)LLC caching options */
+/*
+ * Note:LE_0_PAGETABLEworks only up to Gen11; for newer gens it means
+ * the same asLE_UC
+ */
#defineLE_0_PAGETABLE_LE_CACHEABILITY(0)
#defineLE_1_UC_LE_CACHEABILITY(1)
#defineLE_2_WT_LE_CACHEABILITY(2)drivers/gpu/drm/i915/gt/intel_mocs.c +0
-1@@ -100,8 +104,9 @@ struct drm_i915_mocs_table {* of bspec. * * Entries not part of the following tables are undefined as far as -* userspace is concerned and shouldn't be relied upon. For the time
- * being they will be initialized to PTE.
+ * userspace is concerned and shouldn't be relied upon. For Gen < 12
+ * they will be initialized to PTE. Gen >= 12 onwards don't have a setting for
+ * PTE and will be initialized to an invalid value.
*
* The last two entries are reserved by the hardware. For ICL+ they
* should be initialized according to bspec and never used, for
olderdrivers/gpu/drm/i915/gt/intel_mocs.c +1
-8@@ -137,14 +142,7 @@ static const struct drm_i915_mocs_entry broxton_mocs_table[] = { };#define GEN11_MOCS_ENTRIES \ -/* Base - Uncached (Deprecated) */ \ - MOCS_ENTRY(I915_MOCS_UNCACHED, \ - LE_1_UC | LE_TC_1_LLC, \ - L3_1_UC), \ -/* Base - L3 + LeCC:PAT (Deprecated) */ \ - MOCS_ENTRY(I915_MOCS_PTE, \ - LE_0_PAGETABLE | LE_TC_1_LLC, \ - L3_3_WB), \ +/* Entries 0 and 1 are defined per-platform */ \/* Base - L3 + LLC */ \ MOCS_ENTRY(2, \drivers/gpu/drm/i915/gt/intel_mocs.c +49
-1LE_3_WB | LE_TC_1_LLC | LE_LRUM(3), \@@ -242,7 +240,50 @@ static const struct drm_i915_mocs_entry broxton_mocs_table[] = { LE_3_WB | LE_TC_1_LLC | LE_LRUM(3), \ L3_1_UC) +static const struct drm_i915_mocs_entry tigerlake_mocs_table[] = { +/* Base - Error (Reserved for Non-Use) */ +MOCS_ENTRY (0 ,0x0 ,0x0 ), +/* Base - Reserved */ +MOCS_ENTRY (1 ,0x0 ,0x0 ), + +GEN11_MOCS_ENTRIES , + +/* Implicitly enable L1 - HDC:L1 + L3 + LLC */ +MOCS_ENTRY (48 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_3_WB ), +/* Implicitly enable L1 - HDC:L1 + L3 */ +MOCS_ENTRY (49 , +LE_1_UC |LE_TC_1_LLC , +L3_3_WB ), +/* Implicitly enable L1 - HDC:L1 + LLC */ +MOCS_ENTRY (50 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_1_UC ), +/* Implicitly enable L1 - HDC:L1 */ +MOCS_ENTRY (51 , +LE_1_UC |LE_TC_1_LLC , +L3_1_UC ), +/* HW Special Case (CCS) */ +MOCS_ENTRY (60 , +LE_3_WB |LE_TC_1_LLC |LE_LRUM (3 ), +L3_1_UC ), +/* HW Special Case (Displayable) */ +MOCS_ENTRY (61 , +LE_1_UC |LE_TC_1_LLC |LE_SCF (1 ), +L3_3_WB ), +}; +static const struct drm_i915_mocs_entry icelake_mocs_table[] = { +/* Base - Uncached (Deprecated) */ +MOCS_ENTRY (I915_MOCS_UNCACHED , +LE_1_UC |LE_TC_1_LLC , +L3_1_UC ), +/* Base - L3 + LeCC:PAT (Deprecated) */ +MOCS_ENTRY (I915_MOCS_PTE , +LE_0_PAGETABLE |LE_TC_1_LLC , +L3_3_WB ), +GEN11_MOCS_ENTRIES };@@ -264,7 +305,12 @@ static bool get_mocs_settings(struct intel_gt *gt, struct drm_i915_private *i915 = gt->i915;bool result = false; -if (INTEL_GEN (i915) >=11 ) { +if (INTEL_GEN (i915) >=12 ) { + table->size =ARRAY_SIZE (tigerlake_mocs_table); + table->table = tigerlake_mocs_table; + table->n_entries =GEN11_NUM_MOCS_ENTRIES ; + result = true; + }else if (IS_GEN (i915,11 )) { table->size =ARRAY_SIZE (icelake_mocs_table); table->table = icelake_mocs_table;
Quoted 1 line
table->n_entries=GEN11_NUM_MOCS_ENTRIES;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 4/5 drm/i915/tgl: Tigerlake only has global MOCS registers
In reply to Lucas De MarchiFrom: Michel Thierry <[email protected]>
Until Icelake, each engine had its own set of 64 MOCS registers. In order to simplify, Tigerlake moves to only 64 Global MOCS registers, which are no longer part of the engine context. Since these registers are now global, they also only need to be initialized once.
From Gen12 onwards, MOCS must specify the target cache (3:2) and LRU management (5:4) fields and cannot be programmed to 'use the value from Private PAT', because these fields are no longer part of the PPAT. Also cacheability control (1:0) field has changed, 00 no longer means 'use controls from page table', but uncacheable (UC).
v2 (Lucas):
- Move the changes to the fault registers to a separate commit - the old ones overlap with the range used by the new global MOCS (requested by Daniele)
v3 (Lucas):
- Clarify comment about setting the unused entries to the same value of index 0, that is the invalid entry (requested by Daniele)
- Move changes to DONE_REG and ERROR_GEN6 to a separate commit (requested by Daniele)
--- drivers/gpu/drm/i915/gt/intel_mocs.c | 44 +++++++++++++++++++++++- drivers/gpu/drm/i915/gt/intel_mocs.h | 1 + drivers/gpu/drm/i915/i915_drv.h | 2 ++ drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/i915_pci.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 2 ++ drivers/gpu/drm/i915/intel_device_info.h | 1 + 7 files changed, 52 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/intel_mocs.c +43 -1
@@ -392,6 +392,10 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine)unsigned int index;u32 unused_value; +/* Platforms with global MOCS do not need per-engine initialization. */ +if (HAS_GLOBAL_MOCS_REGISTERS (gt->i915)) +return ; +/* Called under a blanket forcewake */ assert_forcewakes_active (uncore,FORCEWAKE_ALL );
@@ -416,6 +420,43 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine) unused_value); } +/** +* intel_mocs_init_global() - program the global mocs registers +* gt: pointer to struct intel_gt +* +* This function initializes the MOCS global registers. +*/ +void intel_mocs_init_global (struct intel_gt *gt) +{ +struct intel_uncore *uncore = gt->uncore; +struct drm_i915_mocs_table table; +unsigned int index; + +if (!HAS_GLOBAL_MOCS_REGISTERS (gt->i915)) +return ; + +if (!get_mocs_settings (gt, &table)) +return ; + +if (GEM_DEBUG_WARN_ON (table.size > table.n_entries)) +return ; + +for (index =0 ; index < table.size; index++) +intel_uncore_write (uncore, +GEN12_GLOBAL_MOCS (index), + table.table[index].control_value); + +/* +* Ok, now set the unused entries to the invalid entry (index 0). These +* entries are officially undefined and no contract for the contents and +* settings is given for these entries. +*/ +for (; index < table.n_entries; index++) +intel_uncore_write (uncore, +GEN12_GLOBAL_MOCS (index), + table.table[0 ].control_value); +} +/** * emit_mocs_control_table() - emit the mocs control table * @rq: Request to set up the MOCS table for.
@@ -619,7 +660,8 @@ int intel_mocs_emit(struct i915_request *rq)struct drm_i915_mocs_table t;int ret; -if (rq->engine->class !=RENDER_CLASS ) +if (HAS_GLOBAL_MOCS_REGISTERS (rq->i915) || + rq->engine->class !=RENDER_CLASS )return 0 ;if (get_mocs_settings (rq->engine->gt, &t)) {
drivers/gpu/drm/i915/gt/intel_mocs.h +1 -0
@@ -55,6 +55,7 @@ struct intel_engine_cs;struct intel_gt ;void intel_mocs_init_l3cc_table (struct intel_gt *gt); +void intel_mocs_init_global (struct intel_gt *gt);void intel_mocs_init_engine (struct intel_engine_cs *engine);int intel_mocs_emit (struct i915_request *rq);
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -2277,6 +2277,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,#define HAS_POOLED_EU (dev_priv) (INTEL_INFO(dev_priv)->has_pooled_eu) +#define HAS_GLOBAL_MOCS_REGISTERS (dev_priv) (INTEL_INFO(dev_priv)->has_global_mocs) +#define INTEL_PCH_DEVICE_ID_MASK 0xff80#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00
drivers/gpu/drm/i915/i915_gem.c +1 -0
@@ -1253,6 +1253,7 @@ int i915_gem_init_hw(struct drm_i915_private *i915) goto out; } +intel_mocs_init_global (gt);intel_mocs_init_l3cc_table (gt);intel_engines_set_scheduler_caps (i915);
drivers/gpu/drm/i915/i915_pci.c +2 -1
@@ -783,7 +783,8 @@ static const struct intel_device_info intel_elkhartlake_info = { [TRANSCODER_D] = TRANSCODER_D_OFFSET, \ [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \ [TRANSCODER_DSI_1 ] =TRANSCODER_DSI1_OFFSET , \ - } + }, \ + .has_global_mocs = 1static const struct intel_device_info intel_tigerlake_12_info = {GEN12_FEATURES ,
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -11216,6 +11216,8 @@ enum skl_power_gate {#define PMFLUSH_GAPL3UNBLOCK (1 << 21)#define PMFLUSHDONE_LNEBLK (1 << 22) +#define GEN12_GLOBAL_MOCS (i) _MMIO(0x4000 + (i) * 4)/* Global MOCS regs */ +/* gamt regs */ #define GEN8_L3_LRA_1_GPGPU _MMIO(0x4dd4)#define GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW 0x67F1427F/* max/min for LRA1/2 */
drivers/gpu/drm/i915/intel_device_info.h +1 -0
@@ -112,6 +112,7 @@ enum intel_ppgtt_type {func (gpu_reset_clobbers_display); \func (has_reset_engine); \func (has_fpga_dbg); \ +func (has_global_mocs); \func (has_gt_uc); \func (has_l3_dpf); \func (has_llc); \
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 5/5 drm/i915: Move MOCS setup to intel_mocs.c
In reply to Lucas De MarchiFrom: Tvrtko Ursulin <[email protected]>
Hide the details of MOCS setup from i915_gem by moving both current calls into one in intel_mocs_init.
--- drivers/gpu/drm/i915/gt/intel_mocs.c | 15 +++++++++++---- drivers/gpu/drm/i915/gt/intel_mocs.h | 3 +-- drivers/gpu/drm/i915/i915_gem.c | 3 +-- 3 files changed, 13 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/gt/intel_mocs.c +11 -4
@@ -426,14 +426,13 @@ void intel_mocs_init_engine(struct intel_engine_cs *engine)* * This function initializes the MOCS global registers. */ -void intel_mocs_init_global (struct intel_gt *gt) +static void intel_mocs_init_global (struct intel_gt *gt) {struct intel_uncore *uncore = gt->uncore;struct drm_i915_mocs_table table;unsigned int index; -if (!HAS_GLOBAL_MOCS_REGISTERS (gt->i915)) -return ; +GEM_BUG_ON (!HAS_GLOBAL_MOCS_REGISTERS (gt->i915));if (!get_mocs_settings (gt, &table))return ;
@@ -599,7 +598,7 @@ static int emit_mocs_l3cc_table(struct i915_request *rq,* * Return: Nothing. */ -void intel_mocs_init_l3cc_table (struct intel_gt *gt) +static void intel_mocs_init_l3cc_table (struct intel_gt *gt) {struct intel_uncore *uncore = gt->uncore;struct drm_i915_mocs_table table;
@@ -678,3 +677,11 @@ int intel_mocs_emit(struct i915_request *rq)return 0 ; } + +void intel_mocs_init (struct intel_gt *gt) +{ +intel_mocs_init_l3cc_table (gt); + +if (HAS_GLOBAL_MOCS_REGISTERS (gt->i915)) +intel_mocs_init_global (gt); +}
drivers/gpu/drm/i915/gt/intel_mocs.h +1 -2
@@ -54,8 +54,7 @@ struct i915_request;struct intel_engine_cs ;struct intel_gt ; -void intel_mocs_init_l3cc_table (struct intel_gt *gt); -void intel_mocs_init_global (struct intel_gt *gt); +void intel_mocs_init (struct intel_gt *gt);void intel_mocs_init_engine (struct intel_engine_cs *engine);int intel_mocs_emit (struct i915_request *rq);
drivers/gpu/drm/i915/i915_gem.c +1 -2
@@ -1253,8 +1253,7 @@ int i915_gem_init_hw(struct drm_i915_private *i915) goto out; } -intel_mocs_init_global (gt); -intel_mocs_init_l3cc_table (gt); +intel_mocs_init (gt);intel_engines_set_scheduler_caps (i915);
Signature · 6 lines
2.21.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for Tiger Lake: MOCS table handling (rev3)
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: Tiger Lake: MOCS table handling (rev3)
URL : https://patchwork.freedesktop.org/series/64275/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6585 -> Patchwork_13807
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/
Known issues
------------
Here are the changes found in Patchwork_13807 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_create@basic-files:
- fi-cml-u: [PASS][1] -> [INCOMPLETE][2] ([fdo#110566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-cml-u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-cml-u/igt@[email protected]
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-skl-6600u: [PASS][3] -> [FAIL][4] ([fdo#107707])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-skl-6600u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-skl-6600u/igt@[email protected]
* igt@kms_busy@basic-flip-c:
- fi-kbl-7500u: [PASS][5] -> [SKIP][6] ([fdo#109271] / [fdo#109278]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-kbl-7500u/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][7] -> [FAIL][8] ([fdo#109485])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-kbl-7500u/igt@[email protected]
* igt@prime_vgem@basic-read:
- fi-icl-u3: [PASS][9] -> [DMESG-WARN][10] ([fdo#107724])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-icl-u3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-icl-u3/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload:
- fi-icl-u3: [DMESG-WARN][11] ([fdo#107724]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/fi-icl-u3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/fi-icl-u3/igt@[email protected]
[fdo#107707]: https://bugs.freedesktop.org/show_bug.cgi?id=107707
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
Participating hosts (54 -> 46)
------------------------------
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6585 -> Patchwork_13807
CI-20190529: 20190529
CI_DRM_6585: e3758948ece56bbac86e96a326fa6b01ec05d202 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5116: d2e6dd2f789596da5bd06efc2e9448e3160583b6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13807: b9df6b40ff67a8d1219bb3eea1ce8a68c11a4533 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
b9df6b40ff67 drm/i915: Move MOCS setup to intel_mocs.c 83bded8c3976 drm/i915/tgl: Tigerlake only has global MOCS registers e5f291ffbec7 drm/i915/tgl: Define MOCS entries for Tigerlake 93da890f569c drm/i915/tgl: stop using ERROR_GEN6 and DONE_REG e048237ee7c4 drm/i915/tgl: Move fault registers to their new offset
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for Tiger Lake: MOCS table handling (rev3)
In reply to Lucas De Marchi== Series Details ==
== Series Details ==
Series: Tiger Lake: MOCS table handling (rev3)
URL : https://patchwork.freedesktop.org/series/64275/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6585_full -> Patchwork_13807_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_13807_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_isolation@bcs0-s3:
- shard-kbl: [PASS][1] -> [DMESG-WARN][2] ([fdo#108566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-kbl6/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-kbl4/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-apl: [PASS][3] -> [DMESG-WARN][4] ([fdo#108686])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-apl3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-apl2/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([fdo#108566]) +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-apl1/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-apl2/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-atomic:
- shard-hsw: [PASS][7] -> [FAIL][8] ([fdo#103355])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-hsw5/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-hsw6/igt@[email protected]
* igt@kms_draw_crc@draw-method-rgb565-pwrite-xtiled:
- shard-iclb: [PASS][9] -> [FAIL][10] ([fdo#103184] / [fdo#103232])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-iclb7/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-iclb4/igt@[email protected]
* igt@kms_flip_tiling@flip-x-tiled:
- shard-skl: [PASS][11] -> [FAIL][12] ([fdo#108145] / [fdo#108303])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-skl7/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-skl6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-badstride:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +4 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-iclb1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-iclb1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [PASS][15] -> [FAIL][16] ([fdo#108145])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-skl7/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-skl2/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [PASS][17] -> [FAIL][18] ([fdo#108145] / [fdo#110403])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-skl7/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-skl6/igt@[email protected]
* igt@perf@polling:
- shard-skl: [PASS][19] -> [FAIL][20] ([fdo#110728])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-skl6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-skl4/igt@[email protected]
#### Possible fixes ####
* igt@gem_eio@reset-stress:
- shard-kbl: [FAIL][21] ([fdo#109661]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-kbl4/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-kbl3/igt@[email protected]
* igt@gem_softpin@noreloc-s3:
- shard-apl: [DMESG-WARN][23] ([fdo#108566]) -> [PASS][24] +2 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-apl5/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-apl1/igt@[email protected]
* igt@i915_pm_rc6_residency@rc6-accuracy:
- shard-snb: [SKIP][25] ([fdo#109271]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-snb2/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-snb2/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: [FAIL][27] ([fdo#105767]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-hsw1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-hsw8/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc:
- shard-iclb: [FAIL][29] ([fdo#103167]) -> [PASS][30] +5 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6585/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/shard-iclb1/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-wc.html
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108303]: https://bugs.freedesktop.org/show_bug.cgi?id=108303
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6585 -> Patchwork_13807
CI-20190529: 20190529
CI_DRM_6585: e3758948ece56bbac86e96a326fa6b01ec05d202 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5116: d2e6dd2f789596da5bd06efc2e9448e3160583b6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13807: b9df6b40ff67a8d1219bb3eea1ce8a68c11a4533 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13807/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx