From patchwork Fri Nov 13 17:12:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 7613031 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2543EBF90C for ; Fri, 13 Nov 2015 17:13:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 284B520661 for ; Fri, 13 Nov 2015 17:13:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4DE2320658 for ; Fri, 13 Nov 2015 17:13:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF3836E63B; Fri, 13 Nov 2015 09:13:14 -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 C96DF6E632 for ; Fri, 13 Nov 2015 09:13:12 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Nov 2015 09:13:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,288,1444719600"; d="scan'208";a="837185230" Received: from jh1011-mobl1.gar.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.192.177]) by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2015 09:13:11 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 13 Nov 2015 15:12:47 -0200 Message-Id: <1447434771-19337-7-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447434771-19337-1-git-send-email-paulo.r.zanoni@intel.com> References: <1447434771-19337-1-git-send-email-paulo.r.zanoni@intel.com> Subject: [Intel-gfx] [PATCH igt 06/10] kms_frontbuffer_tracking: do page flips using the planes API 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.5 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 Add a new FLIP_PLANES enum so we can do "page flips" using it too. The goal is to exercise the fast modeset paths on the Kernel. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 74acc73..994bb4a 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -122,6 +122,7 @@ enum flip_type { FLIP_PAGEFLIP, FLIP_PAGEFLIP_EVENT, FLIP_MODESET, + FLIP_PLANES, }; enum color { @@ -2194,6 +2195,31 @@ static void wait_flip_event(void) } } +static void set_prim_plane_for_params(struct modeset_params *params) +{ + int rc, i, crtc_index = -1; + uint32_t plane_id = 0; + + for (i = 0; i < drm.res->count_crtcs; i++) + if (drm.res->crtcs[i] == params->crtc_id) + crtc_index = i; + igt_assert(crtc_index >= 0); + + for (i = 0; i < drm.plane_res->count_planes; i++) + if ((drm.planes[i]->possible_crtcs & (1 << crtc_index)) && + drm.plane_types[i] == DRM_PLANE_TYPE_PRIMARY) + plane_id = drm.planes[i]->plane_id; + igt_assert(plane_id); + + rc = drmModeSetPlane(drm.fd, plane_id, params->crtc_id, + params->fb.fb->fb_id, 0, 0, 0, + params->mode->hdisplay, + params->mode->vdisplay, + params->fb.x << 16, params->fb.y << 16, + params->fb.w << 16, params->fb.h << 16); + igt_assert(rc == 0); +} + static void page_flip_for_params(struct modeset_params *params, enum flip_type type) { @@ -2215,6 +2241,9 @@ static void page_flip_for_params(struct modeset_params *params, case FLIP_MODESET: set_mode_for_params(params); break; + case FLIP_PLANES: + set_prim_plane_for_params(params); + break; default: igt_assert(false); } @@ -3184,6 +3213,13 @@ int main(int argc, char *argv[]) igt_draw_get_method_name(t.method)) flip_subtest(&t, FLIP_MODESET); + igt_subtest_f("%s-%s-%s-%s-plflip-%s", + feature_str(t.feature), + pipes_str(t.pipes), + screen_str(t.screen), + fbs_str(t.fbs), + igt_draw_get_method_name(t.method)) + flip_subtest(&t, FLIP_PLANES); TEST_MODE_ITER_END TEST_MODE_ITER_BEGIN(t)