From patchwork Mon Mar 30 21:00:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Phogat X-Patchwork-Id: 6125331 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF3B39F2EC for ; Mon, 30 Mar 2015 21:01:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F32692041E for ; Mon, 30 Mar 2015 21:01:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 24CFC20429 for ; Mon, 30 Mar 2015 21:01:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF4856E630; Mon, 30 Mar 2015 14:01:12 -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 CD0A26E630 for ; Mon, 30 Mar 2015 14:01:10 -0700 (PDT) Received: by padcy3 with SMTP id cy3so177948239pad.3 for ; Mon, 30 Mar 2015 14:01:10 -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=+Wfjndjt6gBbHaOqnMvZ1xyFy2OZG3DZsRBuRyEOCpc=; b=Rcd4lNTkcKLU1G5tFX/EJ+kL8+h6ARWUzriOquc8l5ZKSOdmUqGyCNiuFydjMwTLUE vqKK18+xeZFE81pB616epRdp3Su7qVUWRcchMmR55ZG0TOOVu8oEfkKnNg5ccgQvV7vP GBxyFlQCpu8iFWpadF+JBEnFTtg1z7eev21dxU2/84OoiVeFyz6VRi69ao4VsUZFYxQz ad+7RuFgN3WjWzk/r82/Ck8XAnmcZxm/nin+Q/ILxHxliF0OrDfAEj+6C4xrQHEzlpBv ysMw98/rm4oMRq0q0kM/DX0khhvq9VdXuiUfVynuYwL4rYueEdZkJk0OyWqoNoiUoOJG mQqQ== X-Received: by 10.68.138.230 with SMTP id qt6mr2208425pbb.66.1427749270658; Mon, 30 Mar 2015 14:01:10 -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.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 14:01:09 -0700 (PDT) From: Anuj Phogat To: Date: Mon, 30 Mar 2015 14:00:05 -0700 Message-Id: <1427749208-8961-3-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 2/5] i965/skl: Move tile_width computations out of drm_intel_gem_bo_tile_pitch 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 This will be utilized by next patch in this series. Signed-off-by: Anuj Phogat --- intel/intel_bufmgr_gem.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 5a67f53..af44ba5 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -324,9 +324,9 @@ drm_intel_gem_bo_tile_size(drm_intel_bufmgr_gem *bufmgr_gem, unsigned long size, */ static unsigned long drm_intel_gem_bo_tile_pitch(drm_intel_bufmgr_gem *bufmgr_gem, - unsigned long pitch, uint32_t *tiling_mode) + unsigned long pitch, unsigned long tile_width, + uint32_t *tiling_mode) { - unsigned long tile_width; unsigned long i; /* If untiled, then just align it so that we can do rendering @@ -335,13 +335,6 @@ drm_intel_gem_bo_tile_pitch(drm_intel_bufmgr_gem *bufmgr_gem, if (*tiling_mode == I915_TILING_NONE) return ALIGN(pitch, 64); - if (*tiling_mode == I915_TILING_X - || (IS_915(bufmgr_gem->pci_device) - && *tiling_mode == I915_TILING_Y)) - tile_width = 512; - else - tile_width = 128; - /* 965 is flexible */ if (bufmgr_gem->gen >= 4) return ROUND_UP_TO(pitch, tile_width); @@ -816,7 +809,7 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, unsigned long *pitch, unsigned long flags) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; - unsigned long size, stride; + unsigned long size, stride, tile_width; uint32_t tiling; do { @@ -842,14 +835,18 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name, height_alignment = 16; else if (tiling == I915_TILING_X || (IS_915(bufmgr_gem->pci_device) - && tiling == I915_TILING_Y)) + && tiling == I915_TILING_Y)) { height_alignment = 8; - else if (tiling == I915_TILING_Y) + tile_width = 512; + } else if (tiling == I915_TILING_Y) height_alignment = 32; + tile_width = 128; + } aligned_y = ALIGN(y, height_alignment); stride = x * cpp; - stride = drm_intel_gem_bo_tile_pitch(bufmgr_gem, stride, tiling_mode); + stride = drm_intel_gem_bo_tile_pitch(bufmgr_gem, stride, + tile_width, tiling_mode); size = stride * aligned_y; size = drm_intel_gem_bo_tile_size(bufmgr_gem, size, tiling_mode); } while (*tiling_mode != tiling);