From patchwork Fri Dec 6 08:54:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 3293791 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 449349F373 for ; Fri, 6 Dec 2013 08:53:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2ED31201F4 for ; Fri, 6 Dec 2013 08:53:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0A17A204EB for ; Fri, 6 Dec 2013 08:53:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73A2EFA6BC; Fri, 6 Dec 2013 00:53:30 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id BEE59FA6BC for ; Fri, 6 Dec 2013 00:53:25 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 06 Dec 2013 00:53:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,839,1378882800"; d="scan'208";a="439615981" Received: from xhh-hsw32.sh.intel.com ([10.239.37.15]) by fmsmga001.fm.intel.com with ESMTP; 06 Dec 2013 00:53:24 -0800 From: "Xiang, Haihao" To: intel-gfx@lists.freedesktop.org Date: Fri, 6 Dec 2013 16:54:46 +0800 Message-Id: <1386320087-3017-3-git-send-email-haihao.xiang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386320087-3017-1-git-send-email-haihao.xiang@intel.com> References: <1386320087-3017-1-git-send-email-haihao.xiang@intel.com> Subject: [Intel-gfx] [Intel gfx][i-g-t PATCH 3/4] rendercopy/bdw: A workaround for 3D pipeline 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.4 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" Emit PIPELINE_SELECT twice and make sure the commands in the first batch buffer have been done. However I don't know why this works !!! Signed-off-by: Xiang, Haihao --- lib/rendercopy_gen8.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c index 1a137dd..6eb1051 100644 --- a/lib/rendercopy_gen8.c +++ b/lib/rendercopy_gen8.c @@ -148,7 +148,8 @@ batch_copy(struct intel_batchbuffer *batch, const void *ptr, uint32_t size, uint static void gen6_render_flush(struct intel_batchbuffer *batch, - drm_intel_context *context, uint32_t batch_end) + drm_intel_context *context, uint32_t batch_end, + int waiting) { int ret; @@ -157,6 +158,11 @@ gen6_render_flush(struct intel_batchbuffer *batch, ret = drm_intel_gem_bo_context_exec(batch->bo, context, batch_end, 0); assert(ret == 0); + + if (waiting) { + dri_bo_map(batch->bo, 0); + dri_bo_unmap(batch->bo); + } } /* Mostly copy+paste from gen6, except height, width, pitch moved */ @@ -880,6 +886,15 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch, intel_batchbuffer_flush_with_context(batch, context); + /* I don't know why it works !!! */ + batch->ptr = batch->buffer; + OUT_BATCH(GEN6_PIPELINE_SELECT | PIPELINE_SELECT_3D); + OUT_BATCH(MI_BATCH_BUFFER_END); + batch_end = batch_align(batch, 8); + assert(batch_end < BATCH_STATE_SPLIT); + gen6_render_flush(batch, context, batch_end, 1); + intel_batchbuffer_reset(batch); + batch_align(batch, 8); batch->ptr = &batch->buffer[BATCH_STATE_SPLIT]; @@ -968,6 +983,6 @@ void gen8_render_copyfunc(struct intel_batchbuffer *batch, annotation_flush(&aub_annotations, batch); - gen6_render_flush(batch, context, batch_end); + gen6_render_flush(batch, context, batch_end, 0); intel_batchbuffer_reset(batch); }