[RFC PATCH hwc] drm_hwcomposer: provide a common gralloc handle definition

Rob Herring robh at kernel.org
Thu Oct 26 14:49:26 UTC 2017


On Thu, Oct 26, 2017 at 6:59 AM, Robert Foss <robert.foss at collabora.com> wrote:
> Hey Rob,
>
> On Tue, 2017-10-24 at 18:40 -0500, Rob Herring wrote:
>> EGL, gralloc, and HWC must all have a common definition of fd's and
>> int's
>> in native_handle_t to share the fd and width, height, format, etc.
>> of a dmabuf.
>>
>> Move the definition into HWC so we aren't dependent on a specific
>> gralloc
>> implementation and so we don't have to create an importer just for
>> different native_handle_t layouts. This will allow supporting
>> multiple
>> gralloc implementations that conform to this layout.
>
> I think this makes sense to me, and is an improvement over the current
> situation.
> As far as I can see there is no perfect way of doing this. But this is
> definitely better.

There's also still a mesa to gralloc dependency to get the device FD.
We don't need that if using render nodes, but we still support
android-x86 using the card node and GEM names. Also, I'm not sure what
to do in the s/w rendering case that still uses the card node. Plus
with Treble, things are moving to separate processes, so retrieving an
FD is broken.

>> Perhaps we should allow for multiple levels of subclassing by only
>> defining
>> the fields we care about here and not validating magic and the size.
>
> So the idea with the subclassing would be for each gralloc
> implementations to be able to add their special sauce?

Right. So the owner and data pointer fields would be gone from here.
Not sure if it is worth the churn and breakage that may cause until
everyone is in sync.

Rob


More information about the dri-devel mailing list