summaryrefslogtreecommitdiff
path: root/lib/igt_fb.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2018-10-04 14:39:00 +0200
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-10-08 16:46:39 +0300
commite3b1c3498abf54377245e6d298b4cbcef663d8b4 (patch)
tree618526cadc59e1a67db976dc44a5e777d6c55697 /lib/igt_fb.h
parent5a8de8a0051d53a6b44bd582f1aa233abac708b2 (diff)
fb: Add format conversion routine
The chamelium format subtests will need to convert the reference pattern to the format to be tested on the DRM device. However, Cairo is very limited when it comes to format, and while pixman has much more support for formats, it's still falling short compared to what DRM exposes, especially on the YUV side. Plus, since we want to run CRC checks on the frame, we can't afford having conversions back and forth between RGB24, as the current API is doing. In order to abstract this away, let's create a function that will convert a igt_fb structure to another DRM format and return the converted igt_fb. For now, we will use only cairo to do the conversion, but we will use other libraries or roll our own routines to convert to more exotic formats and abstract it away from the users. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'lib/igt_fb.h')
-rw-r--r--lib/igt_fb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 758d4d0d..9f027deb 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -130,6 +130,8 @@ unsigned int igt_create_image_fb(int drm_fd, int width, int height,
struct igt_fb *fb /* out */);
unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode,
uint32_t format, uint64_t tiling);
+unsigned int igt_fb_convert(struct igt_fb *dst, struct igt_fb *src,
+ uint32_t dst_fourcc);
void igt_remove_fb(int fd, struct igt_fb *fb);
int igt_dirty_fb(int fd, struct igt_fb *fb);
void *igt_fb_map_buffer(int fd, struct igt_fb *fb);