public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Tolakanahalli Pradeep, Madhumitha" <madhumitha.tolakanahalli.pradeep@intel.com>
To: "Navare, Manasi D" <manasi.d.navare@intel.com>,
	"Ser, Simon" <simon.ser@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Latvala, Petri" <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] igt/tests/kms_dp_tiled_display.c : kms test file for display port tiled displays
Date: Sat, 17 Aug 2019 00:01:21 +0000	[thread overview]
Message-ID: <9963e150a136b29c3aa3e00cb10071421d1ea672.camel@intel.com> (raw)
In-Reply-To: <0e9bd3948dad8f36d500af7af88f2a9c951c5d24.camel@intel.com>

On Thu, 2019-08-15 at 12:30 +0100, Ser, Simon wrote:
> wOn Wed, 2019-08-14 at 15:05 -0700, Tolakanahalli Pradeep, Madhumitha
> wrote:
> > On Wed, 2019-08-14 at 14:43 +0100, Ser, Simon wrote:
> > > On Wed, 2019-08-07 at 18:10 -0700, Tolakanahalli Pradeep,
> > > Madhumitha
> > > wrote:
> > > > > > I believe tests in kms_flip do a similar check. The
> > > > > > page_flip_handler
> > > > > > function handles the page flip event (which is given the
> > > > > > flip
> > > > > > timestamp
> > > > > > and sequence number). check_state verifies that the
> > > > > > timestamp
> > > > > > is
> > > > > > close
> > > > > > enough to what we expect (in our atomic check, maybe we can
> > > > > > compare
> > > > > > with strict equality).
> > > > > > 
> > > > > > Since we're dealing with multiple CRTCs, it may be a good
> > > > > > idea
> > > > > > to
> > > > > > use
> > > > > > drmEventContext.version = 3 with page_flip_handler2 so that
> > > > > > we
> > > > > > also
> > > > > > get
> > > > > > the CRTC in the page flip handler. Version 3 is a core DRM
> > > > > > feature,
> > > > > > all
> > > > > > drivers support it given a recent enough kernel.
> > > > > > 
> > > > > > Rough pseudo-code:
> > > > > > 
> > > > > > 	/* When committing buffer, request a page flip */
> > > > > > 	drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_NONBLOCK |
> > > > > > 			    DRM_MODE_PAGE_FLIP_EVENT, data);
> > > > > 
> > > > > Here we do the modese with igt_display_commit2 call that then
> > > > > calls
> > > > > drmModeAtomicCommit but
> > > > > doesnt call it with Page flip, do we have another igt helper
> > > > > that
> > > > > does a atomic commit with
> > > > > page flip event?
> > > > > 
> > > > > Can we not just do atomic commit and get vblank events so for
> > > > > two
> > > > > crtcs we get two events and compare
> > > > > the timestamp and make sure they are close enough?
> > > 
> > > I believe doing an atomic commit with DRM_MODE_PAGE_FLIP_EVENT as
> > > Madhumitha suggested should be enough.
> > 
> > Looks like using DRM_MODE_PAGE_FLIP_EVENT is giving me a errno 22,
> > invalid argument.
> 
> Have you tried DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK?
> 
> Enabling verbose dmesg DRM logging can help figuring out why the
> kernel
> sends "invalid ar"EINVAL:
> 
>     echo 0x00 | sudo tee /sys/module/drm/parameters/debug


Yes, I did try a commit with DRM_MODE_PAGE_FLIP_EVENT |
DRM_MODE_ATOMIC_NONBLOCK but IGT would not let me use them in
combination and the test failed with errno 22.
The cause of ret = -22 was the commit was failing in
drm_atomic_check_only(). Corresponding dmesg logs -
[drm:drm_atomic_check_only] [CRTC:189:pipe C] requesting event but off
[drm:drm_atomic_check_only] [CRTC:189:pipe C] atomic core check failed

I was able to get igt_display_commit2 to work with
DRM_MODE_ATOMIC_NONBLOCK and DRM_MODE_ATOMIC_ALLOW_MODESET (more like a
hacky way where I modified igt_kms.c and passed these flags). I was
able to get a successful non-atomic commit (dmesg mentioned "non-atomic 
commit" too). However, poll() always timed out. Here's 
my implementation for poll().

https://gitlab.freedesktop.org/mtolakan/igt-gpu-tools

Am I missing something trivial? Would really appreciate any
suggestions.

> 
> > > > > Manasi
> > > > > 
> > > > > > 	static void page_flip_handler(int fd, unsigned seq,
> > > > > > 				      unsigned tv_sec,
> > > > > > 				      unsigned tv_usec,
> > > > > > 				      unsigned crtc_id, void
> > > > > > *data)
> > > > > > 	{
> > > > > > 		/* Compare params with the other page flip */
> > > > > > 	}
> > > > > > 
> > > > > > 	/* When we get POLLIN in the DRM FD */
> > > > > > 	drmEventContext event = {
> > > > > > 		.version = 3,
> > > > > > 		.page_flip_handler2 = page_flip_handler,
> > > > > > 	};
> > > > > > 	drmHandleEvent(fd, &event);
> > > > > > 
> > > > 
> > > > I was trying to implement the above code with
> > > > igt_display_commit2.
> > > > Looks like I'm timing out while poll-ing for POLLIN.
> > > > 
> > > > Is there something I could be doing wrong? According to my
> > > > understanding, igt_display_commit2 should cause a page-flip
> > > > event
> > > > right?
> > > 
> > > Hmm. Yeah, it should work, assuming you use
> > > DRM_MODE_PAGE_FLIP_EVENT
> > > when doing the atomic commit. Can you push your code somewhere
> > > (e.g.
> > > on
> > > a GitLab fork) so that I can have a look?
> > 
> > Sure!
> > Here is the link to my forked repository. The commit and polling is
> > in
> > igt_main().
> > https://gitlab.freedesktop.org/mtolakan/igt-gpu-tools
> > My suspicion is the commit is not asynchronous, which is why I am
> > unble
> > to capture the page flip event. Please do let me know what you
> > think,
> > thanks!
> > 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-08-17  0:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 18:02 [igt-dev] [PATCH i-g-t] igt/tests/kms_dp_tiled_display.c : kms test file for display port tiled displays Madhumitha Tolakanahalli Pradeep
2019-07-17 18:35 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2019-07-17 18:56 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2019-07-18  6:43 ` [igt-dev] [PATCH i-g-t] " Ser, Simon
2019-07-30 19:21   ` Manasi Navare
2019-07-31  7:25     ` Ser, Simon
2019-07-31 17:13       ` Manasi Navare
2019-08-01  7:41         ` Ser, Simon
2019-08-01 17:38           ` Manasi Navare
2019-08-02  1:09             ` Tolakanahalli Pradeep, Madhumitha
2019-08-08  1:10             ` Tolakanahalli Pradeep, Madhumitha
2019-08-14 13:43               ` Ser, Simon
2019-08-14 22:05                 ` Tolakanahalli Pradeep, Madhumitha
2019-08-15 11:30                   ` Ser, Simon
2019-08-17  0:01                     ` Tolakanahalli Pradeep, Madhumitha [this message]
2019-08-19 14:50                       ` Ser, Simon
2019-07-31  0:42   ` Tolakanahalli Pradeep, Madhumitha
2019-07-31  8:15     ` Ser, Simon

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=9963e150a136b29c3aa3e00cb10071421d1ea672.camel@intel.com \
    --to=madhumitha.tolakanahalli.pradeep@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=manasi.d.navare@intel.com \
    --cc=petri.latvala@intel.com \
    --cc=simon.ser@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