drm/komeda: Computing layer_split internally
authorjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Mon, 8 Jul 2019 06:59:45 +0000 (07:59 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 8 Jul 2019 14:05:21 +0000 (15:05 +0100)
For layer_split no need user to enable/disable it, but compute it in
komeda internally, komeda will enable it if the scaling exceed the
acceptable range of scaler.

Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708065923.4887-1-james.qian.wang@arm.com
drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
drivers/gpu/drm/arm/display/komeda/komeda_plane.c
drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c

index fc1b861..a90bcbb 100644 (file)
@@ -537,7 +537,8 @@ void komeda_pipeline_disable(struct komeda_pipeline *pipe,
 void komeda_pipeline_update(struct komeda_pipeline *pipe,
                            struct drm_atomic_state *old_state);
 
-void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow,
+void komeda_complete_data_flow_cfg(struct komeda_layer *layer,
+                                  struct komeda_data_flow_cfg *dflow,
                                   struct drm_framebuffer *fb);
 
 #endif /* _KOMEDA_PIPELINE_H_*/
index 2b415ef..972a0f2 100644 (file)
@@ -784,9 +784,11 @@ komeda_timing_ctrlr_validate(struct komeda_timing_ctrlr *ctrlr,
        return 0;
 }
 
-void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow,
+void komeda_complete_data_flow_cfg(struct komeda_layer *layer,
+                                  struct komeda_data_flow_cfg *dflow,
                                   struct drm_framebuffer *fb)
 {
+       struct komeda_scaler *scaler = layer->base.pipeline->scalers[0];
        u32 w = dflow->in_w;
        u32 h = dflow->in_h;
 
@@ -803,6 +805,13 @@ void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow,
 
        dflow->en_scaling = (w != dflow->out_w) || (h != dflow->out_h);
        dflow->is_yuv = fb->format->is_yuv;
+
+       /* try to enable split if scaling exceed the scaler's acceptable
+        * input/output range.
+        */
+       if (dflow->en_scaling && scaler)
+               dflow->en_split = !in_range(&scaler->hsize, dflow->in_w) ||
+                                 !in_range(&scaler->hsize, dflow->out_w);
 }
 
 static bool merger_is_available(struct komeda_pipeline *pipe,
index 5bb8553..b138643 100644 (file)
@@ -58,9 +58,8 @@ komeda_plane_init_data_flow(struct drm_plane_state *st,
        }
 
        dflow->en_img_enhancement = !!kplane_st->img_enhancement;
-       dflow->en_split = !!kplane_st->layer_split;
 
-       komeda_complete_data_flow_cfg(dflow, fb);
+       komeda_complete_data_flow_cfg(kplane->layer, dflow, fb);
 
        return 0;
 }
index bb8a61f..617e1f7 100644 (file)
@@ -13,7 +13,6 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
                         struct komeda_crtc_state *kcrtc_st,
                         struct komeda_data_flow_cfg *dflow)
 {
-       struct komeda_scaler *scaler = wb_layer->base.pipeline->scalers[0];
        struct drm_framebuffer *fb = conn_st->writeback_job->fb;
 
        memset(dflow, 0, sizeof(*dflow));
@@ -28,14 +27,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
        dflow->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE;
        dflow->rot = DRM_MODE_ROTATE_0;
 
-       komeda_complete_data_flow_cfg(dflow, fb);
-
-       /* if scaling exceed the acceptable scaler input/output range, try to
-        * enable split.
-        */
-       if (dflow->en_scaling && scaler)
-               dflow->en_split = !in_range(&scaler->hsize, dflow->in_w) ||
-                                 !in_range(&scaler->hsize, dflow->out_w);
+       komeda_complete_data_flow_cfg(wb_layer, dflow, fb);
 
        return 0;
 }