Message ID | 20230310005704.1332368-33-dmitry.baryshkov@linaro.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | drm/msm/dpu: wide planes support | expand |
On 3/9/2023 4:57 PM, Dmitry Baryshkov wrote: > From: Abhinav Kumar <quic_abhinavk@quicinc.com> > > After cleaning up the older multirect support the function > dpu_plane_validate_multirect_v2() is unused. Lets remove it. > > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> this needs your signed-off too. > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 111 ---------------------- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h | 7 -- > 2 files changed, 118 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index 9a03d1cad0ee..bafa1dd1748b 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -707,117 +707,6 @@ static void _dpu_plane_color_fill(struct dpu_plane *pdpu, > fill_color, fmt); > } > > -int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) > -{ > - struct dpu_plane_state *pstate[R_MAX]; > - const struct drm_plane_state *drm_state[R_MAX]; > - struct drm_rect src[R_MAX], dst[R_MAX]; > - struct dpu_plane *dpu_plane[R_MAX]; > - const struct dpu_format *fmt[R_MAX]; > - int i, buffer_lines; > - unsigned int max_tile_height = 1; > - bool parallel_fetch_qualified = true; > - bool has_tiled_rect = false; > - > - for (i = 0; i < R_MAX; i++) { > - const struct msm_format *msm_fmt; > - > - drm_state[i] = i ? plane->r1 : plane->r0; > - msm_fmt = msm_framebuffer_format(drm_state[i]->fb); > - fmt[i] = to_dpu_format(msm_fmt); > - > - if (DPU_FORMAT_IS_UBWC(fmt[i])) { > - has_tiled_rect = true; > - if (fmt[i]->tile_height > max_tile_height) > - max_tile_height = fmt[i]->tile_height; > - } > - } > - > - for (i = 0; i < R_MAX; i++) { > - int width_threshold; > - > - pstate[i] = to_dpu_plane_state(drm_state[i]); > - dpu_plane[i] = to_dpu_plane(drm_state[i]->plane); > - > - if (pstate[i] == NULL) { > - DPU_ERROR("DPU plane state of plane id %d is NULL\n", > - drm_state[i]->plane->base.id); > - return -EINVAL; > - } > - > - src[i].x1 = drm_state[i]->src_x >> 16; > - src[i].y1 = drm_state[i]->src_y >> 16; > - src[i].x2 = src[i].x1 + (drm_state[i]->src_w >> 16); > - src[i].y2 = src[i].y1 + (drm_state[i]->src_h >> 16); > - > - dst[i] = drm_plane_state_dest(drm_state[i]); > - > - if (drm_rect_calc_hscale(&src[i], &dst[i], 1, 1) != 1 || > - drm_rect_calc_vscale(&src[i], &dst[i], 1, 1) != 1) { > - DPU_ERROR_PLANE(dpu_plane[i], > - "scaling is not supported in multirect mode\n"); > - return -EINVAL; > - } > - > - if (DPU_FORMAT_IS_YUV(fmt[i])) { > - DPU_ERROR_PLANE(dpu_plane[i], > - "Unsupported format for multirect mode\n"); > - return -EINVAL; > - } > - > - /** > - * SSPP PD_MEM is split half - one for each RECT. > - * Tiled formats need 5 lines of buffering while fetching > - * whereas linear formats need only 2 lines. > - * So we cannot support more than half of the supported SSPP > - * width for tiled formats. > - */ > - width_threshold = dpu_plane[i]->catalog->caps->max_linewidth; > - if (has_tiled_rect) > - width_threshold /= 2; > - > - if (parallel_fetch_qualified && > - drm_rect_width(&src[i]) > width_threshold) > - parallel_fetch_qualified = false; > - > - } > - > - /* Validate RECT's and set the mode */ > - > - /* Prefer PARALLEL FETCH Mode over TIME_MX Mode */ > - if (parallel_fetch_qualified) { > - pstate[R0]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; > - pstate[R1]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; > - > - goto done; > - } > - > - /* TIME_MX Mode */ > - buffer_lines = 2 * max_tile_height; > - > - if (dst[R1].y1 >= dst[R0].y2 + buffer_lines || > - dst[R0].y1 >= dst[R1].y2 + buffer_lines) { > - pstate[R0]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; > - pstate[R1]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; > - } else { > - DPU_ERROR( > - "No multirect mode possible for the planes (%d - %d)\n", > - drm_state[R0]->plane->base.id, > - drm_state[R1]->plane->base.id); > - return -EINVAL; > - } > - > -done: > - pstate[R0]->pipe.multirect_index = DPU_SSPP_RECT_0; > - pstate[R1]->pipe.multirect_index = DPU_SSPP_RECT_1; > - > - DPU_DEBUG_PLANE(dpu_plane[R0], "R0: %d - %d\n", > - pstate[R0]->pipe.multirect_mode, pstate[R0]->pipe.multirect_index); > - DPU_DEBUG_PLANE(dpu_plane[R1], "R1: %d - %d\n", > - pstate[R1]->pipe.multirect_mode, pstate[R1]->pipe.multirect_index); > - return 0; > -} > - > static int dpu_plane_prepare_fb(struct drm_plane *plane, > struct drm_plane_state *new_state) > { > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h > index 7490ffd94d03..2784f8841260 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h > @@ -87,13 +87,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, > uint32_t pipe, enum drm_plane_type type, > unsigned long possible_crtcs); > > -/** > - * dpu_plane_validate_multirecti_v2 - validate the multirect planes > - * against hw limitations > - * @plane: drm plate states of the multirect pair > - */ > -int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane); > - > /** > * dpu_plane_color_fill - enables color fill on plane > * @plane: Pointer to DRM plane object
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 9a03d1cad0ee..bafa1dd1748b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -707,117 +707,6 @@ static void _dpu_plane_color_fill(struct dpu_plane *pdpu, fill_color, fmt); } -int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) -{ - struct dpu_plane_state *pstate[R_MAX]; - const struct drm_plane_state *drm_state[R_MAX]; - struct drm_rect src[R_MAX], dst[R_MAX]; - struct dpu_plane *dpu_plane[R_MAX]; - const struct dpu_format *fmt[R_MAX]; - int i, buffer_lines; - unsigned int max_tile_height = 1; - bool parallel_fetch_qualified = true; - bool has_tiled_rect = false; - - for (i = 0; i < R_MAX; i++) { - const struct msm_format *msm_fmt; - - drm_state[i] = i ? plane->r1 : plane->r0; - msm_fmt = msm_framebuffer_format(drm_state[i]->fb); - fmt[i] = to_dpu_format(msm_fmt); - - if (DPU_FORMAT_IS_UBWC(fmt[i])) { - has_tiled_rect = true; - if (fmt[i]->tile_height > max_tile_height) - max_tile_height = fmt[i]->tile_height; - } - } - - for (i = 0; i < R_MAX; i++) { - int width_threshold; - - pstate[i] = to_dpu_plane_state(drm_state[i]); - dpu_plane[i] = to_dpu_plane(drm_state[i]->plane); - - if (pstate[i] == NULL) { - DPU_ERROR("DPU plane state of plane id %d is NULL\n", - drm_state[i]->plane->base.id); - return -EINVAL; - } - - src[i].x1 = drm_state[i]->src_x >> 16; - src[i].y1 = drm_state[i]->src_y >> 16; - src[i].x2 = src[i].x1 + (drm_state[i]->src_w >> 16); - src[i].y2 = src[i].y1 + (drm_state[i]->src_h >> 16); - - dst[i] = drm_plane_state_dest(drm_state[i]); - - if (drm_rect_calc_hscale(&src[i], &dst[i], 1, 1) != 1 || - drm_rect_calc_vscale(&src[i], &dst[i], 1, 1) != 1) { - DPU_ERROR_PLANE(dpu_plane[i], - "scaling is not supported in multirect mode\n"); - return -EINVAL; - } - - if (DPU_FORMAT_IS_YUV(fmt[i])) { - DPU_ERROR_PLANE(dpu_plane[i], - "Unsupported format for multirect mode\n"); - return -EINVAL; - } - - /** - * SSPP PD_MEM is split half - one for each RECT. - * Tiled formats need 5 lines of buffering while fetching - * whereas linear formats need only 2 lines. - * So we cannot support more than half of the supported SSPP - * width for tiled formats. - */ - width_threshold = dpu_plane[i]->catalog->caps->max_linewidth; - if (has_tiled_rect) - width_threshold /= 2; - - if (parallel_fetch_qualified && - drm_rect_width(&src[i]) > width_threshold) - parallel_fetch_qualified = false; - - } - - /* Validate RECT's and set the mode */ - - /* Prefer PARALLEL FETCH Mode over TIME_MX Mode */ - if (parallel_fetch_qualified) { - pstate[R0]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; - pstate[R1]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_PARALLEL; - - goto done; - } - - /* TIME_MX Mode */ - buffer_lines = 2 * max_tile_height; - - if (dst[R1].y1 >= dst[R0].y2 + buffer_lines || - dst[R0].y1 >= dst[R1].y2 + buffer_lines) { - pstate[R0]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; - pstate[R1]->pipe.multirect_mode = DPU_SSPP_MULTIRECT_TIME_MX; - } else { - DPU_ERROR( - "No multirect mode possible for the planes (%d - %d)\n", - drm_state[R0]->plane->base.id, - drm_state[R1]->plane->base.id); - return -EINVAL; - } - -done: - pstate[R0]->pipe.multirect_index = DPU_SSPP_RECT_0; - pstate[R1]->pipe.multirect_index = DPU_SSPP_RECT_1; - - DPU_DEBUG_PLANE(dpu_plane[R0], "R0: %d - %d\n", - pstate[R0]->pipe.multirect_mode, pstate[R0]->pipe.multirect_index); - DPU_DEBUG_PLANE(dpu_plane[R1], "R1: %d - %d\n", - pstate[R1]->pipe.multirect_mode, pstate[R1]->pipe.multirect_index); - return 0; -} - static int dpu_plane_prepare_fb(struct drm_plane *plane, struct drm_plane_state *new_state) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h index 7490ffd94d03..2784f8841260 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h @@ -87,13 +87,6 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, uint32_t pipe, enum drm_plane_type type, unsigned long possible_crtcs); -/** - * dpu_plane_validate_multirecti_v2 - validate the multirect planes - * against hw limitations - * @plane: drm plate states of the multirect pair - */ -int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane); - /** * dpu_plane_color_fill - enables color fill on plane * @plane: Pointer to DRM plane object