[PATCH v9 04/16] drm/imx: dc-kms: Use driver specific .atomic_commit_tail callback
Liu Ying
victor.liu at nxp.com
Mon Nov 2 22:22:00 PST 2026
Currently, a CRTC can be disabled by a commit without considering
it's relevant plane's status(either enabled or disabled). A problem
is that dc_crtc_atomic_disable() puts Pixel Engine and Display Engine's
runtime PMs, so dc_plane_atomic_update() or dc_plane_atomic_disable()
may access registers with AXI clock and CFG clock disabled. To fix
this, specify .atomic_commit_tail callback(based on
drm_atomic_helper_commit_tail() without the unneeded
drm_atomic_helper_fake_vblank() function call) to add
DRM_PLANE_COMMIT_ACTIVE_ONLY and DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET
flags to drm_atomic_helper_commit_planes() function call's flags
argument so that .atomic_update and .atomic_disable callbacks in
dc_plane.c are skipped when necessary.
Fixes: 711a3b878366 ("drm/imx: Add i.MX8qxp Display Controller KMS")
Signed-off-by: Liu Ying <victor.liu at nxp.com>
---
v9:
- Newly introduced. (Sashiko AI bot)
---
drivers/gpu/drm/imx/dc/dc-kms.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/gpu/drm/imx/dc/dc-kms.c b/drivers/gpu/drm/imx/dc/dc-kms.c
index 0e2ce6a42548..9ffa15ac43a2 100644
--- a/drivers/gpu/drm/imx/dc/dc-kms.c
+++ b/drivers/gpu/drm/imx/dc/dc-kms.c
@@ -15,6 +15,7 @@
#include <drm/drm_encoder.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_mode_config.h>
+#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
@@ -30,6 +31,29 @@ static const struct drm_mode_config_funcs dc_drm_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};
+static void dc_drm_atomic_commit_tail(struct drm_atomic_commit *state)
+{
+ struct drm_device *dev = state->dev;
+
+ drm_atomic_helper_commit_modeset_disables(dev, state);
+
+ drm_atomic_helper_commit_planes(dev, state,
+ DRM_PLANE_COMMIT_ACTIVE_ONLY |
+ DRM_PLANE_COMMIT_NO_DISABLE_AFTER_MODESET);
+
+ drm_atomic_helper_commit_modeset_enables(dev, state);
+
+ drm_atomic_helper_commit_hw_done(state);
+
+ drm_atomic_helper_wait_for_vblanks(dev, state);
+
+ drm_atomic_helper_cleanup_planes(dev, state);
+}
+
+static const struct drm_mode_config_helper_funcs dc_drm_mode_config_helpers = {
+ .atomic_commit_tail = dc_drm_atomic_commit_tail,
+};
+
static const struct drm_encoder_funcs dc_kms_encoder_funcs = {
.destroy = drm_encoder_cleanup,
};
@@ -103,6 +127,7 @@ int dc_kms_init(struct dc_drm_device *dc_drm)
drm->mode_config.max_width = 8192;
drm->mode_config.max_height = 8192;
drm->mode_config.funcs = &dc_drm_mode_config_funcs;
+ drm->mode_config.helper_private = &dc_drm_mode_config_helpers;
drm->vblank_disable_immediate = true;
drm->max_vblank_count = DC_FRAMEGEN_MAX_FRAME_INDEX;
--
2.43.0
More information about the linux-arm-kernel
mailing list