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 <andy.yan@rock-chips.com>
This commit is contained in:
Andy Yan
2021-04-14 19:51:45 +08:00
committed by Tao Huang
parent 2e01bfda9f
commit 87d02abf6e

View File

@@ -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,