From patchwork Tue Aug 8 16:16:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 9888709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F95D60363 for ; Tue, 8 Aug 2017 16:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00B6B28996 for ; Tue, 8 Aug 2017 16:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9BFC28942; Tue, 8 Aug 2017 16:17:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A15A228996 for ; Tue, 8 Aug 2017 16:17:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7499A6E1AB; Tue, 8 Aug 2017 16:16:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 694886E195 for ; Tue, 8 Aug 2017 16:16:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 0CA8326C717 From: Daniel Stone To: intel-gfx@lists.freedesktop.org Date: Tue, 8 Aug 2017 17:16:40 +0100 Message-Id: <20170808161645.25329-3-daniels@collabora.com> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170808161645.25329-1-daniels@collabora.com> References: <20170808161645.25329-1-daniels@collabora.com> Cc: daniel.vetter@ffwll.ch Subject: [Intel-gfx] [PATCH i-g-t 3/8] tests/kms_ccs: Remove excessive FB alignment 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-Virus-Scanned: ClamAV using ClamSMTP We don't need to align the framebuffer dimensions to the tile size. As long as the pitch is aligned to the tile width, and the BO dimensions can fit full tiles of both aligned pitch and aligned height, we don't need to claim the FB itself is larger. Signed-off-by: Daniel Stone --- tests/kms_ccs.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c index cdc56f79..c02a0433 100644 --- a/tests/kms_ccs.c +++ b/tests/kms_ccs.c @@ -143,16 +143,14 @@ static void generate_fb(data_t *data, struct igt_fb *fb, modifier = LOCAL_I915_FORMAT_MOD_Y_TILED; f.flags = LOCAL_DRM_MODE_FB_MODIFIERS; - f.width = ALIGN(width, 16); - f.height = ALIGN(height, 8); + f.width = width; + f.height = height; if (data->flags & TEST_BAD_PIXEL_FORMAT) f.pixel_format = DRM_FORMAT_RGB565; else f.pixel_format = DRM_FORMAT_XRGB8888; - width = f.width; - height = f.height; f.pitches[0] = ALIGN(width * 4, 128); f.modifier[0] = modifier; f.offsets[0] = 0; @@ -173,12 +171,12 @@ static void generate_fb(data_t *data, struct igt_fb *fb, * 32x16. Since the main surface has a 32-bit format, we * need to multiply width by 4 to get bytes. */ - width = ALIGN(f.width * 4, 32) / 32; - height = ALIGN(f.height, 16) / 16; - f.pitches[1] = ALIGN(width * 1, 128); + int ccs_width = ALIGN(width * 4, 32) / 32; + int ccs_height = ALIGN(height, 16) / 16; + f.pitches[1] = ALIGN(ccs_width * 1, 128); f.modifier[1] = modifier; f.offsets[1] = size[0]; - size[1] = f.pitches[1] * ALIGN(height, 32); + size[1] = f.pitches[1] * ALIGN(ccs_height, 32); f.handles[0] = gem_create(data->drm_fd, size[0] + size[1]); f.handles[1] = f.handles[0];