Skip to content

Commit ac6560d

Browse files
author
Mark yao
committed
drm/rockchip: vop: move line_flag_num to interrupt registers
In the hardware design process, the design of line flags register is associated with the interrupt register, placing the line flags in the interrupt definition is more reasonable, and it would make multi-vop define easilier. Signed-off-by: Mark Yao <[email protected]> Reviewed-by: Sean Paul <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 9548e1b commit ac6560d

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@
6161
#define VOP_INTR_GET(vop, name) \
6262
vop_read_reg(vop, 0, &vop->data->ctrl->name)
6363

64-
#define VOP_INTR_SET(vop, name, mask, v) \
64+
#define VOP_INTR_SET(vop, name, v) \
65+
REG_SET(vop, 0, vop->data->intr->name, v)
66+
67+
#define VOP_INTR_SET_MASK(vop, name, mask, v) \
6568
REG_SET_MASK(vop, 0, vop->data->intr->name, mask, v)
69+
6670
#define VOP_INTR_SET_TYPE(vop, name, type, v) \
6771
do { \
6872
int i, reg = 0, mask = 0; \
@@ -72,7 +76,7 @@
7276
mask |= 1 << i; \
7377
} \
7478
} \
75-
VOP_INTR_SET(vop, name, mask, reg); \
79+
VOP_INTR_SET_MASK(vop, name, mask, reg); \
7680
} while (0)
7781
#define VOP_INTR_GET_TYPE(vop, name, type) \
7882
vop_get_intr_type(vop, &vop->data->intr->name, type)
@@ -984,7 +988,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc,
984988
VOP_CTRL_SET(vop, vact_st_end, val);
985989
VOP_CTRL_SET(vop, vpost_st_end, val);
986990

987-
VOP_CTRL_SET(vop, line_flag_num[0], vact_end);
991+
VOP_INTR_SET(vop, line_flag_num[0], vact_end);
988992

989993
clk_set_rate(vop->dclk, adjusted_mode->clock * 1000);
990994

drivers/gpu/drm/rockchip/rockchip_drm_vop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ struct vop_ctrl {
6060
struct vop_reg hpost_st_end;
6161
struct vop_reg vpost_st_end;
6262

63-
struct vop_reg line_flag_num[2];
64-
6563
struct vop_reg global_regdone_en;
6664
struct vop_reg cfg_done;
6765
};
6866

6967
struct vop_intr {
7068
const int *intrs;
7169
uint32_t nintrs;
70+
71+
struct vop_reg line_flag_num[2];
7272
struct vop_reg enable;
7373
struct vop_reg clear;
7474
struct vop_reg status;

drivers/gpu/drm/rockchip/rockchip_vop_reg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ static const int rk3036_vop_intrs[] = {
116116
static const struct vop_intr rk3036_intr = {
117117
.intrs = rk3036_vop_intrs,
118118
.nintrs = ARRAY_SIZE(rk3036_vop_intrs),
119+
.line_flag_num[0] = VOP_REG(RK3036_INT_STATUS, 0xfff, 12),
119120
.status = VOP_REG(RK3036_INT_STATUS, 0xf, 0),
120121
.enable = VOP_REG(RK3036_INT_STATUS, 0xf, 4),
121122
.clear = VOP_REG(RK3036_INT_STATUS, 0xf, 8),
@@ -130,7 +131,6 @@ static const struct vop_ctrl rk3036_ctrl_data = {
130131
.hact_st_end = VOP_REG(RK3036_DSP_HACT_ST_END, 0x1fff1fff, 0),
131132
.vtotal_pw = VOP_REG(RK3036_DSP_VTOTAL_VS_END, 0x1fff1fff, 0),
132133
.vact_st_end = VOP_REG(RK3036_DSP_VACT_ST_END, 0x1fff1fff, 0),
133-
.line_flag_num[0] = VOP_REG(RK3036_INT_STATUS, 0xfff, 12),
134134
.cfg_done = VOP_REG_SYNC(RK3036_REG_CFG_DONE, 0x1, 0),
135135
};
136136

@@ -226,7 +226,6 @@ static const struct vop_ctrl rk3288_ctrl_data = {
226226
.vact_st_end = VOP_REG(RK3288_DSP_VACT_ST_END, 0x1fff1fff, 0),
227227
.hpost_st_end = VOP_REG(RK3288_POST_DSP_HACT_INFO, 0x1fff1fff, 0),
228228
.vpost_st_end = VOP_REG(RK3288_POST_DSP_VACT_INFO, 0x1fff1fff, 0),
229-
.line_flag_num[0] = VOP_REG(RK3288_INTR_CTRL0, 0x1fff, 12),
230229
.global_regdone_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 11),
231230
.cfg_done = VOP_REG_SYNC(RK3288_REG_CFG_DONE, 0x1, 0),
232231
};
@@ -258,6 +257,7 @@ static const int rk3288_vop_intrs[] = {
258257
static const struct vop_intr rk3288_vop_intr = {
259258
.intrs = rk3288_vop_intrs,
260259
.nintrs = ARRAY_SIZE(rk3288_vop_intrs),
260+
.line_flag_num[0] = VOP_REG(RK3288_INTR_CTRL0, 0x1fff, 12),
261261
.status = VOP_REG(RK3288_INTR_CTRL0, 0xf, 0),
262262
.enable = VOP_REG(RK3288_INTR_CTRL0, 0xf, 4),
263263
.clear = VOP_REG(RK3288_INTR_CTRL0, 0xf, 8),
@@ -294,8 +294,6 @@ static const struct vop_ctrl rk3399_ctrl_data = {
294294
.vact_st_end = VOP_REG(RK3399_DSP_VACT_ST_END, 0x1fff1fff, 0),
295295
.hpost_st_end = VOP_REG(RK3399_POST_DSP_HACT_INFO, 0x1fff1fff, 0),
296296
.vpost_st_end = VOP_REG(RK3399_POST_DSP_VACT_INFO, 0x1fff1fff, 0),
297-
.line_flag_num[0] = VOP_REG(RK3399_LINE_FLAG, 0xffff, 0),
298-
.line_flag_num[1] = VOP_REG(RK3399_LINE_FLAG, 0xffff, 16),
299297
.cfg_done = VOP_REG_MASK_SYNC(RK3399_REG_CFG_DONE, 0x1, 0),
300298
};
301299

@@ -312,6 +310,8 @@ static const int rk3399_vop_intrs[] = {
312310
static const struct vop_intr rk3399_vop_intr = {
313311
.intrs = rk3399_vop_intrs,
314312
.nintrs = ARRAY_SIZE(rk3399_vop_intrs),
313+
.line_flag_num[0] = VOP_REG(RK3399_LINE_FLAG, 0xffff, 0),
314+
.line_flag_num[1] = VOP_REG(RK3399_LINE_FLAG, 0xffff, 16),
315315
.status = VOP_REG_MASK_SYNC(RK3399_INTR_STATUS0, 0xffff, 0),
316316
.enable = VOP_REG_MASK_SYNC(RK3399_INTR_EN0, 0xffff, 0),
317317
.clear = VOP_REG_MASK_SYNC(RK3399_INTR_CLEAR0, 0xffff, 0),

0 commit comments

Comments
 (0)