[Intel-gfx] [i-g-t PATCH v1 08/14] lib: Add igt_create_bo_with_dimensions

Daniel Stone daniel at fooishbar.org
Tue Mar 8 11:45:35 UTC 2016


Hey,

On 5 March 2016 at 12:30, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Wed, Mar 02, 2016 at 03:00:15PM +0100, Tomeu Vizoso wrote:
>> +int igt_create_bo_with_dimensions(int fd, int width, int height,
>
> Needs gtkdoc. Also this seems to overlap in functionality with the very
> recently added igt_calc_fb_size. Could we perhaps implement your new
> function here using igt_calc_fb_size plus igt_create_fb_with_size? Then
> this would just be a convenience wrapper.

It, er, already is implemented in terms of igt_calc_fb_size? When it
can be, at least.

Dumb buffers calculate stride and size for you, so they _cannot_ be
implemented in those terms. So the idea behind this is that you have
two API entrypoints: one where you only care about having a buffer
with particular dimensions and format (most tests, can use dumb), and
one where you want to very specifically control allocation parameters
(e.g. invalid-stride/size-too-small tests, cannot use dumb).

> I just want to make sure that we have a consistent interface to igt_fb.c
> functionality and avoid the need that driver-specific tiling formats need
> to overwrite bazillion of different places.

That makes sense, and is indeed the intention of this series. It's not
complete or the entire way there yet, but Tomeu wanted to get this out
there as a pretty good starting point to build on.

>> +     igt_assert((modifier && stride) || (!modifier && !stride));

As an aside, I think this is wrong. !modifier && stride can be valid,
though it shouldn't be necessary most of the time. :)

Cheers,
Daniel


More information about the Intel-gfx mailing list