public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Tomasz Figa <tfiga@chromium.org>
Cc: "Sean Paul" <seanpaul@chromium.org>,
	"Mark Yao" <yzq@rock-chips.com>,
	"Inki Dae" <inki.dae@samsung.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Stéphane Marchesin" <marcheu@chromium.org>,
	"Doug Anderson" <dianders@chromium.org>,
	"Thierry Reding" <treding@nvidia.com>,
	"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
	"Javier Martinez Canillas" <javier@osg.samsung.com>,
	"David Airlie" <airlied@linux.ie>,
	"Emil Velikov" <emil.l.velikov@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH v3 2/4] drm/rockchip: add an common abstracted PSR driver
Date: Tue, 12 Jul 2016 18:10:26 +0200	[thread overview]
Message-ID: <20160712161026.GV23520@phenom.ffwll.local> (raw)
In-Reply-To: <CAAFQd5CrT_bM+VLpzqZqu7p=32YYkTrNZw75FkPwx-LteUCBGw@mail.gmail.com>

On Wed, Jul 13, 2016 at 12:10:13AM +0900, Tomasz Figa wrote:
> On Tue, Jul 12, 2016 at 9:38 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Fri, Jul 01, 2016 at 02:00:00PM -0400, Sean Paul wrote:
> >> On Fri, Jul 1, 2016 at 5:19 AM, Yakir Yang <ykk@rock-chips.com> wrote:
> >> > The PSR driver have exported four symbols for specific device driver:
> >> > - rockchip_drm_psr_register()
> >> > - rockchip_drm_psr_unregister()
> >> > - rockchip_drm_psr_enable()
> >> > - rockchip_drm_psr_disable()
> >> > - rockchip_drm_psr_flush()
> >> >
> >> > Encoder driver should call the register/unregister interfaces to hook
> >> > itself into common PSR driver, encoder have implement the 'psr_set'
> >> > callback which use the set PSR state in hardware side.
> >> >
> >> > Crtc driver would call the enable/disable interfaces when vblank is
> >> > enable/disable, after that the common PSR driver would call the encoder
> >> > registered callback to set the PSR state.
> >> >
> >>
> >> This feels overly complicated. It seems like you could cut out a bunch
> >> of code by just coding the psr functions into vop and
> >> analogix_dp-rockchip. I suppose the only reason to keep it abstracted
> >> would be if you plan on supporting psr in a different encoder or crtc
> >> in rockchip, or if you're planning on moving this into drm core.
> >
> > Agreed on the layers of indirection. Also, you end up with 3 delayed
> > timers in total:
> > - defio timer from fbdev emulation
> > - timer in this abstraction
> > - delayed work in the psr backend driver
> 
> Maybe I'm missing something obvious (don't know how the PSR is
> implemented in hardware or in other drivers), but why do we need all
> these timers? Couldn't we just trigger a fake page flip on fb dirty
> call?

Page flips are ratelimited to vrefresh, and not all drivers support it.
The other issue is that dirty ioctl supports dirty rectangles, but page
flip is still a full-screen upload. We discussed adding a dirty rectangle
to the kms properties to fix this gap, but until that's done I don't think
it makes much sense to remap dirty to an (atomic) page flip. One small
technicality is that dirty works on framebuffers, but page flips
(especially atomic ones) work on crtcs. That makes the remapping a notch
more tricky.

But in principle, fully agreed. And once we have atomic dirty rectangles
we could type up a small helper that drivers can plug into the dirty
ioctl. Since new properties requires new userspace we could just track the
dirty rectangle internally to get this helper landed, if there's
interested for that. I'll certainly be happy to review patches.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-07-12 16:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  9:18 [PATCH v3 0/4] Add PSR function support for Analogix/Rockchip DP Yakir Yang
2016-07-01  9:19 ` [PATCH v3 1/4] drm/rockchip: vop: export line flag function Yakir Yang
2016-07-01 15:30   ` Sean Paul
2016-07-01 15:32     ` Sean Paul
2016-07-08  2:30       ` Yakir Yang
2016-07-01  9:19 ` [PATCH v3 2/4] drm/rockchip: add an common abstracted PSR driver Yakir Yang
2016-07-01 18:00   ` Sean Paul
2016-07-08  2:12     ` Yakir Yang
2016-07-12 12:38     ` Daniel Vetter
2016-07-12 15:10       ` Tomasz Figa
2016-07-12 16:10         ` Daniel Vetter [this message]
2016-07-13  3:36       ` Yakir Yang
2016-07-01  9:19 ` [PATCH v3 3/4] drm/bridge: analogix_dp: add the PSR function support Yakir Yang
2016-07-01 19:46   ` Sean Paul
2016-07-08  2:26     ` Yakir Yang
2016-07-08  2:39       ` Yakir Yang
2016-07-12 15:29       ` Sean Paul
2016-07-01  9:19 ` [PATCH v3 4/4] drm/rockchip: analogix_dp: implement PSR function Yakir Yang
2016-07-01 20:05   ` Sean Paul
2016-07-08  2:32     ` Yakir Yang

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=20160712161026.GV23520@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=heiko@sntech.de \
    --cc=inki.dae@samsung.com \
    --cc=javier@osg.samsung.com \
    --cc=jingoohan1@gmail.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=marcheu@chromium.org \
    --cc=seanpaul@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=treding@nvidia.com \
    --cc=yzq@rock-chips.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