All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Nidhi Gupta <nidhi1.gupta@intel.com>
Cc: igt-dev@lists.freedesktop.org, ville.syrjala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v4] tests/i915:Extend kms_frontbuffer_tracking to test FBC on multiple pipes
Date: Wed, 23 Feb 2022 15:21:57 +0200	[thread overview]
Message-ID: <YhY09fYwofNN8O81@intel.com> (raw)
In-Reply-To: <20220221121057.6590-1-nidhi1.gupta@intel.com>

On Mon, Feb 21, 2022 at 05:40:57PM +0530, Nidhi Gupta wrote:
> In future more platforms will support FBC on
> multiple pipes, so to validate the same extending
> the kms_frontbuffer_tracking test.
> 
> In kernel code now  FBC debugfs files are exposed
> for each crtc so added debugfs_read_crtc function
> to get the per pipe fbc status.
> 
> Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
> ---
>  tests/i915/kms_frontbuffer_tracking.c | 40 ++++++++++++++-------------
>  1 file changed, 21 insertions(+), 19 deletions(-)
> 
> diff --git a/tests/i915/kms_frontbuffer_tracking.c b/tests/i915/kms_frontbuffer_tracking.c
> index 532bfbb9..c31adc38 100644
> --- a/tests/i915/kms_frontbuffer_tracking.c
> +++ b/tests/i915/kms_frontbuffer_tracking.c
> @@ -732,8 +732,21 @@ static int __debugfs_write(const char *param, char *buf, int len)
>  	return igt_sysfs_write(drm.debugfs, param, buf, len - 1);
>  }
>  
> +static void __debugfs_read_crtc(const char *param, char *buf, int len)
> +{
> +	int dir;
> +	enum pipe pipe;
> +
> +	pipe = prim_mode_params.pipe;
> +	dir = igt_debugfs_pipe_dir(drm.fd, pipe, O_RDONLY);

Shouldn't that be O_DIRECTORY?

> +	igt_require_fd(dir);
> +	igt_debugfs_simple_read(dir, param, buf, len);
> +	close(dir);
> +}
> +
>  #define debugfs_read(p, arr) __debugfs_read(p, arr, sizeof(arr))
>  #define debugfs_write(p, arr) __debugfs_write(p, arr, sizeof(arr))
> +#define debugfs_read_crtc(p, arr) __debugfs_read_crtc(p, arr, sizeof(arr))
>  
>  static char last_fbc_buf[128];
>  
> @@ -742,7 +755,7 @@ static bool fbc_is_enabled(int lvl)
>  	char buf[128];
>  	bool print = true;
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	if (lvl != IGT_LOG_DEBUG)
>  		last_fbc_buf[0] = '\0';
>  	else if (strcmp(last_fbc_buf, buf))
> @@ -825,8 +838,8 @@ static struct timespec fbc_get_last_action(void)
>  	char *action;
>  	ssize_t n_read;
>  
> -	debugfs_read("i915_fbc_status", buf);
>  
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	action = strstr(buf, "\nLast action:");
>  	igt_assert(action);
>  
> @@ -874,8 +887,8 @@ static void fbc_setup_last_action(void)
>  	char buf[128];
>  	char *action;
>  
> -	debugfs_read("i915_fbc_status", buf);
>  
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	action = strstr(buf, "\nLast action:");
>  	if (!action) {
>  		igt_info("FBC last action not supported\n");
> @@ -893,7 +906,7 @@ static bool fbc_is_compressing(void)
>  {
>  	char buf[128];
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	return strstr(buf, "\nCompressing: yes\n") != NULL;
>  }
>  
> @@ -906,7 +919,7 @@ static bool fbc_not_enough_stolen(void)
>  {
>  	char buf[128];
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	return strstr(buf, "FBC disabled: not enough stolen memory\n");
>  }
>  
> @@ -914,7 +927,7 @@ static bool fbc_stride_not_supported(void)
>  {
>  	char buf[128];
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	return strstr(buf, "FBC disabled: framebuffer stride not supported\n");
>  }
>  
> @@ -922,7 +935,7 @@ static bool fbc_mode_too_large(void)
>  {
>  	char buf[128];
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	return strstr(buf, "FBC disabled: mode too large for compression\n");
>  }
>  
> @@ -1388,7 +1401,7 @@ static bool fbc_supported_on_chipset(void)
>  {
>  	char buf[128];
>  
> -	debugfs_read("i915_fbc_status", buf);
> +	debugfs_read_crtc("i915_fbc_status", buf);
>  	if (*buf == '\0')
>  		return false;
>  
> @@ -1404,17 +1417,6 @@ static void setup_fbc(void)
>  		return;
>  	}
>  
> -	/*
> -	 * While some platforms do allow FBC on pipes B/C, this test suite
> -	 * is not prepared for that yet.
> -	 * TODO: solve this.
> -	 */
> -	if (prim_mode_params.pipe != PIPE_A) {
> -		igt_info("Can't test FBC: primary connector doesn't support "
> -			 "pipe A\n");
> -		return;
> -	}
> -
>  	/* Early Generations are not able to report compression status. */
>  	if (!AT_LEAST_GEN(devid, 7))
>  		opt.fbc_check_compression = false;
> -- 
> 2.26.2

-- 
Ville Syrjälä
Intel

      parent reply	other threads:[~2022-02-23 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 12:10 [igt-dev] [PATCH i-g-t v4] tests/i915:Extend kms_frontbuffer_tracking to test FBC on multiple pipes Nidhi Gupta
2022-02-21 15:17 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915:Extend kms_frontbuffer_tracking to test FBC on multiple pipes (rev4) Patchwork
2022-02-21 19:01 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-23 13:21 ` Ville Syrjälä [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=YhY09fYwofNN8O81@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=nidhi1.gupta@intel.com \
    --cc=ville.syrjala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.