From patchwork Sun Sep 1 19:51:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2852601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56F15C0AB5 for ; Sun, 1 Sep 2013 19:54:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A67E20256 for ; Sun, 1 Sep 2013 19:54:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B03FE20254 for ; Sun, 1 Sep 2013 19:54:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99C7AE673D for ; Sun, 1 Sep 2013 12:54:27 -0700 (PDT) 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 68B4AE6612 for ; Sun, 1 Sep 2013 12:51:29 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 01 Sep 2013 12:48:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.89,1002,1367996400"; d="scan'208"; a="396767949" Received: from bolo_yeung.jf.intel.com ([10.7.197.58]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2013 12:51:27 -0700 From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Sun, 1 Sep 2013 12:51:26 -0700 Message-Id: <1378065086-28705-7-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1378065086-28705-1-git-send-email-benjamin.widawsky@intel.com> References: <1378065086-28705-1-git-send-email-benjamin.widawsky@intel.com> Cc: Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH 7/7] intel_gtt: Raw PTE dumper mode 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 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 ./tools/intel_gtt -d | head GTT offset | PTEs -------------------------------------------------------- 0x000000 | 0xe4005015 0xe2854015 0xe283e015 0xe283f015 0x004000 | 0xe28ba015 0xe28bb015 0xe28b6015 0xe28b7015 0x008000 | 0xe2828015 0xe2829015 0xe282a015 0xe282b015 0x00c000 | 0xe2928015 0xe2929015 0xe292a015 0xe292b015 0x010000 | 0xe2918015 0xe2919015 0xe291a015 0xe291b015 0x014000 | 0xe291c015 0xe291d015 0xe291e015 0xe291f015 0x018000 | 0xe2920015 0xe2921015 0xe2922015 0xe2923015 0x01c000 | 0xe2924015 0xe2925015 0xe2926015 0xe2927015 Signed-off-by: Ben Widawsky --- tools/intel_gtt.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/intel_gtt.c b/tools/intel_gtt.c index acf63c1..090e88d 100644 --- a/tools/intel_gtt.c +++ b/tools/intel_gtt.c @@ -58,6 +58,25 @@ static uint64_t get_phys(uint32_t pt_offset) return (phys | pae) & ~0xfff; } +static void pte_dump(int size, uint32_t offset) { + int start; + /* Want to print 4 ptes at a time (4b PTE assumed). */ + if (size % 16) + size = (size + 16) & ~0xffff; + + + printf("GTT offset | PTEs\n"); + printf("--------------------------------------------------------\n"); + for (start = 0; start < size; start += KB(16)) { + printf(" 0x%06x | 0x%08x 0x%08x 0x%08x 0x%08x\n", + start, + INGTT(start + 0x0), + INGTT(start + 0x1000), + INGTT(start + 0x2000), + INGTT(start + 0x3000)); + } +} + int main(int argc, char **argv) { struct pci_device *pci_dev; @@ -105,6 +124,10 @@ int main(int argc, char **argv) } aper_size = pci_dev->regions[2].size; + if (argc > 1 && !strncmp("-d", argv[1], 2)) { + pte_dump(aper_size, 0); + return 0; + } for (start = 0; start < aper_size; start += KB(4)) { uint64_t start_phys = get_phys(start);