Lines Matching defs:win
168 static void vop2_win_disable(struct vop2_win *win)
170 vop2_win_write(win, VOP2_WIN_ENABLE, 0);
172 if (vop2_cluster_window(win))
173 vop2_win_write(win, VOP2_WIN_CLUSTER_ENABLE, 0);
405 struct vop2_win *win = to_vop2_win(plane);
406 struct vop2 *vop2 = win->vop2;
412 if (vop2_cluster_window(win)) {
539 static int vop2_get_cluster_lb_mode(struct vop2_win *win,
579 static void vop2_setup_scale(struct vop2 *vop2, const struct vop2_win *win,
619 if (!(win->data->feature & WIN_FEATURE_AFBDC)) {
622 win->data->name, dst_w);
628 vop2_win_write(win, VOP2_WIN_SCALE_YRGB_X, val);
630 vop2_win_write(win, VOP2_WIN_SCALE_YRGB_Y, val);
632 vop2_win_write(win, VOP2_WIN_VSD_YRGB_GT4, gt4);
633 vop2_win_write(win, VOP2_WIN_VSD_YRGB_GT2, gt2);
635 vop2_win_write(win, VOP2_WIN_YRGB_HOR_SCL_MODE, hor_scl_mode);
636 vop2_win_write(win, VOP2_WIN_YRGB_VER_SCL_MODE, ver_scl_mode);
638 if (vop2_cluster_window(win))
641 vop2_win_write(win, VOP2_WIN_YRGB_HSCL_FILTER_MODE, hscl_filter_mode);
642 vop2_win_write(win, VOP2_WIN_YRGB_VSCL_FILTER_MODE, vscl_filter_mode);
663 vop2_win_write(win, VOP2_WIN_SCALE_CBCR_X, val);
666 vop2_win_write(win, VOP2_WIN_SCALE_CBCR_Y, val);
668 vop2_win_write(win, VOP2_WIN_VSD_CBCR_GT4, gt4);
669 vop2_win_write(win, VOP2_WIN_VSD_CBCR_GT2, gt2);
670 vop2_win_write(win, VOP2_WIN_CBCR_HOR_SCL_MODE, hor_scl_mode);
671 vop2_win_write(win, VOP2_WIN_CBCR_VER_SCL_MODE, ver_scl_mode);
672 vop2_win_write(win, VOP2_WIN_CBCR_HSCL_FILTER_MODE, hscl_filter_mode);
673 vop2_win_write(win, VOP2_WIN_CBCR_VSCL_FILTER_MODE, vscl_filter_mode);
731 struct vop2_win *win,
756 vop2_win_write(win, VOP2_WIN_Y2R_EN, y2r_en);
757 vop2_win_write(win, VOP2_WIN_R2Y_EN, r2y_en);
758 vop2_win_write(win, VOP2_WIN_CSC_MODE, csc_mode);
1082 struct vop2_win *win = to_vop2_win(plane);
1083 struct vop2 *vop2 = win->vop2;
1085 drm_dbg(vop2->drm, "%s disable\n", win->data->name);
1092 vop2_win_disable(win);
1093 vop2_win_write(win, VOP2_WIN_YUV_CLIP, 0);
1104 struct vop2_win *win = to_vop2_win(plane);
1111 vop2_win_write(win, VOP2_WIN_COLOR_KEY_EN, 0);
1142 vop2_win_write(win, VOP2_WIN_COLOR_KEY_EN, color_key_en);
1143 vop2_win_write(win, VOP2_WIN_COLOR_KEY, (r << 20) | (g << 10) | b);
1151 struct vop2_win *win = to_vop2_win(plane);
1154 struct vop2 *vop2 = win->vop2;
1228 vp->id, win->data->name, dest->x1, dsp_w, adjusted_mode->hdisplay);
1240 vp->id, win->data->name, dest->y1, dsp_h, adjusted_mode->vdisplay);
1251 if (!(win->data->feature & WIN_FEATURE_AFBDC)) {
1254 vp->id, win->data->name, actual_w);
1261 vp->id, win->data->name, actual_w);
1272 vp->id, win->data->name, actual_w, actual_h, dsp_w, dsp_h,
1278 vop2_win_write(win, VOP2_WIN_AXI_BUS_ID, win->data->axi_bus_id);
1279 vop2_win_write(win, VOP2_WIN_AXI_YRGB_R_ID, win->data->axi_yrgb_r_id);
1280 vop2_win_write(win, VOP2_WIN_AXI_UV_R_ID, win->data->axi_uv_r_id);
1284 vop2_win_write(win, VOP2_WIN_VP_SEL, vp->id);
1286 if (vop2_cluster_window(win))
1287 vop2_win_write(win, VOP2_WIN_AFBC_HALF_BLOCK_EN, half_block_en);
1310 vp->id, win->data->name, stride);
1328 if (vop2_cluster_window(win))
1329 vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 1);
1330 vop2_win_write(win, VOP2_WIN_AFBC_FORMAT, afbc_format);
1331 vop2_win_write(win, VOP2_WIN_AFBC_UV_SWAP, uv_swap);
1341 vop2_win_write(win, VOP2_WIN_AFBC_AUTO_GATING_EN, 0);
1343 vop2_win_write(win, VOP2_WIN_AFBC_AUTO_GATING_EN, 1);
1346 vop2_win_write(win, VOP2_WIN_AFBC_BLOCK_SPLIT_EN, 1);
1348 vop2_win_write(win, VOP2_WIN_AFBC_BLOCK_SPLIT_EN, 0);
1351 vop2_win_write(win, VOP2_WIN_AFBC_PLD_OFFSET_EN, 1);
1352 vop2_win_write(win, VOP2_WIN_AFBC_PLD_OFFSET, yrgb_mst);
1356 vop2_win_write(win, VOP2_WIN_AFBC_HDR_PTR, yrgb_mst);
1357 vop2_win_write(win, VOP2_WIN_AFBC_PIC_SIZE, act_info);
1358 vop2_win_write(win, VOP2_WIN_TRANSFORM_OFFSET, transform_offset);
1359 vop2_win_write(win, VOP2_WIN_AFBC_PIC_OFFSET, ((src->x1 >> 16) | src->y1));
1360 vop2_win_write(win, VOP2_WIN_AFBC_DSP_OFFSET, (dest->x1 | (dest->y1 << 16)));
1361 vop2_win_write(win, VOP2_WIN_AFBC_PIC_VIR_WIDTH, stride);
1362 vop2_win_write(win, VOP2_WIN_AFBC_TILE_NUM, afbc_tile_num);
1363 vop2_win_write(win, VOP2_WIN_XMIRROR, xmirror);
1364 vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_270, rotate_270);
1365 vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_90, rotate_90);
1367 if (vop2_cluster_window(win)) {
1368 vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 0);
1369 vop2_win_write(win, VOP2_WIN_TRANSFORM_OFFSET, 0);
1372 vop2_win_write(win, VOP2_WIN_YRGB_VIR, DIV_ROUND_UP(fb->pitches[0], 4));
1375 vop2_win_write(win, VOP2_WIN_YMIRROR, ymirror);
1383 vop2_win_write(win, VOP2_WIN_FORMAT, format);
1384 vop2_win_write(win, VOP2_WIN_YRGB_MST, yrgb_mst);
1387 vop2_win_write(win, VOP2_WIN_RB_SWAP, rb_swap);
1389 vop2_win_write(win, VOP2_WIN_UV_SWAP, uv_swap);
1392 vop2_win_write(win, VOP2_WIN_UV_VIR, DIV_ROUND_UP(fb->pitches[1], 4));
1393 vop2_win_write(win, VOP2_WIN_UV_MST, uv_mst);
1396 vop2_setup_scale(vop2, win, actual_w, actual_h, dsp_w, dsp_h, fb->format->format);
1397 if (!vop2_cluster_window(win))
1399 vop2_win_write(win, VOP2_WIN_ACT_INFO, act_info);
1400 vop2_win_write(win, VOP2_WIN_DSP_INFO, dsp_info);
1401 vop2_win_write(win, VOP2_WIN_DSP_ST, dest->y1 << 16 | (dest->x1 & 0xffff));
1403 vop2_setup_csc_mode(vp, win, pstate);
1406 vop2_win_write(win, VOP2_WIN_DITHER_UP, dither_up);
1408 vop2_win_write(win, VOP2_WIN_ENABLE, 1);
1410 if (vop2_cluster_window(win)) {
1411 int lb_mode = vop2_get_cluster_lb_mode(win, pstate);
1413 vop2_win_write(win, VOP2_WIN_CLUSTER_LB_MODE, lb_mode);
1414 vop2_win_write(win, VOP2_WIN_CLUSTER_ENABLE, 1);
1911 struct vop2_win *win = to_vop2_win(plane);
1924 seq_printf(s, " %s: %s\n", win->data->name, !pstate ?
1938 seq_printf(s, "\twin_id: %d\n", win->win_id);
2288 static int vop2_plane_init(struct vop2 *vop2, struct vop2_win *win,
2291 const struct vop2_win_data *win_data = win->data;
2297 ret = drm_universal_plane_init(vop2->drm, &win->base, possible_crtcs,
2301 win->type, win_data->name);
2307 drm_plane_helper_add(&win->base, &vop2_plane_helper_funcs);
2309 if (win->data->supported_rotations)
2310 drm_plane_create_rotation_property(&win->base, DRM_MODE_ROTATE_0,
2312 win->data->supported_rotations);
2313 drm_plane_create_alpha_property(&win->base);
2314 drm_plane_create_blend_mode_property(&win->base, blend_caps);
2315 drm_plane_create_zpos_property(&win->base, win->win_id, 0,
2328 static bool vop2_is_mirror_win(struct vop2_win *win)
2330 struct vop2 *vop2 = win->vop2;
2333 switch (win->data->phys_id) {
2354 struct vop2_win *win;
2400 win = &vop2->win[j];
2403 if (win->base.type == DRM_PLANE_TYPE_PRIMARY)
2406 /* If this win can not attached to this VP */
2407 if (!(win->data->possible_vp_mask & BIT(vp->id)))
2410 if (vop2_is_mirror_win(win))
2413 if (win->type == DRM_PLANE_TYPE_PRIMARY) {
2415 vp->primary_plane = win;
2416 ret = vop2_plane_init(vop2, win, possible_crtcs);
2420 win->data->name);
2429 win = &vop2->win[i];
2432 if (win->base.type == DRM_PLANE_TYPE_PRIMARY)
2435 if (vop2_is_mirror_win(win))
2438 win->type = DRM_PLANE_TYPE_OVERLAY;
2448 if (win->data->possible_vp_mask & BIT(vp->id))
2453 ret = vop2_plane_init(vop2, win, possible_crtcs);
2456 win->data->name);
2539 static int vop2_regmap_init(struct vop2_win *win, const struct reg_field *regs,
2542 struct vop2 *vop2 = win->vop2;
2548 regs[i].reg + win->offset : regs[i].reg,
2553 win->reg[i] = devm_regmap_field_alloc(vop2->dev, vop2->map, field);
2554 if (IS_ERR(win->reg[i]))
2555 return PTR_ERR(win->reg[i]);
2564 struct vop2_win *win;
2568 const struct vop2_win_data *win_data = &vop2_data->win[i];
2570 win = &vop2->win[i];
2571 win->data = win_data;
2572 win->type = win_data->type;
2573 win->offset = win_data->base;
2574 win->win_id = i;
2575 win->vop2 = vop2;
2576 if (vop2_cluster_window(win))
2577 ret = vop2_regmap_init(win, vop2->data->cluster_reg,
2580 ret = vop2_regmap_init(win, vop2->data->smart_reg,
2631 alloc_size = struct_size(vop2, win, vop2_data->win_size);