Skip to content

Commit 275654c

Browse files
committed
Merge tag 'drm-xe-next-fixes-2024-05-09-1' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - Use ordered WQ for G2H handler. (Matthew Brost) - Use flexible-array rather than zero-sized (Lucas De Marchi) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Zjz7SzCvfA3vQRxu@fedora
2 parents 110ed47 + d69c3d4 commit 275654c

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

drivers/gpu/drm/xe/xe_guc_ads.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct __guc_ads_blob {
107107
struct guc_engine_usage engine_usage;
108108
struct guc_um_init_params um_init_params;
109109
/* From here on, location is dynamic! Refer to above diagram. */
110-
struct guc_mmio_reg regset[0];
110+
struct guc_mmio_reg regset[];
111111
} __packed;
112112

113113
#define ads_blob_read(ads_, field_) \

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static void guc_ct_fini(struct drm_device *drm, void *arg)
121121
{
122122
struct xe_guc_ct *ct = arg;
123123

124+
destroy_workqueue(ct->g2h_wq);
124125
xa_destroy(&ct->fence_lookup);
125126
}
126127

@@ -146,6 +147,10 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
146147

147148
xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE));
148149

150+
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", 0);
151+
if (!ct->g2h_wq)
152+
return -ENOMEM;
153+
149154
spin_lock_init(&ct->fast_lock);
150155
xa_init(&ct->fence_lookup);
151156
INIT_WORK(&ct->g2h_worker, g2h_worker_func);

drivers/gpu/drm/xe/xe_guc_ct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline void xe_guc_ct_irq_handler(struct xe_guc_ct *ct)
3434
return;
3535

3636
wake_up_all(&ct->wq);
37-
queue_work(system_unbound_wq, &ct->g2h_worker);
37+
queue_work(ct->g2h_wq, &ct->g2h_worker);
3838
xe_guc_ct_fast_path(ct);
3939
}
4040

drivers/gpu/drm/xe/xe_guc_ct_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ struct xe_guc_ct {
120120
wait_queue_head_t wq;
121121
/** @g2h_fence_wq: wait queue used for G2H fencing */
122122
wait_queue_head_t g2h_fence_wq;
123+
/** @g2h_wq: used to process G2H */
124+
struct workqueue_struct *g2h_wq;
123125
/** @msg: Message buffer */
124126
u32 msg[GUC_CTB_MSG_MAX_LEN];
125127
/** @fast_msg: Message buffer */

0 commit comments

Comments
 (0)