[igt-dev] [PATCH i-g-t v6 02/10] igt: fb: Add size checks and recalculation before dumb allocation
Lyude Paul
lyude at redhat.com
Fri Feb 8 17:55:34 UTC 2019
Reviewed-by: Lyude Paul <lyude at redhat.com>
On Fri, 2019-02-08 at 14:18 +0100, Maxime Ripard wrote:
> Since we want to use the dumb buffers to store frames in formats with
> multiple planes, we need to add checks for unsupported corner cases, and we
> need to calculate the offsets and sizes of each planes. Let's use
> calc_fb_size for that.
>
> Signed-off-by: Maxime Ripard <maxime.ripard at bootlin.com>
> ---
> lib/igt_fb.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index c61e6805ff7a..ca4865519c13 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -561,6 +561,16 @@ static int create_bo_for_fb(struct igt_fb *fb)
> }
> }
>
> + /*
> + * The current dumb buffer allocation API doesn't really allow to
> + * specify a custom size or stride. Yet the caller is free to specify
> + * them, so we need to make sure to error out in this case.
> + */
> + igt_assert(fb->size == 0);
> + igt_assert(fb->strides[0] == 0);
> +
> + fb->size = calc_fb_size(fb);
> +
> fb->is_dumb = true;
> fb->gem_handle = kmstest_dumb_create(fd, fb->width, fb->height,
> fb->plane_bpp[0],
--
Cheers,
Lyude Paul
More information about the igt-dev
mailing list