[PATCH v3 0/2] Fixup drm_atomic_helper_connector_hdmi_check()

Cristian Ciocaltea posted 2 patches 11 months ago
drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  3 +
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 76 ++++++++++++++++++++++
2 files changed, 79 insertions(+)
[PATCH v3 0/2] Fixup drm_atomic_helper_connector_hdmi_check()
Posted by Cristian Ciocaltea 11 months ago
Fix a NULL pointer dereference discovered while unloading a DRM module
and provide a test to make sure the helper works as expected in case the
connector's CRTC is shut down.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Changes in v3:
- Drop the unnecessary test case changing bpc (Maxime)
- Link to v2: https://lore.kernel.org/r/20250109-hdmi-conn-null-mode-v2-0-9eeaf1109547@collabora.com

Changes in v2:
- Collected R-b tags from Dmitry and Angelo
- Add a 2nd patch providing a couple of KUnit tests (Maxime)
- Link to v1: https://lore.kernel.org/r/20250107-hdmi-conn-null-mode-v1-1-fff4be46d106@collabora.com

---
Cristian Ciocaltea (2):
      drm/connector: hdmi: Handle NULL display mode in state check helper
      drm/tests: hdmi: Add connector's CRTC deactivation test

 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  3 +
 drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 76 ++++++++++++++++++++++
 2 files changed, 79 insertions(+)
---
base-commit: 938fbb16aba8f7b88e0fdcf56f315a5bbad41aad
change-id: 20250107-hdmi-conn-null-mode-be0c5e49ed8c
Re: [PATCH v3 0/2] Fixup drm_atomic_helper_connector_hdmi_check()
Posted by Maxime Ripard 10 months, 3 weeks ago
Hi,

On Tue, Jan 14, 2025 at 08:16:55PM +0200, Cristian Ciocaltea wrote:
> Fix a NULL pointer dereference discovered while unloading a DRM module
> and provide a test to make sure the helper works as expected in case the
> connector's CRTC is shut down.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

I'm sorry, I didn't realize it at the time but it looks like it was made
redundant by another series that got merged about the same time you were
sending this one:

https://patchwork.freedesktop.org/series/143378/

Sorry again,

Maxime
Re: [PATCH v3 0/2] Fixup drm_atomic_helper_connector_hdmi_check()
Posted by Cristian Ciocaltea 10 months, 3 weeks ago
Hi Maxime,

On 1/28/25 11:58 AM, Maxime Ripard wrote:
> Hi,
> 
> On Tue, Jan 14, 2025 at 08:16:55PM +0200, Cristian Ciocaltea wrote:
>> Fix a NULL pointer dereference discovered while unloading a DRM module
>> and provide a test to make sure the helper works as expected in case the
>> connector's CRTC is shut down.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> 
> I'm sorry, I didn't realize it at the time but it looks like it was made
> redundant by another series that got merged about the same time you were
> sending this one:
> 
> https://patchwork.freedesktop.org/series/143378/
> 
> Sorry again,

No worries.

I checked the merged series and I think some bits from this series are
still applicable:

* Simplify the NULL verification by considering only the return of
connector_state_get_mode(), which gets rid of the redundant
'new_conn_state->crtc' check, but also covers the additional checks
already performed in that function.

* Update the newly introduced test case to also verify
{mode|connectors|active}_changed.

I could send those as v4, but probably it makes sense to drop this
series and start a new one - please let me know if you have a preference
here.

Thanks,
Cristian