From patchwork Fri Mar 17 19:15:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 9631479 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 C704E602D6 for ; Fri, 17 Mar 2017 19:08:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B797E2856B for ; Fri, 17 Mar 2017 19:08:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC42428593; Fri, 17 Mar 2017 19:08:22 +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 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 5100A2856B for ; Fri, 17 Mar 2017 19:08:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E2D06E389; Fri, 17 Mar 2017 19:08:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 275F06E389 for ; Fri, 17 Mar 2017 19:08:19 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 17 Mar 2017 12:08:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,177,1486454400"; d="scan'208";a="61796145" Received: from intel-desktop.iind.intel.com ([10.223.82.55]) by orsmga002.jf.intel.com with ESMTP; 17 Mar 2017 12:08:16 -0700 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Sat, 18 Mar 2017 00:45:20 +0530 Message-Id: <1489778126-11988-2-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489778126-11988-1-git-send-email-praveen.paneri@intel.com> References: <1489778126-11988-1-git-send-email-praveen.paneri@intel.com> Cc: paulo.r.zanoni@intel.com, Praveen Paneri Subject: [Intel-gfx] [PATCH 1/7] lib/igt_fb: Let others use igt_get_fb_tile_size 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 This function can be used by igt_draw to get accurate tile dimensions for all tile formats. Signed-off-by: Praveen Paneri --- lib/igt_fb.c | 2 +- lib/igt_fb.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index d2b7e9e..6ecc36b 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -74,7 +74,7 @@ static struct format_desc_struct { #define for_each_format(f) \ for (f = format_desc; f - format_desc < ARRAY_SIZE(format_desc); f++) -static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, +void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, unsigned *width_ret, unsigned *height_ret) { switch (tiling) { diff --git a/lib/igt_fb.h b/lib/igt_fb.h index 4a680ce..b178eba 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -94,7 +94,8 @@ enum igt_text_align { align_vcenter = 0x04, align_hcenter = 0x08, }; - +void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, + unsigned *width_ret, unsigned *height_ret); void igt_calc_fb_size(int fd, int width, int height, int bpp, uint64_t tiling, unsigned *size_ret, unsigned *stride_ret); unsigned int