lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hh64mzfrzdxpeyce4fcj6lnd5axpvrv2t7qfi46uvpcp7erwi7@s5sr5vp5s7ot>
Date: Tue, 7 Jan 2025 18:59:15 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Maxime Ripard <mripard@...nel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
	Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>, 
	Simona Vetter <simona@...ll.ch>, Dave Stevenson <dave.stevenson@...pberrypi.com>, 
	MaĆ­ra Canal <mcanal@...lia.com>, Raspberry Pi Kernel Maintenance <kernel-list@...pberrypi.com>, 
	Andrzej Hajda <andrzej.hajda@...el.com>, Neil Armstrong <neil.armstrong@...aro.org>, 
	Robert Foss <rfoss@...nel.org>, Laurent Pinchart <Laurent.pinchart@...asonboard.com>, 
	Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>, 
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC/RFT 4/9] drm/vc4: hdmi: switch to generic CEC helpers

On Tue, Jan 07, 2025 at 03:34:35PM +0100, Maxime Ripard wrote:
> On Wed, Dec 25, 2024 at 01:10:12AM +0200, Dmitry Baryshkov wrote:
> > Switch VC4 driver to using CEC helpers code, simplifying hotplug and
> > registration / cleanup. The existing vc4_hdmi_cec_release() is kept for
> > now.
> > 
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> > ---
> >  drivers/gpu/drm/vc4/Kconfig    |  1 +
> >  drivers/gpu/drm/vc4/vc4_hdmi.c | 92 ++++++++++++++++++++----------------------
> >  drivers/gpu/drm/vc4/vc4_hdmi.h |  1 -
> >  3 files changed, 44 insertions(+), 50 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig
> > index 6cc7b7e6294a1bfa54137ca65296cd47e46b1e1e..360fbe755951cc40fecb4f9d643a096a6cf92b8e 100644
> > --- a/drivers/gpu/drm/vc4/Kconfig
> > +++ b/drivers/gpu/drm/vc4/Kconfig
> > @@ -34,6 +34,7 @@ config DRM_VC4_HDMI_CEC
> >  	bool "Broadcom VC4 HDMI CEC Support"
> >  	depends on DRM_VC4
> >  	select CEC_CORE
> > +	select DRM_DISPLAY_HDMI_CEC_HELPER
> >  	help
> >  	  Choose this option if you have a Broadcom VC4 GPU
> >  	  and want to use CEC.
> > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > index 47d9ada98430634cfd8c1e21c2a4d00d501bab7e..3086c2ad3bb2e8fafdc1f37ba985aa5785d49f9a 100644
> > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> > @@ -32,6 +32,7 @@
> >   */
> >  
> >  #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>
> >  #include <drm/display/drm_scdc_helper.h>
> > @@ -400,16 +401,8 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
> >  	 * the lock for now.
> >  	 */
> >  
> > -	if (status == connector_status_disconnected) {
> > -		cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
> > -		return;
> > -	}
> > -
> >  	drm_atomic_helper_connector_hdmi_hotplug(connector, status);
> >  
> > -	cec_s_phys_addr(vc4_hdmi->cec_adap,
> > -			connector->display_info.source_physical_address, false);
> > -
> >  	if (status != connector_status_connected)
> >  		return;
> >  
> > @@ -2388,7 +2381,7 @@ static irqreturn_t vc4_cec_irq_handler_rx_thread(int irq, void *priv)
> >  	struct vc4_hdmi *vc4_hdmi = priv;
> >  
> >  	if (vc4_hdmi->cec_rx_msg.len)
> > -		cec_received_msg(vc4_hdmi->cec_adap,
> > +		cec_received_msg(vc4_hdmi->connector.cec.adapter,
> >  				 &vc4_hdmi->cec_rx_msg);
> >  
> >  	return IRQ_HANDLED;
> > @@ -2399,14 +2392,14 @@ static irqreturn_t vc4_cec_irq_handler_tx_thread(int irq, void *priv)
> >  	struct vc4_hdmi *vc4_hdmi = priv;
> >  
> >  	if (vc4_hdmi->cec_tx_ok) {
> > -		cec_transmit_done(vc4_hdmi->cec_adap, CEC_TX_STATUS_OK,
> > +		cec_transmit_done(vc4_hdmi->connector.cec.adapter, CEC_TX_STATUS_OK,
> >  				  0, 0, 0, 0);
> 
> Shouldn't we create helpers for those just like we did to deal with phys_addr?

For phys_addr it was required as we were wrapping locking, adapter and
notifier calls. I can add wrappers for these calls too, of course.

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ