diff mbox series

drm: rcar-du: depend on ARCH_RENESAS for components on that SoC

Message ID 20230108043147.346349-1-pbrobinson@gmail.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series drm: rcar-du: depend on ARCH_RENESAS for components on that SoC | expand

Commit Message

Peter Robinson Jan. 8, 2023, 4:31 a.m. UTC
There's a few components in the rcar-du drm directory that
don't make sense to be slectedable if ARCH_RENESAS isn't because
they are part of those SoCs so add a dependency and add compile
check to ensure they're still tested.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 drivers/gpu/drm/rcar-du/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Laurent Pinchart Jan. 8, 2023, 4:45 a.m. UTC | #1
Hi Peter,

Thank you for the patch.

On Sun, Jan 08, 2023 at 04:31:47AM +0000, Peter Robinson wrote:
> There's a few components in the rcar-du drm directory that
> don't make sense to be slectedable if ARCH_RENESAS isn't because

s/slectedable/selectable/

> they are part of those SoCs so add a dependency and add compile
> check to ensure they're still tested.
> 
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> ---
>  drivers/gpu/drm/rcar-du/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
> index b2bddbeca878..4d2bff78a559 100644
> --- a/drivers/gpu/drm/rcar-du/Kconfig
> +++ b/drivers/gpu/drm/rcar-du/Kconfig
> @@ -25,6 +25,7 @@ config DRM_RCAR_CMM
>  config DRM_RCAR_DW_HDMI
>  	tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
>  	depends on DRM && OF
> +	depends on ARCH_RENESAS || COMPILE_TEST

As this module isn't useful without the DU driver, wouldn't it be better
to add a dependency on DRM_RCAR_DU, which itself already depends on
ARCH_RENESAS || COMPILE_TEST ? Same for the other two below.

>  	select DRM_DW_HDMI
>  	help
>  	  Enable support for R-Car Gen3 or RZ/G2 internal HDMI encoder.
> @@ -32,6 +33,7 @@ config DRM_RCAR_DW_HDMI
>  config DRM_RCAR_USE_LVDS
>  	bool "R-Car DU LVDS Encoder Support"
>  	depends on DRM_BRIDGE && OF
> +	depends on ARCH_RENESAS || COMPILE_TEST
>  	default DRM_RCAR_DU
>  	help
>  	  Enable support for the R-Car Display Unit embedded LVDS encoders.
> @@ -45,6 +47,7 @@ config DRM_RCAR_LVDS
>  config DRM_RCAR_USE_MIPI_DSI
>  	bool "R-Car DU MIPI DSI Encoder Support"
>  	depends on DRM_BRIDGE && OF
> +	depends on ARCH_RENESAS || COMPILE_TEST
>  	default DRM_RCAR_DU
>  	help
>  	  Enable support for the R-Car Display Unit embedded MIPI DSI encoders.
Peter Robinson Jan. 8, 2023, 4:50 a.m. UTC | #2
Hi Laurent,

> Thank you for the patch.
>
> On Sun, Jan 08, 2023 at 04:31:47AM +0000, Peter Robinson wrote:
> > There's a few components in the rcar-du drm directory that
> > don't make sense to be slectedable if ARCH_RENESAS isn't because
>
> s/slectedable/selectable/
>
> > they are part of those SoCs so add a dependency and add compile
> > check to ensure they're still tested.
> >
> > Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> > ---
> >  drivers/gpu/drm/rcar-du/Kconfig | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
> > index b2bddbeca878..4d2bff78a559 100644
> > --- a/drivers/gpu/drm/rcar-du/Kconfig
> > +++ b/drivers/gpu/drm/rcar-du/Kconfig
> > @@ -25,6 +25,7 @@ config DRM_RCAR_CMM
> >  config DRM_RCAR_DW_HDMI
> >       tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
> >       depends on DRM && OF
> > +     depends on ARCH_RENESAS || COMPILE_TEST
>
> As this module isn't useful without the DU driver, wouldn't it be better
> to add a dependency on DRM_RCAR_DU, which itself already depends on
> ARCH_RENESAS || COMPILE_TEST ? Same for the other two below.

I had considered both options but as I suspected that it would have at
least been compile tested by I wasn't 100% sure of the dependency
within the actually SoC as I don't really know the HW but I am happy
to go that route too.

Also the DRM_RCAR_USE_ options seem a little weird too the
DRM_RCAR_USE_MIPI_DSI vs just using DRM_RCAR_MIPI_DSI, seems like
extra logic just in the Kconfig that provides little, but ultimately
that bit doesn't affect me overall.

Will do a v2

Peter

> >       select DRM_DW_HDMI
> >       help
> >         Enable support for R-Car Gen3 or RZ/G2 internal HDMI encoder.
> > @@ -32,6 +33,7 @@ config DRM_RCAR_DW_HDMI
> >  config DRM_RCAR_USE_LVDS
> >       bool "R-Car DU LVDS Encoder Support"
> >       depends on DRM_BRIDGE && OF
> > +     depends on ARCH_RENESAS || COMPILE_TEST
> >       default DRM_RCAR_DU
> >       help
> >         Enable support for the R-Car Display Unit embedded LVDS encoders.
> > @@ -45,6 +47,7 @@ config DRM_RCAR_LVDS
> >  config DRM_RCAR_USE_MIPI_DSI
> >       bool "R-Car DU MIPI DSI Encoder Support"
> >       depends on DRM_BRIDGE && OF
> > +     depends on ARCH_RENESAS || COMPILE_TEST
> >       default DRM_RCAR_DU
> >       help
> >         Enable support for the R-Car Display Unit embedded MIPI DSI encoders.
>
> --
> Regards,
>
> Laurent Pinchart
Laurent Pinchart Jan. 8, 2023, 5:09 a.m. UTC | #3
Hi Peter,

On Sun, Jan 08, 2023 at 04:50:48AM +0000, Peter Robinson wrote:
> > On Sun, Jan 08, 2023 at 04:31:47AM +0000, Peter Robinson wrote:
> > > There's a few components in the rcar-du drm directory that
> > > don't make sense to be slectedable if ARCH_RENESAS isn't because
> >
> > s/slectedable/selectable/
> >
> > > they are part of those SoCs so add a dependency and add compile
> > > check to ensure they're still tested.
> > >
> > > Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> > > ---
> > >  drivers/gpu/drm/rcar-du/Kconfig | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
> > > index b2bddbeca878..4d2bff78a559 100644
> > > --- a/drivers/gpu/drm/rcar-du/Kconfig
> > > +++ b/drivers/gpu/drm/rcar-du/Kconfig
> > > @@ -25,6 +25,7 @@ config DRM_RCAR_CMM
> > >  config DRM_RCAR_DW_HDMI
> > >       tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
> > >       depends on DRM && OF
> > > +     depends on ARCH_RENESAS || COMPILE_TEST
> >
> > As this module isn't useful without the DU driver, wouldn't it be better
> > to add a dependency on DRM_RCAR_DU, which itself already depends on
> > ARCH_RENESAS || COMPILE_TEST ? Same for the other two below.
> 
> I had considered both options but as I suspected that it would have at
> least been compile tested by I wasn't 100% sure of the dependency
> within the actually SoC as I don't really know the HW but I am happy
> to go that route too.

No worries. I can confirm that the extra drivers can't be used without
the DU.

> Also the DRM_RCAR_USE_ options seem a little weird too the
> DRM_RCAR_USE_MIPI_DSI vs just using DRM_RCAR_MIPI_DSI, seems like
> extra logic just in the Kconfig that provides little, but ultimately
> that bit doesn't affect me overall.

Yes it's awkward. The reason for this is that the DU drivers call into
the RCAR_CMM, RCAR_LVDS and RCAR_MIPI_DSI drivers directly. They are
however optional, so the functions are stubbed with IS_ENABLED() using
the corresponding CONFIG_DRM_RCAR_* Kconfig symbol, but Kconfig doesn't
make it easy to express the dependencies correctly in that case. Other
options have been tried, causing build problems in one way or another
(you can check the git log if curious).

> Will do a v2

Thank you.

> > >       select DRM_DW_HDMI
> > >       help
> > >         Enable support for R-Car Gen3 or RZ/G2 internal HDMI encoder.
> > > @@ -32,6 +33,7 @@ config DRM_RCAR_DW_HDMI
> > >  config DRM_RCAR_USE_LVDS
> > >       bool "R-Car DU LVDS Encoder Support"
> > >       depends on DRM_BRIDGE && OF
> > > +     depends on ARCH_RENESAS || COMPILE_TEST
> > >       default DRM_RCAR_DU
> > >       help
> > >         Enable support for the R-Car Display Unit embedded LVDS encoders.
> > > @@ -45,6 +47,7 @@ config DRM_RCAR_LVDS
> > >  config DRM_RCAR_USE_MIPI_DSI
> > >       bool "R-Car DU MIPI DSI Encoder Support"
> > >       depends on DRM_BRIDGE && OF
> > > +     depends on ARCH_RENESAS || COMPILE_TEST
> > >       default DRM_RCAR_DU
> > >       help
> > >         Enable support for the R-Car Display Unit embedded MIPI DSI encoders.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
index b2bddbeca878..4d2bff78a559 100644
--- a/drivers/gpu/drm/rcar-du/Kconfig
+++ b/drivers/gpu/drm/rcar-du/Kconfig
@@ -25,6 +25,7 @@  config DRM_RCAR_CMM
 config DRM_RCAR_DW_HDMI
 	tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
 	depends on DRM && OF
+	depends on ARCH_RENESAS || COMPILE_TEST
 	select DRM_DW_HDMI
 	help
 	  Enable support for R-Car Gen3 or RZ/G2 internal HDMI encoder.
@@ -32,6 +33,7 @@  config DRM_RCAR_DW_HDMI
 config DRM_RCAR_USE_LVDS
 	bool "R-Car DU LVDS Encoder Support"
 	depends on DRM_BRIDGE && OF
+	depends on ARCH_RENESAS || COMPILE_TEST
 	default DRM_RCAR_DU
 	help
 	  Enable support for the R-Car Display Unit embedded LVDS encoders.
@@ -45,6 +47,7 @@  config DRM_RCAR_LVDS
 config DRM_RCAR_USE_MIPI_DSI
 	bool "R-Car DU MIPI DSI Encoder Support"
 	depends on DRM_BRIDGE && OF
+	depends on ARCH_RENESAS || COMPILE_TEST
 	default DRM_RCAR_DU
 	help
 	  Enable support for the R-Car Display Unit embedded MIPI DSI encoders.