Skip to content

Commit 2ef8d63

Browse files
committed
Merge tag 'drm-xe-next-2024-09-05' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Cross-subsystem Changes: - Split dma fence array creation into alloc and arm (Matthew Brost) Driver Changes: - Move kernel_lrc to execlist backend (Ilia) - Fix type width for pcode coommand (Karthik) - Make xe_drm.h include unambiguous (Jani) - Fixes and debug improvements for GSC load (Daniele) - Track resources and VF state by PF (Michal Wajdeczko) - Fix memory leak on error path (Nirmoy) - Cleanup header includes (Matt Roper) - Move pcode logic to tile scope (Matt Roper) - Move hwmon logic to device scope (Matt Roper) - Fix media TLB invalidation (Matthew Brost) - Threshold config fixes for PF (Michal Wajdeczko) - Remove extra "[drm]" from logs (Michal Wajdeczko) - Add missing runtime ref (Rodrigo Vivi) - Fix circular locking on runtime suspend (Rodrigo Vivi) - Fix rpm in TTM swapout path (Thomas) Signed-off-by: Dave Airlie <[email protected]> From: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/eirx5vdvoflbbqlrzi5cip6bpu3zjojm2pxseufu3rlq4pp6xv@eytjvhizfyu6
2 parents af04e65 + 34bb7b8 commit 2ef8d63

Some content is hidden

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

60 files changed

+1978
-272
lines changed

drivers/dma-buf/dma-fence-array.c

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,37 +144,38 @@ const struct dma_fence_ops dma_fence_array_ops = {
144144
EXPORT_SYMBOL(dma_fence_array_ops);
145145

146146
/**
147-
* dma_fence_array_create - Create a custom fence array
147+
* dma_fence_array_alloc - Allocate a custom fence array
148+
* @num_fences: [in] number of fences to add in the array
149+
*
150+
* Return dma fence array on success, NULL on failure
151+
*/
152+
struct dma_fence_array *dma_fence_array_alloc(int num_fences)
153+
{
154+
struct dma_fence_array *array;
155+
156+
return kzalloc(struct_size(array, callbacks, num_fences), GFP_KERNEL);
157+
}
158+
EXPORT_SYMBOL(dma_fence_array_alloc);
159+
160+
/**
161+
* dma_fence_array_init - Init a custom fence array
162+
* @array: [in] dma fence array to arm
148163
* @num_fences: [in] number of fences to add in the array
149164
* @fences: [in] array containing the fences
150165
* @context: [in] fence context to use
151166
* @seqno: [in] sequence number to use
152167
* @signal_on_any: [in] signal on any fence in the array
153168
*
154-
* Allocate a dma_fence_array object and initialize the base fence with
155-
* dma_fence_init().
156-
* In case of error it returns NULL.
157-
*
158-
* The caller should allocate the fences array with num_fences size
159-
* and fill it with the fences it wants to add to the object. Ownership of this
160-
* array is taken and dma_fence_put() is used on each fence on release.
161-
*
162-
* If @signal_on_any is true the fence array signals if any fence in the array
163-
* signals, otherwise it signals when all fences in the array signal.
169+
* Implementation of @dma_fence_array_create without allocation. Useful to init
170+
* a preallocated dma fence array in the path of reclaim or dma fence signaling.
164171
*/
165-
struct dma_fence_array *dma_fence_array_create(int num_fences,
166-
struct dma_fence **fences,
167-
u64 context, unsigned seqno,
168-
bool signal_on_any)
172+
void dma_fence_array_init(struct dma_fence_array *array,
173+
int num_fences, struct dma_fence **fences,
174+
u64 context, unsigned seqno,
175+
bool signal_on_any)
169176
{
170-
struct dma_fence_array *array;
171-
172177
WARN_ON(!num_fences || !fences);
173178

174-
array = kzalloc(struct_size(array, callbacks, num_fences), GFP_KERNEL);
175-
if (!array)
176-
return NULL;
177-
178179
array->num_fences = num_fences;
179180

180181
spin_lock_init(&array->lock);
@@ -200,6 +201,41 @@ struct dma_fence_array *dma_fence_array_create(int num_fences,
200201
*/
201202
while (num_fences--)
202203
WARN_ON(dma_fence_is_container(fences[num_fences]));
204+
}
205+
EXPORT_SYMBOL(dma_fence_array_init);
206+
207+
/**
208+
* dma_fence_array_create - Create a custom fence array
209+
* @num_fences: [in] number of fences to add in the array
210+
* @fences: [in] array containing the fences
211+
* @context: [in] fence context to use
212+
* @seqno: [in] sequence number to use
213+
* @signal_on_any: [in] signal on any fence in the array
214+
*
215+
* Allocate a dma_fence_array object and initialize the base fence with
216+
* dma_fence_init().
217+
* In case of error it returns NULL.
218+
*
219+
* The caller should allocate the fences array with num_fences size
220+
* and fill it with the fences it wants to add to the object. Ownership of this
221+
* array is taken and dma_fence_put() is used on each fence on release.
222+
*
223+
* If @signal_on_any is true the fence array signals if any fence in the array
224+
* signals, otherwise it signals when all fences in the array signal.
225+
*/
226+
struct dma_fence_array *dma_fence_array_create(int num_fences,
227+
struct dma_fence **fences,
228+
u64 context, unsigned seqno,
229+
bool signal_on_any)
230+
{
231+
struct dma_fence_array *array;
232+
233+
array = dma_fence_array_alloc(num_fences);
234+
if (!array)
235+
return NULL;
236+
237+
dma_fence_array_init(array, num_fences, fences,
238+
context, seqno, signal_on_any);
203239

204240
return array;
205241
}

drivers/gpu/drm/xe/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ xe-y += xe_bb.o \
4040
xe_ggtt.o \
4141
xe_gpu_scheduler.o \
4242
xe_gsc.o \
43+
xe_gsc_debugfs.o \
4344
xe_gsc_proxy.o \
4445
xe_gsc_submit.o \
4546
xe_gt.o \

drivers/gpu/drm/xe/compat-i915-headers/intel_pcode.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ static inline int
1313
snb_pcode_write_timeout(struct intel_uncore *uncore, u32 mbox, u32 val,
1414
int fast_timeout_us, int slow_timeout_ms)
1515
{
16-
return xe_pcode_write_timeout(__compat_uncore_to_gt(uncore), mbox, val,
16+
return xe_pcode_write_timeout(__compat_uncore_to_tile(uncore), mbox, val,
1717
slow_timeout_ms ?: 1);
1818
}
1919

2020
static inline int
2121
snb_pcode_write(struct intel_uncore *uncore, u32 mbox, u32 val)
2222
{
2323

24-
return xe_pcode_write(__compat_uncore_to_gt(uncore), mbox, val);
24+
return xe_pcode_write(__compat_uncore_to_tile(uncore), mbox, val);
2525
}
2626

2727
static inline int
2828
snb_pcode_read(struct intel_uncore *uncore, u32 mbox, u32 *val, u32 *val1)
2929
{
30-
return xe_pcode_read(__compat_uncore_to_gt(uncore), mbox, val, val1);
30+
return xe_pcode_read(__compat_uncore_to_tile(uncore), mbox, val, val1);
3131
}
3232

3333
static inline int
3434
skl_pcode_request(struct intel_uncore *uncore, u32 mbox,
3535
u32 request, u32 reply_mask, u32 reply,
3636
int timeout_base_ms)
3737
{
38-
return xe_pcode_request(__compat_uncore_to_gt(uncore), mbox, request, reply_mask, reply,
38+
return xe_pcode_request(__compat_uncore_to_tile(uncore), mbox, request, reply_mask, reply,
3939
timeout_base_ms);
4040
}
4141

drivers/gpu/drm/xe/compat-i915-headers/intel_uncore.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ static inline struct xe_gt *__compat_uncore_to_gt(struct intel_uncore *uncore)
1717
return xe_root_mmio_gt(xe);
1818
}
1919

20+
static inline struct xe_tile *__compat_uncore_to_tile(struct intel_uncore *uncore)
21+
{
22+
struct xe_device *xe = container_of(uncore, struct xe_device, uncore);
23+
24+
return xe_device_get_root_tile(xe);
25+
}
26+
2027
static inline u32 intel_uncore_read(struct intel_uncore *uncore,
2128
i915_reg_t i915_reg)
2229
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "intel_display_types.h"
99
#include "intel_fbdev_fb.h"
1010
#include "xe_bo.h"
11-
#include "xe_gt.h"
1211
#include "xe_ttm_stolen_mgr.h"
1312
#include "xe_wa.h"
1413

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <drm/drm_drv.h>
1212
#include <drm/drm_managed.h>
13-
#include <drm/xe_drm.h>
13+
#include <uapi/drm/xe_drm.h>
1414

1515
#include "soc/intel_dram.h"
1616
#include "i915_drv.h" /* FIXME: HAS_DISPLAY() depends on this */
@@ -345,10 +345,10 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
345345

346346
intel_hpd_cancel_work(xe);
347347

348-
if (!runtime && has_display(xe))
348+
if (!runtime && has_display(xe)) {
349349
intel_display_driver_suspend_access(xe);
350-
351-
intel_encoder_suspend_all(&xe->display);
350+
intel_encoder_suspend_all(&xe->display);
351+
}
352352

353353
intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
354354

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "xe_bo.h"
1010
#include "xe_device.h"
1111
#include "xe_device_types.h"
12-
#include "xe_gt.h"
1312

1413
u32 intel_dsb_buffer_ggtt_offset(struct intel_dsb_buffer *dsb_buf)
1514
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "xe_bo.h"
1313
#include "xe_device.h"
1414
#include "xe_ggtt.h"
15-
#include "xe_gt.h"
1615
#include "xe_pm.h"
1716

1817
static void

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "xe_force_wake.h"
1717
#include "xe_gsc_proxy.h"
1818
#include "xe_gsc_submit.h"
19-
#include "xe_gt.h"
2019
#include "xe_map.h"
2120
#include "xe_pm.h"
2221
#include "xe_uc_fw.h"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@
3232
#define HECI1_FWSTS1_CURRENT_STATE_RESET 0
3333
#define HECI1_FWSTS1_PROXY_STATE_NORMAL 5
3434
#define HECI1_FWSTS1_INIT_COMPLETE REG_BIT(9)
35+
#define HECI_FWSTS2(base) XE_REG((base) + 0xc48)
36+
#define HECI_FWSTS3(base) XE_REG((base) + 0xc60)
37+
#define HECI_FWSTS4(base) XE_REG((base) + 0xc64)
3538
#define HECI_FWSTS5(base) XE_REG((base) + 0xc68)
3639
#define HECI1_FWSTS5_HUC_AUTH_DONE REG_BIT(19)
40+
#define HECI_FWSTS6(base) XE_REG((base) + 0xc6c)
3741

3842
#define HECI_H_GS1(base) XE_REG((base) + 0xc4c)
3943
#define HECI_H_GS1_ER_PREP REG_BIT(0)

0 commit comments

Comments
 (0)