diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-26 09:18:11 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-26 18:50:27 +0100 |
commit | 9aea7ae541212e4116af8d5d922d7cbcc571df50 (patch) | |
tree | af199ac060429b4ad99d557bc6f4de45156d9e03 /lib/igt_fb.h | |
parent | 57d7db8cf8c407541d1ed57348a6f468c2b73577 (diff) |
lib/igt_fb: switch to igt_ prefix from kmstest_
Shorter and more in line with our general igt_ prefix for everything
which isn't somehow intel or i915-gem or otherwise hw specific - these
helpers here are all fully generic framebuffer handling functions
based on kms + cairo.
Well, the actual buffer alloc is done with i915 gem, but meh ;-)
Two special cases:
- bpp_depth_to_drm_format and drm_format_to_bpp completely lacked
prefixes, so just add igt_.
- write_fb was a bit misleading given that we have gem_write for
uploading to buffers. Rename that to write_fb_to_png to make it
crystal clear what this thing does even without looking at docs.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_fb.h')
-rw-r--r-- | lib/igt_fb.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/igt_fb.h b/lib/igt_fb.h index efa54989..d5e728cc 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -34,7 +34,7 @@ #include <xf86drmMode.h> /* helpers to create nice-looking framebuffers */ -struct kmstest_fb { +struct igt_fb { uint32_t fb_id; uint32_t gem_handle; uint32_t drm_format; @@ -47,7 +47,7 @@ struct kmstest_fb { cairo_surface_t *cairo_surface; }; -enum kmstest_text_align { +enum igt_text_align { align_left, align_bottom = align_left, align_right = 0x01, @@ -56,34 +56,36 @@ enum kmstest_text_align { align_hcenter = 0x08, }; -int kmstest_cairo_printf_line(cairo_t *cr, enum kmstest_text_align align, +int igt_cairo_printf_line(cairo_t *cr, enum igt_text_align align, double yspacing, const char *fmt, ...) __attribute__((format (printf, 4, 5))); -unsigned int kmstest_create_fb(int fd, int width, int height, uint32_t format, - bool tiled, struct kmstest_fb *fb); -unsigned int kmstest_create_color_fb(int fd, int width, int height, +unsigned int igt_create_fb(int fd, int width, int height, uint32_t format, + bool tiled, struct igt_fb *fb); +unsigned int igt_create_color_fb(int fd, int width, int height, uint32_t format, bool tiled, double r, double g, double b, - struct kmstest_fb *fb /* out */); -void kmstest_remove_fb(int fd, struct kmstest_fb *fb_info); -cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb); -void kmstest_paint_color(cairo_t *cr, int x, int y, int w, int h, + struct igt_fb *fb /* out */); +void igt_remove_fb(int fd, struct igt_fb *fb_info); + +/* cairo-based painting */ +cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb); +void igt_paint_color(cairo_t *cr, int x, int y, int w, int h, double r, double g, double b); -void kmstest_paint_color_alpha(cairo_t *cr, int x, int y, int w, int h, +void igt_paint_color_alpha(cairo_t *cr, int x, int y, int w, int h, double r, double g, double b, double a); -void kmstest_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, +void igt_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, int r, int g, int b); -void kmstest_paint_test_pattern(cairo_t *cr, int width, int height); -void kmstest_paint_image(cairo_t *cr, const char *filename, +void igt_paint_test_pattern(cairo_t *cr, int width, int height); +void igt_paint_image(cairo_t *cr, const char *filename, int dst_x, int dst_y, int dst_width, int dst_height); -void kmstest_write_fb(int fd, struct kmstest_fb *fb, const char *filename); +void igt_write_fb_to_png(int fd, struct igt_fb *fb, const char *filename); /* helpers to handle drm fourcc codes */ -uint32_t bpp_depth_to_drm_format(int bpp, int depth); -uint32_t drm_format_to_bpp(uint32_t drm_format); -const char *kmstest_format_str(uint32_t drm_format); -void kmstest_get_all_formats(const uint32_t **formats, int *format_count); +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_formats(const uint32_t **formats, int *format_count); #endif /* __IGT_FB_H__ */ |