While working on the TI BSP kernel, adding bootload splash screen support, I noticed some issues with the driver and opportunities for cleanups and improvements.
Tomi
Signed-off-by: Tomi Valkeinen tomi.valkeinen@ideasonboard.com --- Changes in v2: - Add missing pm_runtime_dont_use_autosuspend() in error path - Add simple manual "reset" for K2G - Leave tidss->dispc NULL if dispc_init fails - Add Fixes tags - Drop "drm/tidss: Add dispc_is_idle()" - Add "drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY" - Link to v1: https://lore.kernel.org/r/20231101-tidss-probe-v1-0-45149e0f9415@ideasonboar...
--- Tomi Valkeinen (11): drm/tidss: Use pm_runtime_resume_and_get() drm/tidss: Use PM autosuspend drm/tidss: Drop useless variable init drm/tidss: Move reset to the end of dispc_init() drm/tidss: Return error value from from softreset drm/tidss: Check for K2G in in dispc_softreset() drm/tidss: Add simple K2G manual reset drm/tidss: Fix dss reset drm/tidss: IRQ code cleanup drm/tidss: Fix atomic_flush check drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY
drivers/gpu/drm/tidss/tidss_crtc.c | 12 ++---- drivers/gpu/drm/tidss/tidss_dispc.c | 79 +++++++++++++++++++++++++++++++++---- drivers/gpu/drm/tidss/tidss_drv.c | 15 +++++-- drivers/gpu/drm/tidss/tidss_irq.c | 54 ++++--------------------- drivers/gpu/drm/tidss/tidss_kms.c | 2 +- 5 files changed, 97 insertions(+), 65 deletions(-) --- base-commit: 9d7c8c066916f231ca0ed4e4fce6c4b58ca3e451 change-id: 20231030-tidss-probe-854b1098c3af
Best regards,
tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not, returns immediately as there's no reason to do any register changes.
However, the code checks for 'crtc->state->enable', which does not reflect the actual HW state. We should instead look at the 'crtc->state->active' flag.
This causes the tidss_crtc_atomic_flush() to proceed with the flush even if the active state is false, which then causes us to hit the WARN_ON(!crtc->state->event) check.
Fix this by checking the active flag, and while at it, fix the related debug print which had "active" and "needs modeset" wrong way.
Cc: stable@vger.kernel.org Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Signed-off-by: Tomi Valkeinen tomi.valkeinen@ideasonboard.com --- drivers/gpu/drm/tidss/tidss_crtc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 5e5e466f35d1..7c78c074e3a2 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -169,13 +169,13 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc, struct tidss_device *tidss = to_tidss(ddev); unsigned long flags;
- dev_dbg(ddev->dev, - "%s: %s enabled %d, needs modeset %d, event %p\n", __func__, - crtc->name, drm_atomic_crtc_needs_modeset(crtc->state), - crtc->state->enable, crtc->state->event); + dev_dbg(ddev->dev, "%s: %s is %sactive, %s modeset, event %p\n", + __func__, crtc->name, crtc->state->active ? "" : "not ", + drm_atomic_crtc_needs_modeset(crtc->state) ? "needs" : "doesn't need", + crtc->state->event);
/* There is nothing to do if CRTC is not going to be enabled. */ - if (!crtc->state->enable) + if (!crtc->state->active) return;
/*
Hi Tomi,
Thank you for the patches!
On 09/11/23 13:07, Tomi Valkeinen wrote:
While working on the TI BSP kernel, adding bootload splash screen support, I noticed some issues with the driver and opportunities for cleanups and improvements.
Tomi
Signed-off-by: Tomi Valkeinen tomi.valkeinen@ideasonboard.com
Changes in v2:
- Add missing pm_runtime_dont_use_autosuspend() in error path
- Add simple manual "reset" for K2G
- Leave tidss->dispc NULL if dispc_init fails
- Add Fixes tags
- Drop "drm/tidss: Add dispc_is_idle()"
- Add "drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY"
- Link to v1: https://lore.kernel.org/r/20231101-tidss-probe-v1-0-45149e0f9415@ideasonboar...
Tomi Valkeinen (11): drm/tidss: Use pm_runtime_resume_and_get() drm/tidss: Use PM autosuspend drm/tidss: Drop useless variable init drm/tidss: Move reset to the end of dispc_init() drm/tidss: Return error value from from softreset drm/tidss: Check for K2G in in dispc_softreset() drm/tidss: Add simple K2G manual reset drm/tidss: Fix dss reset drm/tidss: IRQ code cleanup drm/tidss: Fix atomic_flush check drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY
For the series,
Reviewed-by: Aradhya Bhatia a-bhatia1@ti.com
Regards Aradhya
drivers/gpu/drm/tidss/tidss_crtc.c | 12 ++---- drivers/gpu/drm/tidss/tidss_dispc.c | 79 +++++++++++++++++++++++++++++++++---- drivers/gpu/drm/tidss/tidss_drv.c | 15 +++++-- drivers/gpu/drm/tidss/tidss_irq.c | 54 ++++--------------------- drivers/gpu/drm/tidss/tidss_kms.c | 2 +- 5 files changed, 97 insertions(+), 65 deletions(-)
base-commit: 9d7c8c066916f231ca0ed4e4fce6c4b58ca3e451 change-id: 20231030-tidss-probe-854b1098c3af
Best regards,
linux-stable-mirror@lists.linaro.org