Skip to content

Commit 3262957

Browse files
committed
drm/vc4: plane: Correct SAND30 word sizing for cropping on BCM2712
BCM2712/vc6 uses 256bit words when reading in P030/SAND128, increased from 128bit on BCM2711/vc5. Update the code for cropping the read area to handle the correct word length. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 8d53a07 commit 3262957

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -1970,18 +1970,18 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
19701970

19711971
if (fb->format->format == DRM_FORMAT_P030) {
19721972
/*
1973-
* Spec says: bits [31:4] of the given address
1974-
* should point to the 128-bit word containing
1975-
* the desired starting pixel, and bits[3:0]
1976-
* should be between 0 and 11, indicating which
1977-
* of the 12-pixels in that 128-bit word is the
1973+
* Spec says: bits [31:5] of the given address
1974+
* should point to the 256-bit word containing
1975+
* the desired starting pixel, and bits[4:0]
1976+
* should be between 0 and 23, indicating which
1977+
* of the 24-pixels in that 256-bit word is the
19781978
* first pixel to be used
19791979
*/
19801980
u32 remaining_pixels = src_x % 96;
1981-
u32 aligned = remaining_pixels / 12;
1982-
u32 last_bits = remaining_pixels % 12;
1981+
u32 aligned = remaining_pixels / 24;
1982+
u32 last_bits = remaining_pixels % 24;
19831983

1984-
x_off = aligned * 16 + last_bits;
1984+
x_off = aligned * 32 + last_bits;
19851985
pix_per_tile = 96;
19861986
} else {
19871987
pix_per_tile = tile_width / fb->format->cpp[0];

0 commit comments

Comments
 (0)