diff mbox series

drm: rcar-du: Set primary plane zpos immutably at initializing

Message ID 20200401061100.7379-1-etom@igel.co.jp (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series drm: rcar-du: Set primary plane zpos immutably at initializing | expand

Commit Message

Esaki Tomohito April 1, 2020, 6:11 a.m. UTC
According to drm_plane_create_zpos_property() function documentation,
all planes zpos range should be set if zpos property is supported.
However, the rcar-du driver didn't set primary plane zpos range. Since
the primary plane's zpos is fixed, set i immutably.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
---
 drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 ++++-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c   | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart April 4, 2020, 6:24 p.m. UTC | #1
Hello Esaki-san,

Thank you for the patch.

On Wed, Apr 01, 2020 at 03:11:00PM +0900, Tomohito Esaki wrote:
> According to drm_plane_create_zpos_property() function documentation,
> all planes zpos range should be set if zpos property is supported.
> However, the rcar-du driver didn't set primary plane zpos range. Since
> the primary plane's zpos is fixed, set i immutably.
> 
> Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 ++++-
>  drivers/gpu/drm/rcar-du/rcar_du_vsp.c   | 5 ++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> index c6430027169f..9a499be45c45 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> @@ -785,8 +785,11 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
>  
>  		drm_plane_create_alpha_property(&plane->plane);
>  
> -		if (type == DRM_PLANE_TYPE_PRIMARY)
> +		if (type == DRM_PLANE_TYPE_PRIMARY) {
> +			drm_plane_create_zpos_immutable_property(&plane->plane,
> +								 0);
>  			continue;
> +		}

I would prefer an if ... else ... here and below instead of a continue,
to better handle future differences between primary and overlay planes.
Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I've taken the liberty to resend the patch with this change as a v2,
with the dri-devel mailing list in CC, and will include it in my next
pull request.

Would you mind CC'ing me for future patches to the R-Car DU driver ? You
can use the scripts/get_maintainer.pl script from the Linux kernel
sources to get a list of maintainers, reviewers and mailing lists for a
patch. There's no need to CC everybody on that list, but it can give you
at least the driver's maintainer and the corresponding mailing list.

>  
>  		drm_object_attach_property(&plane->plane.base,
>  					   rcdu->props.colorkey,
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
> index 5e4faf258c31..382b720edc09 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
> @@ -392,8 +392,11 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
>  		drm_plane_helper_add(&plane->plane,
>  				     &rcar_du_vsp_plane_helper_funcs);
>  
> -		if (type == DRM_PLANE_TYPE_PRIMARY)
> +		if (type == DRM_PLANE_TYPE_PRIMARY) {
> +			drm_plane_create_zpos_immutable_property(&plane->plane,
> +								 0);
>  			continue;
> +		}
>  
>  		drm_plane_create_alpha_property(&plane->plane);
>  		drm_plane_create_zpos_property(&plane->plane, 1, 1,
Esaki Tomohito April 6, 2020, 1:47 a.m. UTC | #2
Hello Laurent-san

On 2020/04/05 3:24, Laurent Pinchart wrote:
> Hello Esaki-san,
> 
> Thank you for the patch.
> 
> On Wed, Apr 01, 2020 at 03:11:00PM +0900, Tomohito Esaki wrote:
>> According to drm_plane_create_zpos_property() function documentation,
>> all planes zpos range should be set if zpos property is supported.
>> However, the rcar-du driver didn't set primary plane zpos range. Since
>> the primary plane's zpos is fixed, set i immutably.
>>
>> Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
>> ---
>>  drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 ++++-
>>  drivers/gpu/drm/rcar-du/rcar_du_vsp.c   | 5 ++++-
>>  2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
>> index c6430027169f..9a499be45c45 100644
>> --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
>> @@ -785,8 +785,11 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
>>  
>>  		drm_plane_create_alpha_property(&plane->plane);
>>  
>> -		if (type == DRM_PLANE_TYPE_PRIMARY)
>> +		if (type == DRM_PLANE_TYPE_PRIMARY) {
>> +			drm_plane_create_zpos_immutable_property(&plane->plane,
>> +								 0);
>>  			continue;
>> +		}
> 
> I would prefer an if ... else ... here and below instead of a continue,
> to better handle future differences between primary and overlay planes.
> Apart from that,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I've taken the liberty to resend the patch with this change as a v2,
> with the dri-devel mailing list in CC, and will include it in my next
> pull request.

I agree with, thank you for updating patch.

> Would you mind CC'ing me for future patches to the R-Car DU driver ? You
> can use the scripts/get_maintainer.pl script from the Linux kernel
> sources to get a list of maintainers, reviewers and mailing lists for a
> patch. There's no need to CC everybody on that list, but it can give you
> at least the driver's maintainer and the corresponding mailing list.

Sorry, I understood.
I would like to add maintainer to CC from next time.

>>  
>>  		drm_object_attach_property(&plane->plane.base,
>>  					   rcdu->props.colorkey,
>> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
>> index 5e4faf258c31..382b720edc09 100644
>> --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
>> @@ -392,8 +392,11 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
>>  		drm_plane_helper_add(&plane->plane,
>>  				     &rcar_du_vsp_plane_helper_funcs);
>>  
>> -		if (type == DRM_PLANE_TYPE_PRIMARY)
>> +		if (type == DRM_PLANE_TYPE_PRIMARY) {
>> +			drm_plane_create_zpos_immutable_property(&plane->plane,
>> +								 0);
>>  			continue;
>> +		}
>>  
>>  		drm_plane_create_alpha_property(&plane->plane);
>>  		drm_plane_create_zpos_property(&plane->plane, 1, 1,
> 

Thanks,
Esaki
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index c6430027169f..9a499be45c45 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -785,8 +785,11 @@  int rcar_du_planes_init(struct rcar_du_group *rgrp)
 
 		drm_plane_create_alpha_property(&plane->plane);
 
-		if (type == DRM_PLANE_TYPE_PRIMARY)
+		if (type == DRM_PLANE_TYPE_PRIMARY) {
+			drm_plane_create_zpos_immutable_property(&plane->plane,
+								 0);
 			continue;
+		}
 
 		drm_object_attach_property(&plane->plane.base,
 					   rcdu->props.colorkey,
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 5e4faf258c31..382b720edc09 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -392,8 +392,11 @@  int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
 		drm_plane_helper_add(&plane->plane,
 				     &rcar_du_vsp_plane_helper_funcs);
 
-		if (type == DRM_PLANE_TYPE_PRIMARY)
+		if (type == DRM_PLANE_TYPE_PRIMARY) {
+			drm_plane_create_zpos_immutable_property(&plane->plane,
+								 0);
 			continue;
+		}
 
 		drm_plane_create_alpha_property(&plane->plane);
 		drm_plane_create_zpos_property(&plane->plane, 1, 1,