From 87d02abf6e87aed9aecb7129a79f1d7907d40f04 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Wed, 14 Apr 2021 19:51:45 +0800 Subject: [PATCH] drm: debugfs: calculate image width by bpp Not all RGB image is 4 byte per pixel, use bpp to get the correct image width. Change-Id: I8e40980a7f510afcfe9fd8f2a83eaa254f3b5b96 Signed-off-by: Andy Yan --- drivers/gpu/drm/drm_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 58fb9f4c3d0d..02650824cde4 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -184,7 +184,7 @@ int vop_plane_dump(struct vop_dump_info *dump_info, int frame_count) width, dump_info->height, get_format_str(format), "bin"); } else { - width = dump_info->pitches >> 2; + width = dump_info->pitches * 8 / bpp; flags = O_RDWR | O_CREAT; snprintf(file_name, 100, "%s/win%d_area%d_%dx%d_%s%s%d.%s", DUMP_BUF_PATH, dump_info->win_id,