Skip to content

Commit dc1af50

Browse files
committed
Merge tag 'drm-intel-gt-next-2025-10-29' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Driver Changes: Fixes/improvements/new stuff: - Set O_LARGEFILE in __create_shmem() (Taotao Chen) - Fix incorrect error handling in shmem_pwrite() (Taotao Chen) - Skip GuC communication warning on reset in progress [guc] (Zhanjun Dong) - Fix conversion between clock ticks and nanoseconds [guc] (Umesh Nerlige Ramappa) Miscellaneous: - Avoid accessing uninitialized context in emit_rpcs_query() [selftests] (Krzysztof Karas) - Fix typo in comment (I915_EXEC_NO_RELOC) [gem] (Marlon Henrique Sanches) Backmerges: - Merge drm/drm-next into drm-intel-gt-next (Joonas Lahtinen) Signed-off-by: Simona Vetter <simona.vetter@ffwll.ch> From: Tvrtko Ursulin <tursulin@igalia.com> Link: https://patch.msgid.link/aQH994lQI_iVPzTI@linux
2 parents 7446fbf + 2ada9cb commit dc1af50

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ enum {
142142
* we want to leave the object where it is and for all the existing relocations
143143
* to match. If the object is given a new address, or if userspace thinks the
144144
* object is elsewhere, we have to parse all the relocation entries and update
145-
* the addresses. Userspace can set the I915_EXEC_NORELOC flag to hint that
145+
* the addresses. Userspace can set the I915_EXEC_NO_RELOC flag to hint that
146146
* all the target addresses in all of its objects match the value in the
147147
* relocation entries and that they all match the presumed offsets given by the
148148
* list of execbuffer objects. Using this knowledge, we know that if we haven't

drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,20 @@ shmem_pwrite(struct drm_i915_gem_object *obj,
441441
written = file->f_op->write_iter(&kiocb, &iter);
442442
BUG_ON(written == -EIOCBQUEUED);
443443

444-
if (written != size)
445-
return -EIO;
446-
444+
/*
445+
* First, check if write_iter returned a negative error.
446+
* If the write failed, return the real error code immediately.
447+
* This prevents it from being overwritten by the short write check below.
448+
*/
447449
if (written < 0)
448450
return written;
451+
/*
452+
* Check for a short write (written bytes != requested size).
453+
* Even if some data was written, return -EIO to indicate that the
454+
* write was not fully completed.
455+
*/
456+
if (written != size)
457+
return -EIO;
449458

450459
return 0;
451460
}

drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,13 +962,14 @@ emit_rpcs_query(struct drm_i915_gem_object *obj,
962962
if (IS_ERR(rpcs))
963963
return PTR_ERR(rpcs);
964964

965+
i915_gem_ww_ctx_init(&ww, false);
966+
965967
batch = i915_vma_instance(rpcs, ce->vm, NULL);
966968
if (IS_ERR(batch)) {
967969
err = PTR_ERR(batch);
968970
goto err_put;
969971
}
970972

971-
i915_gem_ww_ctx_init(&ww, false);
972973
retry:
973974
err = i915_gem_object_lock(obj, &ww);
974975
if (!err)

drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static u64 div_u64_roundup(u64 nom, u32 den)
205205

206206
u64 intel_gt_clock_interval_to_ns(const struct intel_gt *gt, u64 count)
207207
{
208-
return div_u64_roundup(count * NSEC_PER_SEC, gt->clock_frequency);
208+
return mul_u64_u32_div(count, NSEC_PER_SEC, gt->clock_frequency);
209209
}
210210

211211
u64 intel_gt_pm_interval_to_ns(const struct intel_gt *gt, u64 count)
@@ -215,7 +215,7 @@ u64 intel_gt_pm_interval_to_ns(const struct intel_gt *gt, u64 count)
215215

216216
u64 intel_gt_ns_to_clock_interval(const struct intel_gt *gt, u64 ns)
217217
{
218-
return div_u64_roundup(gt->clock_frequency * ns, NSEC_PER_SEC);
218+
return mul_u64_u32_div(ns, gt->clock_frequency, NSEC_PER_SEC);
219219
}
220220

221221
u64 intel_gt_ns_to_pm_interval(const struct intel_gt *gt, u64 ns)

0 commit comments

Comments
 (0)