From: "Xiang, Haihao" Subject: [PATCH 2/2] Update gem_ring_sync_loop to support VEBOX ring (the 4th ring) on Haswell Date: Wed, 14 Nov 2012 12:55:56 +0800 Message-ID: <1352868956-19533-3-git-send-email-haihao.xiang@intel.com> References: <1352868956-19533-1-git-send-email-haihao.xiang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 674469F659 for ; Tue, 13 Nov 2012 21:03:00 -0800 (PST) In-Reply-To: <1352868956-19533-1-git-send-email-haihao.xiang@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: "Xiang, Haihao" Signed-off-by: Xiang, Haihao --- tests/gem_ring_sync_loop.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c index b689bcd..199dcfd 100644 --- a/tests/gem_ring_sync_loop.c +++ b/tests/gem_ring_sync_loop.c @@ -56,14 +56,26 @@ static drm_intel_bo *target_buffer; #define MI_DO_COMPARE (1<<21) static void -store_dword_loop(void) +store_dword_loop(int devid) { int i; + int num_rings = 3; srandom(0xdeadbeef); + if (IS_HASWELL(devid)) + num_rings = 4; + else if (IS_IVYBRIDGE(devid) || IS_GEN6(devid)) + num_rings = 3; + else if (IS_GEN5(devid) || IS_G4X(devid)) + num_rings = 2; + else + num_rings = 1; + + fprintf(stderr, "The number of rings: %d\n", num_rings); + for (i = 0; i < 0x100000; i++) { - int ring = random() % 3 + 1; + int ring = random() % num_rings + 1; if (ring == I915_EXEC_RENDER) { BEGIN_BATCH(4); @@ -127,7 +139,7 @@ int main(int argc, char **argv) exit(-1); } - store_dword_loop(); + store_dword_loop(devid); drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); -- 1.7.9.5