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>,
	Hersen Wu <Hersenxs.Wu@amd.com>
Subject: [PATCH 2/3] lib/amd: Return false if dp_fec or dp_dsc is not supported
Date: Wed, 27 Mar 2024 10:23:21 -0600	[thread overview]
Message-ID: <20240327162322.1068745-2-alex.hung@amd.com> (raw)
In-Reply-To: <20240327162322.1068745-1-alex.hung@amd.com>

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

Reviewed-by: Hersen Wu <Hersenxs.Wu@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
V2: - Limit lines to 100

 lib/igt_amd.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/igt_amd.c b/lib/igt_amd.c
index 623883dbc..c0c4dfc67 100644
--- a/lib/igt_amd.c
+++ b/lib/igt_amd.c
@@ -353,10 +353,11 @@ 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 +381,11 @@ 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-27 16:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 16:23 [PATCH 1/3][V2] tests/amdgpu/amd_dp_dsc: Correct code style problems Alex Hung
2024-03-27 16:23 ` Alex Hung [this message]
2024-03-27 16:23 ` [PATCH 3/3] tests/amdgpu/amd_dp_dsc: Check connector's dsc capability Alex Hung
2024-03-27 17:57 ` ✓ CI.xeBAT: success for series starting with [1/3,V2] tests/amdgpu/amd_dp_dsc: Correct code style problems Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-03-21 22:47 [PATCH 1/3] " Alex Hung
2024-03-21 22:47 ` [PATCH 2/3] lib/amd: Return false if dp_fec or dp_dsc is not supported Alex Hung
2024-03-25 11:27   ` Wu, Hersen

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=20240327162322.1068745-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