Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-xe-next-fixes-2025-12-04' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next

Driver Changes:
- Fix a memory leak (Mika)
- Fix a 64-bit division (Michal Wajdeczko)
- vf migration fix (Matt Brost)
- LRC pause Fix (Tomasz lis)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/aTIGiHJnnMtqbDOO@fedora

+36 -23
+3 -2
drivers/gpu/drm/xe/xe_gpu_scheduler.h
··· 54 54 static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched) 55 55 { 56 56 struct drm_sched_job *s_job; 57 + bool restore_replay = false; 57 58 58 59 list_for_each_entry(s_job, &sched->base.pending_list, list) { 59 60 struct drm_sched_fence *s_fence = s_job->s_fence; 60 61 struct dma_fence *hw_fence = s_fence->parent; 61 62 62 - if (to_xe_sched_job(s_job)->skip_emit || 63 - (hw_fence && !dma_fence_is_signaled(hw_fence))) 63 + restore_replay |= to_xe_sched_job(s_job)->restore_replay; 64 + if (restore_replay || (hw_fence && !dma_fence_is_signaled(hw_fence))) 64 65 sched->base.ops->run_job(s_job); 65 66 } 66 67 }
+1 -1
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
··· 711 711 if (num_vfs > 56) 712 712 return SZ_64M - SZ_8M; 713 713 714 - return rounddown_pow_of_two(shareable / num_vfs); 714 + return rounddown_pow_of_two(div_u64(shareable, num_vfs)); 715 715 } 716 716 717 717 /**
+30 -17
drivers/gpu/drm/xe/xe_guc_submit.c
··· 822 822 823 823 xe_gt_assert(guc_to_gt(guc), exec_queue_registered(q)); 824 824 825 - if (!job->skip_emit || job->last_replay) { 825 + if (!job->restore_replay || job->last_replay) { 826 826 if (xe_exec_queue_is_parallel(q)) 827 827 wq_item_append(q); 828 828 else ··· 881 881 if (!killed_or_banned_or_wedged && !xe_sched_job_is_error(job)) { 882 882 if (!exec_queue_registered(q)) 883 883 register_exec_queue(q, GUC_CONTEXT_NORMAL); 884 - if (!job->skip_emit) 884 + if (!job->restore_replay) 885 885 q->ring_ops->emit_job(job); 886 886 submit_exec_queue(q, job); 887 - job->skip_emit = false; 887 + job->restore_replay = false; 888 888 } 889 889 890 890 /* ··· 2112 2112 q->guc->resume_time = 0; 2113 2113 } 2114 2114 2115 + static void lrc_parallel_clear(struct xe_lrc *lrc) 2116 + { 2117 + struct xe_device *xe = gt_to_xe(lrc->gt); 2118 + struct iosys_map map = xe_lrc_parallel_map(lrc); 2119 + int i; 2120 + 2121 + for (i = 0; i < WQ_SIZE / sizeof(u32); ++i) 2122 + parallel_write(xe, map, wq[i], 2123 + FIELD_PREP(WQ_TYPE_MASK, WQ_TYPE_NOOP) | 2124 + FIELD_PREP(WQ_LEN_MASK, 0)); 2125 + } 2126 + 2115 2127 /* 2116 2128 * This function is quite complex but only real way to ensure no state is lost 2117 2129 * during VF resume flows. The function scans the queue state, make adjustments ··· 2147 2135 guc_exec_queue_revert_pending_state_change(guc, q); 2148 2136 2149 2137 if (xe_exec_queue_is_parallel(q)) { 2150 - struct xe_device *xe = guc_to_xe(guc); 2151 - struct iosys_map map = xe_lrc_parallel_map(q->lrc[0]); 2138 + /* Pairs with WRITE_ONCE in __xe_exec_queue_init */ 2139 + struct xe_lrc *lrc = READ_ONCE(q->lrc[0]); 2152 2140 2153 2141 /* 2154 2142 * NOP existing WQ commands that may contain stale GGTT ··· 2156 2144 * seems to get confused if the WQ head/tail pointers are 2157 2145 * adjusted. 2158 2146 */ 2159 - for (i = 0; i < WQ_SIZE / sizeof(u32); ++i) 2160 - parallel_write(xe, map, wq[i], 2161 - FIELD_PREP(WQ_TYPE_MASK, WQ_TYPE_NOOP) | 2162 - FIELD_PREP(WQ_LEN_MASK, 0)); 2147 + if (lrc) 2148 + lrc_parallel_clear(lrc); 2163 2149 } 2164 2150 2165 2151 job = xe_sched_first_pending_job(sched); 2166 2152 if (job) { 2153 + job->restore_replay = true; 2154 + 2167 2155 /* 2168 2156 * Adjust software tail so jobs submitted overwrite previous 2169 2157 * position in ring buffer with new GGTT addresses. ··· 2253 2241 struct xe_exec_queue *q) 2254 2242 { 2255 2243 struct xe_gpu_scheduler *sched = &q->guc->sched; 2256 - struct drm_sched_job *s_job; 2257 2244 struct xe_sched_job *job = NULL; 2245 + bool restore_replay = false; 2258 2246 2259 - list_for_each_entry(s_job, &sched->base.pending_list, list) { 2260 - job = to_xe_sched_job(s_job); 2247 + list_for_each_entry(job, &sched->base.pending_list, drm.list) { 2248 + restore_replay |= job->restore_replay; 2249 + if (restore_replay) { 2250 + xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d", 2251 + q->guc->id, xe_sched_job_seqno(job)); 2261 2252 2262 - xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d", 2263 - q->guc->id, xe_sched_job_seqno(job)); 2264 - 2265 - q->ring_ops->emit_job(job); 2266 - job->skip_emit = true; 2253 + q->ring_ops->emit_job(job); 2254 + job->restore_replay = true; 2255 + } 2267 2256 } 2268 2257 2269 2258 if (job)
-1
drivers/gpu/drm/xe/xe_pagefault.c
··· 102 102 103 103 /* Lock VM and BOs dma-resv */ 104 104 xe_validation_ctx_init(&ctx, &vm->xe->val, &exec, (struct xe_val_flags) {}); 105 - drm_exec_init(&exec, 0, 0); 106 105 drm_exec_until_all_locked(&exec) { 107 106 err = xe_pagefault_begin(&exec, vma, tile->mem.vram, 108 107 needs_vram == 1);
+2 -2
drivers/gpu/drm/xe/xe_sched_job_types.h
··· 63 63 bool ring_ops_flush_tlb; 64 64 /** @ggtt: mapped in ggtt. */ 65 65 bool ggtt; 66 - /** @skip_emit: skip emitting the job */ 67 - bool skip_emit; 66 + /** @restore_replay: job being replayed for restore */ 67 + bool restore_replay; 68 68 /** @last_replay: last job being replayed */ 69 69 bool last_replay; 70 70 /** @ptrs: per instance pointers. */