Re: [PATCH v3 2/6] drm/komeda: Add side by side plane_state split

2019-11-19 Thread james qian wang (Arm Technology China)
On Fri, Nov 15, 2019 at 12:00:01AM +, Mihail Atanassov wrote:
> On Thursday, 14 November 2019 08:37:31 GMT james qian wang (Arm Technology 
> China) wrote:
> > On side by side mode, The full display frame will be split into two parts
> > (Left/Right), and each part will be handled by a single pipeline separately
> > master pipeline for left part, slave for right.
> > 
> > To simplify the usage and implementation, komeda use the following scheme
> > to do the side by side split
> > 1. The planes also have been grouped into two classes:
> >master-planes and slave-planes.
> > 2. The master plane can display its image on any location of the final/full
> >display frame, komeda will help to split the plane configuration to two
> >parts and fed them into master and slave pipelines.
> > 3. The slave plane only can put its display rect on the right part of the
> >final display frame, and its data is only can be fed into the slave
> >pipeline.
> > 
> > From the perspective of resource usage and assignment:
> > The master plane can use the resources from the master pipeline and slave
> > pipeline both, but slave plane only can use the slave pipeline resources.
> > 
> > With such scheme, the usage of master planes are same as the none
> > side_by_side mode. user can easily skip the slave planes and no need to
> > consider side_by_side for them.
> > 
> > Signed-off-by: James Qian Wang (Arm Technology China) 
> > 
> > ---
> >  .../drm/arm/display/komeda/komeda_pipeline.h  |  33 ++-
> >  .../display/komeda/komeda_pipeline_state.c| 188 ++
> >  .../gpu/drm/arm/display/komeda/komeda_plane.c |   7 +-
> >  3 files changed, 220 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h 
> > b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> > index 20a076cce635..4c0946fbaac1 100644
> > --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> > @@ -521,6 +521,20 @@ komeda_component_pickup_output(struct komeda_component 
> > *c, u32 avail_comps)
> > return komeda_pipeline_get_first_component(c->pipeline, avail_inputs);
> >  }
> >  
> > +static inline const char *
> > +komeda_data_flow_msg(struct komeda_data_flow_cfg *config)
> > +{
> > +   static char str[128];
> > +
> > +   snprintf(str, sizeof(str),
> > +"rot: %x src[x/y:%d/%d, w/h:%d/%d] disp[x/y:%d/%d, w/h:%d/%d]",
> > +config->rot,
> > +config->in_x, config->in_y, config->in_w, config->in_h,
> > +config->out_x, config->out_y, config->out_w, config->out_h);
> > +
> > +   return str;
> > +}
> > +
> >  struct komeda_plane_state;
> >  struct komeda_crtc_state;
> >  struct komeda_crtc;
> > @@ -532,22 +546,27 @@ int komeda_build_layer_data_flow(struct komeda_layer 
> > *layer,
> >  struct komeda_plane_state *kplane_st,
> >  struct komeda_crtc_state *kcrtc_st,
> >  struct komeda_data_flow_cfg *dflow);
> > -int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
> > - struct drm_connector_state *conn_st,
> > - struct komeda_crtc_state *kcrtc_st,
> > - struct komeda_data_flow_cfg *dflow);
> > -int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
> > -  struct komeda_crtc_state *kcrtc_st);
> > -
> >  int komeda_build_layer_split_data_flow(struct komeda_layer *left,
> >struct komeda_plane_state *kplane_st,
> >struct komeda_crtc_state *kcrtc_st,
> >struct komeda_data_flow_cfg *dflow);
> > +int komeda_build_layer_sbs_data_flow(struct komeda_layer *layer,
> > +struct komeda_plane_state *kplane_st,
> > +struct komeda_crtc_state *kcrtc_st,
> > +struct komeda_data_flow_cfg *dflow);
> > +
> > +int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
> > + struct drm_connector_state *conn_st,
> > + struct komeda_crtc_state *kcrtc_st,
> > + struct komeda_data_flow_cfg *dflow);
> >  int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer,
> > struct drm_connector_state *conn_st,
> > struct komeda_crtc_state *kcrtc_st,
> > struct komeda_data_flow_cfg *dflow);
> >  
> > +int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
> > +  struct komeda_crtc_state *kcrtc_st);
> > +
> >  int komeda_release_unclaimed_resources(struct komeda_pipeline *pipe,
> >struct komeda_crtc_state *kcrtc_st);
> >  
> > diff --git 

Re: [PATCH v3 2/6] drm/komeda: Add side by side plane_state split

2019-11-14 Thread Mihail Atanassov
On Thursday, 14 November 2019 08:37:31 GMT james qian wang (Arm Technology 
China) wrote:
> On side by side mode, The full display frame will be split into two parts
> (Left/Right), and each part will be handled by a single pipeline separately
> master pipeline for left part, slave for right.
> 
> To simplify the usage and implementation, komeda use the following scheme
> to do the side by side split
> 1. The planes also have been grouped into two classes:
>master-planes and slave-planes.
> 2. The master plane can display its image on any location of the final/full
>display frame, komeda will help to split the plane configuration to two
>parts and fed them into master and slave pipelines.
> 3. The slave plane only can put its display rect on the right part of the
>final display frame, and its data is only can be fed into the slave
>pipeline.
> 
> From the perspective of resource usage and assignment:
> The master plane can use the resources from the master pipeline and slave
> pipeline both, but slave plane only can use the slave pipeline resources.
> 
> With such scheme, the usage of master planes are same as the none
> side_by_side mode. user can easily skip the slave planes and no need to
> consider side_by_side for them.
> 
> Signed-off-by: James Qian Wang (Arm Technology China) 
> 
> ---
>  .../drm/arm/display/komeda/komeda_pipeline.h  |  33 ++-
>  .../display/komeda/komeda_pipeline_state.c| 188 ++
>  .../gpu/drm/arm/display/komeda/komeda_plane.c |   7 +-
>  3 files changed, 220 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h 
> b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> index 20a076cce635..4c0946fbaac1 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> @@ -521,6 +521,20 @@ komeda_component_pickup_output(struct komeda_component 
> *c, u32 avail_comps)
>   return komeda_pipeline_get_first_component(c->pipeline, avail_inputs);
>  }
>  
> +static inline const char *
> +komeda_data_flow_msg(struct komeda_data_flow_cfg *config)
> +{
> + static char str[128];
> +
> + snprintf(str, sizeof(str),
> +  "rot: %x src[x/y:%d/%d, w/h:%d/%d] disp[x/y:%d/%d, w/h:%d/%d]",
> +  config->rot,
> +  config->in_x, config->in_y, config->in_w, config->in_h,
> +  config->out_x, config->out_y, config->out_w, config->out_h);
> +
> + return str;
> +}
> +
>  struct komeda_plane_state;
>  struct komeda_crtc_state;
>  struct komeda_crtc;
> @@ -532,22 +546,27 @@ int komeda_build_layer_data_flow(struct komeda_layer 
> *layer,
>struct komeda_plane_state *kplane_st,
>struct komeda_crtc_state *kcrtc_st,
>struct komeda_data_flow_cfg *dflow);
> -int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
> -   struct drm_connector_state *conn_st,
> -   struct komeda_crtc_state *kcrtc_st,
> -   struct komeda_data_flow_cfg *dflow);
> -int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
> -struct komeda_crtc_state *kcrtc_st);
> -
>  int komeda_build_layer_split_data_flow(struct komeda_layer *left,
>  struct komeda_plane_state *kplane_st,
>  struct komeda_crtc_state *kcrtc_st,
>  struct komeda_data_flow_cfg *dflow);
> +int komeda_build_layer_sbs_data_flow(struct komeda_layer *layer,
> +  struct komeda_plane_state *kplane_st,
> +  struct komeda_crtc_state *kcrtc_st,
> +  struct komeda_data_flow_cfg *dflow);
> +
> +int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
> +   struct drm_connector_state *conn_st,
> +   struct komeda_crtc_state *kcrtc_st,
> +   struct komeda_data_flow_cfg *dflow);
>  int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer,
>   struct drm_connector_state *conn_st,
>   struct komeda_crtc_state *kcrtc_st,
>   struct komeda_data_flow_cfg *dflow);
>  
> +int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
> +struct komeda_crtc_state *kcrtc_st);
> +
>  int komeda_release_unclaimed_resources(struct komeda_pipeline *pipe,
>  struct komeda_crtc_state *kcrtc_st);
>  
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c 
> b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> index 0930234abb9d..5de0d231a1c3 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> 

[PATCH v3 2/6] drm/komeda: Add side by side plane_state split

2019-11-14 Thread james qian wang (Arm Technology China)
On side by side mode, The full display frame will be split into two parts
(Left/Right), and each part will be handled by a single pipeline separately
master pipeline for left part, slave for right.

To simplify the usage and implementation, komeda use the following scheme
to do the side by side split
1. The planes also have been grouped into two classes:
   master-planes and slave-planes.
2. The master plane can display its image on any location of the final/full
   display frame, komeda will help to split the plane configuration to two
   parts and fed them into master and slave pipelines.
3. The slave plane only can put its display rect on the right part of the
   final display frame, and its data is only can be fed into the slave
   pipeline.

From the perspective of resource usage and assignment:
The master plane can use the resources from the master pipeline and slave
pipeline both, but slave plane only can use the slave pipeline resources.

With such scheme, the usage of master planes are same as the none
side_by_side mode. user can easily skip the slave planes and no need to
consider side_by_side for them.

Signed-off-by: James Qian Wang (Arm Technology China) 
---
 .../drm/arm/display/komeda/komeda_pipeline.h  |  33 ++-
 .../display/komeda/komeda_pipeline_state.c| 188 ++
 .../gpu/drm/arm/display/komeda/komeda_plane.c |   7 +-
 3 files changed, 220 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h 
b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
index 20a076cce635..4c0946fbaac1 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
@@ -521,6 +521,20 @@ komeda_component_pickup_output(struct komeda_component *c, 
u32 avail_comps)
return komeda_pipeline_get_first_component(c->pipeline, avail_inputs);
 }
 
+static inline const char *
+komeda_data_flow_msg(struct komeda_data_flow_cfg *config)
+{
+   static char str[128];
+
+   snprintf(str, sizeof(str),
+"rot: %x src[x/y:%d/%d, w/h:%d/%d] disp[x/y:%d/%d, w/h:%d/%d]",
+config->rot,
+config->in_x, config->in_y, config->in_w, config->in_h,
+config->out_x, config->out_y, config->out_w, config->out_h);
+
+   return str;
+}
+
 struct komeda_plane_state;
 struct komeda_crtc_state;
 struct komeda_crtc;
@@ -532,22 +546,27 @@ int komeda_build_layer_data_flow(struct komeda_layer 
*layer,
 struct komeda_plane_state *kplane_st,
 struct komeda_crtc_state *kcrtc_st,
 struct komeda_data_flow_cfg *dflow);
-int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
- struct drm_connector_state *conn_st,
- struct komeda_crtc_state *kcrtc_st,
- struct komeda_data_flow_cfg *dflow);
-int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
-  struct komeda_crtc_state *kcrtc_st);
-
 int komeda_build_layer_split_data_flow(struct komeda_layer *left,
   struct komeda_plane_state *kplane_st,
   struct komeda_crtc_state *kcrtc_st,
   struct komeda_data_flow_cfg *dflow);
+int komeda_build_layer_sbs_data_flow(struct komeda_layer *layer,
+struct komeda_plane_state *kplane_st,
+struct komeda_crtc_state *kcrtc_st,
+struct komeda_data_flow_cfg *dflow);
+
+int komeda_build_wb_data_flow(struct komeda_layer *wb_layer,
+ struct drm_connector_state *conn_st,
+ struct komeda_crtc_state *kcrtc_st,
+ struct komeda_data_flow_cfg *dflow);
 int komeda_build_wb_split_data_flow(struct komeda_layer *wb_layer,
struct drm_connector_state *conn_st,
struct komeda_crtc_state *kcrtc_st,
struct komeda_data_flow_cfg *dflow);
 
+int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
+  struct komeda_crtc_state *kcrtc_st);
+
 int komeda_release_unclaimed_resources(struct komeda_pipeline *pipe,
   struct komeda_crtc_state *kcrtc_st);
 
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c 
b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
index 0930234abb9d..5de0d231a1c3 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
@@ -1130,6 +1130,194 @@ int komeda_build_layer_split_data_flow(struct 
komeda_layer *left,
return err;
 }
 
+/* split func will split configuration of master