Skip to content

Commit 612978b

Browse files
emomaxdrodrigovivi
authored andcommitted
drm/i915/selftests: Fix GT PM sort comparators
Compare the sampled clock values instead of their addresses. Comparing addresses leaves the samples unsorted, preventing the code from discarding the minimum and maximum samples. Fixes: 1a53924 ("drm/i915/selftests: Measure CS_TIMESTAMP") Signed-off-by: Emre Cecanpunar <emreleno@gmail.com> Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net> Link: https://lore.kernel.org/r/20260714220430.238433-1-emreleno@gmail.com (cherry picked from commit 682ea2d) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent e89978c commit 612978b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ static int cmp_u64(const void *A, const void *B)
1616
{
1717
const u64 *a = A, *b = B;
1818

19-
if (a < b)
19+
if (*a < *b)
2020
return -1;
21-
else if (a > b)
21+
else if (*a > *b)
2222
return 1;
2323
else
2424
return 0;
@@ -28,9 +28,9 @@ static int cmp_u32(const void *A, const void *B)
2828
{
2929
const u32 *a = A, *b = B;
3030

31-
if (a < b)
31+
if (*a < *b)
3232
return -1;
33-
else if (a > b)
33+
else if (*a > *b)
3434
return 1;
3535
else
3636
return 0;

0 commit comments

Comments
 (0)