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 4/6] lib/kms: Add helpers for VDSC Fractional BPP debugfs entry
Date: Fri, 23 Dec 2022 17:36:58 +0530 [thread overview]
Message-ID: <b922d995-bc42-8b99-91dd-432c6243c5fb@intel.com> (raw)
In-Reply-To: <20221125115808.13394-5-swati2.sharma@intel.com>
On 11/25/2022 5:28 PM, Swati Sharma wrote:
> Helper functions are added for getting/setting VDSC Fractional BPP
> debugfs entry.
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> lib/igt_kms.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++
> lib/igt_kms.h | 4 +++
> 2 files changed, 82 insertions(+)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index c7135790b..93f45410c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -5592,6 +5592,20 @@ bool check_dsc_ycbcr420_debugfs(int drmfd, char *connector_name,
> return strstr(buf, check_str);
> }
>
> +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);
> +}
> +
> static
> int write_dsc_debugfs(int drmfd, char *connector_name,
> const char *file_name,
> @@ -5623,6 +5637,29 @@ bool igt_is_dsc_supported(int drmfd, char *connector_name)
> return check_dsc_debugfs(drmfd, connector_name, "DSC_Sink_Support: yes");
> }
>
> +/*
> + * igt_get_dsc_fractional_bpp_supported:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: The dsc sink bpp precision.
Perhaps need to specify precision value of 16 means 1/16, 8 means 1/8
and so on.
A value of 1 means fractional bpp not supported.
> + */
> +int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name)
> +{
> + char file_name[128] = {0};
> + char buf[24];
This size is not sufficient to store the contents of the debugfs entry.
Thanks & Regards,
Ankit
> + 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);
> +
> + return bpp_prec;
> +}
> +
> /*
> * igt_is_dsc_ycbcr420_supported:
> * @drmfd: A drm file descriptor
> @@ -5685,6 +5722,19 @@ bool igt_is_force_dsc_ycbcr420_enabled(int drmfd, char *connector_name)
> return check_dsc_ycbcr420_debugfs(drmfd, connector_name, "Force_DSC_YCBCR420_Enable: yes");
> }
>
> +/*
> + * 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_enable:
> * @drmfd: A drm file descriptor
> @@ -5709,6 +5759,18 @@ int igt_force_dsc_ycbcr420_enable(int drmfd, char *connector_name)
> return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_ycbcr420", "1");
> }
>
> +/*
> + * igt_force_dsc_fractional_bpp_enable:
> + * @drmfd: A drm file descriptor
> + * @connector_name: Name of the libdrm connector we're going to use
> + *
> + * Returns: 1 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_force_dsc_enable_bpc:
> * @drmfd: A drm file descriptor
> @@ -5758,6 +5820,22 @@ int igt_get_dsc_ycbcr420_debugfs_fd(int drmfd, char *connector_name)
> return openat(igt_debugfs_dir(drmfd), file_name, O_WRONLY);
> }
>
> +/*
> + * 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);
> +}
> +
> /*
> * igt_get_output_max_bpc:
> * @drmfd: A drm file descriptor
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index ccd8adf2c..990157bbc 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -977,15 +977,19 @@ bool igt_override_all_active_output_modes_to_fit_bw(igt_display_t *display);
>
> bool igt_is_dsc_supported(int drmfd, char *connector_name);
> bool igt_is_dsc_ycbcr420_supported(int drmfd, char *connector_name);
> +int igt_get_dsc_fractional_bpp_supported(int drmfd, char *connector_name);
> bool igt_is_fec_supported(int drmfd, char *connector_name);
> bool igt_is_dsc_enabled(int drmfd, char *connector_name);
> bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
> bool igt_is_force_dsc_ycbcr420_enabled(int drmfd, char *connector_name);
> +bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name);
> int igt_force_dsc_enable(int drmfd, char *connector_name);
> int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc);
> int igt_force_dsc_ycbcr420_enable(int drmfd, char *connector_name);
> +int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name);
> int igt_get_dsc_debugfs_fd(int drmfd, char *connector_name);
> int igt_get_dsc_ycbcr420_debugfs_fd(int drmfd, char *connector_name);
> +int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name);
>
> unsigned int igt_get_output_max_bpc(int drmfd, char *connector_name);
> unsigned int igt_get_pipe_current_bpc(int drmfd, enum pipe pipe);
next prev parent reply other threads:[~2022-12-23 12:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 11:58 [igt-dev] [PATCH i-g-t 0/6] VDSC YCbCr420 + Fractional BPP Swati Sharma
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 1/6] lib/kms: Add helpers for VDSC YCbCr420 debugfs entry Swati Sharma
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 2/6] tests/i915/kms_dsc: Prep work for extending val support for VDSC YCbCr420 Swati Sharma
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 3/6] tests/i915/kms_dsc: Enable validation " Swati Sharma
2022-12-23 11:39 ` Nautiyal, Ankit K
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 4/6] lib/kms: Add helpers for VDSC Fractional BPP debugfs entry Swati Sharma
2022-12-23 12:06 ` Nautiyal, Ankit K [this message]
2022-12-26 6:05 ` Nautiyal, Ankit K
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 5/6] tests/i915/kms_dsc: Enable validation for VDSC Fractional BPP Swati Sharma
2022-12-26 7:00 ` Nautiyal, Ankit K
2022-11-25 11:58 ` [igt-dev] [PATCH i-g-t 6/6] tests/i915/kms_dsc: Add test summary Swati Sharma
2022-11-25 12:39 ` [igt-dev] ✓ Fi.CI.BAT: success for VDSC YCbCr420 + Fractional BPP 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=b922d995-bc42-8b99-91dd-432c6243c5fb@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