Re: [PATCH v5 2/7] drm/rockchip: vop: move write_relaxed flags to vop register

From: Mark yao
Date: Wed Jul 26 2017 - 02:17:37 EST


On 2017å07æ26æ 05:47, Heiko Stuebner wrote:
Hi Mark,

Am Donnerstag, 20. Juli 2017, 10:43:27 CEST schrieb Mark Yao:
Since the drm atomic framework, only a small part of the vop
register needs sync write, Currently seems only following registers
need sync write:
cfg_done, standby and interrupt related register.

All ctrl registers are using the sync write method that is
inefficient, hardcode the write_relaxed flags to vop registers,
then can only do synchronize write for those actual needed register.

Signed-off-by: Mark Yao <mark.yao@xxxxxxxxxxxxxx>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 +++-------
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 42 ++++++++++++++++-------------
2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 81164d6..784a2b7 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -42,18 +42,12 @@
#include "rockchip_drm_psr.h"
#include "rockchip_drm_vop.h"
-#define __REG_SET_RELAXED(x, off, mask, shift, v, write_mask) \
- vop_mask_write(x, off, mask, shift, v, write_mask, true)
-
-#define __REG_SET_NORMAL(x, off, mask, shift, v, write_mask) \
- vop_mask_write(x, off, mask, shift, v, write_mask, false)
-
#define REG_SET(x, base, reg, v, mode) \
- __REG_SET_##mode(x, base + reg.offset, \
- reg.mask, reg.shift, v, reg.write_mask)
+ vop_mask_write(x, base + reg.offset, reg.mask, reg.shift, \
+ v, reg.write_mask, reg.relaxed)
#define REG_SET_MASK(x, base, reg, mask, v, mode) \
- __REG_SET_##mode(x, base + reg.offset, \
- mask, reg.shift, v, reg.write_mask)
+ vop_mask_write(x, base + reg.offset, \
+ mask, reg.shift, v, reg.write_mask, reg.relaxed)
you only introduce the relaxed element of struct vop_reg in patch4.
So using it here produces a compile error

../drivers/gpu/drm/rockchip/rockchip_drm_vop.c: In function âvop_cfg_doneâ:
../drivers/gpu/drm/rockchip/rockchip_drm_vop.c:47:33: error: âconst struct vop_regâ has no member named ârelaxedâ
v, reg.write_mask, reg.relaxed)
^
../drivers/gpu/drm/rockchip/rockchip_drm_vop.c:59:3: note: in expansion of macro âREG_SETâ
REG_SET(x, 0, (x)->data->ctrl->name, v, NORMAL)
^~~~~~~
../drivers/gpu/drm/rockchip/rockchip_drm_vop.c:201:2: note: in expansion of macro âVOP_CTRL_SETâ
VOP_CTRL_SET(vop, cfg_done, 1);
^~~~~~~~~~~~

when only patches 1+2 are applied. So the relaxed field addition should
definitly move into this patch to not break bisectability.


Heiko




Hi Heiko

Thanks for the test, will fix it at next version.

--
ïark Yao