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

Daniel Stone daniel at fooishbar.org
Thu Jan 12 18:57:20 UTC 2017


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;
}

Cheers,
Daniel


More information about the mesa-dev mailing list