[igt-dev] [PATCH i-g-t 04/12] lib/igt_fb: Remove igt_get_all_cairo_formats()

Mika Kahola mika.kahola at intel.com
Thu Feb 8 08:15:34 UTC 2018


On Tue, 2018-02-06 at 11:14 +0100, Maarten Lankhorst wrote:
> All users have been converted to igt_fb_supported_format(),
> I don't think there's a valid use left for this.
> 

Reviewed-by: Mika Kahola <mika.kahola at intel.com>

> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  lib/igt_fb.c | 33 ---------------------------------
>  lib/igt_fb.h |  1 -
>  2 files changed, 34 deletions(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 0389b1c1b159..ecd73053f16f 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -1687,39 +1687,6 @@ const char *igt_format_str(uint32_t
> drm_format)
>  	return f ? f->name : "invalid";
>  }
>  
> -/**
> - * igt_get_all_cairo_formats:
> - * @formats: pointer to pointer to store the allocated formats array
> - * @format_count: pointer to integer to store the size of the
> allocated array
> - *
> - * This functions returns an array of all the drm fourcc codes
> supported by
> - * cairo and this library.
> - */
> -void igt_get_all_cairo_formats(const uint32_t **formats, int
> *format_count)
> -{
> -	static uint32_t *drm_formats;
> -	static int n_formats;
> -
> -	if (!drm_formats) {
> -		struct format_desc_struct *f;
> -		uint32_t *format;
> -
> -		n_formats = 0;
> -		for_each_format(f)
> -			if (f->cairo_id != CAIRO_FORMAT_INVALID)
> -				n_formats++;
> -
> -		drm_formats = calloc(n_formats,
> sizeof(*drm_formats));
> -		format = &drm_formats[0];
> -		for_each_format(f)
> -			if (f->cairo_id != CAIRO_FORMAT_INVALID)
> -				*format++ = f->drm_id;
> -	}
> -
> -	*formats = drm_formats;
> -	*format_count = n_formats;
> -}
> -
>  /**
>   * igt_fb_supported_format:
>   * @drm_format: drm fourcc to test.
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index a6ce07898784..023b069db592 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -162,7 +162,6 @@ int igt_cairo_printf_line(cairo_t *cr, enum
> igt_text_align align,
>  uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth);
>  uint32_t igt_drm_format_to_bpp(uint32_t drm_format);
>  const char *igt_format_str(uint32_t drm_format);
> -void igt_get_all_cairo_formats(const uint32_t **formats, int
> *format_count);
>  bool igt_fb_supported_format(uint32_t drm_format);
>  
>  #endif /* __IGT_FB_H__ */
-- 
Mika Kahola - Intel OTC



More information about the igt-dev mailing list