<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 20, 2014 at 5:28 PM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>oh, that's right.. I'm glad you reminded me, I do remember now talk of<br></div>
a field which drivers could use to return some opaque (to drm core)<br>
handle/value/token/whatever..<br>
<br>
hmm, for the non-vsync'd multi-display case, does it matter much one<br>
ioctl per display vs one globally?<br>
<br>
If no, I'd vote for just one output field in the ioctl struct which<br>
can be whatever the driver wants it to.. that would be pretty simple.</blockquote><div><br></div><div>If you're planning to support generic clients, you'd at least need some way to indicate the output contains an fd that the client's responsible for closing.  Otherwise it would leak a fence (or whatever fd-backed object that's being returned) each time it updates the display.</div>




<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
> It's up to the vendor whether their HWC HAL does fine-grained error handling<br>
> and renegotiation like you're describing.  Typically they don't, they just<br>
> push that complexity into userspace instead.  e.g. if the display controller<br>
> needs to gang together two planes for a given configuration, the HWC HAL's<br>
> prepare() op will already know to set aside that extra plane and plan<br>
> accordingly.<br>
<br>
</div>Well, I suspect that this is in the HWC HAL at all is a strong<br>
indication that we should think about including this somehow in the<br>
atomic ioctl.. considering that the trend for wayland compositors is a<br>
fairly generic userspace just using kms+gbm directly.  I suspect the<br>
alternative will only be an atomic2 ioctl at some point ;-)<br></blockquote><div><br></div><div>These policies are complicated enough that I'm skeptical you could push them into the kernel without making the drivers really large and complicated.  A typical HWC HAL will have thousands of lines of code plus pull in other helper libraries, and the bulk of that will be for planning the composition in the prepare() op.  Maybe you could break some of that out into common helper code, but IME and IMO the hardware constraints are too different from SoC to SoC for that to scale.</div>
<div><br></div><div>That said, I'd be happy to be proven wrong -- if the hypothetical atomic2 ioctl has a kernel counterpart that I'm comfortable recommending to vendors, being able to write a single generic HWC HAL would be good for Android too.</div>

</div></div></div>