mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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 <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
19f19daa64
commit
2f544a1721
@@ -1973,18 +1973,18 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
|
||||
|
||||
if (fb->format->format == DRM_FORMAT_P030) {
|
||||
/*
|
||||
* Spec says: bits [31:4] of the given address
|
||||
* should point to the 128-bit word containing
|
||||
* the desired starting pixel, and bits[3:0]
|
||||
* should be between 0 and 11, indicating which
|
||||
* of the 12-pixels in that 128-bit word is the
|
||||
* Spec says: bits [31:5] of the given address
|
||||
* should point to the 256-bit word containing
|
||||
* the desired starting pixel, and bits[4:0]
|
||||
* should be between 0 and 23, indicating which
|
||||
* of the 24-pixels in that 256-bit word is the
|
||||
* first pixel to be used
|
||||
*/
|
||||
u32 remaining_pixels = src_x % 96;
|
||||
u32 aligned = remaining_pixels / 12;
|
||||
u32 last_bits = remaining_pixels % 12;
|
||||
u32 aligned = remaining_pixels / 24;
|
||||
u32 last_bits = remaining_pixels % 24;
|
||||
|
||||
x_off = aligned * 16 + last_bits;
|
||||
x_off = aligned * 32 + last_bits;
|
||||
pix_per_tile = 96;
|
||||
} else {
|
||||
pix_per_tile = tile_width / fb->format->cpp[0];
|
||||
|
||||
Reference in New Issue
Block a user