From patchwork Mon Mar 30 21:00:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Phogat X-Patchwork-Id: 6125351 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBB71BF4A6 for ; Mon, 30 Mar 2015 21:01:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AE4520434 for ; Mon, 30 Mar 2015 21:01:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3149620429 for ; Mon, 30 Mar 2015 21:01:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B297A6E636; Mon, 30 Mar 2015 14:01:20 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 861566E630 for ; Mon, 30 Mar 2015 14:01:12 -0700 (PDT) Received: by pacgg7 with SMTP id gg7so48865773pac.0 for ; Mon, 30 Mar 2015 14:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=TTUp1dre3a9vT4ivbBdDaBZSQAVVv4KR5eyHaHc/itA=; b=Y1lkHb7L3YOfM1I/WISgpjDLAomG0sKbNdO4JBUtdhFRJUX0cld9ly+rozh/zOnXzh vxIYCcnoRaHdQjXvDHGRr7XRectW8tJjf4NH7xR4x0zFKTN0y4LjrLXLKqO+m4AkeBy1 nTOLjGRn5NYfQ2zpjKwp9RYTfN1REoHhNQjMmRS3/5D7hUD+B95zEyF0w2v7m4dVVk5i Iiku+l9OTFCcv2fFxKRaK/TtBu2+IShscpy/0ctc4Ts0vv0PoyrRMXYWE4p0RaX5klwM iJvnhKmczXoZcT9Pi9QKIfZpfB2TWWRmI8UJ2pCcnGWvONxB3jpL1DLFj6oiBMuzKowD Xq5Q== X-Received: by 10.68.237.226 with SMTP id vf2mr62596210pbc.12.1427749272397; Mon, 30 Mar 2015 14:01:12 -0700 (PDT) Received: from carbon.ak.intel.com (jfdmzpr02-ext.jf.intel.com. [134.134.137.71]) by mx.google.com with ESMTPSA id g9sm875640pdj.24.2015.03.30.14.01.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 14:01:11 -0700 (PDT) From: Anuj Phogat To: Date: Mon, 30 Mar 2015 14:00:07 -0700 Message-Id: <1427749208-8961-5-git-send-email-anuj.phogat@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1427749208-8961-1-git-send-email-anuj.phogat@gmail.com> References: <1427749208-8961-1-git-send-email-anuj.phogat@gmail.com> Subject: [Intel-gfx] [PATCH 4/5] Align YS tile base address to 64KB X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 Signed-off-by: Anuj Phogat --- intel/intel_bufmgr_gem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 7c50e26..775a9f9 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -289,8 +289,13 @@ drm_intel_gem_bo_tile_size(drm_intel_bufmgr_gem *bufmgr_gem, unsigned long size, if (*tiling_mode == I915_TILING_NONE) return size; + /* Tiled surface base addresses must be tile aligned (64KB aligned + * for TileYS, 4KB aligned for all other tile modes). + */ + if (*tiling_mode == I915_TILING_YS) + return ROUND_UP_TO(size, 64 * 1024); /* 965+ just need multiples of page size for tiling */ - if (bufmgr_gem->gen >= 4) + else if (bufmgr_gem->gen >= 4) return ROUND_UP_TO(size, 4096); /* Older chips need powers of two, of at least 512k or 1M */