From patchwork Fri Jan 29 18:46:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 8166501 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 A88619F440 for ; Fri, 29 Jan 2016 18:46:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9D4420382 for ; Fri, 29 Jan 2016 18:46:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BB5B820381 for ; Fri, 29 Jan 2016 18:46:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 325D96E0B5; Fri, 29 Jan 2016 10:46:47 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id 752456E0B5 for ; Fri, 29 Jan 2016 10:46:45 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 29 Jan 2016 10:46:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,365,1449561600"; d="scan'208";a="643627695" Received: from svosulli-mobl3.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.193.19]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jan 2016 10:46:44 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 29 Jan 2016 16:46:30 -0200 Message-Id: <1454093192-23857-1-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.7.0.rc3 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 1/3] lib/igt_fb: also call __gem_set_tiling for Y tiling 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The interesting thing is that if we don't do this, we still get a Y tiled framebuffer, but there won't be a fence around it, which makes the GTT mmaps less interesting. Is this a Kernel bug? Signed-off-by: Paulo Zanoni --- lib/igt_fb.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 5f23136..efdd793 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -73,6 +73,22 @@ static struct format_desc_struct { #define for_each_format(f) \ for (f = format_desc; f - format_desc < ARRAY_SIZE(format_desc); f++) +static unsigned int fb_mod_to_obj_tiling(uint64_t fb_mod) +{ + switch (fb_mod) { + case LOCAL_DRM_FORMAT_MOD_NONE: + return I915_TILING_NONE; + case LOCAL_I915_FORMAT_MOD_X_TILED: + return I915_TILING_X; + case LOCAL_I915_FORMAT_MOD_Y_TILED: + return I915_TILING_Y; + case LOCAL_I915_FORMAT_MOD_Yf_TILED: + return I915_TILING_Yf; + default: + igt_assert(0); + } +} + static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, unsigned *width_ret, unsigned *height_ret) { @@ -191,9 +207,10 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp, gem_handle = gem_create(fd, bo_size); - if (tiling == LOCAL_I915_FORMAT_MOD_X_TILED) - ret = __gem_set_tiling(fd, gem_handle, I915_TILING_X, - bo_stride); + if (tiling == LOCAL_I915_FORMAT_MOD_X_TILED || + tiling == LOCAL_I915_FORMAT_MOD_Y_TILED) + ret = __gem_set_tiling(fd, gem_handle, + fb_mod_to_obj_tiling(tiling), bo_stride); *stride_ret = bo_stride; *size_ret = bo_size; @@ -862,22 +879,6 @@ struct fb_blit_upload { } linear; }; -static unsigned int fb_mod_to_obj_tiling(uint64_t fb_mod) -{ - switch (fb_mod) { - case LOCAL_DRM_FORMAT_MOD_NONE: - return I915_TILING_NONE; - case LOCAL_I915_FORMAT_MOD_X_TILED: - return I915_TILING_X; - case LOCAL_I915_FORMAT_MOD_Y_TILED: - return I915_TILING_Y; - case LOCAL_I915_FORMAT_MOD_Yf_TILED: - return I915_TILING_Yf; - default: - igt_assert(0); - } -} - static void destroy_cairo_surface__blit(void *arg) { struct fb_blit_upload *blit = arg;