From 3415b197c60a9e9f74d44ece3cbafa8ddb598b97 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 4 Oct 2018 14:38:54 +0200 Subject: fb: Add buffer map/unmap functions The current code to manipulate the buffer has the assumption that we can create an underlying cairo instance. However, when it comes to supporting various formats, cairo is very limited so we would need to decouple the buffer access from cairo surfaces. Let's create a function that allows to map the underlying GEM buffer from an igt_fb structure, which will then allow use to manipulate as we wish. Reviewed-by: Eric Anholt Signed-off-by: Maxime Ripard --- lib/igt_fb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_fb.h') diff --git a/lib/igt_fb.h b/lib/igt_fb.h index 35bf307a..758d4d0d 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -132,6 +132,8 @@ unsigned int igt_create_stereo_fb(int drm_fd, drmModeModeInfo *mode, uint32_t format, uint64_t tiling); 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); +void igt_fb_unmap_buffer(struct igt_fb *fb, void *buffer); int igt_create_bo_with_dimensions(int fd, int width, int height, uint32_t format, uint64_t modifier, unsigned stride, -- cgit v1.2.3