On Tue, Jan 16, 2018 at 11:36 AM, Robert Foss <robert.f...@collabora.com> wrote:
> This struct is used in mesa and drm_hwcomposer.
> Versions of if have been implemented in several grallocs:
> drm_gralloc, gbm_gralloc, minigbm and intel-minigbm.
>
> Other than the 1:1 move of the struct a new generic name
> has been chosen and variables have had comments added to them.
>
> Sign-off-by: Robert Foss <robert.f...@collabora.com>
> Signed-off-by: Robert Foss <robert.f...@collabora.com>
> ---

> +/**
> + * Create a buffer handle.
> + */
> +static struct gralloc_handle_t *gralloc_handle_create(int width, int height,
> +                                                      int format, int usage)
> +{
> +       struct gralloc_handle_t handle = { .magic = GRALLOC_HANDLE_MAGIC };

This is a stack variable and you are returning it.

> +
> +       handle->base.version = sizeof(handle->base);

This also won't compile because handle is not a pointer.

> +       handle->base.numInts = GRALLOC_HANDLE_NUM_INTS;
> +       handle->base.numFds = GRALLOC_HANDLE_NUM_FDS;
> +
> +       handle->width = width;
> +       handle->height = height;
> +       handle->format = format;
> +       handle->usage = usage;
> +       handle->prime_fd = -1;
> +
> +       handle->data_owner = getpid();
> +       handle->data = bo;
> +
> +       return handle;
> +}
> +
> +#endif
> --
> 2.14.1
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to