<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 September 2015 at 01:49, Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Sep 17, 2015 at 05:51:28PM +0800, Xinliang Liu wrote:<br>
> On 17 September 2015 at 04:16, Daniel Vetter <<a href="mailto:daniel@ffwll.ch">daniel@ffwll.ch</a>> wrote:<br>
><br>
> > On Wed, Sep 16, 2015 at 04:23:35PM +0100, Daniel Stone wrote:<br>
> > > The biggest issue though, is that this driver should become an atomic<br>
> > > modesetting driver. Atomic modesetting, rather than sending small<br>
> > > individual commands (enable CRTC, change plane position, etc) is based<br>
> > > on validating and passing around complete sets of hardware state.<br>
> > > Daniel Vetter's blog has an article on how to convert your driver:<br>
> > > <a href="http://blog.ffwll.ch/2014/11/atomic-modeset-support-for-kms-drivers.html" rel="noreferrer" target="_blank">http://blog.ffwll.ch/2014/11/atomic-modeset-support-for-kms-drivers.html</a><br>
> ><br>
> > Yeah, any new driver should really be built on top of atomic - it's a lot<br>
> > more flexible than the old thing and it's also what you want long-term.<br>
> ><br>
> > I've also just done a presenation about atomic for drivers:<br>
> ><br>
> > <a href="http://people.freedesktop.org/~danvet/presentations/xdc-2015.pdf" rel="noreferrer" target="_blank">http://people.freedesktop.org/~danvet/presentations/xdc-2015.pdf</a><br>
><br>
><br>
> Hi Daniel,<br>
> This is a good presentation. It gives us very detail and good suggection on<br>
> implementation.<br>
> Thank you for sharing this.<br>
><br>
> We have a open source KMS hwc:<br>
> wiki:<br>
> <a href="https://wiki.linaro.org/BenjaminGaignard/HWComposer_DRM?highlight=%28hwcomposer%2" rel="noreferrer" target="_blank">https://wiki.linaro.org/BenjaminGaignard/HWComposer_DRM?highlight=%28hwcomposer%2</a><br>
> source code: git://<a href="http://git.linaro.org/people/benjamin.gaignard/hwcomposer.git" rel="noreferrer" target="_blank">git.linaro.org/people/benjamin.gaignard/hwcomposer.git</a><br>
> Now only STI and Hikey boards are tested on it. And atomic mode setting is<br>
> not support now.<br>
> I think we should add support for atomic mode setting next.<br>
><br>
> One difficulty I am facing is that one setting should be made sure is ok in<br>
> the prepare function of hwc.<br>
> If not, the set function of hwc may be fail and display will not properly.<br>
> I don't know atomic mode setting how to handle this situation. And it seems<br>
> that in the prepare function,<br>
> it should check the hardware's capabilities, such as clip, scale, rotation,<br>
> blending and so on.<br>
<br>
</div></div>Specifically to support things like hwc's ->prepare callback atomic<br>
supports a TEST_ONLY mode. Hence in your the prepare code build up the<br>
atomic state, but set the TEST_ONLY flag when calling the ioctl. When the<br>
kernel is happy you can store it somewhere and tell surface flinger the<br>
configuration so it can render the remaining buffers with GL. The idea is<br>
that generic userspace does use TEST_ONLY mode iterative to build up the<br>
maximal configuration of hw planes that a given kms driver supports,<br>
leaving no hw-specific code in userspace. For optimized hwc drivers<br>
running on atomic you then just need to tune the selection, but detailed<br>
constraint checking would still be done by the kernel.<br>
<br>
The weston patches from Daniel Stone have a similar design, would be worth<br>
checking those out.<br></blockquote><div> </div><div><div class="gmail_default" style="font-family:monospace,monospace">Oh, that's great! This sounds a great way. That might solve my problem.</div><div class="gmail_default" style="font-family:monospace,monospace">I'll try. Thanks.</div><br></div><div class="gmail_default" style="font-family:monospace,monospace">Best,</div><div class="gmail_default" style="font-family:monospace,monospace">-Xinliang</div><div class="gmail_default" style="font-family:monospace,monospace"></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
Cheers, Daniel<br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
</div></div></blockquote></div><br></div></div>