Please drop this one. -----Original Message----- From: Wang, Zhi A Sent: Thursday, September 21, 2017 8:27 PM To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx; intel-gvt-dev@xxxxxxxxxxxxxxxxxxxxx Cc: joonas.lahtinen@xxxxxxxxxxxxxxx; chris@xxxxxxxxxxxxxxxxxx; zhenyuw@xxxxxxxxxxxxxxx; Wang, Zhi A <zhi.a.wang@xxxxxxxxx>; Widawsky, Benjamin <benjamin.widawsky@xxxxxxxxx>; Vivi, Rodrigo <rodrigo.vivi@xxxxxxxxx> Subject: [PATCH 1/2] drm/i915/selftests: Refine the i915_ppat_get test case Refine the i915_ppat_get test case to catch a bug recently intrduced by me. If the PPAT page table is filled first, then there will be PPAT entries which has the same attributes with another one. If we try to get our entry at this time. Tested on my SKL NUC box. Cc: Ben Widawsky <benjamin.widawsky@xxxxxxxxx> Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Signed-off-by: Zhi Wang <zhi.a.wang@xxxxxxxxx> --- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 28 +++++++++++---------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index cd7eeb6..75cb2d6 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1284,7 +1284,7 @@ static int perform_perfect_match_test(struct intel_ppat *ppat) { struct drm_i915_private *i915 = ppat->i915; const struct intel_ppat_entry *entry; - int ret, i; + int i; for_each_set_bit(i, ppat->used, ppat->max_entries) { entry = intel_ppat_get(i915, ppat->entries[i].value); @@ -1296,9 +1296,7 @@ static int perform_perfect_match_test(struct intel_ppat *ppat) intel_ppat_put(entry); return -EINVAL; } - ret = put_and_check_entry(entry); - if (ret) - return ret; + intel_ppat_put(entry); } return 0; } @@ -1328,7 +1326,6 @@ static int perform_partial_match_test(struct intel_ppat *ppat) struct drm_i915_private *i915 = ppat->i915; const struct intel_ppat_entry *entry; u8 value; - int ret; value = generate_new_value(ppat, value_for_partial_test); if (!value) { @@ -1350,10 +1347,7 @@ static int perform_partial_match_test(struct intel_ppat *ppat) return -EINVAL; } - ret = put_and_check_entry(entry); - if (ret) - return ret; - + intel_ppat_put(entry); return 0; } @@ -1373,14 +1367,7 @@ static int igt_ppat_get(void *arg) if (ret) return ret; - /* case 1: perfect match */ - ret = perform_perfect_match_test(ppat); - if (ret) { - pr_err("fail on perfect match test\n"); - return ret; - } - - /* case 2: alloc new entries */ + /* case 1: alloc new entries */ entries = NULL; ret = 0; @@ -1407,6 +1394,13 @@ static int igt_ppat_get(void *arg) *p = entry; } + /* case 2: perfect match */ + ret = perform_perfect_match_test(ppat); + if (ret) { + pr_err("fail on perfect match test\n"); + return ret; + } + /* case 3: negative test 1, suppose PPAT table is full now */ ret = perform_negative_test(ppat); if (ret) { -- 2.7.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx