On 17-01-12 14:22:09, Jason Ekstrand wrote:
On Thu, Jan 12, 2017 at 10:57 AM, Daniel Stone <dan...@fooishbar.org> wrote:
Hi,
On 5 January 2017 at 04:43, Ben Widawsky <b...@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?
They aren't the same thing. Daniel is saying for cases where there is no
DRIimage (dumb BOs). Yours is for a bad plane. The two should be complementary.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev