Skip to content

Conversation

@6by9
Copy link
Contributor

@6by9 6by9 commented Jan 13, 2026

Draft PR for @jc-kynesim to test whilst I fix up SAND and T-Format handling.

The TPZ filter wants ideally 3 lines of image to give good quality downscaling. More than that leads to excessive SDRAM bandwidth for no gain.

If the downsample factor allows for it, reduce the programmed image height and increase the pitch to compensate.

FIXME: This currently does not handle SAND or T-format images where we need to configure it slightly differently.

The TPZ filter wants ideally 3 lines of image to give good quality
downscaling. More than that leads to excessive SDRAM bandwidth
for no gain.

If the downsample factor allows for it, reduce the programmed image
height and increase the pitch to compensate.

This currently does not handle T-format images where we need to
configure it slightly differently.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9
Copy link
Contributor Author

6by9 commented Jan 22, 2026

Now fixed up for SAND and tested on Pi4 and Pi5.

I haven't got an easy way to test T-format, so have left the behaviour as-is with a comment.

@jc-kynesim
Copy link
Contributor

jc-kynesim commented Jan 22, 2026 via email

@6by9
Copy link
Contributor Author

6by9 commented Jan 22, 2026

T format is only used with the Pi0-3 3D unit.
Seeing as we drop back to pixman for composition on Pi0-3 due to memory fragmentation, I'm not sure there are many paths that would render directly from 3D to HVS as T-format, and doing so with a big downscale would be weird as you'd be making the 3D work far harder than necessary.

Basic description is in https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h#L1090-L1108. We can probably find some Broadcom docs if needed.

...

Found in the HVS docs for 2708 (Pi1)

Support for T-Format is deprecated as it cannot be fetched efficiently in raster order from SDRAM.

I take that as meaning it's really not worth pursuing.

As long as you don't manage to break this for any of your test cases with linear or SAND, then I'm happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants