[Mesa-dev] [PATCH 05/32] [v2] gbm: Export a getter for per plane handles

Jason Ekstrand jason at jlekstrand.net
Thu Jan 12 22:22:09 UTC 2017


On Thu, Jan 12, 2017 at 10:57 AM, Daniel Stone <daniel at fooishbar.org> wrote:

> Hi,
>
> On 5 January 2017 at 04:43, Ben Widawsky <ben at bwidawsk.net> wrote:
> > diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_
> dri.c
> > index c61d56b44a..f9c1afd8cb 100644
> > --- a/src/gbm/backends/dri/gbm_dri.c
> > +++ b/src/gbm/backends/dri/gbm_dri.c
> > @@ -622,6 +622,33 @@ gbm_dri_bo_get_planes(struct gbm_bo *_bo)
> >     return get_number_planes(dri, bo->image);
> >  }
> >
> > +static union gbm_bo_handle
> > +gbm_dri_bo_get_handle_for_plane(struct gbm_bo *_bo, int plane)
> > +{
> > +   struct gbm_dri_device *dri = gbm_dri_device(_bo->gbm);
> > +   struct gbm_dri_bo *bo = gbm_dri_bo(_bo);
> > +   union gbm_bo_handle ret;
> > +   ret.s32 = -1;
> > +
> > +   if (!dri->image || dri->image->base.version < 13 ||
> !dri->image->fromPlanar) {
> > +      errno = ENOSYS;
> > +      return ret;
> > +   }
> > +
> > +   if (plane >= get_number_planes(dri, bo->image))
> > +      return ret;
>
> if (!bo->image) {
>    ret.s32 = bo->handle;
>    return ret;
> }


I suggested EINVAL if plane is too large.  Would you rather do a default
thing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170112/87dc42b6/attachment-0001.html>


More information about the mesa-dev mailing list