From patchwork Wed Nov 14 04:55:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 1737761 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id AEF42DF264 for ; Wed, 14 Nov 2012 05:04:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A56EE9F5D2 for ; Tue, 13 Nov 2012 21:04:04 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Nov 2012 21:02:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.83,248,1352102400"; d="scan'208";a="241849821" Received: from xhh-hsw32.sh.intel.com ([10.239.36.99]) by orsmga002.jf.intel.com with ESMTP; 13 Nov 2012 21:02:59 -0800 From: "Xiang, Haihao" To: intel-gfx@lists.freedesktop.org Date: Wed, 14 Nov 2012 12:55:56 +0800 Message-Id: <1352868956-19533-3-git-send-email-haihao.xiang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352868956-19533-1-git-send-email-haihao.xiang@intel.com> References: <1352868956-19533-1-git-send-email-haihao.xiang@intel.com> Subject: [Intel-gfx] [PATCH 2/2] Update gem_ring_sync_loop to support VEBOX ring (the 4th ring) on Haswell X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@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);