Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: Swati Sharma <swati2.sharma@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [v8 1/3] lib/dsc: add helpers for vdsc fractional bpp debugfs entry
Date: Tue, 5 Sep 2023 19:11:19 +0530	[thread overview]
Message-ID: <32105015-e679-4329-7c73-180319e31588@intel.com> (raw)
In-Reply-To: <20230905083351.1249743-2-swati2.sharma@intel.com>

Hi Swati,

On Tue-05-09-2023 02:03 pm, Swati Sharma wrote:
> Helper functions are added for getting/setting VDSC Fractional BPP
> debugfs entry.
> 
> v2: -improved func description (Ankit)
>      -increased buff size (Ankit)
>      -asserted bpp_prec (Ankit)
> v3: -return 0 on success instead of 1 (Jouni)
> v4: -rebase
> v5: -alignment fixes (Ankit)
> 
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>   lib/igt_dsc.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
>   lib/igt_dsc.h |   6 +++
>   2 files changed, 109 insertions(+)
> 
> diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
> index 76a420c10..61d619a4a 100644
> --- a/lib/igt_dsc.c
> +++ b/lib/igt_dsc.c
> @@ -205,3 +205,106 @@ int igt_force_dsc_output_format(int drmfd, char *connector_name,
>   
>   	return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_output_format", buf);
>   }
> +
> +/*

Please fix the documentation (second '*' is missing), otherwise scripts 
will treat it as simple multiline comment.

it should start with /**

- Bhanu

> + * igt_get_dsc_fractional_bpp_supported:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: DSC BPP precision supported by the sink.
> + * 	    Precision value of
> + * 		16 => 1/16
> + * 		8  => 1/8
> + * 		1  => fractional bpp not supported
> + */
> +int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name)
> +{
> +	char file_name[128] = {0};
> +	char buf[512];
> +	char *start_loc;
> +	int bpp_prec;
> +
> +	sprintf(file_name, "%s/i915_dsc_fec_support", connector_name);
> +	igt_debugfs_read(drmfd, file_name, buf);
> +
> +	igt_assert(start_loc = strstr(buf, "DSC_Sink_BPP_Precision: "));
> +	igt_assert_eq(sscanf(start_loc, "DSC_Sink_BPP_Precision: %d", &bpp_prec), 1);
> +	igt_assert(bpp_prec > 0);
> +
> +	return bpp_prec;
> +}
> +
> +/*
> + * igt_is_dsc_fractional_bpp_supported_by_sink:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: True if DSC fractional bpp is supported for the given connector,
> + * false otherwise.
> + */
> +bool igt_is_dsc_fractional_bpp_supported_by_sink(int drmfd, char *connector_name)
> +{
> +	int bpp_prec;
> +
> +	bpp_prec = igt_get_dsc_fractional_bpp_supported(drmfd, connector_name);
> +
> +	if (bpp_prec == 1)
> +		return false;
> +
> +	return true;
> +}
> +
> +static bool check_dsc_fractional_bpp_debugfs(int drmfd, char *connector_name,
> +					     const char *check_str)
> +{
> +	char file_name[128] = {0};
> +	char buf[512];
> +
> +	sprintf(file_name, "%s/i915_dsc_fractional_bpp", connector_name);
> +
> +	igt_debugfs_read(drmfd, file_name, buf);
> +
> +	return strstr(buf, check_str);
> +}
> +
> +/*
> + * igt_is_force_dsc_fractional_bpp_enabled:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: True if DSC Fractional BPP is force enabled (via debugfs) for the given connector,
> + * false otherwise.
> + */
> +bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name)
> +{
> +	return check_dsc_fractional_bpp_debugfs(drmfd, connector_name, "Force_DSC_Fractional_BPP_Enable: yes");
> +}
> +
> +/*
> + * igt_force_dsc_fractional_bpp_enable:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: 0 on success or negative error code, in case of failure.
> + */
> +int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name)
> +{
> +	return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_fractional_bpp", "1");
> +}
> +
> +/*
> + * igt_get_dsc_fractional_bpp_debugfs_fd:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: fd of the DSC Fractional BPP debugfs for the given connector,
> + * else returns -1.
> + */
> +int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name)
> +{
> +	char file_name[128] = {0};
> +
> +	sprintf(file_name, "%s/i915_dsc_fractional_bpp", connector_name);
> +
> +	return openat(igt_debugfs_dir(drmfd), file_name, O_WRONLY);
> +}
> diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
> index b58743b5f..7ab0917ec 100644
> --- a/lib/igt_dsc.h
> +++ b/lib/igt_dsc.h
> @@ -8,6 +8,7 @@
>   
>   #include "igt_fb.h"
>   #include "igt_kms.h"
> +#include "igt_core.h"
>   
>   bool igt_is_dsc_supported_by_source(int drmfd);
>   bool igt_is_dsc_supported_by_sink(int drmfd, char *connector_name);
> @@ -21,5 +22,10 @@ bool igt_is_dsc_output_format_supported_by_sink(int drmfd, char *connector_name,
>   						enum dsc_output_format output_format);
>   int igt_force_dsc_output_format(int drmfd, char *connector_name,
>   				enum dsc_output_format output_format);
> +bool igt_is_dsc_fractional_bpp_supported_by_sink(int drmfd, char *connector_name);
> +int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name);
> +bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name);
> +int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name);
> +int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name);
>   
>   #endif

  reply	other threads:[~2023-09-05 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05  8:33 [igt-dev] [v8 0/3] DSC Fractional BPP Val Support Swati Sharma
2023-09-05  8:33 ` [igt-dev] [v8 1/3] lib/dsc: add helpers for vdsc fractional bpp debugfs entry Swati Sharma
2023-09-05 13:41   ` Modem, Bhanuprakash [this message]
2023-09-05  8:33 ` [igt-dev] [v8 2/3] tests/intel/kms_dsc: enable validation for vdsc fractional bpp Swati Sharma
2023-09-05  8:33 ` [igt-dev] [v8 3/3] tests/intel/kms_dsc: add test to validate fractional bpp with input bpc Swati Sharma
2023-09-05 14:04 ` [igt-dev] ✓ Fi.CI.BAT: success for DSC Fractional BPP Val Support (rev10) Patchwork
2023-09-05 15:56 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=32105015-e679-4329-7c73-180319e31588@intel.com \
    --to=bhanuprakash.modem@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