From patchwork Mon Jan 16 07:15:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 9518193 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 7AA0E601C3 for ; Mon, 16 Jan 2017 07:10:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 481BA2838E for ; Mon, 16 Jan 2017 07:10:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B695283D3; Mon, 16 Jan 2017 07:10:15 +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 C29952838E for ; Mon, 16 Jan 2017 07:10:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BC446E23D; Mon, 16 Jan 2017 07:10:13 +0000 (UTC) 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 ESMTPS id C23096E23F for ; Mon, 16 Jan 2017 07:10:11 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 15 Jan 2017 23:10:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,238,1477983600"; d="scan'208"; a="1083471646" Received: from intel-desktop.iind.intel.com ([10.223.82.55]) by orsmga001.jf.intel.com with ESMTP; 15 Jan 2017 23:10:09 -0800 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Mon, 16 Jan 2017 12:45:44 +0530 Message-Id: <1484550948-8649-1-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Praveen Paneri Subject: [Intel-gfx] [PATCH 1/5] 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 bb87869..32e0277 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