From patchwork Tue Jan 26 13:29:00 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: 8121921 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 04BA39F859 for ; Tue, 26 Jan 2016 13:29:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 436D620254 for ; Tue, 26 Jan 2016 13:29:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5526A20256 for ; Tue, 26 Jan 2016 13:29:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 962A76E5BD; Tue, 26 Jan 2016 05:29:22 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id B158C6E5BB for ; Tue, 26 Jan 2016 05:29:17 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 26 Jan 2016 05:29:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,350,1449561600"; d="scan'208";a="889472075" Received: from svosulli-mobl3.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.193.19]) by fmsmga001.fm.intel.com with ESMTP; 26 Jan 2016 05:29:16 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 26 Jan 2016 11:29:00 -0200 Message-Id: <1453814944-15373-2-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.7.0.rc3 In-Reply-To: <1453814944-15373-1-git-send-email-paulo.r.zanoni@intel.com> References: <1453814944-15373-1-git-send-email-paulo.r.zanoni@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 2/6] kms_frontbuffer_tracking: use igt_drm_format_to_bpp() 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 only format from fb_get_bpp() not supported by igt_drm_format_to_bpp() is ARGB2101010, but we don't really use it in kms_frontbuffer_tracking, so we can do the switch. Adding ARGB2101010 to igt_fb won't be that simple since there's no equivalent Cairo format, and igt_fb users assume that all formats known by igt_fb have equivalent Cairo formats. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index e7acc7c..c819019 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1102,21 +1102,6 @@ static void *busy_thread_func(void *data) pthread_exit(0); } -static int fb_get_bpp(struct igt_fb *fb) -{ - switch (fb->drm_format) { - case DRM_FORMAT_RGB565: - return 16; - case DRM_FORMAT_XRGB8888: - case DRM_FORMAT_ARGB8888: - case DRM_FORMAT_ARGB2101010: - case DRM_FORMAT_XRGB2101010: - return 32; - default: - igt_assert(false); - } -} - static void start_busy_thread(struct igt_fb *fb) { int rc; @@ -1129,7 +1114,7 @@ static void start_busy_thread(struct igt_fb *fb) busy_thread.width = fb->width; busy_thread.height = fb->height; busy_thread.color = pick_color(fb, COLOR_PRIM_BG); - busy_thread.bpp = fb_get_bpp(fb); + busy_thread.bpp = igt_drm_format_to_bpp(fb->drm_format); rc = pthread_create(&busy_thread.thread, NULL, busy_thread_func, NULL); igt_assert_eq(rc, 0);