mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Dave Airlie <airlied@gmail.com>,
	Daniel Stone <daniel@fooishbar.org>,
	David Brown <David.Brown@arm.com>,
	Brian Starkey <Brian.Starkey@arm.com>,
	devicetree@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	DRI devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC][PATCH 2/2] drm/arm: Add support for Mali Display Processors
Date: Tue, 12 Apr 2016 21:30:14 +0200	[thread overview]
Message-ID: <20160412193014.GN2510@phenom.ffwll.local> (raw)
In-Reply-To: <20160412171349.GK16063@e106497-lin.cambridge.arm.com>

On Tue, Apr 12, 2016 at 06:13:49PM +0100, Liviu Dudau wrote:
> On Tue, Apr 12, 2016 at 05:47:57PM +0200, Daniel Vetter wrote:
> > On Fri, Apr 01, 2016 at 05:21:52PM +0100, Liviu Dudau wrote:
> > > +static int malidp_enable_vblank(struct drm_device *drm, unsigned int crtc)
> > > +{
> > > +	return 0;
> > > +}
> > > +
> > > +static void malidp_disable_vblank(struct drm_device *drm, unsigned int pipe)
> > > +{
> > > +}
> > 
> > Might be worth it to create a patch for drm_irq.c to make
> > enable/disable_vblank functions optional. Otoh does your chip really keep
> > on generating vblank irqs all the time, with no way to shut it up? That
> > would be terrible for power consumption ... Especially since you have no
> > hw counter either.
> 
> Initially I had code here that was turning off the vblank irq, then I've read
> the comment in drmP.h that the routine should be a no-op when hardware counters
> are missing, hence this version. As for the display processor: it will generate
> an interrupt for every finished scanout cycle, but it has support for variable
> vsync. Interrupt can be disabled, but I've read in the drmP.h that it is required
> for timestamping support when one doesn't have hw counters.
> 
> I'm OK with fixing drm_irq.c to not require enable/disable_vblank but then the
> comments in drmP.h will also have to change?

Nah, you bring up a good point actually - you really can't disable vblank
if there's no hw counter. At least not right now. I think dummy functions
in drm_irq.c like drm_vblank_get/set_no_hw_counter to make this clear
would be nice. Or maybe just a comment here.

The other option would be to finally fake this using high-precision
timestamps, since a lot of mobile hw seems to have forgotten to add a
proper vblank counter. But that has issues (it can drift), and probably
better done separately.

> > > +static void malidp_de_plane_disable(struct drm_plane *plane,
> > > +				    struct drm_plane_state *state)
> > > +{
> > > +	struct malidp_plane *mp = to_malidp_plane(plane);
> > > +
> > > +	/* ToDo: figure out the attached framebuffer lifecycle */
> > 
> > You don't need to figure this out, atomic helpers will take care of the fb
> > for you.
> 
> It is more in line with un/pinning the framebuffer and making sure that the
> framebuffer has been scanned out before unref-ing it.

That should be taken care of by the vblank wait the helpers do for you.
Again happans all automatically (except you need to keep that in mind for
the async work).

> Thanks again for finding time to review the code.

No problem.

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

  reply	other threads:[~2016-04-12 19:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 16:21 [RFC][PATCH 0/2] Initial support for ARM " Liviu Dudau
2016-04-01 16:21 ` [RFC][PATCH 1/2] dt/bindings: display: Add DT bindings for " Liviu Dudau
2016-04-01 16:47   ` Mark Rutland
2016-04-04  9:02     ` Liviu Dudau
2016-04-04  5:16   ` Rob Herring
2016-04-04  9:01     ` Liviu Dudau
2016-04-01 16:21 ` [RFC][PATCH 2/2] drm/arm: Add support " Liviu Dudau
2016-04-12 15:47   ` Daniel Vetter
2016-04-12 17:13     ` Liviu Dudau
2016-04-12 19:30       ` Daniel Vetter [this message]
2016-04-12 15:58   ` Daniel Vetter
2016-04-12 17:16     ` Liviu Dudau
2016-04-12 19:31       ` Daniel Vetter
2016-04-13 11:48   ` Emil Velikov
2016-04-13 13:48     ` Liviu Dudau
2016-04-13 15:29       ` Emil Velikov

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=20160412193014.GN2510@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Brian.Starkey@arm.com \
    --cc=David.Brown@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=airlied@gmail.com \
    --cc=daniel@fooishbar.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome