Skip to content

Commit cd9e894

Browse files
committed
drm/rockchip: Support AFBC on all big VOP planes
1 parent db216b3 commit cd9e894

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

drivers/gpu/drm/rockchip/rockchip_vop_reg.c

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ static const uint64_t format_modifiers_win_lite[] = {
9494
DRM_FORMAT_MOD_INVALID,
9595
};
9696

97+
static const uint64_t format_modifiers_win_lite_afbc[] = {
98+
ROCKCHIP_AFBC_MOD,
99+
DRM_FORMAT_MOD_LINEAR,
100+
DRM_FORMAT_MOD_INVALID,
101+
};
102+
97103
static const struct vop_scl_regs rk3036_win_scl = {
98104
.scale_yrgb_x = VOP_REG(RK3036_WIN0_SCL_FACTOR_YRGB, 0xffff, 0x0),
99105
.scale_yrgb_y = VOP_REG(RK3036_WIN0_SCL_FACTOR_YRGB, 0xffff, 16),
@@ -900,19 +906,35 @@ static const struct vop_win_phy rk3399_win01_data = {
900906
.dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0),
901907
};
902908

909+
static const struct vop_win_phy rk3399_win23_data = {
910+
.data_formats = formats_win_lite,
911+
.nformats = ARRAY_SIZE(formats_win_lite),
912+
.format_modifiers = format_modifiers_win_lite_afbc,
913+
.enable = VOP_REG(RK3288_WIN2_CTRL0, 0x1, 4),
914+
.gate = VOP_REG(RK3288_WIN2_CTRL0, 0x1, 0),
915+
.format = VOP_REG(RK3288_WIN2_CTRL0, 0x7, 1),
916+
.rb_swap = VOP_REG(RK3288_WIN2_CTRL0, 0x1, 12),
917+
.dsp_info = VOP_REG(RK3288_WIN2_DSP_INFO0, 0x0fff0fff, 0),
918+
.dsp_st = VOP_REG(RK3288_WIN2_DSP_ST0, 0x1fff1fff, 0),
919+
.yrgb_mst = VOP_REG(RK3288_WIN2_MST0, 0xffffffff, 0),
920+
.yrgb_vir = VOP_REG(RK3288_WIN2_VIR0_1, 0x1fff, 0),
921+
.src_alpha_ctl = VOP_REG(RK3288_WIN2_SRC_ALPHA_CTRL, 0xff, 0),
922+
.dst_alpha_ctl = VOP_REG(RK3288_WIN2_DST_ALPHA_CTRL, 0xff, 0),
923+
};
924+
903925
/*
904926
* rk3399 vop big windows register layout is same as rk3288, but we
905927
* have a separate rk3399 win data array here so that we can advertise
906-
* AFBC on the primary plane.
928+
* AFBC.
907929
*/
908930
static const struct vop_win_data rk3399_vop_win_data[] = {
909931
{ .base = 0x00, .phy = &rk3399_win01_data,
910932
.type = DRM_PLANE_TYPE_PRIMARY },
911-
{ .base = 0x40, .phy = &rk3288_win01_data,
933+
{ .base = 0x40, .phy = &rk3399_win01_data,
912934
.type = DRM_PLANE_TYPE_OVERLAY },
913-
{ .base = 0x00, .phy = &rk3288_win23_data,
935+
{ .base = 0x00, .phy = &rk3399_win23_data,
914936
.type = DRM_PLANE_TYPE_OVERLAY },
915-
{ .base = 0x50, .phy = &rk3288_win23_data,
937+
{ .base = 0x50, .phy = &rk3399_win23_data,
916938
.type = DRM_PLANE_TYPE_CURSOR },
917939
};
918940

0 commit comments

Comments
 (0)