Lines Matching refs:plane
137 static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) in _dpu_plane_get_kms() argument
139 struct msm_drm_private *priv = plane->dev->dev_private; in _dpu_plane_get_kms()
152 static void _dpu_plane_calc_bw(struct drm_plane *plane, in _dpu_plane_calc_bw() argument
155 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_calc_bw()
159 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); in _dpu_plane_calc_bw()
167 pstate = to_dpu_plane_state(plane->state); in _dpu_plane_calc_bw()
168 mode = &plane->state->crtc->mode; in _dpu_plane_calc_bw()
208 static void _dpu_plane_calc_clk(struct drm_plane *plane) in _dpu_plane_calc_clk() argument
210 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_calc_clk()
215 pstate = to_dpu_plane_state(plane->state); in _dpu_plane_calc_clk()
216 mode = &plane->state->crtc->mode; in _dpu_plane_calc_clk()
239 static int _dpu_plane_calc_fill_level(struct drm_plane *plane, in _dpu_plane_calc_fill_level() argument
247 if (!fmt || !plane->state || !src_width || !fmt->bpp) { in _dpu_plane_calc_fill_level()
252 pdpu = to_dpu_plane(plane); in _dpu_plane_calc_fill_level()
253 pstate = to_dpu_plane_state(plane->state); in _dpu_plane_calc_fill_level()
325 static void _dpu_plane_set_qos_lut(struct drm_plane *plane, in _dpu_plane_set_qos_lut() argument
328 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_qos_lut()
339 total_fl = _dpu_plane_calc_fill_level(plane, fmt, in _dpu_plane_set_qos_lut()
370 static void _dpu_plane_set_danger_lut(struct drm_plane *plane, in _dpu_plane_set_danger_lut() argument
373 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_danger_lut()
426 static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, in _dpu_plane_set_qos_ctrl() argument
429 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_qos_ctrl()
469 static void _dpu_plane_set_ot_limit(struct drm_plane *plane, in _dpu_plane_set_ot_limit() argument
472 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_ot_limit()
474 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); in _dpu_plane_set_ot_limit()
494 static void _dpu_plane_set_qos_remap(struct drm_plane *plane) in _dpu_plane_set_qos_remap() argument
496 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_qos_remap()
498 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); in _dpu_plane_set_qos_remap()
516 static void _dpu_plane_set_scanout(struct drm_plane *plane, in _dpu_plane_set_scanout() argument
521 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_set_scanout()
684 const struct drm_plane *plane = &pdpu->base; in _dpu_plane_color_fill() local
685 struct dpu_plane_state *pstate = to_dpu_plane_state(plane->state); in _dpu_plane_color_fill()
742 int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) in dpu_plane_validate_multirect_v2() argument
757 drm_state[i] = i ? plane->r1 : plane->r0; in dpu_plane_validate_multirect_v2()
772 dpu_plane[i] = to_dpu_plane(drm_state[i]->plane); in dpu_plane_validate_multirect_v2()
776 drm_state[i]->plane->base.id); in dpu_plane_validate_multirect_v2()
837 drm_state[R0]->plane->base.id, in dpu_plane_validate_multirect_v2()
838 drm_state[R1]->plane->base.id); in dpu_plane_validate_multirect_v2()
864 void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl, in dpu_plane_get_ctl_flush() argument
867 *flush_sspp = ctl->ops.get_bitmask_sspp(ctl, dpu_plane_pipe(plane)); in dpu_plane_get_ctl_flush()
870 static int dpu_plane_prepare_fb(struct drm_plane *plane, in dpu_plane_prepare_fb() argument
874 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_prepare_fb()
893 drm_gem_plane_helper_prepare_fb(plane, new_state); in dpu_plane_prepare_fb()
915 static void dpu_plane_cleanup_fb(struct drm_plane *plane, in dpu_plane_cleanup_fb() argument
918 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_cleanup_fb()
950 static int dpu_plane_atomic_check(struct drm_plane *plane, in dpu_plane_atomic_check() argument
954 plane); in dpu_plane_atomic_check()
956 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_atomic_check()
1036 void dpu_plane_flush(struct drm_plane *plane) in dpu_plane_flush() argument
1041 if (!plane || !plane->state) { in dpu_plane_flush()
1046 pdpu = to_dpu_plane(plane); in dpu_plane_flush()
1047 pstate = to_dpu_plane_state(plane->state); in dpu_plane_flush()
1063 if (plane->state) in dpu_plane_flush()
1072 void dpu_plane_set_error(struct drm_plane *plane, bool error) in dpu_plane_set_error() argument
1076 if (!plane) in dpu_plane_set_error()
1079 pdpu = to_dpu_plane(plane); in dpu_plane_set_error()
1083 static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) in dpu_plane_sspp_atomic_update() argument
1086 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_sspp_atomic_update()
1087 struct drm_plane_state *state = plane->state; in dpu_plane_sspp_atomic_update()
1097 _dpu_plane_set_scanout(plane, pstate, &pdpu->pipe_cfg, fb); in dpu_plane_sspp_atomic_update()
1102 _dpu_plane_set_qos_ctrl(plane, false, DPU_PLANE_QOS_PANIC_CTRL); in dpu_plane_sspp_atomic_update()
1199 _dpu_plane_set_qos_lut(plane, fb); in dpu_plane_sspp_atomic_update()
1200 _dpu_plane_set_danger_lut(plane, fb); in dpu_plane_sspp_atomic_update()
1202 if (plane->type != DRM_PLANE_TYPE_CURSOR) { in dpu_plane_sspp_atomic_update()
1203 _dpu_plane_set_qos_ctrl(plane, true, DPU_PLANE_QOS_PANIC_CTRL); in dpu_plane_sspp_atomic_update()
1204 _dpu_plane_set_ot_limit(plane, crtc); in dpu_plane_sspp_atomic_update()
1215 _dpu_plane_set_qos_remap(plane); in dpu_plane_sspp_atomic_update()
1218 _dpu_plane_calc_bw(plane, fb); in dpu_plane_sspp_atomic_update()
1220 _dpu_plane_calc_clk(plane); in dpu_plane_sspp_atomic_update()
1223 static void _dpu_plane_atomic_disable(struct drm_plane *plane) in _dpu_plane_atomic_disable() argument
1225 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_atomic_disable()
1226 struct drm_plane_state *state = plane->state; in _dpu_plane_atomic_disable()
1229 trace_dpu_plane_disable(DRMID(plane), is_dpu_plane_virtual(plane), in _dpu_plane_atomic_disable()
1234 if (is_dpu_plane_virtual(plane) && in _dpu_plane_atomic_disable()
1240 static void dpu_plane_atomic_update(struct drm_plane *plane, in dpu_plane_atomic_update() argument
1243 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_atomic_update()
1245 plane); in dpu_plane_atomic_update()
1252 _dpu_plane_atomic_disable(plane); in dpu_plane_atomic_update()
1254 dpu_plane_sspp_atomic_update(plane); in dpu_plane_atomic_update()
1258 static void dpu_plane_destroy(struct drm_plane *plane) in dpu_plane_destroy() argument
1260 struct dpu_plane *pdpu = plane ? to_dpu_plane(plane) : NULL; in dpu_plane_destroy()
1265 _dpu_plane_set_qos_ctrl(plane, false, DPU_PLANE_QOS_PANIC_CTRL); in dpu_plane_destroy()
1270 drm_plane_cleanup(plane); in dpu_plane_destroy()
1278 static void dpu_plane_destroy_state(struct drm_plane *plane, in dpu_plane_destroy_state() argument
1286 dpu_plane_duplicate_state(struct drm_plane *plane) in dpu_plane_duplicate_state() argument
1292 if (!plane) { in dpu_plane_duplicate_state()
1295 } else if (!plane->state) { in dpu_plane_duplicate_state()
1300 old_state = to_dpu_plane_state(plane->state); in dpu_plane_duplicate_state()
1301 pdpu = to_dpu_plane(plane); in dpu_plane_duplicate_state()
1312 __drm_atomic_helper_plane_duplicate_state(plane, &pstate->base); in dpu_plane_duplicate_state()
1317 static void dpu_plane_reset(struct drm_plane *plane) in dpu_plane_reset() argument
1322 if (!plane) { in dpu_plane_reset()
1327 pdpu = to_dpu_plane(plane); in dpu_plane_reset()
1331 if (plane->state) { in dpu_plane_reset()
1332 dpu_plane_destroy_state(plane, plane->state); in dpu_plane_reset()
1333 plane->state = NULL; in dpu_plane_reset()
1342 __drm_atomic_helper_plane_reset(plane, &pstate->base); in dpu_plane_reset()
1346 static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) in dpu_plane_danger_signal_ctrl() argument
1348 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_danger_signal_ctrl()
1349 struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); in dpu_plane_danger_signal_ctrl()
1355 _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL); in dpu_plane_danger_signal_ctrl()
1373 struct drm_plane *plane; in _dpu_plane_set_danger_state() local
1375 drm_for_each_plane(plane, kms->dev) { in _dpu_plane_set_danger_state()
1376 if (plane->fb && plane->state) { in _dpu_plane_set_danger_state()
1377 dpu_plane_danger_signal_ctrl(plane, enable); in _dpu_plane_set_danger_state()
1379 plane->base.id, plane->fb->width, in _dpu_plane_set_danger_state()
1380 plane->fb->height); in _dpu_plane_set_danger_state()
1382 plane->state->src_x >> 16, in _dpu_plane_set_danger_state()
1383 plane->state->src_y >> 16, in _dpu_plane_set_danger_state()
1384 plane->state->src_w >> 16, in _dpu_plane_set_danger_state()
1385 plane->state->src_h >> 16, in _dpu_plane_set_danger_state()
1386 plane->state->crtc_x, plane->state->crtc_y, in _dpu_plane_set_danger_state()
1387 plane->state->crtc_w, plane->state->crtc_h); in _dpu_plane_set_danger_state()
1389 DPU_DEBUG("Inactive plane:%d\n", plane->base.id); in _dpu_plane_set_danger_state()
1426 static int _dpu_plane_init_debugfs(struct drm_plane *plane) in _dpu_plane_init_debugfs() argument
1428 struct dpu_plane *pdpu = to_dpu_plane(plane); in _dpu_plane_init_debugfs()
1429 struct dpu_kms *kms = _dpu_plane_get_kms(plane); in _dpu_plane_init_debugfs()
1436 plane->dev->primary->debugfs_root); in _dpu_plane_init_debugfs()
1502 static int _dpu_plane_init_debugfs(struct drm_plane *plane) in _dpu_plane_init_debugfs() argument
1508 static int dpu_plane_late_register(struct drm_plane *plane) in dpu_plane_late_register() argument
1510 return _dpu_plane_init_debugfs(plane); in dpu_plane_late_register()
1513 static void dpu_plane_early_unregister(struct drm_plane *plane) in dpu_plane_early_unregister() argument
1515 struct dpu_plane *pdpu = to_dpu_plane(plane); in dpu_plane_early_unregister()
1520 static bool dpu_plane_format_mod_supported(struct drm_plane *plane, in dpu_plane_format_mod_supported() argument
1556 enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane) in dpu_plane_pipe() argument
1558 return plane ? to_dpu_plane(plane)->pipe : SSPP_NONE; in dpu_plane_pipe()
1561 bool is_dpu_plane_virtual(struct drm_plane *plane) in is_dpu_plane_virtual() argument
1563 return plane ? to_dpu_plane(plane)->is_virtual : false; in is_dpu_plane_virtual()
1571 struct drm_plane *plane = NULL, *master_plane = NULL; in dpu_plane_init() local
1589 plane = &pdpu->base; in dpu_plane_init()
1629 ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs, in dpu_plane_init()
1644 ret = drm_plane_create_zpos_property(plane, 0, 0, zpos_max); in dpu_plane_init()
1648 drm_plane_create_alpha_property(plane); in dpu_plane_init()
1649 drm_plane_create_blend_mode_property(plane, in dpu_plane_init()
1654 drm_plane_create_rotation_property(plane, in dpu_plane_init()
1661 drm_plane_enable_fb_damage_clips(plane); in dpu_plane_init()
1664 drm_plane_helper_add(plane, &dpu_plane_helper_funcs); in dpu_plane_init()
1667 snprintf(pdpu->pipe_name, DPU_NAME_SIZE, "plane%u", plane->base.id); in dpu_plane_init()
1672 pipe, plane->base.id, master_plane_id); in dpu_plane_init()
1673 return plane; in dpu_plane_init()