drm/stm: ltdc: Use simple encoder

Message ID 20210302175700.28640-1-jagan@amarulasolutions.com
State New
Headers show
Series
  • drm/stm: ltdc: Use simple encoder
Related show

Commit Message

Jagan Teki March 2, 2021, 5:57 p.m. UTC
STM ltdc driver uses an empty implementation for its encoder.
Replace the code with the generic simple encoder.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 drivers/gpu/drm/stm/ltdc.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Comments

Thomas Zimmermann March 3, 2021, 7:46 a.m. UTC | #1
Am 02.03.21 um 18:57 schrieb Jagan Teki:
> STM ltdc driver uses an empty implementation for its encoder.
> Replace the code with the generic simple encoder.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/stm/ltdc.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 7812094f93d6..aeeb43524ca0 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -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);
>   
>
Thomas Zimmermann March 4, 2021, 8:21 a.m. UTC | #2
Hi,

shall I merge this patch?

Am 02.03.21 um 18:57 schrieb Jagan Teki:
> STM ltdc driver uses an empty implementation for its encoder.
> Replace the code with the generic simple encoder.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 12 ++----------
>   1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 7812094f93d6..aeeb43524ca0 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -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);
>   
>
yannick Fertre March 4, 2021, 8:49 a.m. UTC | #3
Hi Thomas,
I wait a few days before merging it.
Thank you for your help.

Best regards

Yannick


On 3/4/21 9:21 AM, Thomas Zimmermann wrote:
> Hi,
> 
> shall I merge this patch?
> 
> Am 02.03.21 um 18:57 schrieb Jagan Teki:
>> STM ltdc driver uses an empty implementation for its encoder.
>> Replace the code with the generic simple encoder.
>>
>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> ---
>>   drivers/gpu/drm/stm/ltdc.c | 12 ++----------
>>   1 file changed, 2 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>> index 7812094f93d6..aeeb43524ca0 100644
>> --- a/drivers/gpu/drm/stm/ltdc.c
>> +++ b/drivers/gpu/drm/stm/ltdc.c
>> @@ -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);
>>
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Philippe CORNU March 8, 2021, 10:50 a.m. UTC | #4
Applied on drm-misc-next.
Many thanks Jagan for your patch and many thanks Thomas & Yannick for your reviews & tests.
Philippe :-)

Patch

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 7812094f93d6..aeeb43524ca0 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -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);