From patchwork Thu Mar 6 21:12:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Graunke X-Patchwork-Id: 3786461 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 0C02EBF540 for ; Thu, 6 Mar 2014 21:16:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 140C62024C for ; Thu, 6 Mar 2014 21:16:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 23EE2201F0 for ; Thu, 6 Mar 2014 21:16:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5754FAB59; Thu, 6 Mar 2014 13:16:53 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from homiemail-a10.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E2A3FAB66 for ; Thu, 6 Mar 2014 13:16:46 -0800 (PST) Received: from homiemail-a10.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a10.g.dreamhost.com (Postfix) with ESMTP id 5BEF6280074; Thu, 6 Mar 2014 13:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=whitecape.org; h=from:to :cc:subject:date:message-id:in-reply-to:references; s= whitecape.org; bh=alzy4E9jv+QgyHIQih6ZYNly8+s=; b=s2QRJaGNBhnT5U X7YxtEO5UqjbHL4Dc4VcZdShCTNQ+fpYH2jDzaamMIfErVrzzaayoB8BAKBuCIQf 8KxdqP5RpiEb4Q22We+b/MoRv3khzC5+qPAe8+2HoOBsKiA1l9LBQWbIwlfwQH6N pLuT3OkOT0/k9ELFDiMh0MyA1ujBg= Received: from localhost.localdomain (unknown [172.56.32.17]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: kenneth@whitecape.org) by homiemail-a10.g.dreamhost.com (Postfix) with ESMTPSA id 2092A28005C; Thu, 6 Mar 2014 13:16:45 -0800 (PST) From: Kenneth Graunke To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Mar 2014 13:12:32 -0800 Message-Id: <1394140352-1307-3-git-send-email-kenneth@whitecape.org> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1394140352-1307-1-git-send-email-kenneth@whitecape.org> References: <1394140352-1307-1-git-send-email-kenneth@whitecape.org> Cc: stephane.marchesin@gmail.com Subject: [Intel-gfx] [PATCH 3/3] uxa: Enable BLT acceleration on Broadwell. 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 This supports solid, copy, put_image, and get_image acceleration via the BLT engine. RENDER acceleration (composite) would be piles of work, which is not worth doing since SNA exists, and Glamor is coming. Signed-off-by: Kenneth Graunke --- src/uxa/intel_batchbuffer.h | 8 +++++++- src/uxa/intel_driver.c | 7 ++----- src/uxa/intel_uxa.c | 12 +++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/uxa/intel_batchbuffer.h b/src/uxa/intel_batchbuffer.h index b2bb390..79e2ab0 100644 --- a/src/uxa/intel_batchbuffer.h +++ b/src/uxa/intel_batchbuffer.h @@ -108,6 +108,8 @@ intel_batch_emit_reloc(intel_screen_private *intel, uint32_t read_domains, uint32_t write_domains, uint32_t delta, int needs_fence) { + uint64_t offset; + if (needs_fence) drm_intel_bo_emit_reloc_fence(intel->batch_bo, intel->batch_used * 4, @@ -118,7 +120,11 @@ intel_batch_emit_reloc(intel_screen_private *intel, bo, delta, read_domains, write_domains); - intel_batch_emit_dword(intel, bo->offset + delta); + offset = bo->offset64 + delta; + + intel_batch_emit_dword(intel, offset); + if (INTEL_INFO(intel)->gen >= 0100) + intel_batch_emit_dword(intel, offset >> 32); } static inline void diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c index 46e06df..7ea3b63 100644 --- a/src/uxa/intel_driver.c +++ b/src/uxa/intel_driver.c @@ -405,9 +405,6 @@ static Bool can_accelerate_blt(struct intel_screen_private *intel) if (INTEL_INFO(intel)->gen == -1) return FALSE; - if (INTEL_INFO(intel)->gen >= 0100) - return FALSE; - if (xf86ReturnOptValBool(intel->Options, OPTION_ACCEL_DISABLE, FALSE) || !intel_option_cast_string_to_bool(intel, OPTION_ACCEL_METHOD, TRUE)) { xf86DrvMsg(intel->scrn->scrnIndex, X_CONFIG, @@ -938,7 +935,7 @@ I830ScreenInit(SCREEN_INIT_ARGS_DECL) intel_batch_init(scrn); - if (INTEL_INFO(intel)->gen >= 040) + if (INTEL_INFO(intel)->gen >= 040 && INTEL_INFO(intel)->gen < 0100) gen4_render_state_init(scrn); miClearVisualTypes(); @@ -1193,7 +1190,7 @@ static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL) intel_batch_teardown(scrn); - if (INTEL_INFO(intel)->gen >= 040) + if (INTEL_INFO(intel)->gen >= 040 && INTEL_INFO(intel)->gen < 0100) gen4_render_state_cleanup(scrn); xf86_cursors_fini(screen); diff --git a/src/uxa/intel_uxa.c b/src/uxa/intel_uxa.c index e46e15b..f4b8d2a 100644 --- a/src/uxa/intel_uxa.c +++ b/src/uxa/intel_uxa.c @@ -324,9 +324,10 @@ static void intel_uxa_solid(PixmapPtr pixmap, int x1, int y1, int x2, int y2) pitch = intel_pixmap_pitch(pixmap); { - BEGIN_BATCH_BLT(6); + int len = INTEL_INFO(intel)->gen >= 0100 ? 7 : 6; + BEGIN_BATCH_BLT(len); - cmd = XY_COLOR_BLT_CMD | (6 - 2); + cmd = XY_COLOR_BLT_CMD | (len - 2); if (pixmap->drawable.bitsPerPixel == 32) cmd |= @@ -462,9 +463,10 @@ intel_uxa_copy(PixmapPtr dest, int src_x1, int src_y1, int dst_x1, src_pitch = intel_pixmap_pitch(intel->render_source); { - BEGIN_BATCH_BLT(8); + int len = INTEL_INFO(intel)->gen >= 0100 ? 10 : 8; + BEGIN_BATCH_BLT(len); - cmd = XY_SRC_COPY_BLT_CMD | (8 - 2); + cmd = XY_SRC_COPY_BLT_CMD | (len - 2); if (dest->drawable.bitsPerPixel == 32) cmd |= @@ -1353,7 +1355,7 @@ Bool intel_uxa_init(ScreenPtr screen) intel->uxa_driver->done_copy = intel_uxa_done; /* Composite */ - if (intel_option_accel_blt(intel)) { + if (intel_option_accel_blt(intel) || INTEL_INFO(intel)->gen >= 0100) { } else if (IS_GEN2(intel)) { intel->uxa_driver->check_composite = i830_check_composite; intel->uxa_driver->check_composite_target = i830_check_composite_target;