AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Li <sunpeng.li@amd.com>
To: Yuling Li <yulingli@amd.com>, <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>, Yuling Li <Yuling.Li@amd.com>
Subject: Re: [PATCH] drm/amd/display: Fix cursor disable with horizontally split planes
Date: Mon, 31 Aug 2026 12:26:48 -0400	[thread overview]
Message-ID: <547d5fc9-5a46-4097-87f8-a1ca2ec26df1@amd.com> (raw)
In-Reply-To: <20260831072841.2302952-1-yulingli@amd.com>



On 2026-08-31 03:28, Yuling Li wrote:
> From: Yuling Li <Yuling.Li@amd.com>
> 
> [WHY]
> resource_can_pipe_disable_cursor() disables the hardware cursor on a
> pipe when a higher layer fully covers that pipe's recout, to avoid
> double-cursor and scaling artifacts.
> 
> When merging pipe-split halves of the same overlay layer, the inner
> loop walks every pipe above the current one and looks for siblings
> sharing test_pipe's layer_index. Because test_pipe itself satisfies
> that condition, it can be treated as its own split partner. That
> incorrectly doubles r2.width and makes the covering check succeed even
> when the overlay does not fully contain the underlying pipe.
> 
> On horizontally split or multi-quadrant layouts this causes the cursor
> to disappear over overlay regions while input/coordinate mapping remains
> correct.
> 
> [HOW]
> Skip test_pipe when searching for a pipe-split sibling on the same
> layer, so only the other half of the split plane is merged into r2.
> 
> Signed-off-by: Yuling Li <yulingli@amd.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index ac558e715b72..7bbbe118e365 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -1801,7 +1801,10 @@ bool resource_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx)
>  		 * pipe-split, merge together per same height.
>  		 */
>  		for (split_pipe = pipe_ctx->top_pipe; split_pipe;
> -		     split_pipe = split_pipe->top_pipe)
> +		     split_pipe = split_pipe->top_pipe) {

Nit: add a newline here.

Otherwise, it makes sense to me: 

Reviewed-by: Leo Li <sunpeng.li@amd.com>

Curious, what was the specific use case where you saw the cursor disappearing? Which compositor/app?

Thanks,
Leo

> +			if (split_pipe == test_pipe)
> +				continue;
> +
>  			if (split_pipe->plane_state->layer_index == test_pipe->plane_state->layer_index) {
>  				struct rect r2_half;
>  
> @@ -1813,6 +1816,7 @@ bool resource_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx)
>  				r2_bottom = min(r2_bottom, r2_half.y + r2_half.height);
>  				break;
>  			}
> +		}
>  
>  		if (r1.x >= r2.x && r1.y >= r2.y && r1_right <= r2_right && r1_bottom <= r2_bottom)
>  			return true;


  reply	other threads:[~2026-08-31 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  7:28 [PATCH] drm/amd/display: Fix cursor disable with horizontally split planes Yuling Li
2026-08-31 16:26 ` Leo Li [this message]
2026-09-01  7:40   ` Li, Yuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=547d5fc9-5a46-4097-87f8-a1ca2ec26df1@amd.com \
    --to=sunpeng.li@amd.com \
    --cc=Yuling.Li@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=yulingli@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox