From: "Ville Syrjälä" <ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
harry.wentland-5C7GfCeVMHo@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [Intel-gfx] [PATCH i-g-t] test/kms_properties.c: fix connector-properties
Date: Tue, 20 Jun 2017 22:03:44 +0300 [thread overview]
Message-ID: <20170620190344.GX12629@intel.com> (raw)
In-Reply-To: <20170620182738.22255-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
On Tue, Jun 20, 2017 at 02:27:38PM -0400, Bhawanpreet Lakha wrote:
> The test doesn't consider immutable properties
>
> Legacy Test: The test trys to set the property, but if the property
> is immutable the test fails.
> Added conditions to check if the property is immutable.
>
> Atomic Test: The immutable properties are added and fails on commit.
> Added condition to skip 'add property' if the property
> is immutable. This insures that the commit will not fail.
>
> Skipping the add property is the only way, because otherwise
> the the actual commit will always fail if there is atleast
> one immutable property.
Might be a good idea to have a test that tries to set immutable
properties via atomic as well.
>
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
> ---
> tests/kms_properties.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/tests/kms_properties.c b/tests/kms_properties.c
> index c15026b8..aa1af767 100644
> --- a/tests/kms_properties.c
> +++ b/tests/kms_properties.c
> @@ -138,13 +138,19 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
> if (!atomic) {
> ret = drmModeObjectSetProperty(fd, id, type, prop_id, prop_value);
>
> - igt_assert_eq(ret, 0);
> + if (!(prop->flags & DRM_MODE_PROP_IMMUTABLE))
> + igt_assert_eq(ret, 0);
> + else
> + igt_assert(ret != 0);
> +
> } else {
> - ret = drmModeAtomicAddProperty(req, id, prop_id, prop_value);
> - igt_assert(ret >= 0);
> + if (!(prop->flags & DRM_MODE_PROP_IMMUTABLE)) {
> + ret = drmModeAtomicAddProperty(req, id, prop_id, prop_value);
> + igt_assert(ret >= 0);
>
> - ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> - igt_assert_eq(ret, 0);
> + ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> + igt_assert_eq(ret, 0);
> + }
> }
>
> drmModeFreeProperty(prop);
> --
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-06-20 19:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 18:27 [PATCH i-g-t] test/kms_properties.c: fix connector-properties Bhawanpreet Lakha
[not found] ` <20170620182738.22255-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2017-06-20 19:03 ` Ville Syrjälä [this message]
[not found] ` <20170620190344.GX12629-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-20 19:40 ` [Intel-gfx] " Harry Wentland
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=20170620190344.GX12629@intel.com \
--to=ville.syrjala-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=harry.wentland-5C7GfCeVMHo@public.gmane.org \
--cc=intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/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