Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sripada, Radhakrishna" <radhakrishna.sripada@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested
Date: Thu, 19 Nov 2020 10:32:25 -0800	[thread overview]
Message-ID: <20201119183225.GA21281@InViCtUs> (raw)
In-Reply-To: <20201103013304.128195-1-jose.souza@intel.com>

On Mon, Nov 02, 2020 at 05:33:04PM -0800, José Roberto de Souza wrote:
> IGT has no control of what is going to be the modeset of fbcon and as
> it could set a mode that is not compatible with the feature being
> tested lets check for those incompatibilities and skip the test if
> needed.
> 
> Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/2327
LGTM,
Reviewed-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>

-RK
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  tests/kms_fbcon_fbt.c | 47 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
> index e99a1f2f2..4df4db521 100644
> --- a/tests/kms_fbcon_fbt.c
> +++ b/tests/kms_fbcon_fbt.c
> @@ -255,6 +255,48 @@ static inline void psr_debugfs_enable(int device, int debugfs_fd)
>  	psr_enable(device, debugfs_fd, PSR_MODE_1);
>  }
>  
> +static void fbc_skips_on_fbcon(int debugfs_fd)
> +{
> +	const char *reasons[] = {
> +		"incompatible mode",
> +		"mode too large for compression",
> +		"framebuffer not tiled or fenced",
> +		"pixel format is invalid",
> +		"rotation unsupported",
> +		"tiling unsupported",
> +		"framebuffer stride not supported",
> +		"per-pixel alpha blending is incompatible with FBC",
> +		"pixel rate is too big",
> +		"CFB requirements changed",
> +		"plane Y offset is misaligned",
> +		"plane height + offset is non-modulo of 4"
> +	};
> +	bool skip = false;
> +	char buf[128];
> +	int i;
> +
> +	igt_debugfs_simple_read(debugfs_fd, "i915_fbc_status", buf, sizeof(buf));
> +	if (strstr(buf, "FBC enabled\n"))
> +		return;
> +
> +	for (i = 0; skip == false && i < ARRAY_SIZE(reasons); i++)
> +		skip = strstr(buf, reasons[i]);
> +
> +	if (skip)
> +		igt_skip("fbcon modeset is not compatible with FBC\n");
> +}
> +
> +static void psr_skips_on_fbcon(int debugfs_fd)
> +{
> +	/*
> +	 * Unless fbcon enables interlaced mode all other PSR restrictions
> +	 * will be caught and skipped in supported_on_chipset() hook.
> +	 * As PSR don't expose in debugfs why it is not enabling for now
> +	 * not checking not even if it was not enabled because of interlaced
> +	 * mode, if some day it happens changes will be needed first.
> +	 */
> +}
> +
>  struct feature {
>  	bool (*supported_on_chipset)(int device, int debugfs_fd);
>  	bool (*wait_until_enabled)(int debugfs_fd);
> @@ -262,6 +304,8 @@ struct feature {
>  	bool (*wait_until_update)(struct drm_info *drm);
>  	bool (*connector_possible_fn)(drmModeConnectorPtr connector);
>  	void (*enable)(int device, int debugfs_fd);
> +	/* skip test if feature can't be enabled due fbcon modeset */
> +	void (*skips_on_fbcon)(int debugfs_fd);
>  } fbc = {
>  	.supported_on_chipset = fbc_supported_on_chipset,
>  	.wait_until_enabled = fbc_wait_until_enabled,
> @@ -269,6 +313,7 @@ struct feature {
>  	.wait_until_update = fbc_wait_until_update,
>  	.connector_possible_fn = connector_can_fbc,
>  	.enable = fbc_modparam_enable,
> +	.skips_on_fbcon = fbc_skips_on_fbcon,
>  }, psr = {
>  	.supported_on_chipset = psr_supported_on_chipset,
>  	.wait_until_enabled = psr_wait_until_enabled,
> @@ -276,6 +321,7 @@ struct feature {
>  	.wait_until_update = psr_wait_until_update,
>  	.connector_possible_fn = connector_can_psr,
>  	.enable = psr_debugfs_enable,
> +	.skips_on_fbcon = psr_skips_on_fbcon,
>  };
>  
>  static void restore_fbcon(struct drm_info *drm)
> @@ -317,6 +363,7 @@ static void subtest(struct drm_info *drm, struct feature *feature, bool suspend)
>  	sleep(3);
>  
>  	wait_user("Back to fbcon.");
> +	feature->skips_on_fbcon(drm->debugfs_fd);
>  	igt_assert(feature->wait_until_update(drm));
>  
>  	if (suspend) {
> -- 
> 2.29.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2020-11-19 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  1:33 [igt-dev] [PATCH i-g-t] tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested José Roberto de Souza
2020-11-03  2:14 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2020-11-05 14:09 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested (rev2) Patchwork
2020-11-05 15:17 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/fbcon: Skip test if fbcon modeset if not compatible with feature tested (rev3) Patchwork
2020-11-05 18:25 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-11-05 18:27   ` Souza, Jose
2020-11-19 20:58   ` Souza, Jose
2020-11-19 18:32 ` Sripada, Radhakrishna [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=20201119183225.GA21281@InViCtUs \
    --to=radhakrishna.sripada@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jose.souza@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