[igt-dev] [PATCH i-g-t v4 1/2] lib/fb: introduce __igt_create_fb_with_bo_size() and __igt_create_fb()
Arkadiusz Hiler
arkadiusz.hiler at intel.com
Tue Mar 13 11:25:46 UTC 2018
On Mon, Feb 26, 2018 at 03:47:02PM +0200, Martin Peres wrote:
> They are the same as their non-underscored counterparts, except they
> will return the error rather than dying when an error occurs.
>
> v2: (suggested by Ville Syrjälä)
> - drop the fb_id out parameter, it can be accessed from fb->fb_id.
>
> Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
> ---
<SNIP>
> +/**
> + * __igt_create_fb:
> + * @fd: open i915 drm file descriptor
> + * @width: width of the framebuffer in pixel
> + * @height: height of the framebuffer in pixel
> + * @format: drm fourcc pixel format code
> + * @tiling: tiling layout of the framebuffer
> + * @fb: pointer to an #igt_fb structure
> + *
> + * Same as igt_create_fb, but return an error if it failed rather than failing.
> + *
> + * Returns: 0 in case of success, the error otherwise. The fb_id can be found
> + * in fb->fb_id.
> + */
I prefer the previous version because consistency. Now we have
non-underscored functions returning fb_id and the underscored ones
returning 0.
I think we should either keeping them as they were or change the
non-underscore versions to follow the same conversion.
- Arek
> +int __igt_create_fb(int fd, int width, int height, uint32_t format,
> + uint64_t tiling, struct igt_fb *fb)
> +{
> + return __igt_create_fb_with_bo_size(fd, width, height, format, tiling,
> + fb, 0, 0);
> +}
> +
> /**
> * igt_create_color_fb:
> * @fd: open i915 drm file descriptor
More information about the igt-dev
mailing list