| 86db652f | 04-Nov-2025 |
Jayesh Choudhary <j-choudhary@ti.com> |
drm/tidss: Move OLDI mode validation to OLDI bridge mode_valid hook
After integrating OLDI support[0], it is necessary to identify which VP instances use OLDI, since the OLDI driver owns the video p
drm/tidss: Move OLDI mode validation to OLDI bridge mode_valid hook
After integrating OLDI support[0], it is necessary to identify which VP instances use OLDI, since the OLDI driver owns the video port clock (as a serial clock). Clock operations on these VPs must be delegated to the OLDI driver, not handled by the TIDSS driver. This issue also emerged in upstream discussions when DSI-related clock management was attempted in the TIDSS driver[1].
To address this, add an 'is_ext_vp_clk' array to the 'tidss_device' structure, marking a VP as 'true' during 'tidss_oldi_init()' and as 'false' during 'tidss_oldi_deinit()'. TIDSS then uses 'is_ext_vp_clk' to skip clock validation checks in 'dispc_vp_mode_valid()' for VPs under OLDI control.
Since OLDI uses the DSS VP clock directly as a serial interface and manages its own rate, mode validation should be implemented in the OLDI bridge's 'mode_valid' hook. This patch adds that logic, ensuring proper delegation and avoiding spurious clock handling in the TIDSS driver.
[0]: https://lore.kernel.org/all/20250528122544.817829-1-aradhya.bhatia@linux.dev/ [1]: https://lore.kernel.org/all/DA6TT575Z82D.3MPK8HG5GRL8U@kernel.org/
Fixes: 7246e0929945 ("drm/tidss: Add OLDI bridge support") Tested-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com> Signed-off-by: Swamil Jain <s-jain1@ti.com> Link: https://patch.msgid.link/20251104151422.307162-3-s-jain1@ti.com Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patch.msgid.link/ffd5ebe03391b3c01e616c0c844a4b8ddecede36.1762513240.git.jani.nikula@intel.com
show more ...
|
| 8cde1c9b | 05-Sep-2025 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
drm/tidss: Set vblank (event) time at crtc_atomic_enable
It was reported that Weston stops at an assert, which checks that the page flip event timestamp is the same or newer than the previous timest
drm/tidss: Set vblank (event) time at crtc_atomic_enable
It was reported that Weston stops at an assert, which checks that the page flip event timestamp is the same or newer than the previous timestamp:
weston_output_finish_frame: Assertion `timespec_sub_to_nsec(stamp, &output->frame_time) >= 0' failed.
With manual tests, I can see that when I enable the CRTC, I get a page flip event with a timestamp of 0. Tracking this down led to drm_reset_vblank_timestamp() which does "t_vblank = 0" if "high-precision query" is not available.
TI DSS does not have any hardware timestamping, and thus the default ktime_get() is used in the DRM framework to get the vblank timestamp, and ktime_get() is not "high precision" here.
It is not quite clear why the framework behaves this way, but I assume the idea is that drm_crtc_vblank_on(), which calls drm_reset_vblank_timestamp(), can be called at any time, and thus ktime_get() wouldn't give a good timestamp. And, the idea is that the driver would wait until next vblank after the CRTC enable, and then we could get a good timestamp. This is hinted in the comment: "reinitialize delayed at next vblank interrupt and assign 0 for now".
I think that makes sense. However, when we enable the CRTC in TI DSS, i.e. we write the enable bit to the hardware, that's the exact moment when the "vblank cycle" starts. It is the zero point in the cycle, and thus ktime_get() would give a good timestamp.
I am not sure if this is applicable to other hardware, and if so, how should it be solved in the framework. So, let's fix this in the tidss driver at least for now.
This patch updates the vblank->time manually to ktime_get() just before sending the vblank event, and we enable the crtc just before calling ktime_get(). To get even more exact timing, the dispc_vp_enable() is moved inside the event_lock spinlock.
With this, we get a proper timestamp for the page flip event from enabling the CRTC, and Weston is happy.
Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Link: https://patch.msgid.link/20250905-tidss-fix-timestamp-v1-2-c2aedf31e2c9@ideasonboard.com Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Closes: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1553964/processor-sdk-am62x-weston-fails-to-wake-from-idle-time-sleep-restarts-after-sigterm Closes: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1416342/am625-am625-doesn-t-wake-up-from-standy-when-idle-time-is-configured-in-weston-ini
show more ...
|
| 6939508c | 05-Sep-2025 |
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> |
drm/tidss: Restructure dispc_vp_prepare() and dispc_vp_enable()
tidss_crtc.c calls dispc_vp_prepare() and dispc_vp_enable() in that order, next to each other. dispc_vp_prepare() does preparations fo
drm/tidss: Restructure dispc_vp_prepare() and dispc_vp_enable()
tidss_crtc.c calls dispc_vp_prepare() and dispc_vp_enable() in that order, next to each other. dispc_vp_prepare() does preparations for enabling the crtc, by writing some registers, and dispc_vp_enable() does more preparations. As the last thing, dispc_vp_enable() enables the CRTC by writing the enable bit.
There might have been a reason at some point in the history for this split, but I can't find any point to it. They also do a bit of overlapping work: both call dispc_vp_find_bus_fmt(). They could as well be a single function.
But instead of combining them, this patch moves everything from dispc_vp_enable() to dispc_vp_prepare(), except the actual CRTC enable bit write. The reason for this is that unlike all the preparatory register writes, CRTC enable has an immediate effect, starting the timing generator and the CRTC as a whole. Thus it may be important to time the enable just right (as we do in the next patch).
No functional changes.
Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Link: https://patch.msgid.link/20250905-tidss-fix-timestamp-v1-1-c2aedf31e2c9@ideasonboard.com Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| b83c30ac | 02-Sep-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: crtc: Cleanup reset implementation
The tidss_crtc_reset() function will (rightfully) destroy any pre-existing state.
However, the tidss CRTC driver has its own CRTC state structure that
drm/tidss: crtc: Cleanup reset implementation
The tidss_crtc_reset() function will (rightfully) destroy any pre-existing state.
However, the tidss CRTC driver has its own CRTC state structure that subclasses drm_crtc_state, and yet will destroy the previous state by calling __drm_atomic_helper_crtc_destroy_state() and kfree() on its drm_crtc_state pointer.
It works only because the drm_crtc_state is the first field in the structure, and thus its offset is 0. It's incredibly fragile however, so let's call our destroy implementation in such a case to deal with it properly.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org
show more ...
|
| ec1049f6 | 02-Sep-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: crtc: Implement destroy_state
The tidss crtc driver implements its own state, with its own implementation of reset and duplicate_state, but uses the default destroy_state helper.
This so
drm/tidss: crtc: Implement destroy_state
The tidss crtc driver implements its own state, with its own implementation of reset and duplicate_state, but uses the default destroy_state helper.
This somewhat works for now because the drm_crtc_state field in tidss_crtc_state is the first field so the offset is 0, but it's pretty fragile and it should really have its own destroy_state implementation.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org
show more ...
|
| 081da117 | 02-Sep-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: crtc: Change variable name
The tidss_crtc_reset() function stores a pointer to struct tidss_crtc_state in a variable called tcrtc, while it uses tcrtc as a pointer to struct tidss_crtc in
drm/tidss: crtc: Change variable name
The tidss_crtc_reset() function stores a pointer to struct tidss_crtc_state in a variable called tcrtc, while it uses tcrtc as a pointer to struct tidss_crtc in the rest of the driver.
This is confusing, so let's change the variable name.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-20-14ad5315da3f@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-20-14ad5315da3f@kernel.org
show more ...
|
| 2c6af66b | 02-Sep-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: Remove ftrace-like logs
These logs don't really log any information and create checkpatch warnings. Remove them.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.k
drm/tidss: Remove ftrace-like logs
These logs don't really log any information and create checkpatch warnings. Remove them.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-19-14ad5315da3f@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-19-14ad5315da3f@kernel.org
show more ...
|
| 33a7776f | 02-Sep-2025 |
Nathan Chancellor <nathan@kernel.org> |
drm/tidss: dispc: Explicitly include bitfield.h
After a recent series to use FIELD_PREP and FIELD_MODIFY in tidss_dispc.c, there are many errors when bitfield.h is not implicitly included, such as w
drm/tidss: dispc: Explicitly include bitfield.h
After a recent series to use FIELD_PREP and FIELD_MODIFY in tidss_dispc.c, there are many errors when bitfield.h is not implicitly included, such as when building allmodconfig for ARCH=hexagon:
drivers/gpu/drm/tidss/tidss_dispc.c:1116:2: error: call to undeclared function 'FIELD_MODIFY'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1116 | VP_REG_FLD_MOD(dispc, hw_videoport, DISPC_VP_CONTROL, v, | ^ drivers/gpu/drm/tidss/tidss_dispc.c:631:3: note: expanded from macro 'VP_REG_FLD_MOD' 631 | FIELD_MODIFY((mask), &_reg, (val)); \ | ^ drivers/gpu/drm/tidss/tidss_dispc.c:1140:2: error: call to undeclared function 'FIELD_MODIFY'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1140 | FIELD_MODIFY(DISPC_VP_DSS_OLDI_CFG_MAP_MASK, &oldi_cfg, | ^ drivers/gpu/drm/tidss/tidss_dispc.c:1203:10: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 1203 | FIELD_PREP(DISPC_VP_TIMING_H_SYNC_PULSE_MASK, hsw - 1) | | ^ ...
Explicitly include bitfield.h to resolve the errors.
Fixes: 9accc8b10de8 ("drm/tidss: dispc: Get rid of FLD_VAL") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250902-drm-tidss-fix-missing-bitfield-h-v1-1-aaad4a285f98@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 7287177e | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Define field masks being used
Now that we have all the accessors taking masks, we can create defines for them and reuse them as needed.
It makes the driver easier to read, less pr
drm/tidss: dispc: Define field masks being used
Now that we have all the accessors taking masks, we can create defines for them and reuse them as needed.
It makes the driver easier to read, less prone to consistency issues, and allows to reuse defines when needed.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-14-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 9b74ce7a | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch OVR_REG_FLD_MOD to using a mask
The OVR_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to shar
drm/tidss: dispc: Switch OVR_REG_FLD_MOD to using a mask
The OVR_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change OVR_REG_FLD_MOD to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-13-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 68f7fa24 | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch VP_REG_FLD_MOD to using a mask
The VP_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share
drm/tidss: dispc: Switch VP_REG_FLD_MOD to using a mask
The VP_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change VP_REG_FLD_MOD to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-12-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| b695ff1e | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch VP_REG_GET to using a mask
The VP_REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the mask
drm/tidss: dispc: Switch VP_REG_GET to using a mask
The VP_REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change VP_REG_GET to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-11-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| aeaef1ba | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch VID_REG_FLD_MOD to using a mask
The VID_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to shar
drm/tidss: dispc: Switch VID_REG_FLD_MOD to using a mask
The VID_REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change VID_REG_FLD_MOD to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-10-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 990e6f28 | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch VID_REG_GET to using a mask
The VID_REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the ma
drm/tidss: dispc: Switch VID_REG_GET to using a mask
The VID_REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change VID_REG_GET to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-9-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| e6b571e6 | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch REG_FLD_MOD to using a mask
The REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the ma
drm/tidss: dispc: Switch REG_FLD_MOD to using a mask
The REG_FLD_MOD function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change REG_FLD_MOD to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-8-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 8bd839a3 | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Switch REG_GET to using a mask
The REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks betw
drm/tidss: dispc: Switch REG_GET to using a mask
The REG_GET function takes the start and end bits as parameter and will generate a mask out of them.
This makes it difficult to share the masks between callers, since we now need two arguments and to keep them consistent.
Let's change REG_GET to take the mask as an argument instead, and let the caller create the mask. Eventually, this mask will be moved to a define.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-7-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 13925ccb | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Get rid of FLD_MOD
The FLD_MOD function is an equivalent to what FIELD_MODIFY + GENMASK provide, so let's drop it and switch to the latter.
Signed-off-by: Maxime Ripard <mripard@k
drm/tidss: dispc: Get rid of FLD_MOD
The FLD_MOD function is an equivalent to what FIELD_MODIFY + GENMASK provide, so let's drop it and switch to the latter.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-6-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|
| 6e50765b | 27-Aug-2025 |
Maxime Ripard <mripard@kernel.org> |
drm/tidss: dispc: Get rid of FLD_GET
The FLD_GET function is an equivalent to what FIELD_GET + GENMASK provide, so let's drop it and switch to the latter.
Signed-off-by: Maxime Ripard <mripard@kern
drm/tidss: dispc: Get rid of FLD_GET
The FLD_GET function is an equivalent to what FIELD_GET + GENMASK provide, so let's drop it and switch to the latter.
Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250827-drm-tidss-field-api-v3-5-7689b664cc63@kernel.org Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
show more ...
|