From patchwork Fri Jun 20 10:02:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sourab.gupta@intel.com X-Patchwork-Id: 4387621 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 461DDBEEAA for ; Fri, 20 Jun 2014 10:01:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 505DB20351 for ; Fri, 20 Jun 2014 10:01:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6B39D20222 for ; Fri, 20 Jun 2014 10:01:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 102216E9CD; Fri, 20 Jun 2014 03:01:31 -0700 (PDT) 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 0307F6E9CD for ; Fri, 20 Jun 2014 03:01:29 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 20 Jun 2014 03:01:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,513,1400050800"; d="scan'208";a="531475032" Received: from sourabgu-desktop.iind.intel.com ([10.223.82.83]) by orsmga001.jf.intel.com with ESMTP; 20 Jun 2014 03:01:27 -0700 From: sourab.gupta@intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 20 Jun 2014 15:32:08 +0530 Message-Id: <1403258530-12548-3-git-send-email-sourab.gupta@intel.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1403258530-12548-1-git-send-email-sourab.gupta@intel.com> References: <1403258530-12548-1-git-send-email-sourab.gupta@intel.com> Cc: Daniel Vetter , Akash Goel Subject: [Intel-gfx] [PATCH 2/4] drm/i915: Clearing buffer objects via blitter engine for Gen8 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 From: Deepak S On Gen8, COLOR BLT commands are different. Add gen8 specific command to clearing buffer objects via blitter engines. Signed-off-by: Deepak S --- drivers/gpu/drm/i915/i915_gem_exec.c | 39 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_exec.c b/drivers/gpu/drm/i915/i915_gem_exec.c index 374f1e1..fc9e454 100644 --- a/drivers/gpu/drm/i915/i915_gem_exec.c +++ b/drivers/gpu/drm/i915/i915_gem_exec.c @@ -29,6 +29,8 @@ #include #include "i915_drv.h" +#define GEN8_COLOR_BLT_CMD (2<<29 | 0x50<<22) + #define COLOR_BLT_CMD (2<<29 | 0x40<<22) #define BLT_WRITE_ALPHA (1<<21) #define BLT_WRITE_RGB (1<<20) @@ -100,18 +102,35 @@ int i915_gem_exec_clear_object(struct drm_i915_gem_object *obj) if (ret) goto unpin; - ret = intel_ring_begin(ring, 6); - if (ret) - goto unpin; + if (IS_GEN8(dev)) { + ret = intel_ring_begin(ring, 8); + if (ret) + goto unpin; - intel_ring_emit(ring, COLOR_BLT_CMD | BLT_WRITE_RGBA | (5-2)); - intel_ring_emit(ring, BPP_32 | ROP_FILL_COPY | PAGE_SIZE); - intel_ring_emit(ring, obj->base.size >> PAGE_SHIFT << 16 | PAGE_SIZE); - intel_ring_emit(ring, i915_gem_obj_ggtt_offset(obj)); - intel_ring_emit(ring, 0); - intel_ring_emit(ring, MI_NOOP); + intel_ring_emit(ring, GEN8_COLOR_BLT_CMD | BLT_WRITE_RGBA | (7-2)); + intel_ring_emit(ring, BPP_32 | ROP_FILL_COPY | PAGE_SIZE); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, obj->base.size >> PAGE_SHIFT << 16 | PAGE_SIZE / 4); + intel_ring_emit(ring, i915_gem_obj_ggtt_offset(obj)); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, MI_NOOP); + + __intel_ring_advance(ring); + } else { + ret = intel_ring_begin(ring, 6); + if (ret) + goto unpin; - __intel_ring_advance(ring); + intel_ring_emit(ring, COLOR_BLT_CMD | BLT_WRITE_RGBA | (5-2)); + intel_ring_emit(ring, BPP_32 | ROP_FILL_COPY | PAGE_SIZE); + intel_ring_emit(ring, obj->base.size >> PAGE_SHIFT << 16 | PAGE_SIZE); + intel_ring_emit(ring, i915_gem_obj_ggtt_offset(obj)); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, MI_NOOP); + + __intel_ring_advance(ring); + } i915_gem_exec_dirty_object(obj, ring); unpin: