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

Daniel Vetter daniel at ffwll.ch
Wed Nov 1 08:56:32 UTC 2017


On Tue, Oct 31, 2017 at 04:10:52PM -0500, Rob Herring wrote:
> On Tue, Oct 31, 2017 at 11:44 AM, Daniel Vetter <daniel at ffwll.ch> wrote:
> > On Tue, Oct 31, 2017 at 09:59:20AM -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.
> 
> [...]
> 
> >> +#define GRALLOC_HANDLE_MAGIC 0x5f47424d
> >
> > Maybe add a
> >
> > #define GRALLOC_HANDLE_VERSION 1
> > #define GRALLOC_HANDLE_MAGIC (0x5f47424d + GRALLOC_HANDLE_VERSION)
> >
> > and a comment that the version needs to be incremented for every change,
> > to catch mismatching mesa/hwc versions? Given the layout there's no way to
> > add more fds in a backwards-compatible way, so we need full versioning I
> > think, and treat any change as a breaking one.
> 
> If we add or remove anything that will already be caught because sizes
> are stored and checked.
> 
> The magic corresponds to 'GBM_'. Maybe we want to change that to
> something else. However, I'd like to not change it just yet. My
> intention was to keep it compatible, update gbm_gralloc and mesa
> dependencies, then make any changes to this struct.

Hm, start out with version 0 then, to match? Anyway, was just a
suggestion, feel free to ignore :-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list