Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: <rodrigo.siqueira@amd.com>, <harry.wentland@amd.com>,
	<hersenxs.wu@amd.com>, Alex Hung <alex.hung@amd.com>
Subject: [PATCH 2/3] lib/amd: Return false if dp_fec or dp_dsc is not supported
Date: Thu, 21 Mar 2024 16:47:57 -0600	[thread overview]
Message-ID: <20240321224758.1531610-2-alex.hung@amd.com> (raw)
In-Reply-To: <20240321224758.1531610-1-alex.hung@amd.com>

Stop assertion but return accordingly when dp_fec or dp_dsc is
not supported.

Signed-off-by: Alex Hung <alex.hung@amd.com>
---
 lib/igt_amd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 623883dbc..a321da335 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -353,10 +353,10 @@ bool is_dp_dsc_supported(int drm_fd, char *connector_name)
 	}
 
 	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
-	close(fd);
+	if (ret < 0)
+		igt_info("Reading %s for connector %s failed.\n", DEBUGFS_DSC_FEC_SUPPORT, connector_name);
 
-	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
-		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
+	close(fd);
 
 	return strstr(buf, "DSC_Sink_Support: yes");
 }
@@ -380,10 +380,10 @@ bool is_dp_fec_supported(int drm_fd, char *connector_name)
 	}
 
 	ret = igt_debugfs_simple_read(fd, DEBUGFS_DSC_FEC_SUPPORT, buf, sizeof(buf));
-	close(fd);
+	if (ret < 0)
+		igt_info("Reading %s for connector %s failed.\n", DEBUGFS_DSC_FEC_SUPPORT, connector_name);
 
-	igt_assert_f(ret >= 0, "Reading %s for connector %s failed.\n",
-		     DEBUGFS_DSC_FEC_SUPPORT, connector_name);
+	close(fd);
 
 	return strstr(buf, "FEC_Sink_Support: yes");
 }
-- 
2.34.1


  reply	other threads:[~2024-03-21 22:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 22:47 [PATCH 1/3] tests/amdgpu/amd_dp_dsc: Correct code style problems Alex Hung
2024-03-21 22:47 ` Alex Hung [this message]
2024-03-25 11:27   ` [PATCH 2/3] lib/amd: Return false if dp_fec or dp_dsc is not supported Wu, Hersen
2024-03-21 22:47 ` [PATCH 3/3] tests/amdgpu/amd_dp_dsc: Check connector's dsc capability Alex Hung
2024-03-25 11:30   ` Wu, Hersen
2024-03-21 23:27 ` ✓ CI.xeBAT: success for series starting with [1/3] tests/amdgpu/amd_dp_dsc: Correct code style problems Patchwork
2024-03-21 23:30 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-22 15:51 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-25 15:35   ` Hung, Alex
2024-03-24 18:32 ` [PATCH 1/3] " Wu, Hersen
2024-03-26 20:30 ` ✓ Fi.CI.BAT: success for series starting with [1/3] tests/amdgpu/amd_dp_dsc: Correct code style problems (rev2) Patchwork
2024-03-26 20:31 ` ✓ CI.xeBAT: " Patchwork
2024-03-27 14:35 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-27 14:46 ` [PATCH 1/3] tests/amdgpu/amd_dp_dsc: Correct code style problems Kamil Konieczny
  -- strict thread matches above, loose matches on Subject: below --
2024-03-27 16:23 [PATCH 1/3][V2] " Alex Hung
2024-03-27 16:23 ` [PATCH 2/3] lib/amd: Return false if dp_fec or dp_dsc is not supported Alex Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321224758.1531610-2-alex.hung@amd.com \
    --to=alex.hung@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=hersenxs.wu@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.siqueira@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox