Skip to content

Commit 8b62d7a

Browse files
6by9pelwell
authored andcommitted
drm/vc4: Correct arithmetic for shifting between columns of SAND images
Commit 69dbba7 ("drm/vc4: Add algorithmic handling for SAND") lost a multiplication by the tile width when doing the pointer arithmetic for cropping off columns for vc6. Correct that computation. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 37e962c commit 8b62d7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
15161516

15171517
tile = src_x / pix_per_tile;
15181518

1519-
offsets[i] += pitch[i] * tile;
1519+
offsets[i] += pitch[i] * tile * tile_width;
15201520
offsets[i] += src_y / (i ? v_subsample : 1) * tile_width;
15211521
offsets[i] += x_off & ~(i ? 1 : 0);
15221522
}
@@ -1992,7 +1992,7 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
19921992

19931993
tile = src_x / pix_per_tile;
19941994

1995-
offsets[i] += pitch[i] * tile;
1995+
offsets[i] += pitch[i] * tile * tile_width;
19961996
offsets[i] += src_y / (i ? v_subsample : 1) * tile_width;
19971997
offsets[i] += x_off & ~(i ? 1 : 0);
19981998

0 commit comments

Comments
 (0)