From patchwork Thu Aug 20 09:43:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, Mahesh" X-Patchwork-Id: 7043021 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 B4AF49F372 for ; Thu, 20 Aug 2015 09:42:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4254205C2 for ; Thu, 20 Aug 2015 09:42:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DBD62205CB for ; Thu, 20 Aug 2015 09:42:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 462D589F07; Thu, 20 Aug 2015 02:42:33 -0700 (PDT) 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 B521989F07 for ; Thu, 20 Aug 2015 02:42:31 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 20 Aug 2015 02:42:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,714,1432623600"; d="scan'208";a="628949327" Received: from kumarmah-desk.iind.intel.com ([10.223.25.6]) by orsmga003.jf.intel.com with ESMTP; 20 Aug 2015 02:42:25 -0700 From: "Kumar, Mahesh" To: intel-gfx@lists.freedesktop.org Date: Thu, 20 Aug 2015 15:13:51 +0530 Message-Id: <1440063831-26354-1-git-send-email-mahesh1.kumar@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <55ADBB93.4090003@intel.com> References: <55ADBB93.4090003@intel.com> Subject: [Intel-gfx] [PATCH v2] kms_universal_plane: subtest for yuv pixel format in primary plane 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.8 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 This test commit YUV framebuffer in primay plane. I'm using empty FB, because this fulfills the purpose of testing YUV. V2: Revert chnages for MAX_PLANE count as per nabendu's comment. These changes are already floating for review. Signed-off-by: Kumar, Mahesh --- lib/igt_fb.c | 4 +++ tests/kms_universal_plane.c | 82 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 134dbd2..e570bfa 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -66,6 +66,10 @@ static struct format_desc_struct { DF(XRGB8888, RGB24, 32, 24), DF(XRGB2101010, RGB30, 32, 30), DF(ARGB8888, ARGB32, 32, 32), + DF(YUYV, INVALID, 16, 16), + DF(YVYU, INVALID, 16, 16), + DF(UYVY, INVALID, 16, 16), + DF(VYUY, INVALID, 16, 16), }; #undef DF diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c index 635cc79..ed4b134 100644 --- a/tests/kms_universal_plane.c +++ b/tests/kms_universal_plane.c @@ -57,6 +57,12 @@ typedef struct { struct igt_fb red_fb, blue_fb; } pageflip_test_t; +typedef struct { + data_t *data; + struct igt_fb fullsize_fb, undersize_fb; +} primary_yuv_test_t; + + static void functional_test_init(functional_test_t *test, igt_output_t *output, enum pipe pipe) { @@ -430,6 +436,77 @@ sanity_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output) } static void +primary_yuv_test_init(primary_yuv_test_t *test, igt_output_t *output, enum pipe pipe) +{ + data_t *data = test->data; + drmModeModeInfo *mode; + + igt_output_set_pipe(output, pipe); + + mode = igt_output_get_mode(output); + igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay, + DRM_FORMAT_YUYV, + LOCAL_DRM_FORMAT_MOD_NONE, + &test->fullsize_fb); + igt_create_fb(data->drm_fd, 300, 300, + DRM_FORMAT_YVYU, + LOCAL_DRM_FORMAT_MOD_NONE, + &test->undersize_fb); +} + +static void +primary_yuv_test_fini(primary_yuv_test_t *test, igt_output_t *output) +{ + igt_remove_fb(test->data->drm_fd, &test->fullsize_fb); + igt_remove_fb(test->data->drm_fd, &test->undersize_fb); + + igt_output_set_pipe(output, PIPE_ANY); + igt_display_commit2(&test->data->display, COMMIT_LEGACY); +} + +/* + * YUV pixel format test for primary plane + * Display Full frame in primay then 300x300 frame + */ + +static void +primary_yuv_test_pipe(data_t *data, enum pipe pipe, igt_output_t *output) +{ + primary_yuv_test_t test = { .data = data }; + igt_plane_t *primary; + + igt_skip_on(pipe >= data->display.n_pipes); + + igt_output_set_pipe(output, pipe); + + primary_yuv_test_init(&test, output, pipe); + + primary = igt_output_get_plane(output, IGT_PLANE_PRIMARY); + + /* Use legacy API to set a mode with a Fullsize FB */ + igt_plane_set_fb(primary, &test.fullsize_fb); + igt_display_commit2(&data->display, COMMIT_LEGACY); + + /* Disable the primary plane */ + igt_plane_set_fb(primary, NULL); + igt_display_commit2(&data->display, COMMIT_UNIVERSAL); + + /* Use Universal API to set a mode with a Fullsize FB */ + igt_plane_set_fb(primary, &test.fullsize_fb); + igt_display_commit2(&data->display, COMMIT_UNIVERSAL); + + /* Use Universal API to set a mode with a Undersize FB */ + igt_plane_set_fb(primary, &test.undersize_fb); + igt_display_commit2(&data->display, COMMIT_UNIVERSAL); + + /* Disable the primary plane */ + igt_plane_set_fb(primary, NULL); + + primary_yuv_test_fini(&test, output); + +} + +static void pageflip_test_init(pageflip_test_t *test, igt_output_t *output, enum pipe pipe) { data_t *data = test->data; @@ -663,6 +740,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe) kmstest_pipe_name(pipe)) for_each_connected_output(&data->display, output) cursor_leak_test_pipe(data, pipe, output); + + igt_subtest_f("primary-plane-pipe-%s-yuv", + kmstest_pipe_name(pipe)) + for_each_connected_output(&data->display, output) + primary_yuv_test_pipe(data, pipe, output); } static data_t data;