diff options
author | Praveen Paneri <praveen.paneri@intel.com> | 2017-07-18 22:52:56 +0530 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2017-07-25 12:06:18 -0300 |
commit | 4bb45416a7a55d860ecaf656767ee15fe8128237 (patch) | |
tree | 285a094ceecc1617b165a2a31dab2924fea59c68 /lib/igt_fb.c | |
parent | 542658a452e7fbd63071dd4be3aa22b1fcc33cf0 (diff) |
lib/igt_fb: Let others use igt_get_fb_tile_size
This function can be used by igt_draw to get accurate
tile dimensions for all tile formats.
v2: Added comments to function igt_get_fb_tile_size (Daniel)
v3: Fixed errors in comments and coding style (Paulo)
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r-- | lib/igt_fb.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 93e21c17..c6291e62 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -74,8 +74,19 @@ static struct format_desc_struct { #define for_each_format(f) \ for (f = format_desc; f - format_desc < ARRAY_SIZE(format_desc); f++) -static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, - unsigned *width_ret, unsigned *height_ret) +/** + * igt_get_fb_tile_size: + * @fd: the DRM file descriptor + * @tiling: tiling layout of the framebuffer (as framebuffer modifier) + * @fb_bpp: bits per pixel of the framebuffer + * @width_ret: width of the tile in bytes + * @height_ret: height of the tile in lines + * + * This function returns width and height of a tile based on the given tiling + * format. + */ +void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp, + unsigned *width_ret, unsigned *height_ret) { switch (tiling) { case LOCAL_DRM_FORMAT_MOD_NONE: |