Thread (19 messages) 19 messages, 2 authors, 2026-02-12

Re: [PATCH RFC 3/6] drm/mediatek: ovl: Fix misaligned layer source size on AFBC mode

From: CK Hu (胡俊光) <hidden>
Date: 2026-02-03 02:01:26
Also in: dri-devel, linux-mediatek, lkml

On Tue, 2025-12-30 at 11:03 -0300, Nícolas F. R. A. Prado wrote:
From: Ariel D'Alessandro <redacted>

In AFBC mode, OVL_SRC_SIZE must be block aligned. Due to this limitation
of the AFBC format, OVL_CLIP needs to be used to achieve the desired
output size of the layer while still meeting the alignment constraints.
Failure to do this will result in vblank timeouts and no rendered output
when the AFBC data source isn't aligned to the AFBC block (32x8).

Configure OVL_CLIP so unaligned AFBC layers can be displayed.

The following illustrates how the alignment is achieved through the clip
settings for the horizontal coordinates, the vertical coordinates are
analogous:

/------------------------------------------------\
quoted
                                               |
           ........................            |
           ........................            |
           ........................            |
           ........................            |
                                               |
\------------------------------------------------/
     |       |                      |       |
     |       src.x1                 src.x2  |
     |       |                      |       |
     |       |<-------------------->|       |
     |              src_width               |
     |                                      |
     N * AFBC_DATA_BLOCK_WIDTH              M * AFBC_DATA_BLOCK_WIDTH
     |                                      |
     |<----->|                      |<----->|
      clip_left                      clip_right
As I know, crop is used to drop pixel data.
From the name of 'clip_left', I think it would drop the left part of this image.
But usually the image is aligned to the left (start from axis 0) and append garbage data in right part.
If so, clip_left should be zero and all the clip would be clip_right.
This is the normal behavior.
If OVL_CROP does behave as this, add comment to describe that clip_left does not drop pixel data.

Regards,
CK
Signed-off-by: Ariel D'Alessandro <redacted>
Co-developed-by: Nícolas F. R. A. Prado <redacted>
Signed-off-by: Nícolas F. R. A. Prado <redacted>
---
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help