From patchwork Wed Feb 16 06:07:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 565801 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1G6AMaL031100 for ; Wed, 16 Feb 2011 06:10:42 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40BEF9E7EA for ; Tue, 15 Feb 2011 22:10:22 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EED39E7F1 for ; Tue, 15 Feb 2011 22:08:14 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 15 Feb 2011 22:07:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.60,479,1291622400"; d="scan'208";a="603105400" Received: from ubuntu-hp.sh.intel.com ([10.239.36.56]) by orsmga002.jf.intel.com with ESMTP; 15 Feb 2011 22:07:44 -0800 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org Date: Wed, 16 Feb 2011 14:07:39 +0800 Message-Id: <1297836461-31543-3-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297836461-31543-1-git-send-email-zhenyuw@linux.intel.com> References: <1297836461-31543-1-git-send-email-zhenyuw@linux.intel.com> Cc: yuanhan.liu@intel.com Subject: [Intel-gfx] [PATCH 1/3] intel: new debug option for aub file dump X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Feb 2011 06:10:42 +0000 (UTC) diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 65c4148..45e9915 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -522,6 +522,7 @@ static const struct dri_debug_control debug_control[] = { { "urb", DEBUG_URB }, { "vs", DEBUG_VS }, { "clip", DEBUG_CLIP }, + { "aub", DEBUG_AUB }, { NULL, 0 } }; @@ -863,6 +864,15 @@ intelInitContext(struct intel_context *intel, if (INTEL_DEBUG & DEBUG_BUFMGR) dri_bufmgr_set_debug(intel->bufmgr, GL_TRUE); + if (INTEL_DEBUG & DEBUG_AUB) { + fprintf(stderr, "Enable Aub file dump.\n"); + intel->aub_file = fopen("intel.aub", "w"); + if (intel->aub_file) + drm_intel_bufmgr_gem_set_aubfile(intel->bufmgr, intel->aub_file); + else + fprintf(stderr, "Fail to create aub file.\n"); + } + intel->batch = intel_batchbuffer_alloc(intel); intel_fbo_init(intel); diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 134e07e..c3c83e4 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -267,6 +267,7 @@ struct intel_context * Configuration cache */ driOptionCache optionCache; + FILE *aub_file; }; extern char *__progname; @@ -360,6 +361,7 @@ extern int INTEL_DEBUG; #define DEBUG_URB 0x1000000 #define DEBUG_VS 0x2000000 #define DEBUG_CLIP 0x8000000 +#define DEBUG_AUB 0x10000000 #define DBG(...) do { \ if (unlikely(INTEL_DEBUG & FILE_DEBUG_FLAG)) \