Skip to contentSkip to conversation

drm/stm: ltdc: Use simple encoder

PATCH In review Jagan Teki 4 participants 6 messages Mar 2, 2021 – Mar 8, 2021

Subsystems (4)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/1 drm/stm: ltdc: Use simple encoder

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

---
 drivers/gpu/drm/stm/ltdc.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +2 -10
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
 #include <drm/drm_of.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)
 	return ret;
 }
 
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
 static void ltdc_encoder_disable(struct drm_encoder *encoder)
 {
 	struct drm_device *ddev = encoder->dev;
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
 	encoder->possible_crtcs = CRTC_MASK;
 	encoder->possible_clones = 0;	/* No cloning support */
 
-	drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
-			 DRM_MODE_ENCODER_DPI, NULL);
+	drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI);
 
 	drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
 
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 1/1
#1 lore raw

Am 02.03.21 um 18:57 schrieb Jagan Teki:

Quoted 4 lines

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

Quoted 42 lines
---
  drivers/gpu/drm/stm/ltdc.c | 12 ++----------
  1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +2 -10
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
  #include <drm/drm_of.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
  #include <drm/drm_vblank.h>
 
  #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)
  	return ret;
  }
 
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
  static void ltdc_encoder_disable(struct drm_encoder *encoder)
  {
  	struct drm_device *ddev = encoder->dev;
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
  	encoder->possible_crtcs = CRTC_MASK;
  	encoder->possible_clones = 0;	/* No cloning support */
 
-	drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
-			 DRM_MODE_ENCODER_DPI, NULL);
+	drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI);
 
  	drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Tested-by on v1 1/1
#2 lore raw
In reply to Jagan Teki

Thanks Jagan for the patch.

Quoted 37 lines · Jagan Teki

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

---
  drivers/gpu/drm/stm/ltdc.c | 12 ++----------
  1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +1 -8
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
  #include <drm/drm_of.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
  #include <drm/drm_vblank.h>
 
  #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)
  	return ret;
  }
 
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
  static void ltdc_encoder_disable(struct drm_encoder *encoder)
  {
  	struct drm_device *ddev = encoder->dev;

drivers/gpu/drm/stm/ltdc.c static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge) · line 1087

Quoted 9 lines
drivers/gpu/drm/stm/ltdc.c +1 -2
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
  	encoder->possible_crtcs = CRTC_MASK;
  	encoder->possible_clones = 0;	/* No cloning support */
 
-	drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
-			 DRM_MODE_ENCODER_DPI, NULL);
+	drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI);
 
  	drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Jagan Teki

Hi,

shall I merge this patch?

Am 02.03.21 um 18:57 schrieb Jagan Teki:

Quoted 46 lines

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

---
  drivers/gpu/drm/stm/ltdc.c | 12 ++----------
  1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +2 -10
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
  #include <drm/drm_of.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
  #include <drm/drm_vblank.h>
 
  #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device *ddev, struct drm_crtc *crtc)
  	return ret;
  }
 
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
  static void ltdc_encoder_disable(struct drm_encoder *encoder)
  {
  	struct drm_device *ddev = encoder->dev;
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
  	encoder->possible_crtcs = CRTC_MASK;
  	encoder->possible_clones = 0;	/* No cloning support */
 
-	drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
-			 DRM_MODE_ENCODER_DPI, NULL);
+	drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI);
 
  	drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
 
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#4 lore raw

Hi Thomas,
I wait a few days before merging it.
Thank you for your help.

Best regards

Yannick

Quoted 55 lines · Thomas Zimmermann

Hi,

shall I merge this patch?

Am 02.03.21 um 18:57 schrieb Jagan Teki:

Quoted 37 lines

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

---
  drivers/gpu/drm/stm/ltdc.c | 12 ++----------

  1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +1 -8
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
   #include <drm/drm_of.h>
   #include <drm/drm_plane_helper.h>
   #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
   #include <drm/drm_vblank.h>
   #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device 
 *ddev, struct drm_crtc *crtc)
       return ret;
   }
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-    .destroy = drm_encoder_cleanup,
-};
-
   static void ltdc_encoder_disable(struct drm_encoder *encoder)
   {
       struct drm_device *ddev = encoder->dev;
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device 
 *ddev, struct drm_bridge *bridge)
       encoder->possible_crtcs = CRTC_MASK;
Quoted 6 lines

      encoder->possible_clones = 0;    /* No cloning support */ -    drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs, -             DRM_MODE_ENCODER_DPI, NULL);
+    drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI); drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Applied on drm-misc-next.
Many thanks Jagan for your patch and many thanks Thomas & Yannick for your reviews & tests. Philippe :-)

________________________________________
De : Linux-stm32 <[email protected]> de la part de Yannick FERTRE - foss
Envoyé : jeudi 4 mars 2021 09:49
À : Thomas Zimmermann; Jagan Teki; Yannick FERTRE; Philippe CORNU; Benjamin Gaignard; Vincent ABRIOU
Cc : [email protected]; [email protected]; [email protected]; [email protected]; [email protected] Objet : Re: [Linux-stm32] [PATCH] drm/stm: ltdc: Use simple encoder

Hi Thomas,
I wait a few days before merging it.
Thank you for your help.

Best regards

Yannick

Quoted 46 lines · Thomas Zimmermann

Hi,

shall I merge this patch?

Am 02.03.21 um 18:57 schrieb Jagan Teki:

Quoted 41 lines

STM ltdc driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder.

---
  drivers/gpu/drm/stm/ltdc.c | 12 ++----------
  1 file changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/stm/ltdc.c +2 -10
index 7812094f93d6..aeeb43524ca0 100644
@@ -31,6 +31,7 @@
  #include <drm/drm_of.h>
  #include <drm/drm_plane_helper.h>
  #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
  #include <drm/drm_vblank.h>
  #include <video/videomode.h>
@@ -1020,14 +1021,6 @@ static int ltdc_crtc_init(struct drm_device
 *ddev, struct drm_crtc *crtc)
      return ret;
  }
-/*
- * DRM_ENCODER
- */
-
-static const struct drm_encoder_funcs ltdc_encoder_funcs = {
-    .destroy = drm_encoder_cleanup,
-};
-
  static void ltdc_encoder_disable(struct drm_encoder *encoder)
  {
      struct drm_device *ddev = encoder->dev;
@@ -1088,8 +1081,7 @@ static int ltdc_encoder_init(struct drm_device
 *ddev, struct drm_bridge *bridge)
      encoder->possible_crtcs = CRTC_MASK;
      encoder->possible_clones = 0;    /* No cloning support */
-    drm_encoder_init(ddev, encoder, &ltdc_encoder_funcs,
-             DRM_MODE_ENCODER_DPI, NULL);
+    drm_simple_encoder_init(ddev, encoder, DRM_MODE_ENCODER_DPI);
Quoted 9 lines

drivers/gpu/drm/stm/ltdc.c static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge) · line 1087

Quoted 2 lines
drivers/gpu/drm/stm/ltdc.c +0 -0
      drm_encoder_helper_add(encoder, &ltdc_encoder_helper_funcs);
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
Linux-stm32 mailing list
[email protected]
https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel