From patchwork Wed Feb 27 18:28:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2194441 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 11CB53FD4E for ; Wed, 27 Feb 2013 18:28:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17D73E665B for ; Wed, 27 Feb 2013 10:28:46 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D2EEE5E0E for ; Wed, 27 Feb 2013 10:28:13 -0800 (PST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 27 Feb 2013 10:28:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,749,1355126400"; d="scan'208";a="262229181" Received: from unknown (HELO dyon.amr.corp.intel.com) ([10.255.12.237]) by azsmga001.ch.intel.com with ESMTP; 27 Feb 2013 10:28:12 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Wed, 27 Feb 2013 18:28:07 +0000 Message-Id: <1361989687-12989-2-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1361989687-12989-1-git-send-email-damien.lespiau@intel.com> References: <1361989687-12989-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH] tests: Make it easy to tell if rendercopy is doing the right thing 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 When dumping an .aub file, gem_render_linear_blit samples a texture to write it in a render target 1:1. When enabling new platforms, it's really handy to be able to see if you are actually rendering to the target which is hard to see currently as all the buffers are initialized with incrementing numbers and look very much alike. So, when dumping an .aub file for inspection, let's fill the destination buffer with a constant color (0xff0000ff) and dump both src and dest bos into bmp files. Signed-off-by: Damien Lespiau --- tests/gem_render_linear_blits.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index 2def40d..03d3546 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -52,6 +52,9 @@ check_bo(int fd, uint32_t handle, uint32_t val) { int i; + if (drmtest_dump_aub()) + return; + gem_read(fd, handle, 0, linear, sizeof(linear)); for (i = 0; i < WIDTH*HEIGHT; i++) { if (linear[i] != val) { @@ -105,7 +108,12 @@ int main(int argc, char **argv) bo[i] = drm_intel_bo_alloc(bufmgr, "", SIZE, 4096); start_val[i] = start; for (j = 0; j < WIDTH*HEIGHT; j++) - linear[j] = start++; + /* When dumping an .aub file, fill the destination with blue + * so can easily tell if the source has been copied over */ + if (drmtest_dump_aub() && i == 1) + linear[j] = 0xff0000ff; + else + linear[j] = start++; gem_write(fd, bo[i]->handle, 0, linear, sizeof(linear)); } @@ -134,6 +142,10 @@ int main(int argc, char **argv) /* We're not really here for the test, we just want to dump a * trace of a call to render_copy() */ if (drmtest_dump_aub()) { + drm_intel_gem_bo_aub_dump_bmp(src.bo, + 0, 0, WIDTH, HEIGHT, + AUB_DUMP_BMP_FORMAT_ARGB_8888, + STRIDE, 0); drm_intel_gem_bo_aub_dump_bmp(dst.bo, 0, 0, WIDTH, HEIGHT, AUB_DUMP_BMP_FORMAT_ARGB_8888,