From patchwork Thu May 27 14:32:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 12284423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05A05C4707F for ; Thu, 27 May 2021 14:41:12 +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 BAFDC60249 for ; Thu, 27 May 2021 14:41:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAFDC60249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68D5C6E8CE; Thu, 27 May 2021 14:41:11 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 000C56E8CE; Thu, 27 May 2021 14:41:09 +0000 (UTC) IronPort-SDR: JKsBIv87Re3rpTK/V83IKUvyyBdN+7i6g0NZa/so/U9uGA/NLdZbJvxZPxfmFUV0UIBUPk3sUB IiMgwz4H88XA== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="183084317" X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="183084317" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 07:41:09 -0700 IronPort-SDR: F0jsq9PJTQ3vXJ7KbvtmLaNCLw2Dn2EEEEtHnJAFNiisKnMYkq4UQWmN5h2yU0rGKL4OOJRrwC K1c4FlXpSyHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="615403543" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.223.163.28]) by orsmga005.jf.intel.com with ESMTP; 27 May 2021 07:41:07 -0700 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org Date: Thu, 27 May 2021 20:02:14 +0530 Message-Id: <20210527143214.25486-1-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/4] [RFC] tests/drm_read: Fix subtest invalid-buffer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: markyacoub@chromium.org, charlton.lin@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Using (void *)-1 directly in read is aborting on chrome systems. Following message is seen. Starting subtest: invalid-buffer *** buffer overflow detected ***: terminated Received signal SIGABRT. Stack trace: Aborted (core dumped) Patch just adds a pointer variable and uses it in read. Signed-off-by: Vidya Srinivas Change-Id: I97f129e586bf9212eb0a63a4cd4c91e0327dd550 --- tests/drm_read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/drm_read.c b/tests/drm_read.c index ccf9d822fd8d..2fdec5be4078 100644 --- a/tests/drm_read.c +++ b/tests/drm_read.c @@ -103,10 +103,11 @@ static void teardown(int fd) static void test_invalid_buffer(int in) { int fd = setup(in, 0); + void *add = (void *)-1; alarm(1); - igt_assert_eq(read(fd, (void *)-1, 4096), -1); + igt_assert_eq(read(fd, add, 4096), -1); igt_assert_eq(errno, EFAULT); teardown(fd); From patchwork Thu May 27 14:32:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 12284425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B4ABC4708A for ; Thu, 27 May 2021 14:41:23 +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 34F7660249 for ; Thu, 27 May 2021 14:41:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34F7660249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEB7D6EC0A; Thu, 27 May 2021 14:41:22 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD4906E8DC; Thu, 27 May 2021 14:41:21 +0000 (UTC) IronPort-SDR: bq4Jrg0avFc8rW088q7uGTerD86+G9u7i5QQdzyHmE//oz6dmwO8mPtVmojdIxQ0t380OV2jpl eqSVbAT+w5gA== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="202785536" X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="202785536" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 07:41:20 -0700 IronPort-SDR: o+AVGPYnq91lJRDf4GAWI/g9zuK6upqWRVLjbjEwyd6XtKW0QJPF9+O/K4hQmBQZJ3xyzE44SP 2oA/B72XElEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="436572163" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.223.163.28]) by orsmga007.jf.intel.com with ESMTP; 27 May 2021 07:41:18 -0700 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org Date: Thu, 27 May 2021 20:02:26 +0530 Message-Id: <20210527143226.25548-1-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/4] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: markyacoub@chromium.org, charlton.lin@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For Intel platforms, pitch needs to be 64 byte aligned. Kernel code vgem_gem_dumb_create which is platform generic code doesnt do the alignment. This causes frame buffer creation to fail on Intel platforms where the pitch is not 64 byte aligned. tests: test run on Intel platforms with panel resolution 1366x768 Signed-off-by: Vidya Srinivas Change-Id: Ie8f938b9672127537f433a5674b60e88275cc2c7 --- tests/kms_prime.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/kms_prime.c b/tests/kms_prime.c index 8cb2ca2a9dc3..fdc941fe8100 100644 --- a/tests/kms_prime.c +++ b/tests/kms_prime.c @@ -51,6 +51,8 @@ static struct { { .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 }, }; +bool check_platform; + IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side"); static bool has_prime_import(int fd) @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch, scratch->bpp = 32; scratch->handle = kmstest_dumb_create(exporter_fd, - scratch->width, + check_platform? ALIGN(scratch->width, 64): scratch->width, scratch->height, scratch->bpp, &scratch->pitch, @@ -262,6 +264,7 @@ igt_main /* ANY = anything that is not VGEM */ first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM); + check_platform = is_i915_device(first_fd); igt_require(first_fd >= 0); second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM); From patchwork Thu May 27 14:32:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 12284427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D10C4707F for ; Thu, 27 May 2021 14:41:35 +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 A38A46124C for ; Thu, 27 May 2021 14:41:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A38A46124C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DFFE6EA84; Thu, 27 May 2021 14:41:35 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B2616E8DC; Thu, 27 May 2021 14:41:33 +0000 (UTC) IronPort-SDR: y0+0CB/gHSu2A/aL78SqpPM2k27295b1V2IV7WAMlyKboaT7dCTEe8K9qDh1Ki9x0DT3cZliku iWy0HNEJ05NQ== X-IronPort-AV: E=McAfee;i="6200,9189,9996"; a="202754885" X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="202754885" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 07:41:32 -0700 IronPort-SDR: DiTTJxtcARgUwgwHUioAo5zfKWuDgUQtA2s79O601Lup25R/MrGuUMNl+zEmHD+9esqTtx+6tH jOb+E1vQelrg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,334,1613462400"; d="scan'208";a="409764113" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.223.163.28]) by fmsmga007.fm.intel.com with ESMTP; 27 May 2021 07:41:29 -0700 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org Date: Thu, 27 May 2021 20:02:37 +0530 Message-Id: <20210527143237.25612-1-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/4] [RFC] tests/kms_color: Fix pipe degamma subtests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: markyacoub@chromium.org, charlton.lin@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" We need to collect CRC with no degamma transformation and after drawing gradient with degamma LUT. This patch makes subtest pipe degamma code similar to pipe gamma is written. Change-Id: Iee70f01c0ae25ee873e5dc6a327a28b6ac1ea13a Signed-off-by: Vidya Srinivas --- tests/kms_color.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/kms_color.c b/tests/kms_color.c index 3a42532a5c27..2d55f2611e72 100644 --- a/tests/kms_color.c +++ b/tests/kms_color.c @@ -31,8 +31,7 @@ static void test_pipe_degamma(data_t *data, { igt_output_t *output; igt_display_t *display = &data->display; - gamma_lut_t *degamma_linear, *degamma_full; - gamma_lut_t *gamma_linear; + gamma_lut_t *degamma_full; color_t red_green_blue[] = { { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, @@ -42,11 +41,8 @@ static void test_pipe_degamma(data_t *data, igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT)); igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT)); - degamma_linear = generate_table(data->degamma_lut_size, 1.0); degamma_full = generate_table_max(data->degamma_lut_size); - gamma_linear = generate_table(data->gamma_lut_size, 1.0); - for_each_valid_output_on_pipe(&data->display, primary->pipe->pipe, output) { drmModeModeInfo *mode; struct igt_fb fb_modeset, fb; @@ -75,8 +71,7 @@ static void test_pipe_degamma(data_t *data, igt_plane_set_fb(primary, &fb_modeset); disable_ctm(primary->pipe); - disable_degamma(primary->pipe); - set_gamma(data, primary->pipe, gamma_linear); + set_degamma(data, primary->pipe, degamma_full); igt_display_commit(&data->display); /* Draw solid colors with no degamma transformation. */ @@ -92,7 +87,6 @@ static void test_pipe_degamma(data_t *data, */ paint_gradient_rectangles(data, mode, red_green_blue, &fb); igt_plane_set_fb(primary, &fb); - set_degamma(data, primary->pipe, degamma_full); igt_display_commit(&data->display); igt_wait_for_vblank(data->drm_fd, display->pipes[primary->pipe->pipe].crtc_offset); @@ -109,9 +103,7 @@ static void test_pipe_degamma(data_t *data, igt_remove_fb(data->drm_fd, &fb_modeset); } - free_lut(degamma_linear); free_lut(degamma_full); - free_lut(gamma_linear); } /*