Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
---
 tests/perf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/perf.c b/tests/perf.c
index 5058315c..bc5ea133 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -1280,9 +1280,7 @@ read_2_oa_reports(int format_id,
        /* Note: we allocate a large buffer so that each read() iteration
         * should scrape *all* pending records.
         *
-        * The largest buffer the OA unit supports is 16MB and the smallest
-        * OA report format is 64bytes allowing up to 262144 reports to
-        * be buffered.
+        * The largest buffer the OA unit supports is 16MB.
         *
         * Being sure we are fetching all buffered reports allows us to
         * potentially throw away / skip all reports whenever we see
@@ -1295,7 +1293,8 @@ read_2_oa_reports(int format_id,
         * to indicate that the OA unit may be over taxed if lots of reports
         * are being lost.
         */
-       int buf_size = 262144 * (64 + sizeof(struct 
drm_i915_perf_record_header));
+       int max_reports = (16 * 1024 * 1024) / format_size;
+       int buf_size = sample_size * max_reports * 1.5;
        uint8_t *buf = malloc(buf_size);
        int n = 0;
 
@@ -1307,6 +1306,7 @@ read_2_oa_reports(int format_id,
                        ;
 
                igt_assert(len > 0);
+               igt_debug("read %d bytes\n", (int)len);
 
                for (size_t offset = 0; offset < len; offset += header->size) {
                        const uint32_t *report;
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to