From 2238361afbfee71827e2ee6e71fc43f1a39dcefe Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Tue, 17 Jul 2018 18:32:38 +0300 Subject: lib/igt_fb: Pass around igt_fb internally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of passing around a boatload of integers everywhere let's just pass around the igt_fb struct. That obviously means we have to populate it first sufficiently, to which end we'll add a small helper. Later on the stride/size calculations will consult the already pre-populated igt_fb and fill in the rest as needed. This makes the whole thing a lot less error prone as it's impossible to accidentally pass the arguments in the wrong order when there's just the one of them, and it's a pointer. v2: Rebase due to uint64_t size Cc: Paulo Zanoni Signed-off-by: Ville Syrjälä Reviewed-by: Paulo Zanoni --- lib/igt_fb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/igt_fb.h') diff --git a/lib/igt_fb.h b/lib/igt_fb.h index 2343fe50..35bf307a 100644 --- a/lib/igt_fb.h +++ b/lib/igt_fb.h @@ -47,12 +47,12 @@ * @drm_format: DRM FOURCC code * @width: width in pixels * @height: height in pixels - * @stride: line stride in bytes * @tiling: tiling mode as a DRM framebuffer modifier * @size: size in bytes of the underlying backing storage * @cairo_surface: optionally attached cairo drawing surface * @domain: current domain for cache flushing tracking on i915.ko * @num_planes: Amount of planes on this fb. >1 for planar formats. + * @strides: line stride for each plane in bytes * @offsets: Offset for each plane in bytes. * @plane_bpp: The bpp for each plane. * @plane_width: The width for each plane. @@ -70,12 +70,12 @@ typedef struct igt_fb { int height; enum igt_color_encoding color_encoding; enum igt_color_range color_range; - unsigned int stride; uint64_t tiling; uint64_t size; cairo_surface_t *cairo_surface; unsigned int domain; unsigned int num_planes; + uint32_t strides[4]; uint32_t offsets[4]; unsigned int plane_bpp[4]; unsigned int plane_width[4]; -- cgit v1.2.3