drm/vkms: use the block height for the vertical stride
PATCH 1/1 drm/vkms: use the block height for the vertical stride
The vertical step is the block pitch, i.e. pitch times the block height, not the block width. R1/R2/R4 have a block height of 1 and a block width of 8/4/2, so a vertical read walked 8/4/2 rows per pixel and read past the buffer.
Fixes b52fd27356af ("drm/vkms: Introduce pixel_read_direction enum")
Signed-off-by Oarora Etimis <[email protected]>
--- drivers/gpu/drm/vkms/vkms_formats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/vkms/vkms_formats.c +4 -4
@@ -103,11 +103,11 @@ static int get_block_step_bytes(struct drm_framebuffer *fb, enum pixel_read_direcase READ_RIGHT_TO_LEFT :return -fb->format->char_per_block[plane_index];case READ_TOP_TO_BOTTOM : -return (int )fb->pitches[plane_index] *drm_format_info_block_width (fb->format, - plane_index); -case READ_BOTTOM_TO_TOP : -return -(int )fb->pitches[plane_index] *drm_format_info_block_width (fb->format, +return (int )fb->pitches[plane_index] *drm_format_info_block_height (fb->format, plane_index); +case READ_BOTTOM_TO_TOP : +return -(int )fb->pitches[plane_index] *drm_format_info_block_height (fb->format, + plane_index); }return 0 ;
Signature · 1 line
2.56.1