From patchwork Fri Dec 6 00:55:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 3292021 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 242659F373 for ; Fri, 6 Dec 2013 00:54:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 447F52050B for ; Fri, 6 Dec 2013 00:54:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 662EB20503 for ; Fri, 6 Dec 2013 00:54:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23678FA845; Thu, 5 Dec 2013 16:53:59 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 5778DFA7EE for ; Thu, 5 Dec 2013 16:53:54 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga102.ch.intel.com with ESMTP; 05 Dec 2013 16:53:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,837,1378882800"; d="scan'208";a="439438211" Received: from xhh-hsw32.sh.intel.com ([10.239.37.15]) by fmsmga001.fm.intel.com with ESMTP; 05 Dec 2013 16:53:53 -0800 From: "Xiang, Haihao" To: intel-gfx@lists.freedesktop.org Date: Fri, 6 Dec 2013 08:55:18 +0800 Message-Id: <1386291318-12670-4-git-send-email-haihao.xiang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386291318-12670-1-git-send-email-haihao.xiang@intel.com> References: <1386291318-12670-1-git-send-email-haihao.xiang@intel.com> Subject: [Intel-gfx] [Intel gfx][i-g-t PATCH (v3) 4/4] tests/gem_media_fill: the assembly code for the shader used in the case 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.2 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 From: "Xiang, Haihao" The code is for reference only v2: Fixed the source register used for the send with EOT Fixed the posted destination operand for the send with EOT v3: Fixed the cache agent used in media_block_write message on GEN8 Reviewed-by: Zhao Yakui Signed-off-by: Xiang, Haihao --- shaders/media/README | 5 +++++ shaders/media/media_fill.gxa | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 shaders/media/README create mode 100644 shaders/media/media_fill.gxa diff --git a/shaders/media/README b/shaders/media/README new file mode 100644 index 0000000..9f29601 --- /dev/null +++ b/shaders/media/README @@ -0,0 +1,5 @@ +These files are here for reference only. + +Commands used to generate the shader on gen8 +$> m4 media_fill.gxa > media_fill.gxm +$> intel-gen4asm -g 8 -o media_fill.gxm diff --git a/shaders/media/media_fill.gxa b/shaders/media/media_fill.gxa new file mode 100644 index 0000000..7578890 --- /dev/null +++ b/shaders/media/media_fill.gxa @@ -0,0 +1,44 @@ +/* + * Registers + * g0 -- header + * g1 -- constant + * g2 -- inline data + * g3 -- reserved + * g4-g12 payload for write message + */ +define(`ORIG', `g2.0<2,2,1>UD') +define(`COLOR', `g1.0') +define(`COLORUB', `COLOR<0,1,0>UB') +define(`COLORUD', `COLOR<0,1,0>UD') + +mov(4) COLOR<1>UB COLORUB {align1}; + +/* WRITE */ +mov(8) g4.0<1>UD g0.0<8,8,1>UD {align1}; +mov(2) g4.0<1>UD ORIG {align1}; +mov(1) g4.8<1>UD 0x000f000fUD {align1}; + +mov(16) g5.0<1>UD COLORUD {align1 compr}; +mov(16) g7.0<1>UD COLORUD {align1 compr}; +mov(16) g9.0<1>UD COLORUD {align1 compr}; +mov(16) g11.0<1>UD COLORUD {align1 compr}; + +/* + * comment out the following instruction on Gen7 + * write(0, 0, 10, 12) + * 10: media_block_write + * 12: data cache data port 1 + */ +send(16) 4 acc0<1>UW null write(0, 0, 10, 12) mlen 9 rlen 0 {align1}; + +/* + * uncomment the following instruction on Gen7 + * write(0, 0, 10, 0) + * 10: media_block_write + * 0: reander cache data port + */ +/* send(16) 4 acc0<1>UW null write(0, 0, 10, 0) mlen 9 rlen 0 {align1}; */ + +/* EOT */ +mov(8) g112.0<1>UD g0.0<8,8,1>UD {align1}; +send(16) 112 null<1>UW null thread_spawner(0, 0, 1) mlen 1 rlen 0 {align1 EOT};