From patchwork Mon Nov 15 09:47:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12619211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA328C433EF for ; Mon, 15 Nov 2021 09:51:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8902A615E1 for ; Mon, 15 Nov 2021 09:51:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8902A615E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67BB46EC9F; Mon, 15 Nov 2021 09:51:06 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A4366EC2B; Mon, 15 Nov 2021 09:51:04 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10168"; a="232133819" X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="232133819" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 01:50:59 -0800 X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="535447334" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 01:50:56 -0800 From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [i-g-t 13/14] tests/kms_color: Extended IGT tests to support logarithmic gamma mode Date: Mon, 15 Nov 2021 15:17:58 +0530 Message-Id: <20211115094759.520955-14-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211115094759.520955-1-bhanuprakash.modem@intel.com> References: <20211115094759.520955-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mukunda Pramodh Kumar , Juha-Pekka Heikkila , Uma Shankar , Bhanuprakash Modem Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Mukunda Pramodh Kumar Extended IGT tests to support logarithmic gamma mode on pipe Cc: Harry Wentland Cc: Ville Syrjälä Cc: Juha-Pekka Heikkila Cc: Uma Shankar Signed-off-by: Mukunda Pramodh Kumar Signed-off-by: Bhanuprakash Modem --- tests/kms_color.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/kms_color.c b/tests/kms_color.c index d9fe417ba9..00742afaaf 100644 --- a/tests/kms_color.c +++ b/tests/kms_color.c @@ -232,8 +232,6 @@ static void test_pipe_gamma(data_t *data, igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT)); - gamma_full = generate_table_max(data->gamma_lut_size); - output = igt_get_single_output_for_pipe(&data->display, primary->pipe->pipe); igt_require(output); @@ -258,10 +256,13 @@ static void test_pipe_gamma(data_t *data, igt_assert(fb_modeset_id); igt_plane_set_fb(primary, &fb_modeset); + /* Reset Color properties */ disable_ctm(primary->pipe); disable_degamma(primary->pipe); - set_gamma(data, primary->pipe, gamma_full); + disable_gamma(primary->pipe); igt_display_commit(&data->display); + igt_wait_for_vblank(data->drm_fd, + display->pipes[primary->pipe->pipe].crtc_offset); /* Draw solid colors with no gamma transformation. */ paint_rectangles(data, mode, red_green_blue, &fb); @@ -274,6 +275,13 @@ static void test_pipe_gamma(data_t *data, /* Draw a gradient with gamma LUT to remap all values * to max red/green/blue. */ + if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_MODE)) { + set_advance_gamma(data, primary->pipe, MAX_GAMMA); + } else { + gamma_full = generate_table_max(data->gamma_lut_size); + set_gamma(data, primary->pipe, gamma_full); + igt_display_commit(&data->display); + } paint_gradient_rectangles(data, mode, red_green_blue, &fb); igt_plane_set_fb(primary, &fb); igt_display_commit(&data->display); @@ -581,7 +589,10 @@ static bool test_pipe_ctm(data_t *data, */ if (memcmp(before, after, sizeof(color_t))) { set_degamma(data, primary->pipe, degamma_linear); - set_gamma(data, primary->pipe, gamma_linear); + if (igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_MODE)) + disable_gamma(primary->pipe); + else + set_gamma(data, primary->pipe, gamma_linear); } else { /* Disable Degamma and Gamma for ctm max test */ disable_degamma(primary->pipe);