All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_properties: Add functional test for "max bpc" property
Date: Fri, 2 Nov 2018 09:17:36 -0700	[thread overview]
Message-ID: <20181102161735.GA2233@intel.com> (raw)
In-Reply-To: <20181102093221.GC21967@phenom.ffwll.local>

On Fri, Nov 02, 2018 at 10:32:21AM +0100, Daniel Vetter wrote:
> On Wed, Oct 31, 2018 at 12:41:44PM -0700, Rodrigo Vivi wrote:
> > On Mon, Oct 29, 2018 at 04:23:18AM -0700, Radhakrishna Sripada wrote:
> > > On Wed, Oct 24, 2018 at 03:45:35PM -0700, Rodrigo Vivi wrote:
> > > > On Fri, Oct 12, 2018 at 12:18:46AM -0700, Radhakrishna Sripada wrote:
> > > > > Test the values in the range advertised by the "max bpc" property.
> > > > > 
> > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > > > Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
> > > > > ---
> > > > >  tests/kms_properties.c | 32 +++++++++++++++++++++++++++++++-
> > > > >  1 file changed, 31 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/tests/kms_properties.c b/tests/kms_properties.c
> > > > > index f5a86236f5c8..503a5c251e10 100644
> > > > > --- a/tests/kms_properties.c
> > > > > +++ b/tests/kms_properties.c
> > > > > @@ -82,7 +82,37 @@ static bool ignore_property(uint32_t obj_type, uint32_t prop_flags,
> > > > >  	return false;
> > > > >  }
> > > > >  
> > > > > -static const struct additional_test property_functional_test[] = {};
> > > > > +static void max_bpc_prop_test(int fd, uint32_t id, uint32_t type, drmModePropertyPtr prop,
> > > > > +			      uint32_t prop_id, uint64_t prop_value, bool atomic)
> > > > > +{
> > > > > +	drmModeAtomicReqPtr req = NULL;
> > > > > +	int i, ret;
> > > > > +
> > > > > +	if (atomic)
> > > > > +		req = drmModeAtomicAlloc();
> > > > > +
> > > > > +	for ( i = prop->values[0]; i < prop->values[1] ; i++) {
> > > > > +		if (!atomic) {
> > > > > +			ret = drmModeObjectSetProperty(fd, id, type, prop_id, i);
> > > > > +
> > > > > +			igt_assert_eq(ret, 0);
> > > > > +		} else {
> > > > > +			ret = drmModeAtomicAddProperty(req, id, prop_id, i);
> > > > > +			igt_assert(ret >= 0);
> > > > > +
> > > > > +			ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
> > > > > +			igt_assert_eq(ret, 0);
> > > > 
> > > > Should we read it back to see if it sticks?
> > > 
> > > Reading back the property to see if the value sticks IMO is validation 
> > > of the drm_property infrastructure which is being done by the sanity sub tests.
> > 
> > ahh cool...
> > 
> > > > or should we be checking with some debugfs to see all
> > > > conditions and to see if the max is getting really respected?
> > > > 
> > > We could do this additional check for this property. However it would involve 
> > > obtaining the corresponding CRTC id and parsing the i915_display_info debugs 
> > > file to get the appropriate bpp for the CRTC and make sure the bpp is less 
> > > than 8 * prop->values[i] making the test bulky. Do you suggest a simpler way?
> > 
> > probably a place where selftests could be useful for display?
> > 
> > I don't have the confidence that this test case is validating the feature
> > itself. We set the max, but we are not sure if the max gets respected.
> > 
> > But it is better to have at least this side of the validation.
> > For this reasons:
> 
> Yeah for full end-to-end testing we'd need to ask chamelium what bpc it
> receives. Or something like that.
> 
> But also: This test here at least exercises all the code, and with the hw
> state readback and cross-check we do catch quiet a few bugs.

makes sense...

> -Daniel
> 
> > 
> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

^ for the series...

and pushed.

> > 
> > > 
> > > Thanks,
> > > Radhakrishna(RK) Sripada
> > > > ( really questions not a request ;) )
> > > > 
> > > > > +		}
> > > > > +	}
> > > > > +
> > > > > +	if (atomic)
> > > > > +		drmModeAtomicFree(req);
> > > > > +}
> > > > > +
> > > > > +static const struct additional_test property_functional_test[] = {
> > > > > +									{"max bpc", DRM_MODE_OBJECT_CONNECTOR,
> > > > > +									 max_bpc_prop_test},
> > > > > +								 };
> > > > >  
> > > > >  static bool has_additional_test_lookup(uint32_t obj_type, const char *name,
> > > > >  				bool atomic, int *index)
> > > > > -- 
> > > > > 2.9.3
> > > > > 
> > > > > _______________________________________________
> > > > > 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
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> 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

  reply	other threads:[~2018-11-02 16:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12  7:18 [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_properties: Add additional prperty test infrastructure Radhakrishna Sripada
2018-10-12  7:18 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_properties: Add functional test for "max bpc" property Radhakrishna Sripada
2018-10-24 22:45   ` Rodrigo Vivi
2018-10-29 11:23     ` Radhakrishna Sripada
2018-10-31 19:41       ` Rodrigo Vivi
2018-11-02  9:32         ` Daniel Vetter
2018-11-02 16:17           ` Rodrigo Vivi [this message]
2018-10-12  8:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/2] tests/kms_properties: Add additional prperty test infrastructure Patchwork
2018-10-12  9:43 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20181102161735.GA2233@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.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 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.