From patchwork Mon Nov 24 09:48:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Forbes X-Patchwork-Id: 5364431 Return-Path: X-Original-To: patchwork-dri-devel@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 E4E7B9F2F5 for ; Mon, 24 Nov 2014 09:48:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11FA720373 for ; Mon, 24 Nov 2014 09:48:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6643320351 for ; Mon, 24 Nov 2014 09:48:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90C18899D4; Mon, 24 Nov 2014 01:48:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 48D5A899D4 for ; Mon, 24 Nov 2014 01:48:32 -0800 (PST) Received: by mail-pa0-f45.google.com with SMTP id lj1so9194266pab.4 for ; Mon, 24 Nov 2014 01:48:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nqyYHESZ+d8KV/gWbPH8+MpiSH/28OgRw8oFYjUg7GA=; b=JF8CtNZ8Y7iXqwjKieR2EvZ1FfNLcQy4xtUu7hBAjflwTCdIi5DuUYNseQA01TmnsI O8j0SzBAogDRhlPrcjMUyIfO04Cpf85tVJsq/DrpufEbQAXFaC+CrTNUMxVH38GW0QDY ApnF+COkodyj4IWpuvnMTx6HnQu3H3wg81A9EH3xsUXkp+HUKu8aRS/BtilnlWJrjDYX IqHuioOOq1Ud1yG2cRfs8lf6tc9EHFrEMxg7D/awAraiDfJzxIKvjt9aBCqkIo8ysk4N jmeYDgwc/UpQ3aWe73txGNR5csEnc8y4GQX1btMo3PZnm4dFdGFugQoNgQv3EXSPIV6R maUg== X-Gm-Message-State: ALoCoQn2mcFQEhSZV+F1TdfGYHhp3Z00UIRcjImk2qpWYWupLfXnqGG8IEezbjNd4gMVWoHIkdF3 X-Received: by 10.66.193.8 with SMTP id hk8mr9661620pac.141.1416822512078; Mon, 24 Nov 2014 01:48:32 -0800 (PST) Received: from localhost.localdomain (202-78-145-199.cable.telstraclear.net. [202.78.145.199]) by mx.google.com with ESMTPSA id kj9sm11884699pbc.37.2014.11.24.01.48.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 01:48:30 -0800 (PST) From: Chris Forbes To: dri-devel@lists.freedesktop.org Subject: [PATCH] [libdrm] intel: Add decode for Gen7 3DSTATE_DEPTH_BUFFER Date: Mon, 24 Nov 2014 22:48:18 +1300 Message-Id: <1416822498-18204-1-git-send-email-chrisf@ijw.co.nz> X-Mailer: git-send-email 2.1.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 Signed-off-by: Chris Forbes --- intel/intel_decode.c | 57 +++++++++++++++++++++++++++++++-------- intel/tests/gen7-3d.batch-ref.txt | 12 ++++----- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/intel/intel_decode.c b/intel/intel_decode.c index adda29a..0c3c943 100644 --- a/intel/intel_decode.c +++ b/intel/intel_decode.c @@ -2637,6 +2637,20 @@ static const char *get_965_depthformat(unsigned int depthformat) } } +static const char *get_gen7_depthformat(unsigned int depthformat) +{ + switch (depthformat) { + case 1: + return "z32float"; + case 3: + return "z24x8"; + case 5: + return "z16"; + default: + return "unknown"; + } +} + static const char *get_965_element_component(uint32_t data, int component) { uint32_t component_control = (data >> (16 + (3 - component) * 4)) & 0x7; @@ -3363,17 +3377,38 @@ decode_3d_965(struct drm_intel_decode *ctx) instr_out(ctx, 3, "WM sampler state\n"); return len; case 0x7805: - /* Actually 3DSTATE_DEPTH_BUFFER on gen7. */ - if (ctx->gen == 7) - break; - - instr_out(ctx, 0, "3DSTATE_URB\n"); - instr_out(ctx, 1, - "VS entries %d, alloc size %d (1024bit row)\n", - data[1] & 0xffff, ((data[1] >> 16) & 0x07f) + 1); - instr_out(ctx, 2, - "GS entries %d, alloc size %d (1024bit row)\n", - (data[2] >> 8) & 0x3ff, (data[2] & 7) + 1); + if (ctx->gen >= 7) { + /* 3DSTATE_DEPTH_BUFFER on gen7. */ + instr_out(ctx, 0, "3DSTATE_DEPTH_BUFFER\n"); + instr_out(ctx, 1, "%s %s pitch = %d ZWr%s SWr%s Hiz%s\n", + get_965_surfacetype(data[1] >> 29), + get_gen7_depthformat((data[1] >> 18) & 0x7), + (data[1] & 0x1ffff) + 1, + data[1] & (1<<28) ? "On" : "Off", + data[1] & (1<<27) ? "On" : "Off", + data[1] & (1<<22) ? "On" : "Off" + ); + instr_out(ctx, 2, "surface base address\n"); + instr_out(ctx, 3, "width = %d height = %d lod = %d\n", + ((data[3] >> 4) & 0x3fff) + 1, + (data[3] >> 18) + 1, + data[3] & 0xf); + instr_out(ctx, 4, "depth = %d minlayer = %d\n", + (data[4] >> 21) + 1, + (data[4] >> 10) & 0x7ff); + instr_out(ctx, 5, "offsets\n"); + instr_out(ctx, 6, "view extent = %d\n", + (data[6] >> 21)); + } else { + /* 3DSTATE_URB on <= gen6. */ + instr_out(ctx, 0, "3DSTATE_URB\n"); + instr_out(ctx, 1, + "VS entries %d, alloc size %d (1024bit row)\n", + data[1] & 0xffff, ((data[1] >> 16) & 0x07f) + 1); + instr_out(ctx, 2, + "GS entries %d, alloc size %d (1024bit row)\n", + (data[2] >> 8) & 0x3ff, (data[2] & 7) + 1); + } return len; case 0x7808: diff --git a/intel/tests/gen7-3d.batch-ref.txt b/intel/tests/gen7-3d.batch-ref.txt index cd2dfc4..db70625 100644 --- a/intel/tests/gen7-3d.batch-ref.txt +++ b/intel/tests/gen7-3d.batch-ref.txt @@ -173,12 +173,12 @@ 0x123002b0: 0x00000000: 0x123002b4: 0x00000000: 0x123002b8: 0x78050005: 3DSTATE_DEPTH_BUFFER -0x123002bc: 0xe0040000: dword 1 -0x123002c0: 0x00000000: dword 2 -0x123002c4: 0x00000000: dword 3 -0x123002c8: 0x00000000: dword 4 -0x123002cc: 0x00000000: dword 5 -0x123002d0: 0x00000000: dword 6 +0x123002bc: 0xe0040000: NULL z32float pitch = 1 ZWrOff SWrOff HizOff +0x123002c0: 0x00000000: surface base address +0x123002c4: 0x00000000: width = 1 height = 1 lod = 0 +0x123002c8: 0x00000000: depth = 1 minlayer = 0 +0x123002cc: 0x00000000: offsets +0x123002d0: 0x00000000: view extent = 0 0x123002d4: 0x78070001: 3DSTATE_HIER_DEPTH_BUFFER 0x123002d8: 0x00000000: pitch 1b 0x123002dc: 0x00000000: pointer to HiZ buffer