Skip to content

Commit a4172af

Browse files
committed
Merge tag 'drm-xe-next-2024-07-30' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
drm-xe-next for 6.12 UAPI Changes: - Rename xe perf layer as xe observation layer, but was also made available via fixes to previous verison (Ashutosh) - Use write-back caching mode for system memory on DGFX, but was also mad available via fixes to previous version (Thomas) - Expose SIMD16 EU mask in topology query for userspace to know the type of EU, as available in PVC, Lunar Lake and Battlemage (Lucas) - Return ENOBUFS instead of ENOMEM in vm_bind if failure is tied to an array of binds (Matthew Brost) Driver Changes: - Log cleanup moving messages to debug priority (Michal Wajdeczko) - Add timeout to fences to adhere to dma_buf rules (Matthew Brost) - Rename old engine nomenclature to exec_queue (Matthew Brost) - Convert multiple bind ops to 1 job (Matthew Brost) - Add error injection for vm bind to help testing error path (Matthew Brost) - Fix error handling in page table to propagate correctly to userspace (Matthew Brost) - Re-organize and cleanup SR-IOV related registers (Michal Wajdeczko) - Make the device write barrier compatible with VF (Michal Wajdeczko) - New display workarounds for Battlemage (Matthew Auld) - New media workarounds for Lunar Lake and Battlemage (Ngai-Mint Kwan) - New graphics workarounds for Lunar Lake (Bommu Krishnaiah) - Tracepoint updates (Matthew Brost, Nirmoy Das) - Cleanup the header generation for OOB workarounds (Lucas De Marchi) - Fix leaking HDCP-related object (Nirmoy Das) - Serialize L2 flushes to avoid races (Tejas Upadhyay) - Log pid and comm on job timeout (José Roberto de Souza) - Simplify boilerplate code for live kunit (Michal Wajdeczko) - Improve kunit skips for live kunit (Michal Wajdeczko) - Fix xe_sync cleanup when handling xe_exec ioctl (Ashutosh Dixit) - Limit fair VF LMEM provisioning (Michal Wajdeczko) - New workaround to fence mmio writes in Lunar Lake (Tejas Upadhyay) - Warn on writes inaccessible register in VF (Michal Wajdeczko) - Fix register lookup in VF (Michal Wajdeczko) - Add GSC support for Battlemage (Alexander Usyskin) - Fix wedging only the GT in which timeout occurred (Matthew Brost) - Block device suspend when wedging (Matthew Brost) - Handle compression and migration changes for Battlemage (Akshata Jahagirdar) - Limit access of stolen memory for Lunar Lake (Uma Shankar) - Fail invalid addresses during user fence creation (Matthew Brost) - Refcount xe_file to safely and accurately store fdinfo stats (Umesh Nerlige Ramappa) - Cleanup and fix PM reference for TLB invalidation code (Matthew Brost) - Fix PM reference handling when communicating with GuC (Matthew Brost) - Add new BO flag for 2 MiB alignement and use in VF (Michal Wajdeczko) - Simplify MMIO setup for multi-tile platforms (Lucas De Marchi) - Add check for uninitialized access to OOB workarounds (Lucas De Marchi) - New GSC and HuC firmware blobs for Lunar Lake and Battlemage (Daniele Ceraolo Spurio) - Unify mmio wait logic (Gustavo Sousa) - Fix off-by-one when processing RTP rules (Lucas De Marchi) - Future-proof migrate logic with compressed PAT flag (Matt Roper) - Add WA kunit tests for Battlemage (Lucas De Marchi) - Test active tracking for workaorunds with kunit (Lucas De Marchi) - Add kunit tests for RTP with no actions (Lucas De Marchi) - Unify parse of OR rules in RTP (Lucas De Marchi) - Add performance tuning for Battlemage (Sai Teja Pottumuttu) - Make bit masks unsigned (Geert Uytterhoeven) Signed-off-by: Dave Airlie <[email protected]> From: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/k7xuktfav4zmtxxjr77glu2hszypvzgmzghoumh757nqfnk7kn@ccfi4ts3ytbk
2 parents de9c2c6 + f2881df commit a4172af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3273
-1739
lines changed

drivers/gpu/drm/i915/display/intel_display_wa.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
#ifndef __INTEL_DISPLAY_WA_H__
77
#define __INTEL_DISPLAY_WA_H__
88

9+
#include <linux/types.h>
10+
911
struct drm_i915_private;
1012

1113
void intel_display_wa_apply(struct drm_i915_private *i915);
1214

15+
#ifdef I915
16+
static inline bool intel_display_needs_wa_16023588340(struct drm_i915_private *i915) { return false; }
17+
#else
18+
bool intel_display_needs_wa_16023588340(struct drm_i915_private *i915);
19+
#endif
20+
1321
#endif

drivers/gpu/drm/i915/display/intel_fbc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include "intel_display_device.h"
5757
#include "intel_display_trace.h"
5858
#include "intel_display_types.h"
59+
#include "intel_display_wa.h"
5960
#include "intel_fbc.h"
6061
#include "intel_fbc_regs.h"
6162
#include "intel_frontbuffer.h"
@@ -1237,6 +1238,11 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
12371238
return 0;
12381239
}
12391240

1241+
if (intel_display_needs_wa_16023588340(i915)) {
1242+
plane_state->no_fbc_reason = "Wa_16023588340";
1243+
return 0;
1244+
}
1245+
12401246
/* WaFbcTurnOffFbcWhenHyperVisorIsUsed:skl,bxt */
12411247
if (i915_vtd_active(i915) && (IS_SKYLAKE(i915) || IS_BROXTON(i915))) {
12421248
plane_state->no_fbc_reason = "VT-d enabled";

drivers/gpu/drm/xe/Makefile

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,15 @@ subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
1212
subdir-ccflags-y += -I$(obj) -I$(src)
1313

1414
# generated sources
15-
hostprogs := xe_gen_wa_oob
1615

16+
hostprogs := xe_gen_wa_oob
1717
generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
18-
1918
quiet_cmd_wa_oob = GEN $(notdir $(generated_oob))
2019
cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
21-
2220
$(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \
2321
$(src)/xe_wa_oob.rules
2422
$(call cmd,wa_oob)
2523

26-
uses_generated_oob := \
27-
$(obj)/xe_ggtt.o \
28-
$(obj)/xe_gsc.o \
29-
$(obj)/xe_gt.o \
30-
$(obj)/xe_guc.o \
31-
$(obj)/xe_guc_ads.o \
32-
$(obj)/xe_guc_pc.o \
33-
$(obj)/xe_migrate.o \
34-
$(obj)/xe_ring_ops.o \
35-
$(obj)/xe_vm.o \
36-
$(obj)/xe_wa.o \
37-
$(obj)/xe_ttm_stolen_mgr.o
38-
39-
$(uses_generated_oob): $(generated_oob)
40-
4124
# Please keep these build lists sorted!
4225

4326
# core driver code
@@ -192,6 +175,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
192175
display/xe_display.o \
193176
display/xe_display_misc.o \
194177
display/xe_display_rps.o \
178+
display/xe_display_wa.o \
195179
display/xe_dsb_buffer.o \
196180
display/xe_fb_pin.o \
197181
display/xe_hdcp_gsc.o \
@@ -320,3 +304,6 @@ quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
320304

321305
$(obj)/%.hdrtest: $(src)/%.h FORCE
322306
$(call if_changed_dep,hdrtest)
307+
308+
uses_generated_oob := $(addprefix $(obj)/, $(xe-y))
309+
$(uses_generated_oob): $(obj)/generated/xe_wa_oob.h

drivers/gpu/drm/xe/display/intel_fbdev_fb.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "xe_bo.h"
1111
#include "xe_gt.h"
1212
#include "xe_ttm_stolen_mgr.h"
13+
#include "xe_wa.h"
14+
15+
#include <generated/xe_wa_oob.h>
1316

1417
struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
1518
struct drm_fb_helper_surface_size *sizes)
@@ -37,7 +40,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
3740
size = PAGE_ALIGN(size);
3841
obj = ERR_PTR(-ENODEV);
3942

40-
if (!IS_DGFX(xe)) {
43+
if (!IS_DGFX(xe) && !XE_WA(xe_root_mmio_gt(xe), 22019338487_display)) {
4144
obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe),
4245
NULL, size,
4346
ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
@@ -48,6 +51,7 @@ struct intel_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper,
4851
else
4952
drm_info(&xe->drm, "Allocated fbdev into stolen failed: %li\n", PTR_ERR(obj));
5053
}
54+
5155
if (IS_ERR(obj)) {
5256
obj = xe_bo_create_pin_map(xe, xe_device_get_root_tile(xe), NULL, size,
5357
ttm_bo_type_kernel, XE_BO_FLAG_SCANOUT |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: MIT
2+
/*
3+
* Copyright © 2024 Intel Corporation
4+
*/
5+
6+
#include "intel_display_wa.h"
7+
8+
#include "xe_device.h"
9+
#include "xe_wa.h"
10+
11+
#include <generated/xe_wa_oob.h>
12+
13+
bool intel_display_needs_wa_16023588340(struct drm_i915_private *i915)
14+
{
15+
return XE_WA(xe_root_mmio_gt(i915), 16023588340);
16+
}

drivers/gpu/drm/xe/display/xe_dsb_buffer.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "intel_display_types.h"
88
#include "intel_dsb_buffer.h"
99
#include "xe_bo.h"
10+
#include "xe_device.h"
11+
#include "xe_device_types.h"
1012
#include "xe_gt.h"
1113

1214
u32 intel_dsb_buffer_ggtt_offset(struct intel_dsb_buffer *dsb_buf)
@@ -16,7 +18,10 @@ u32 intel_dsb_buffer_ggtt_offset(struct intel_dsb_buffer *dsb_buf)
1618

1719
void intel_dsb_buffer_write(struct intel_dsb_buffer *dsb_buf, u32 idx, u32 val)
1820
{
21+
struct xe_device *xe = dsb_buf->vma->bo->tile->xe;
22+
1923
iosys_map_wr(&dsb_buf->vma->bo->vmap, idx * 4, u32, val);
24+
xe_device_l2_flush(xe);
2025
}
2126

2227
u32 intel_dsb_buffer_read(struct intel_dsb_buffer *dsb_buf, u32 idx)
@@ -26,9 +31,12 @@ u32 intel_dsb_buffer_read(struct intel_dsb_buffer *dsb_buf, u32 idx)
2631

2732
void intel_dsb_buffer_memset(struct intel_dsb_buffer *dsb_buf, u32 idx, u32 val, size_t size)
2833
{
34+
struct xe_device *xe = dsb_buf->vma->bo->tile->xe;
35+
2936
WARN_ON(idx > (dsb_buf->buf_size - size) / sizeof(*dsb_buf->cmd_buf));
3037

3138
iosys_map_memset(&dsb_buf->vma->bo->vmap, idx * 4, val, size);
39+
xe_device_l2_flush(xe);
3240
}
3341

3442
bool intel_dsb_buffer_create(struct intel_crtc *crtc, struct intel_dsb_buffer *dsb_buf, size_t size)

drivers/gpu/drm/xe/display/xe_fb_pin.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "intel_fb.h"
1111
#include "intel_fb_pin.h"
1212
#include "xe_bo.h"
13+
#include "xe_device.h"
1314
#include "xe_ggtt.h"
1415
#include "xe_gt.h"
1516
#include "xe_pm.h"
@@ -304,6 +305,8 @@ static struct i915_vma *__xe_pin_fb_vma(const struct intel_framebuffer *fb,
304305
if (ret)
305306
goto err_unpin;
306307

308+
/* Ensure DPT writes are flushed */
309+
xe_device_l2_flush(xe);
307310
return vma;
308311

309312
err_unpin:

drivers/gpu/drm/xe/display/xe_plane_initial.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#include "intel_frontbuffer.h"
1919
#include "intel_plane_initial.h"
2020
#include "xe_bo.h"
21+
#include "xe_wa.h"
22+
23+
#include <generated/xe_wa_oob.h>
2124

2225
static bool
2326
intel_reuse_initial_plane_obj(struct intel_crtc *this,
@@ -104,6 +107,9 @@ initial_plane_bo(struct xe_device *xe,
104107
phys_base = base;
105108
flags |= XE_BO_FLAG_STOLEN;
106109

110+
if (XE_WA(xe_root_mmio_gt(xe), 22019338487_display))
111+
return NULL;
112+
107113
/*
108114
* If the FB is too big, just don't use it since fbdev is not very
109115
* important and we should probably use that space with FBC or other

drivers/gpu/drm/xe/regs/xe_gt_regs.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
#define LE_CACHEABILITY_MASK REG_GENMASK(1, 0)
8181
#define LE_CACHEABILITY(value) REG_FIELD_PREP(LE_CACHEABILITY_MASK, value)
8282

83+
#define XE2_GAMREQSTRM_CTRL XE_REG(0x4194)
84+
#define CG_DIS_CNTLBUS REG_BIT(6)
85+
8386
#define CCS_AUX_INV XE_REG(0x4208)
8487

8588
#define VD0_AUX_INV XE_REG(0x4218)
@@ -88,6 +91,8 @@
8891
#define VE1_AUX_INV XE_REG(0x42b8)
8992
#define AUX_INV REG_BIT(0)
9093

94+
#define XE2_LMEM_CFG XE_REG(0x48b0)
95+
9196
#define XEHP_TILE_ADDR_RANGE(_idx) XE_REG_MCR(0x4900 + (_idx) * 4)
9297
#define XEHP_FLAT_CCS_BASE_ADDR XE_REG_MCR(0x4910)
9398
#define XEHP_FLAT_CCS_PTR REG_GENMASK(31, 8)
@@ -103,6 +108,7 @@
103108

104109
#define FF_MODE XE_REG_MCR(0x6210)
105110
#define DIS_TE_AUTOSTRIP REG_BIT(31)
111+
#define VS_HIT_MAX_VALUE_MASK REG_GENMASK(25, 20)
106112
#define DIS_MESH_PARTIAL_AUTOSTRIP REG_BIT(16)
107113
#define DIS_MESH_AUTOSTRIP REG_BIT(15)
108114

@@ -372,6 +378,11 @@
372378

373379
#define XEHPC_L3CLOS_MASK(i) XE_REG_MCR(0xb194 + (i) * 8)
374380

381+
#define XE2_GLOBAL_INVAL XE_REG(0xb404)
382+
383+
#define SCRATCH1LPFC XE_REG(0xb474)
384+
#define EN_L3_RW_CCS_CACHE_FLUSH REG_BIT(0)
385+
375386
#define XE2LPM_L3SQCREG5 XE_REG_MCR(0xb658)
376387

377388
#define XE2_TDF_CTRL XE_REG(0xb418)
@@ -395,6 +406,10 @@
395406
#define INVALIDATION_BROADCAST_MODE_DIS REG_BIT(12)
396407
#define GLOBAL_INVALIDATION_MODE REG_BIT(2)
397408

409+
#define LMEM_CFG XE_REG(0xcf58)
410+
#define LMEM_EN REG_BIT(31)
411+
#define LMTT_DIR_PTR REG_GENMASK(30, 0) /* in multiples of 64KB */
412+
398413
#define HALF_SLICE_CHICKEN5 XE_REG_MCR(0xe188, XE_REG_OPTION_MASKED)
399414
#define DISABLE_SAMPLE_G_PERFORMANCE REG_BIT(0)
400415

drivers/gpu/drm/xe/regs/xe_regs.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@
1515
#define GU_MISC_IRQ_OFFSET 0x444f0
1616
#define GU_MISC_GSE REG_BIT(27)
1717

18-
#define SOFTWARE_FLAGS_SPR33 XE_REG(0x4f084)
19-
2018
#define GU_CNTL_PROTECTED XE_REG(0x10100C)
2119
#define DRIVERINT_FLR_DIS REG_BIT(31)
2220

2321
#define GU_CNTL XE_REG(0x101010)
2422
#define LMEM_INIT REG_BIT(7)
2523
#define DRIVERFLR REG_BIT(31)
2624

25+
#define XEHP_CLOCK_GATE_DIS XE_REG(0x101014)
26+
#define SGSI_SIDECLK_DIS REG_BIT(17)
27+
2728
#define GU_DEBUG XE_REG(0x101018)
2829
#define DRIVERFLR_STATUS REG_BIT(31)
2930

30-
#define XEHP_CLOCK_GATE_DIS XE_REG(0x101014)
31-
#define SGSI_SIDECLK_DIS REG_BIT(17)
31+
#define VIRTUAL_CTRL_REG XE_REG(0x10108c)
32+
#define GUEST_GTT_UPDATE_EN REG_BIT(8)
3233

3334
#define XEHP_MTCFG_ADDR XE_REG(0x101800)
3435
#define TILE_COUNT REG_GENMASK(15, 8)
@@ -66,6 +67,9 @@
6667
#define DISPLAY_IRQ REG_BIT(16)
6768
#define GT_DW_IRQ(x) REG_BIT(x)
6869

70+
#define VF_CAP_REG XE_REG(0x1901f8, XE_REG_OPTION_VF)
71+
#define VF_CAP REG_BIT(0)
72+
6973
#define PVC_RP_STATE_CAP XE_REG(0x281014)
7074

7175
#endif

0 commit comments

Comments
 (0)