From: Thierry Reding <thierry.reding@kernel.org>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Chenyu Chen <chen-yu.chen@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Ray Wu <ray.wu@amd.com>
Subject: linux-next: manual merge of the amdgpu tree with the drm-next tree
Date: Wed, 06 May 2026 11:55:55 +0200 [thread overview]
Message-ID: <f8ede562c8335f22073b4cc5535001d4@kernel.org> (raw)
Hi all,
Today's linux-next merge of the amdgpu tree got a conflict in:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
between commit:
5164f7e7ff8e ("drm: Rename struct drm_atomic_state to drm_atomic_commit")
from the drm-next tree and commit:
3c108046e1d6 ("drm/amd/display: Add power module on Linux")
from the amdgpu tree.
I fixed it up (see below) and can carry the fix as necessary. It looks
like this is pretty much what's in the amdgpu tree, modulo some
whitespace changes. This is now fixed as far as linux-next is concerned,
but any non trivial conflicts should be mentioned to your upstream
maintainer when your tree is submitted for merging. You may also want
to consider cooperating with the maintainer of the conflicting tree to
minimise any particularly complex conflicts.
diff --cc drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index cbfdcc65bf5d,246ee40e202a..ad56a409a88e
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@@ -10479,8 -10582,104 +10582,104 @@@ static void dm_clear_writeback(struct a
dc_stream_remove_writeback(dm->dc, crtc_state->stream, 0);
}
+ /**
+ * amdgpu_dm_mod_power_update_streams - update mod_power stream state on modeset
+ * @state: the drm atomic state
+ * @dm: the display manager to update mod_power on
+ *
+ * Notify mod_power of stream changes on modeset events, and disable PSR/Replay
+ * in preparation for hardware programming. See also
+ * amdgpu_dm_mod_power_setup_streams() for post-modeset mod_power setup.
+ */
+ static void amdgpu_dm_mod_power_update_streams(struct drm_atomic_state *state,
+ struct amdgpu_display_manager *dm)
+ {
+ struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
+ struct amdgpu_dm_connector *aconnector;
+ struct drm_crtc *crtc;
+ int i = 0;
+
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+ dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
+ dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
+
+ if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+ continue;
+
+ /*
+ * Update mod_power on modeset event in preparation for hw
+ * programming. Always use the old stream, since it would have
+ * been previously added to mod_power. If old stream is null (on
+ * crtc enable, for example), mod_power will no-op, which is the
+ * desried behavior.
+ */
+ if (old_crtc_state->active) {
+ scoped_guard(mutex, &dm->dc_lock) {
+ amdgpu_dm_psr_set_event(dm, dm_old_crtc_state->stream, true,
+ psr_event_hw_programming, true);
+ amdgpu_dm_replay_set_event(dm, dm_old_crtc_state->stream, true,
+ replay_event_hw_programming, true);
+ }
+ }
+
+ if (new_crtc_state->active) {
+ aconnector = (struct amdgpu_dm_connector *)
+ dm_new_crtc_state->stream->dm_stream_context;
+ if (old_crtc_state->active) {
+ mod_power_replace_stream(dm->power_module,
+ dm_old_crtc_state->stream,
+ dm_new_crtc_state->stream,
+ &aconnector->psr_caps);
+ } else {
+ mod_power_add_stream(dm->power_module,
+ dm_new_crtc_state->stream,
+ &aconnector->psr_caps);
+ }
+ } else if (old_crtc_state->active) {
+ mod_power_remove_stream(dm->power_module,
+ dm_old_crtc_state->stream);
+ }
+ }
+ }
+
+ /**
+ * amdgpu_dm_mod_power_setup_streams - setup mod_power stream state post modeset
+ * @state: the drm atomic state
+ * @dm: the display manager to update mod_power on
+ *
+ * Notify mod_power of mode_change. This needs to be done after dc_stream
+ * updates have been committed, and VRR parameters have been updated.
+ */
+ static void amdgpu_dm_mod_power_setup_streams(struct drm_atomic_state *state,
+ struct amdgpu_display_manager *dm)
+ {
+ struct dm_crtc_state *dm_new_crtc_state;
+ struct drm_crtc_state *new_crtc_state;
+ struct amdgpu_crtc *acrtc;
+ struct drm_crtc *crtc;
+ int i = 0;
+
+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+ dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
+ acrtc = to_amdgpu_crtc(crtc);
+
+ if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+ continue;
+
+ if (new_crtc_state->active) {
+ amdgpu_dm_link_setup_replay(dm_new_crtc_state->stream,
+ &acrtc->dm_irq_params.vrr_params);
+ mod_power_notify_mode_change(dm->power_module,
+ dm_new_crtc_state->stream,
+ false);
+ }
+ }
+
+ }
+
-static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
- struct dc_state *dc_state)
+static void amdgpu_dm_commit_streams(struct drm_atomic_commit *state,
- struct dc_state *dc_state)
++ struct dc_state *dc_state)
{
struct drm_device *dev = state->dev;
struct amdgpu_device *adev = drm_to_adev(dev);
next reply other threads:[~2026-05-06 9:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 9:55 Thierry Reding [this message]
2026-05-06 10:20 ` linux-next: manual merge of the amdgpu tree with the drm-next tree Thierry Reding
-- strict thread matches above, loose matches on Subject: below --
2026-05-06 9:54 Thierry Reding
2026-04-02 12:41 Mark Brown
2023-05-05 13:26 Mark Brown
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=f8ede562c8335f22073b4cc5535001d4@kernel.org \
--to=thierry.reding@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.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