From: "Ser, Simon" <simon.ser@intel.com>
To: "Vasilev, Oleg" <oleg.vasilev@intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH] tests/i915/i915_pm_rpm: skip i2c subtest on VGA subconnector
Date: Wed, 28 Aug 2019 08:38:20 +0000 [thread overview]
Message-ID: <60b4b415a87df9370d58586c32ace993523fa9ae.camel@intel.com> (raw)
In-Reply-To: <20190826132537.3476-1-oleg.vasilev@intel.com>
On Mon, 2019-08-26 at 16:25 +0300, Oleg Vasilev wrote:
> The subtest compares EDID obtained through I2C with the one thorugh DRM
> interface. Getting EDID through I2C on VGA is not reliable, and the test
> should be skipped. However, on some machines VGA connector is
> implemented as DP branch device. More background in an fdo bug [1].
>
> The patch enables skips of the test based on a subconnector property,
> introduced in the kernel series [2].
>
> [1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
> [2]: https://patchwork.freedesktop.org/series/65800/
>
> CC: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> CC: Simon Ser <simon.ser@intel.com>
> Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> ---
> tests/i915/i915_pm_rpm.c | 38 ++++++++++++++++++++++++++++++++++++--
> 1 file changed, 36 insertions(+), 2 deletions(-)
>
> diff --git a/tests/i915/i915_pm_rpm.c b/tests/i915/i915_pm_rpm.c
> index 2168ff72..5c512597 100644
> --- a/tests/i915/i915_pm_rpm.c
> +++ b/tests/i915/i915_pm_rpm.c
> @@ -389,6 +389,41 @@ static drmModePropertyBlobPtr get_connector_edid(drmModeConnectorPtr connector,
> return blob;
> }
>
> +static bool is_vga(drmModeConnectorPtr connector)
> +{
> + bool found;
> + uint64_t prop_value;
> + drmModePropertyPtr prop;
> + char *enum_name = NULL;
> + bool is_subconnector_vga = false;
> +
> + if (connector->connector_type == DRM_MODE_CONNECTOR_VGA)
> + return true;
> +
> + if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)
> + return false;
Question: is it necessary to check that the connector type is
DisplayPort?
> + found = kmstest_get_property(drm_fd, connector->connector_id,
> + DRM_MODE_OBJECT_CONNECTOR, "subconnector",
> + NULL, &prop_value, &prop);
prop is leaked, we need to drmModeFreeProperty it.
With that fixed:
Reviewed-by: Simon Ser <simon.ser@intel.com>
> +
> + igt_assert(found);
> + igt_assert(prop->flags & DRM_MODE_PROP_ENUM);
> +
> + for (int i = 0; i < prop->count_enums; i++) {
> + if (prop->enums[i].value == prop_value) {
> + enum_name = prop->enums[i].name;
> + break;
> + }
> + }
> + igt_assert(enum_name);
> +
> + is_subconnector_vga = (strcmp(enum_name, "VGA") == 0);
> + if (is_subconnector_vga)
> + igt_debug("This DP is in fact VGA, skipping\n");
> + return is_subconnector_vga;
> +}
> +
> static void init_mode_set_data(struct mode_set_data *data)
> {
> data->res = drmModeGetResources(drm_fd);
> @@ -679,7 +714,6 @@ static void test_i2c(struct mode_set_data *data)
>
> bool got_i2c_edid = i2c_read_edid(connector_name, i2c_edid);
> bool got_drm_edid = drm_edid != NULL;
> - bool is_vga = data->connectors[i]->connector_type == DRM_MODE_CONNECTOR_VGA;
>
> bool edids_equal;
>
> @@ -688,7 +722,7 @@ static void test_i2c(struct mode_set_data *data)
> * the EDID reading mostly FFs and then disabling bit-banging. Since we
> * don't want to reimplement everything the Kernel does, let's just
> * accept the fact that some VGA outputs won't be properly detected. */
> - if (is_vga)
> + if (is_vga(data->connectors[i]))
> continue;
>
> if (!got_i2c_edid && !got_drm_edid)
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
prev parent reply other threads:[~2019-08-28 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 13:25 [igt-dev] [PATCH] tests/i915/i915_pm_rpm: skip i2c subtest on VGA subconnector Oleg Vasilev
2019-08-26 15:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-26 18:34 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-08-28 8:38 ` Ser, Simon [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=60b4b415a87df9370d58586c32ace993523fa9ae.camel@intel.com \
--to=simon.ser@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=oleg.vasilev@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