All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe
@ 2023-01-17 11:08 Alexander Stein
  2023-01-17 11:08 ` [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A Alexander Stein
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Stein @ 2023-01-17 11:08 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter
  Cc: Alexander Stein, dri-devel

fsl_dcu_drm_modeset_init can return -EPROBE_DEFER, so use dev_err_probe
to remove an invalid error message and add it to deferral description.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 8579c7629f5e..418887654bac 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -103,10 +103,8 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
 	int ret;
 
 	ret = fsl_dcu_drm_modeset_init(fsl_dev);
-	if (ret < 0) {
-		dev_err(dev->dev, "failed to initialize mode setting\n");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(dev->dev, ret, "failed to initialize mode setting\n");
 
 	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
 	if (ret < 0) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A
  2023-01-17 11:08 [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
@ 2023-01-17 11:08 ` Alexander Stein
  2023-02-06 13:33   ` Alexander Stein
  2023-02-13  8:24 ` [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
  2023-05-09 12:51 ` Alexander Stein
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Stein @ 2023-01-17 11:08 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter
  Cc: Alexander Stein, dri-devel, Matthias Schiffer

From: Matthias Schiffer <matthias.schiffer@tq-group.com>

The PIXCLK needs to be enabled in SCFG before accessing certain DCU
registers, or the access will hang.

Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/gpu/drm/fsl-dcu/Kconfig           |  1 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 14 ++++++++++++++
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h |  3 +++
 3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/fsl-dcu/Kconfig b/drivers/gpu/drm/fsl-dcu/Kconfig
index 5ca71ef87325..c9ee98693b48 100644
--- a/drivers/gpu/drm/fsl-dcu/Kconfig
+++ b/drivers/gpu/drm/fsl-dcu/Kconfig
@@ -8,6 +8,7 @@ config DRM_FSL_DCU
 	select DRM_PANEL
 	select REGMAP_MMIO
 	select VIDEOMODE_HELPERS
+	select MFD_SYSCON if SOC_LS1021A
 	help
 	  Choose this option if you have an Freescale DCU chipset.
 	  If M is selected the module will be called fsl-dcu-drm.
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 418887654bac..314cb8af89ee 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -100,12 +100,26 @@ static void fsl_dcu_irq_uninstall(struct drm_device *dev)
 static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
 {
 	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
+	struct regmap *scfg;
 	int ret;
 
 	ret = fsl_dcu_drm_modeset_init(fsl_dev);
 	if (ret < 0)
 		return dev_err_probe(dev->dev, ret, "failed to initialize mode setting\n");
 
+	scfg = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+	if (PTR_ERR(scfg) != -ENODEV) {
+		/*
+		 * For simplicity, enable the PIXCLK unconditionally. Disabling
+		 * the clock in PM or on unload could be implemented as a future
+		 * improvement.
+		 */
+		ret = regmap_update_bits(scfg, SCFG_PIXCLKCR, SCFG_PIXCLKCR_PXCEN,
+					SCFG_PIXCLKCR_PXCEN);
+		if (ret < 0)
+			return dev_err_probe(dev->dev, ret, "failed to enable pixclk\n");
+	}
+
 	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
 	if (ret < 0) {
 		dev_err(dev->dev, "failed to initialize vblank\n");
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
index e2049a0e8a92..566396013c04 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
@@ -160,6 +160,9 @@
 #define FSL_DCU_ARGB4444		12
 #define FSL_DCU_YUV422			14
 
+#define SCFG_PIXCLKCR			0x28
+#define SCFG_PIXCLKCR_PXCEN		BIT(31)
+
 #define VF610_LAYER_REG_NUM		9
 #define LS1021A_LAYER_REG_NUM		10
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A
  2023-01-17 11:08 ` [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A Alexander Stein
@ 2023-02-06 13:33   ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2023-02-06 13:33 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter
  Cc: dri-devel, Matthias Schiffer

Hi,

any feedback on this?

Best regards
Alexander

Am Dienstag, 17. Januar 2023, 12:08:01 CET schrieb Alexander Stein:
> From: Matthias Schiffer <matthias.schiffer@tq-group.com>
> 
> The PIXCLK needs to be enabled in SCFG before accessing certain DCU
> registers, or the access will hang.
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  drivers/gpu/drm/fsl-dcu/Kconfig           |  1 +
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 14 ++++++++++++++
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h |  3 +++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/drivers/gpu/drm/fsl-dcu/Kconfig
> b/drivers/gpu/drm/fsl-dcu/Kconfig index 5ca71ef87325..c9ee98693b48 100644
> --- a/drivers/gpu/drm/fsl-dcu/Kconfig
> +++ b/drivers/gpu/drm/fsl-dcu/Kconfig
> @@ -8,6 +8,7 @@ config DRM_FSL_DCU
>  	select DRM_PANEL
>  	select REGMAP_MMIO
>  	select VIDEOMODE_HELPERS
> +	select MFD_SYSCON if SOC_LS1021A
>  	help
>  	  Choose this option if you have an Freescale DCU chipset.
>  	  If M is selected the module will be called fsl-dcu-drm.
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index
> 418887654bac..314cb8af89ee 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -100,12 +100,26 @@ static void fsl_dcu_irq_uninstall(struct drm_device
> *dev) static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
> {
>  	struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
> +	struct regmap *scfg;
>  	int ret;
> 
>  	ret = fsl_dcu_drm_modeset_init(fsl_dev);
>  	if (ret < 0)
>  		return dev_err_probe(dev->dev, ret, "failed to initialize 
mode
> setting\n");
> 
> +	scfg = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
> +	if (PTR_ERR(scfg) != -ENODEV) {
> +		/*
> +		 * For simplicity, enable the PIXCLK unconditionally. 
Disabling
> +		 * the clock in PM or on unload could be implemented as a 
future
> +		 * improvement.
> +		 */
> +		ret = regmap_update_bits(scfg, SCFG_PIXCLKCR, 
SCFG_PIXCLKCR_PXCEN,
> +					SCFG_PIXCLKCR_PXCEN);
> +		if (ret < 0)
> +			return dev_err_probe(dev->dev, ret, "failed to 
enable pixclk\n");
> +	}
> +
>  	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
>  	if (ret < 0) {
>  		dev_err(dev->dev, "failed to initialize vblank\n");
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h index
> e2049a0e8a92..566396013c04 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
> @@ -160,6 +160,9 @@
>  #define FSL_DCU_ARGB4444		12
>  #define FSL_DCU_YUV422			14
> 
> +#define SCFG_PIXCLKCR			0x28
> +#define SCFG_PIXCLKCR_PXCEN		BIT(31)
> +
>  #define VF610_LAYER_REG_NUM		9
>  #define LS1021A_LAYER_REG_NUM		10





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe
  2023-01-17 11:08 [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
  2023-01-17 11:08 ` [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A Alexander Stein
@ 2023-02-13  8:24 ` Alexander Stein
  2023-03-16  9:35   ` Alexander Stein
  2023-05-09 12:51 ` Alexander Stein
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Stein @ 2023-02-13  8:24 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter; +Cc: dri-devel

Hi,

any feedback on this series?

Best regards,
Alexander

Am Dienstag, 17. Januar 2023, 12:08:00 CET schrieb Alexander Stein:
> fsl_dcu_drm_modeset_init can return -EPROBE_DEFER, so use dev_err_probe
> to remove an invalid error message and add it to deferral description.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index
> 8579c7629f5e..418887654bac 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -103,10 +103,8 @@ static int fsl_dcu_load(struct drm_device *dev,
> unsigned long flags) int ret;
> 
>  	ret = fsl_dcu_drm_modeset_init(fsl_dev);
> -	if (ret < 0) {
> -		dev_err(dev->dev, "failed to initialize mode setting\n");
> -		return ret;
> -	}
> +	if (ret < 0)
> +		return dev_err_probe(dev->dev, ret, "failed to initialize 
mode
> setting\n");
> 
>  	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
>  	if (ret < 0) {


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe
  2023-02-13  8:24 ` [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
@ 2023-03-16  9:35   ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2023-03-16  9:35 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter; +Cc: dri-devel

Hi,

this series is uncommented for some time now. Any feedback?

Thanks,
Alexander

Am Montag, 13. Februar 2023, 09:24:33 CET schrieb Alexander Stein:
> Hi,
> 
> any feedback on this series?
> 
> Best regards,
> Alexander
> 
> Am Dienstag, 17. Januar 2023, 12:08:00 CET schrieb Alexander Stein:
> > fsl_dcu_drm_modeset_init can return -EPROBE_DEFER, so use dev_err_probe
> > to remove an invalid error message and add it to deferral description.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > 
> >  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index
> > 8579c7629f5e..418887654bac 100644
> > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> > @@ -103,10 +103,8 @@ static int fsl_dcu_load(struct drm_device *dev,
> > unsigned long flags) int ret;
> > 
> >  	ret = fsl_dcu_drm_modeset_init(fsl_dev);
> > 
> > -	if (ret < 0) {
> > -		dev_err(dev->dev, "failed to initialize mode setting\n");
> > -		return ret;
> > -	}
> > +	if (ret < 0)
> > +		return dev_err_probe(dev->dev, ret, "failed to initialize
> 
> mode
> 
> > setting\n");
> > 
> >  	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
> >  	if (ret < 0) {


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe
  2023-01-17 11:08 [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
  2023-01-17 11:08 ` [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A Alexander Stein
  2023-02-13  8:24 ` [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
@ 2023-05-09 12:51 ` Alexander Stein
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2023-05-09 12:51 UTC (permalink / raw)
  To: Stefan Agner, Alison Wang, David Airlie, Daniel Vetter; +Cc: dri-devel

Hello,

another gentle ping.

Alexander

Am Dienstag, 17. Januar 2023, 12:08:00 CEST schrieb Alexander Stein:
> fsl_dcu_drm_modeset_init can return -EPROBE_DEFER, so use dev_err_probe
> to remove an invalid error message and add it to deferral description.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index
> 8579c7629f5e..418887654bac 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -103,10 +103,8 @@ static int fsl_dcu_load(struct drm_device *dev,
> unsigned long flags) int ret;
> 
>  	ret = fsl_dcu_drm_modeset_init(fsl_dev);
> -	if (ret < 0) {
> -		dev_err(dev->dev, "failed to initialize mode setting\n");
> -		return ret;
> -	}
> +	if (ret < 0)
> +		return dev_err_probe(dev->dev, ret, "failed to initialize 
mode
> setting\n");
> 
>  	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
>  	if (ret < 0) {


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-09 12:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 11:08 [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
2023-01-17 11:08 ` [PATCH 2/2] drm: fsl-dcu: enable PIXCLK on LS1021A Alexander Stein
2023-02-06 13:33   ` Alexander Stein
2023-02-13  8:24 ` [PATCH 1/2] drm: fsl-dcu: Use dev_err_probe Alexander Stein
2023-03-16  9:35   ` Alexander Stein
2023-05-09 12:51 ` Alexander Stein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.