All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Yinshengbao <yinshengbao@hisilicon.com>,
	Yiping Xu <xuyiping@hisilicon.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Yanhaifeng <yanhaifeng@hisilicon.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andy Green <andy.green@linaro.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Dechun Fang <fangdechun@hisilicon.com>,
	puck.chen@hisilicon.com, Yangminglei <ml.yang@hisilicon.com>,
	gongyu@hisilicon.com, xuwei5@hisilicon.com,
	"Liguozhu (Kenneth)" <liguozhu@hisilicon.com>,
	qijiwen@hisilicon.com,
	"Yanglong (James)" <james.yanglong@hisilicon.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>
Subject: Re: [PATCH RFC 0/8] Add New DRM Driver for Hisilicon's Hi6220 SoC
Date: Tue, 22 Sep 2015 10:49:15 +0200	[thread overview]
Message-ID: <20150922084915.GS3383@phenom.ffwll.local> (raw)
In-Reply-To: <CAGd==05NKAjH=hD=bqKNh052ff=osJ4WxwOdDb3xoC1Mgy6Jdg@mail.gmail.com>

On Thu, Sep 17, 2015 at 05:51:28PM +0800, Xinliang Liu wrote:
> On 17 September 2015 at 04:16, Daniel Vetter <daniel@ffwll.ch> wrote:
> 
> > On Wed, Sep 16, 2015 at 04:23:35PM +0100, Daniel Stone wrote:
> > > The biggest issue though, is that this driver should become an atomic
> > > modesetting driver. Atomic modesetting, rather than sending small
> > > individual commands (enable CRTC, change plane position, etc) is based
> > > on validating and passing around complete sets of hardware state.
> > > Daniel Vetter's blog has an article on how to convert your driver:
> > > http://blog.ffwll.ch/2014/11/atomic-modeset-support-for-kms-drivers.html
> >
> > Yeah, any new driver should really be built on top of atomic - it's a lot
> > more flexible than the old thing and it's also what you want long-term.
> >
> > I've also just done a presenation about atomic for drivers:
> >
> > http://people.freedesktop.org/~danvet/presentations/xdc-2015.pdf
> 
> 
> Hi Daniel,
> This is a good presentation. It gives us very detail and good suggection on
> implementation.
> Thank you for sharing this.
> 
> We have a open source KMS hwc:
> wiki:
> https://wiki.linaro.org/BenjaminGaignard/HWComposer_DRM?highlight=%28hwcomposer%2
> source code: git://git.linaro.org/people/benjamin.gaignard/hwcomposer.git
> Now only STI and Hikey boards are tested on it. And atomic mode setting is
> not support now.
> I think we should add support for atomic mode setting next.
> 
> One difficulty I am facing is that one setting should be made sure is ok in
> the prepare function of hwc.
> If not, the set function of hwc may be fail and display will not properly.
> I don't know atomic mode setting how to handle this situation. And it seems
> that in the prepare function,
> it should check the hardware's capabilities, such as clip, scale, rotation,
> blending and so on.

Specifically to support things like hwc's ->prepare callback atomic
supports a TEST_ONLY mode. Hence in your the prepare code build up the
atomic state, but set the TEST_ONLY flag when calling the ioctl. When the
kernel is happy you can store it somewhere and tell surface flinger the
configuration so it can render the remaining buffers with GL. The idea is
that generic userspace does use TEST_ONLY mode iterative to build up the
maximal configuration of hw planes that a given kms driver supports,
leaving no hw-specific code in userspace. For optimized hwc drivers
running on atomic you then just need to tune the selection, but detailed
constraint checking would still be done by the kernel.

The weston patches from Daniel Stone have a similar design, would be worth
checking those out.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Daniel Stone <daniel@fooishbar.org>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Yinshengbao <yinshengbao@hisilicon.com>,
	Yiping Xu <xuyiping@hisilicon.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Yanhaifeng <yanhaifeng@hisilicon.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andy Green <andy.green@linaro.org>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Dechun Fang <fangdechun@hisilicon.com>,
	puck.chen@hisilicon.com, Yangminglei <ml.yang@hisilicon.com>,
	gongyu@hisilicon.com, xuwei5@hisilicon.com,
	"Liguozhu (Kenneth)" <liguozhu@hisilicon.com>,
	qijiwen@hisilicon.com,
	"Yanglong (James)" <james.yanglong@hisilicon.com>
Subject: Re: [PATCH RFC 0/8] Add New DRM Driver for Hisilicon's Hi6220 SoC
Date: Tue, 22 Sep 2015 10:49:15 +0200	[thread overview]
Message-ID: <20150922084915.GS3383@phenom.ffwll.local> (raw)
In-Reply-To: <CAGd==05NKAjH=hD=bqKNh052ff=osJ4WxwOdDb3xoC1Mgy6Jdg@mail.gmail.com>

On Thu, Sep 17, 2015 at 05:51:28PM +0800, Xinliang Liu wrote:
> On 17 September 2015 at 04:16, Daniel Vetter <daniel@ffwll.ch> wrote:
> 
> > On Wed, Sep 16, 2015 at 04:23:35PM +0100, Daniel Stone wrote:
> > > The biggest issue though, is that this driver should become an atomic
> > > modesetting driver. Atomic modesetting, rather than sending small
> > > individual commands (enable CRTC, change plane position, etc) is based
> > > on validating and passing around complete sets of hardware state.
> > > Daniel Vetter's blog has an article on how to convert your driver:
> > > http://blog.ffwll.ch/2014/11/atomic-modeset-support-for-kms-drivers.html
> >
> > Yeah, any new driver should really be built on top of atomic - it's a lot
> > more flexible than the old thing and it's also what you want long-term.
> >
> > I've also just done a presenation about atomic for drivers:
> >
> > http://people.freedesktop.org/~danvet/presentations/xdc-2015.pdf
> 
> 
> Hi Daniel,
> This is a good presentation. It gives us very detail and good suggection on
> implementation.
> Thank you for sharing this.
> 
> We have a open source KMS hwc:
> wiki:
> https://wiki.linaro.org/BenjaminGaignard/HWComposer_DRM?highlight=%28hwcomposer%2
> source code: git://git.linaro.org/people/benjamin.gaignard/hwcomposer.git
> Now only STI and Hikey boards are tested on it. And atomic mode setting is
> not support now.
> I think we should add support for atomic mode setting next.
> 
> One difficulty I am facing is that one setting should be made sure is ok in
> the prepare function of hwc.
> If not, the set function of hwc may be fail and display will not properly.
> I don't know atomic mode setting how to handle this situation. And it seems
> that in the prepare function,
> it should check the hardware's capabilities, such as clip, scale, rotation,
> blending and so on.

Specifically to support things like hwc's ->prepare callback atomic
supports a TEST_ONLY mode. Hence in your the prepare code build up the
atomic state, but set the TEST_ONLY flag when calling the ioctl. When the
kernel is happy you can store it somewhere and tell surface flinger the
configuration so it can render the remaining buffers with GL. The idea is
that generic userspace does use TEST_ONLY mode iterative to build up the
maximal configuration of hw planes that a given kms driver supports,
leaving no hw-specific code in userspace. For optimized hwc drivers
running on atomic you then just need to tune the selection, but detailed
constraint checking would still be done by the kernel.

The weston patches from Daniel Stone have a similar design, would be worth
checking those out.

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

  reply	other threads:[~2015-09-22  8:46 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15  9:37 [PATCH RFC 0/8] Add New DRM Driver for Hisilicon's Hi6220 SoC Xinwei Kong
2015-09-15  9:37 ` Xinwei Kong
2015-09-15  9:37 ` Xinwei Kong
2015-09-15  9:37 ` [PATCH RFC 1/8] dt-bindings: Document the hi6220 bindings for DRM driver Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15 18:11   ` Rob Herring
2015-09-15 18:11     ` Rob Herring
2015-09-16  8:34     ` Xinwei Kong
2015-09-16  8:34       ` Xinwei Kong
2015-09-16  8:34       ` Xinwei Kong
2015-09-16  9:10       ` Archit Taneja
2015-09-16  9:10         ` Archit Taneja
2015-09-17 12:14         ` Xinwei Kong
2015-09-17 12:14           ` Xinwei Kong
2015-09-17 12:14           ` Xinwei Kong
2015-09-15  9:37 ` [PATCH RFC 2/8] drm: hisilicon: Add new DRM driver for hisilicon Soc Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-17 11:13   ` Archit Taneja
2015-09-17 11:13     ` Archit Taneja
2015-09-15  9:37 ` [PATCH RFC 3/8] drm: hisilicon: Add the link to DRM/KMS interface Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37 ` [PATCH RFC 4/8] drm: hisilicon: fill interface function of plane\crtc part Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37 ` [PATCH RFC 5/8] drm: hisilicon: fill interface function of encoder\connector part Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-17 11:39   ` Archit Taneja
2015-09-17 11:39     ` Archit Taneja
2015-09-15  9:37 ` [PATCH RFC 6/8] drm: hisilicon: Add support for fbdev Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15 18:25   ` Rob Herring
2015-09-15 18:25     ` Rob Herring
2015-09-16  3:32     ` Xinwei Kong
2015-09-16  3:32       ` Xinwei Kong
2015-09-16  3:32       ` Xinwei Kong
2015-09-16  9:48     ` Xinliang Liu
2015-09-17 11:52       ` Rob Clark
2015-09-17 11:52         ` Rob Clark
2015-09-17 11:52         ` Rob Clark
2015-09-17 12:11         ` Xinliang Liu
2015-09-15  9:37 ` [PATCH RFC 7/8] drm: hisilicon: Add support for vblank Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37 ` [PATCH RFC 8/8] dts: hisilicon: Add drm driver device dts config for HiKey board Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-15  9:37   ` Xinwei Kong
2015-09-16 15:23 ` [PATCH RFC 0/8] Add New DRM Driver for Hisilicon's Hi6220 SoC Daniel Stone
2015-09-16 15:23   ` Daniel Stone
2015-09-16 20:16   ` Daniel Vetter
2015-09-16 20:16     ` Daniel Vetter
2015-09-17  9:51     ` Xinliang Liu
2015-09-22  8:49       ` Daniel Vetter [this message]
2015-09-22  8:49         ` Daniel Vetter
2015-09-24 18:35         ` Xinliang Liu
2015-09-17  9:28   ` Xinliang Liu
2015-09-18 10:32   ` Xinwei Kong
2015-09-18 10:32     ` Xinwei Kong

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=20150922084915.GS3383@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=andy.green@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fangdechun@hisilicon.com \
    --cc=gongyu@hisilicon.com \
    --cc=haojian.zhuang@linaro.org \
    --cc=james.yanglong@hisilicon.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ml.yang@hisilicon.com \
    --cc=puck.chen@hisilicon.com \
    --cc=qijiwen@hisilicon.com \
    --cc=will.deacon@arm.com \
    --cc=xinliang.liu@linaro.org \
    --cc=xuwei5@hisilicon.com \
    --cc=xuyiping@hisilicon.com \
    --cc=yanhaifeng@hisilicon.com \
    --cc=yinshengbao@hisilicon.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 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.