From patchwork Thu Feb 6 18:19:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3597631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA92F9F2F5 for ; Thu, 6 Feb 2014 18:19:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBAFC2012F for ; Thu, 6 Feb 2014 18:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 09C0620109 for ; Thu, 6 Feb 2014 18:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AAD0FB518; Thu, 6 Feb 2014 10:19:16 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A9E8FB518 for ; Thu, 6 Feb 2014 10:19:14 -0800 (PST) Received: by mail-pb0-f48.google.com with SMTP id rr13so2086226pbb.21 for ; Thu, 06 Feb 2014 10:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RRGbg+BuH1WjRNUFsVFAWNCi2Et0y2WtGZ7zj1W/TeE=; b=Ao6LyV8QKMnvcbry8d3r913zGifEeinUbhakhsj2AAA/OUoNsrhUUVEPrJkrOaPJW4 eBC3pnmCgCo6Fwl+K0BNdagWxpX4PY4D6ULe3WEmDah1U1PrWcbG84rxH3wOWwq6MW3Z qoKXFFez4ciWZhspLBco3m8FXLh6kOu8S4AJvEUkKF7TfN1IJYo+KL7ELKddCCMZh4Yl BV0Wm+0rgRLp2DTHNVERDwDhnkgyjhGDytGALseyoz1riTygxdeQOedYg22LnpbEJ7Nu n/GX8+tuYWGcPz53KncCkAWGYl4VeQ/3sO4mD51/aAyzEVzvXRf7gV0t7kWE8bVicDTR +aYA== X-Received: by 10.66.217.133 with SMTP id oy5mr2262571pac.46.1391710754275; Thu, 06 Feb 2014 10:19:14 -0800 (PST) Received: from localhost (jfdmzpr01-ext.jf.intel.com. [134.134.139.70]) by mx.google.com with ESMTPSA id hb10sm5756012pbd.1.2014.02.06.10.19.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2014 10:19:13 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Feb 2014 16:19:08 -0200 Message-Id: <1391710748-27520-1-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20140206172644.GF5360@nuc-i3427.alporthouse.com> References: <20140206172644.GF5360@nuc-i3427.alporthouse.com> Cc: , ChrisWilsonchris@chris-wilson.co.uk Subject: [Intel-gfx] [PATCH] tests/gem_gtt_hog: Fix for BDW 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update XY_COLOR_BLT command for Broadwell. v2: stash devid and remove ugly double allocation. (by Chris). Cc: Chris Wilson chris@chris-wilson.co.uk> Signed-off-by: Rodrigo Vivi --- tests/gem_gtt_hog.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c index 53cd7eb..4198a94 100644 --- a/tests/gem_gtt_hog.c +++ b/tests/gem_gtt_hog.c @@ -57,17 +57,25 @@ static void busy(int fd, uint32_t handle, int size, int loops) struct drm_i915_gem_execbuffer2 execbuf; struct drm_i915_gem_pwrite gem_pwrite; struct drm_i915_gem_create create; - uint32_t buf[122], *b; - int i; + uint32_t buf[170], *b; + int i, b_size; + int devid = intel_get_drm_devid(fd); memset(reloc, 0, sizeof(reloc)); memset(gem_exec, 0, sizeof(gem_exec)); memset(&execbuf, 0, sizeof(execbuf)); + b_size = devid >= 8 ? 170 : 122; b = buf; for (i = 0; i < 20; i++) { - *b++ = XY_COLOR_BLT_CMD_NOLEN | 4 | - COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB; + if (devid >= 8) { + *b++ = MI_NOOP; + *b++ = XY_COLOR_BLT_CMD_NOLEN | 4 | + COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB; + } else { + *b++ = XY_COLOR_BLT_CMD_NOLEN | 5 | + COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB; + } *b++ = 0xf0 << 16 | 1 << 25 | 1 << 24 | 4096; *b++ = 0; *b++ = size >> 12 << 16 | 1024; @@ -76,6 +84,8 @@ static void busy(int fd, uint32_t handle, int size, int loops) reloc[i].read_domains = I915_GEM_DOMAIN_RENDER; reloc[i].write_domain = I915_GEM_DOMAIN_RENDER; *b++ = 0; + if (devid >= 8) + *b++ = 0; *b++ = canary; } *b++ = MI_BATCH_BUFFER_END; @@ -93,14 +103,14 @@ static void busy(int fd, uint32_t handle, int size, int loops) execbuf.buffers_ptr = (uintptr_t)gem_exec; execbuf.buffer_count = 2; - execbuf.batch_len = sizeof(buf); + execbuf.batch_len = b_size; execbuf.flags = 1 << 11; - if (HAS_BLT_RING(intel_get_drm_devid(fd))) + if (HAS_BLT_RING(devid)) execbuf.flags |= I915_EXEC_BLT; gem_pwrite.handle = gem_exec[1].handle; gem_pwrite.offset = 0; - gem_pwrite.size = sizeof(buf); + gem_pwrite.size = b_size; gem_pwrite.data_ptr = (uintptr_t)buf; if (drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite) == 0) { while (loops--)