public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@intel.com>,
	Emil Velikov <emil.velikov@collabora.com>
Subject: Re: [PATCH v2 2/3] drm: Add API for capturing frame CRCs
Date: Tue, 12 Jul 2016 16:06:24 +0200	[thread overview]
Message-ID: <20160712140624.GL23520@phenom.ffwll.local> (raw)
In-Reply-To: <20160707154126.GN4329@intel.com>

On Thu, Jul 07, 2016 at 06:41:26PM +0300, Ville Syrjälä wrote:
> On Thu, Jul 07, 2016 at 05:06:08PM +0200, Tomeu Vizoso wrote:
> > +static int crtc_crc_release(struct inode *inode, struct file *filep)
> > +{
> > +	struct drm_crtc *crtc = filep->f_inode->i_private;
> > +	struct drm_crtc_crc *crc = &crtc->crc;
> > +
> > +	spin_lock_irq(&crc->lock);
> > +	crc->opened = false;
> > +	spin_unlock_irq(&crc->lock);
> > +
> > +	return 0;
> > +}
> 
> One thing I hate about the i915 code is the fact that it leaves crc
> capture on even if you close the file. igt has an exit handler to
> try to deal with that problem, but if the kernel just did the right
> thing from the start it wouln't be needed. Sadly I failed to convince
> Daniel that the kernel shouldn't suck. I still think it's a bad design.

Ack on fixing this. Not sure what exactly the interface should look like,
since right now igt does open/close the crc capture file a lot of times.
We'd need to change the igt backend quite a bit.

> > +		bytes_read += snprintf(buf, CRC_BUFFER_LEN,
> > +				       "%8u %8x %8x %8x %8x %8x\n",
> 
> You copied the bug from i915. Either make the frame counter hex, or give
> it more room to accomodate the full 32 bit number. Long time ago I posted
> a patch to use hex in i915, but it got stuck in some review limbo and
> as I had more important things to fix, I never revisited the issue.

Ack here too, totally forgotten about this one.

> In i915 we currently stuff the raw hardware frame counter in there, which
> isn't all that great since it's only 24 bits on some machines, and doesn't
> even exist on others. So userspace can't really deal with wraparound in
> any sane way. I guess just switching over to the sw counter universally
> could be the most sane way to go. Or maybe we should have room for both?

Either we go with the cooked vblank counter or both. Maybe both while at
it, it might come handy ... One problem is with CRC capturing in the sink,
where it's ill-defined how a sink frame corresponds to the drm vblank
counter. In that case we might need to return 0x######## or something else for
"invalid".

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-07-12 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07 15:06 [PATCH v2 0/3] New debugfs API for capturing CRC of frames Tomeu Vizoso
2016-07-07 15:06 ` [PATCH v2 1/3] drm/i915/debugfs: Move out pipe CRC code Tomeu Vizoso
2016-07-07 15:06 ` [PATCH v2 2/3] drm: Add API for capturing frame CRCs Tomeu Vizoso
2016-07-07 15:41   ` Ville Syrjälä
2016-07-12 14:06     ` Daniel Vetter [this message]
2016-07-07 15:06 ` [PATCH v2 3/3] drm/i915: Use new CRC debugfs API Tomeu Vizoso

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=20160712140624.GL23520@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomeu.vizoso@collabora.com \
    --cc=ville.syrjala@linux.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