Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Swati Sharma <swati2.sharma@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add has_dsc()
Date: Tue, 30 May 2023 11:10:06 +0530	[thread overview]
Message-ID: <04813d07-c9b4-53fa-2068-6648ca5328a4@intel.com> (raw)
In-Reply-To: <20230518052722.249768-1-swati2.sharma@intel.com>


On 5/18/2023 10:57 AM, Swati Sharma wrote:
> Instead of assuming dsc is supported gen11+, lets use has_dsc
> flag in i915_capability to check h/w support.
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
>   tests/i915/kms_dsc.c | 20 +++++++++++++++++++-
>   1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index 3ce28f84..ad698f27 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -253,6 +253,24 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
>   	}
>   }
>   
> +static bool has_dsc(data_t *data)
> +{
> +	char buf[4096];
> +	int dir, res;
> +
> +	dir = igt_debugfs_dir(data->drm_fd);
> +	igt_assert(dir >= 0);
> +
> +	igt_require_intel(data->drm_fd);
> +
> +	res = igt_debugfs_simple_read(dir, "i915_capabilities",
> +				      buf, sizeof(buf));
> +	igt_require(res > 0);
> +	close(dir);
> +
> +	return strstr(buf, "has_dsc: yes");
> +}

Looks good to me.

I suggest we can have it in lib igt_kms,  and re-use this in 
kms_invalid_mode.c . There too we are checking for display version to 
get DSC support from source.

Regards,

Ankit


> +
>   igt_main
>   {
>   	data_t data = {};
> @@ -265,7 +283,7 @@ igt_main
>   		igt_install_exit_handler(kms_dsc_exit_handler);
>   		igt_display_require(&data.display, data.drm_fd);
>   		igt_display_require_output(&data.display);
> -		igt_require(data.disp_ver >= 11);
> +		igt_require(has_dsc(&data));
>   	}
>   
>   	igt_describe("Tests basic display stream compression functionality if supported "

      parent reply	other threads:[~2023-05-30  5:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  5:27 [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add has_dsc() Swati Sharma
2023-05-18  6:18 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-05-18 17:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-30  5:40 ` Nautiyal, Ankit K [this message]

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=04813d07-c9b4-53fa-2068-6648ca5328a4@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=swati2.sharma@intel.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