From: Mark Yao Date: Tue, 21 Jun 2016 06:26:54 +0000 (+0800) Subject: drm/rockchip: fix vop value mask X-Git-Tag: firefly_0821_release~2260 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=15780585a72f25f91dffb412b46698acbe8c7537;p=firefly-linux-kernel-4.4.55.git drm/rockchip: fix vop value mask Change-Id: Iedfb871f2909a427ca97f3014f4b0e0b565d06f0 Signed-off-by: Mark Yao --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c816b3db4b28..181c582a71a4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -191,11 +191,11 @@ static inline void vop_mask_write(struct vop *vop, uint32_t offset, return; if (write_mask) { - v = (v << shift) | (mask << (shift + 16)); + v = ((v & mask) << shift) | (mask << (shift + 16)); } else { uint32_t cached_val = vop->regsbak[offset >> 2]; - v = (cached_val & ~(mask << shift)) | (v << shift); + v = (cached_val & ~(mask << shift)) | ((v & mask) << shift); vop->regsbak[offset >> 2] = v; }