From patchwork Wed Dec 13 09:50:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 10109583 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 C24A5602C2 for ; Wed, 13 Dec 2017 09:41:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCBFE290E0 for ; Wed, 13 Dec 2017 09:41:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1B0D29139; Wed, 13 Dec 2017 09:41:57 +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 6DD53290E0 for ; Wed, 13 Dec 2017 09:41:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DCEF6E400; Wed, 13 Dec 2017 09:41:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4FEDB6E405 for ; Wed, 13 Dec 2017 09:41:56 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2017 01:41:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,397,1508828400"; d="scan'208";a="186554286" Received: from vsrini4-ubuntu.iind.intel.com ([10.223.25.4]) by fmsmga006.fm.intel.com with ESMTP; 13 Dec 2017 01:41:53 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Date: Wed, 13 Dec 2017 15:20:51 +0530 Message-Id: <1513158652-8912-6-git-send-email-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513158652-8912-1-git-send-email-vidya.srinivas@intel.com> References: <1513158652-8912-1-git-send-email-vidya.srinivas@intel.com> Cc: daniel.vetter@intel.com, Vidya Srinivas Subject: [Intel-gfx] [PATCH i-g-t 5/6] i-g-t: kms_plane_scaling: test scaler with clipping clamping 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 From: Jyoti Yadav This patch adds subtest to test scaler clipping and clamping scenario Signed-off-by: Jyoti Yadav Signed-off-by: Mahesh Kumar Signed-off-by: Vidya Srinivas --- tests/kms_plane_scaling.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c index 3725d8e..b80cafb 100644 --- a/tests/kms_plane_scaling.c +++ b/tests/kms_plane_scaling.c @@ -480,6 +480,71 @@ static void test_plane_scaling(data_t *d, enum pipe pipe) igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); } +static void +test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe) +{ + igt_output_t *output; + igt_require(d->num_scalers); + + for_each_valid_output_on_pipe(&d->display, pipe, output) { + drmModeModeInfo *mode; + + /* Gen9 has single scaler in PIPEC */ + if (intel_gen(d->devid) == 9 && pipe == PIPE_C) + continue; + + igt_output_set_pipe(output, pipe); + mode = igt_output_get_mode(output); + d->fb_id2 = igt_create_pattern_fb(d->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, + &d->fb2); + igt_assert(d->fb_id2); + + d->fb_id3 = igt_create_pattern_fb(d->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_Y_TILED, + &d->fb3); + igt_assert(d->fb_id3); + + d->plane1 = igt_output_get_plane(output, 0); + igt_plane_set_fb(d->plane1, &d->fb2); + d->plane2 = igt_output_get_plane(output, 1); + igt_plane_set_fb(d->plane2, &d->fb3); + + igt_fb_set_position(&d->fb2, d->plane1, 0, 0); + igt_fb_set_size(&d->fb2, d->plane1, 300, 300); + igt_plane_set_position(d->plane1, 100, 400); + igt_fb_set_position(&d->fb3, d->plane2, 0, 0); + igt_fb_set_size(&d->fb3, d->plane2, 400, 400); + igt_plane_set_position(d->plane2, 100, 100); + + /* scaled window size is outside the modeset area.*/ + igt_plane_set_size(d->plane1, mode->hdisplay + 200, + mode->vdisplay + 200); + igt_plane_set_size(d->plane2, mode->hdisplay + 100, + mode->vdisplay + 100); + igt_display_commit2(&d->display, COMMIT_ATOMIC); + + /* disable above 2 planes */ + igt_plane_set_fb(d->plane1, NULL); + igt_plane_set_position(d->plane1, 0, 0); + igt_plane_set_fb(d->plane2, NULL); + igt_plane_set_position(d->plane2, 0, 0); + if (d->fb_id2) { + igt_remove_fb(d->drm_fd, &d->fb2); + d->fb_id2 = 0; + } + if (d->fb_id3) { + igt_remove_fb(d->drm_fd, &d->fb3); + d->fb_id3 = 0; + } + igt_output_set_pipe(output, PIPE_ANY); + } +} + igt_main { data_t data = {}; @@ -512,6 +577,10 @@ igt_main test_scaler_with_rotation(&data, pipe); } + igt_subtest_f("scaler_with_clipping_clamping") { + test_scaler_with_clipping_clamping_scenario(&data, pipe); + } + igt_fixture { igt_display_fini(&data.display); }