From patchwork Mon Nov 18 14:38:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 3196981 Return-Path: X-Original-To: patchwork-dri-devel@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 177BEC045B for ; Mon, 18 Nov 2013 14:38:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8AE020179 for ; Mon, 18 Nov 2013 14:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9A2F22061E for ; Mon, 18 Nov 2013 14:38:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E45ACFBD27; Mon, 18 Nov 2013 06:38:32 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 730C2FB944 for ; Mon, 18 Nov 2013 06:38:31 -0800 (PST) Received: by mail-ea0-f173.google.com with SMTP id g15so1711472eak.4 for ; Mon, 18 Nov 2013 06:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=KDfa1qISFeN6ubmfmP5BBDtWH/60bSJAEJAnLra3ry8=; b=FSISo6eCY0ijxTMufLZiqgV23p/0BnpdchE97WzJGaK3RMKr1LZdYZdClqmh1J5+z9 9/DKkjaeI6W1t01yuVqb/FN4xEfthSQTrsslDZavcrN8GjZVz26hxgIs1PEs+PTZT4Es SCZhDqGpXNtL/R/bciQbX+GVn00LwtZ83mK0XarnOala1WZvKP8sUrMIO6ZUe5uqFKip 8kxd69PlI+EopbOKSlA92M/k+aKLpctp2pAuK1kQm2ZcO5O3MaX1ib1FYxIk7/G5d912 FRHsoAuVNi536Wnp8L99x6i1JWAPrtCn7IJ9QubVq1cD0Kkxio8fImxecHcDX8foIXAk rbOw== X-Received: by 10.14.114.71 with SMTP id b47mr13520911eeh.26.1384785510496; Mon, 18 Nov 2013 06:38:30 -0800 (PST) Received: from localhost.localdomain ([194.228.11.93]) by mx.google.com with ESMTPSA id b42sm38481202eem.9.2013.11.18.06.38.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Nov 2013 06:38:30 -0800 (PST) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] radeon: don't overallocate stencil by 4 on SI and CIK Date: Mon, 18 Nov 2013 15:38:26 +0100 Message-Id: <1384785506-25650-1-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Michel Dänzer Signed-off-by: Marek Olšák --- radeon/radeon_surface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c index 927a21e..cd5cbd6 100644 --- a/radeon/radeon_surface.c +++ b/radeon/radeon_surface.c @@ -1435,16 +1435,17 @@ static void si_surf_minify(struct radeon_surface *surf, */ if (level == 0 && surf->last_level == 0) /* Non-mipmap pitch padded to slice alignment */ + /* Using just bpe here breaks stencil blitting; surf->bpe works. */ xalign = MAX2(xalign, slice_align / surf->bpe); else if (surflevel->mode == RADEON_SURF_MODE_LINEAR_ALIGNED) /* Small rows evenly distributed across slice */ - xalign = MAX2(xalign, slice_align / surf->bpe / surflevel->nblk_y); + xalign = MAX2(xalign, slice_align / bpe / surflevel->nblk_y); surflevel->nblk_x = ALIGN(surflevel->nblk_x, xalign); surflevel->nblk_z = ALIGN(surflevel->nblk_z, zalign); surflevel->offset = offset; - surflevel->pitch_bytes = surflevel->nblk_x * surf->bpe * surf->nsamples; + surflevel->pitch_bytes = surflevel->nblk_x * bpe * surf->nsamples; surflevel->slice_size = ALIGN(surflevel->pitch_bytes * surflevel->nblk_y, slice_align); surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size;