diff mbox series

[v3,03/10] drm/display: hdmi-state-helper: handle CEC physical address

Message ID 20250126-drm-hdmi-connector-cec-v3-3-5b5b2d4956da@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/display: generic HDMI CEC helpers | expand

Commit Message

Dmitry Baryshkov Jan. 26, 2025, 1:29 p.m. UTC
Call HDMI CEC helpers in order to update physical address of the
adapter.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Dmitry Baryshkov Jan. 26, 2025, 2:10 p.m. UTC | #1
On Sun, Jan 26, 2025 at 03:29:08PM +0200, Dmitry Baryshkov wrote:
> Call HDMI CEC helpers in order to update physical address of the
> adapter.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 2691e8b3e480131ac6e4e4b74b24947be55694bd..1e7ea9b387088d5f407b647a9a3fead7a2929a30 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -6,6 +6,7 @@
>  #include <drm/drm_print.h>
>  
>  #include <drm/display/drm_hdmi_audio_helper.h>
> +#include <drm/display/drm_hdmi_cec_helper.h>
>  #include <drm/display/drm_hdmi_helper.h>
>  #include <drm/display/drm_hdmi_state_helper.h>
>  
> @@ -786,8 +787,11 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>  	const struct drm_edid *drm_edid;
>  
>  	if (status == connector_status_disconnected) {
> -		// TODO: also handle CEC and scramber, HDMI sink disconnected.
> +		// TODO: also handle scramber, HDMI sink disconnected.
>  		drm_connector_hdmi_audio_plugged_notify(connector, false);
> +		drm_edid_connector_update(connector, NULL);
> +		drm_connector_hdmi_cec_phys_addr_invalidate(connector);

This also has a chunk from the commit 78a5acf5433d ("drm/display: hdmi:
Do not read EDID on disconnected connectors") present only in
drm-misc-next-fixes. In future I will make sure that that commit is
included into my tree history, but the series should probably wait for
-rc1, until all -fixes branches are again a part of the drm-misc-next.

On the other hand, if anybody would like to test the series on top of
drm-misc-next (wink-wink), there would be no need to pick up any other
changes.

> +		return;
>  	}
>  
>  	if (connector->hdmi.funcs->read_edid)
> @@ -800,8 +804,9 @@ drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
>  	drm_edid_free(drm_edid);
>  
>  	if (status == connector_status_connected) {
> -		// TODO: also handle CEC and scramber, HDMI sink is now connected.
> +		// TODO: also handle scramber, HDMI sink is now connected.
>  		drm_connector_hdmi_audio_plugged_notify(connector, true);
> +		drm_connector_hdmi_cec_phys_addr_set(connector);
>  	}
>  }
>  
> 
> -- 
> 2.39.5
>
Maxime Ripard Jan. 28, 2025, 10:29 a.m. UTC | #2
On Sun, Jan 26, 2025 at 03:29:08PM +0200, Dmitry Baryshkov wrote:
> Call HDMI CEC helpers in order to update physical address of the
> adapter.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index 2691e8b3e480131ac6e4e4b74b24947be55694bd..1e7ea9b387088d5f407b647a9a3fead7a2929a30 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -6,6 +6,7 @@ 
 #include <drm/drm_print.h>
 
 #include <drm/display/drm_hdmi_audio_helper.h>
+#include <drm/display/drm_hdmi_cec_helper.h>
 #include <drm/display/drm_hdmi_helper.h>
 #include <drm/display/drm_hdmi_state_helper.h>
 
@@ -786,8 +787,11 @@  drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
 	const struct drm_edid *drm_edid;
 
 	if (status == connector_status_disconnected) {
-		// TODO: also handle CEC and scramber, HDMI sink disconnected.
+		// TODO: also handle scramber, HDMI sink disconnected.
 		drm_connector_hdmi_audio_plugged_notify(connector, false);
+		drm_edid_connector_update(connector, NULL);
+		drm_connector_hdmi_cec_phys_addr_invalidate(connector);
+		return;
 	}
 
 	if (connector->hdmi.funcs->read_edid)
@@ -800,8 +804,9 @@  drm_atomic_helper_connector_hdmi_update(struct drm_connector *connector,
 	drm_edid_free(drm_edid);
 
 	if (status == connector_status_connected) {
-		// TODO: also handle CEC and scramber, HDMI sink is now connected.
+		// TODO: also handle scramber, HDMI sink is now connected.
 		drm_connector_hdmi_audio_plugged_notify(connector, true);
+		drm_connector_hdmi_cec_phys_addr_set(connector);
 	}
 }