From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
Wayne Lin <wayne.lin@amd.com>, Leo Li <sunpeng.li@amd.com>,
Daniel Wheeler <daniel.wheeler@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15 24/37] drm/amd/display: Fix double cursor on non-video RGB MPO
Date: Mon, 10 Oct 2022 09:05:43 +0200 [thread overview]
Message-ID: <20221010070331.913262431@linuxfoundation.org> (raw)
In-Reply-To: <20221010070331.211113813@linuxfoundation.org>
From: Leo Li <sunpeng.li@amd.com>
[ Upstream commit b261509952bc19d1012cf732f853659be6ebc61e ]
[Why]
DC makes use of layer_index (zpos) when picking the HW plane to enable
HW cursor on. However, some compositors will not attach zpos information
to each DRM plane. Consequently, in amdgpu, we default layer_index to 0
and do not update it.
This causes said DC logic to enable HW cursor on all planes of the same
layer_index, which manifests as a double cursor issue if one of the
planes is scaled (and hence scaling the cursor as well).
[How]
Use DRM core helpers to calculate a normalized_zpos value for each
drm_plane_state under each crtc, within the atomic state.
This helper will first consider existing zpos values, and if
identical/unset, fallback to plane ID ordering.
The normalized_zpos is then passed to dc_plane_info during atomic check
for later use by the cursor logic.
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e3dfea3d44a4..c826fc493e0f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5442,7 +5442,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
plane_info->visible = true;
plane_info->stereo_format = PLANE_STEREO_FORMAT_NONE;
- plane_info->layer_index = 0;
+ plane_info->layer_index = plane_state->normalized_zpos;
ret = fill_plane_color_attributes(plane_state, plane_info->format,
&plane_info->color_space);
@@ -5509,7 +5509,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,
dc_plane_state->global_alpha = plane_info.global_alpha;
dc_plane_state->global_alpha_value = plane_info.global_alpha_value;
dc_plane_state->dcc = plane_info.dcc;
- dc_plane_state->layer_index = plane_info.layer_index; // Always returns 0
+ dc_plane_state->layer_index = plane_info.layer_index;
dc_plane_state->flip_int_enabled = true;
/*
@@ -10828,6 +10828,14 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
}
}
+ /*
+ * DC consults the zpos (layer_index in DC terminology) to determine the
+ * hw plane on which to enable the hw cursor (see
+ * `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in
+ * atomic state, so call drm helper to normalize zpos.
+ */
+ drm_atomic_normalize_zpos(dev, state);
+
/* Remove exiting planes if they are modified */
for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {
ret = dm_update_plane_state(dc, state, plane,
--
2.35.1
next prev parent reply other threads:[~2022-10-10 7:17 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 7:05 [PATCH 5.15 00/37] 5.15.73-rc1 review Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 01/37] Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 02/37] docs: update mediator information in CoC docs Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 03/37] xsk: Inherit need_wakeup flag for shared sockets Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 04/37] mm: gup: fix the fast GUP race against THP collapse Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 05/37] powerpc/64s/radix: dont need to broadcast IPI for radix pmd collapse flush Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 06/37] wait_on_bit: add an acquire memory barrier Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 07/37] provide arch_test_bit_acquire for architectures that define test_bit Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 08/37] fs: fix UAF/GPF bug in nilfs_mdt_destroy Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 09/37] firmware: arm_scmi: Improve checks in the info_get operations Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 10/37] firmware: arm_scmi: Harden accesses to the sensor domains Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 11/37] firmware: arm_scmi: Add SCMI PM driver remove routine Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 12/37] dmaengine: xilinx_dma: Fix devm_platform_ioremap_resource error handling Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 13/37] dmaengine: xilinx_dma: cleanup for fetching xlnx,num-fstores property Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 14/37] dmaengine: xilinx_dma: Report error in case of dma_set_mask_and_coherent API failure Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 15/37] ARM: dts: fix Moxa SDIO compatible, remove sdhci misnomer Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 16/37] scsi: qedf: Fix a UAF bug in __qedf_probe() Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 17/37] net/ieee802154: fix uninit value bug in dgram_sendmsg Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 18/37] net: marvell: prestera: add support for for Aldrin2 Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 19/37] ALSA: hda/hdmi: Fix the converter reuse for the silent stream Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 20/37] um: Cleanup syscall_handler_t cast in syscalls_32.h Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 21/37] um: Cleanup compiler warning in arch/x86/um/tls_32.c Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 22/37] arch: um: Mark the stack non-executable to fix a binutils warning Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 23/37] net: atlantic: fix potential memory leak in aq_ndev_close() Greg Kroah-Hartman
2022-10-10 7:05 ` Greg Kroah-Hartman [this message]
2022-10-10 7:05 ` [PATCH 5.15 25/37] drm/amd/display: Assume an LTTPR is always present on fixed_vs links Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 26/37] drm/amd/display: update gamut remap if plane has changed Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 27/37] drm/amd/display: skip audio setup when audio stream is enabled Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 28/37] mmc: core: Replace with already defined values for readability Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 29/37] mmc: core: Terminate infinite loop in SD-UHS voltage switch Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 30/37] perf parse-events: Identify broken modifiers Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 31/37] mm/huge_memory: minor cleanup for split_huge_pages_all Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 32/37] mm/huge_memory: use pfn_to_online_page() in split_huge_pages_all() Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 33/37] wifi: cfg80211: fix MCS divisor value Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 34/37] net/mlx5: Disable irq when locking lag_lock Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 35/37] usb: mon: make mmapped memory read only Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 36/37] USB: serial: ftdi_sio: fix 300 bps rate for SIO Greg Kroah-Hartman
2022-10-10 7:05 ` [PATCH 5.15 37/37] rpmsg: qcom: glink: replace strncpy() with strscpy_pad() Greg Kroah-Hartman
2022-10-10 16:05 ` [PATCH 5.15 00/37] 5.15.73-rc1 review Naresh Kamboju
2022-10-10 17:49 ` Guenter Roeck
2022-10-10 19:07 ` Greg Kroah-Hartman
2022-10-10 18:26 ` Florian Fainelli
2022-10-10 18:59 ` Ron Economos
2022-10-10 21:28 ` Shuah Khan
2022-10-11 4:23 ` Bagas Sanjaya
2022-10-12 2:24 ` Bagas Sanjaya
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=20221010070331.913262431@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=alexander.deucher@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@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;
as well as URLs for NNTP newsgroup(s).