Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1699866 > unrolled thread

[PATCH 4/6] drm/rockchip: vop: round_up pitches to word align

Started byMark Yao <mark.yao@rock-chips.com>
First post2017-07-31 12:00 +0200
Last post2017-08-04 03:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/6] drm/rockchip: vop: round_up pitches to word align Mark Yao <mark.yao@rock-chips.com> - 2017-07-31 12:00 +0200
    Re: [PATCH 4/6] drm/rockchip: vop: round_up pitches to word align Sandy Huang <sandy.huang@rock-chips.com> - 2017-08-04 03:00 +0200

#1699866 — [PATCH 4/6] drm/rockchip: vop: round_up pitches to word align

FromMark Yao <mark.yao@rock-chips.com>
Date2017-07-31 12:00 +0200
Subject[PATCH 4/6] drm/rockchip: vop: round_up pitches to word align
Message-ID<u9fEt-4EG-5@gated-at.bofh.it>
VOP pitch register is word align, need align to word.

VOP_WIN0_VIR:
  bit[31:16] win0_vir_stride_uv
    Number of words of Win0 uv Virtual width
  bit[15:0] win0_vir_width
    Number of words of Win0 yrgb Virtual width
    ARGB888 : win0_vir_width
    RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3)
    RGB565 : ceil(win0_vir_width/2)
    YUV : ceil(win0_vir_width/4)

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 0b5fd75..fa0d9f7 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -756,7 +756,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
 	spin_lock(&vop->reg_lock);
 
 	VOP_WIN_SET(vop, win, format, format);
-	VOP_WIN_SET(vop, win, yrgb_vir, fb->pitches[0] >> 2);
+	VOP_WIN_SET(vop, win, yrgb_vir, DIV_ROUND_UP(fb->pitches[0], 4));
 	VOP_WIN_SET(vop, win, yrgb_mst, dma_addr);
 	if (is_yuv_support(fb->format->format)) {
 		int hsub = drm_format_horz_chroma_subsampling(fb->format->format);
@@ -770,7 +770,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
 		offset += (src->y1 >> 16) * fb->pitches[1] / vsub;
 
 		dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1];
-		VOP_WIN_SET(vop, win, uv_vir, fb->pitches[1] >> 2);
+		VOP_WIN_SET(vop, win, uv_vir, DIV_ROUND_UP(fb->pitches[1], 4));
 		VOP_WIN_SET(vop, win, uv_mst, dma_addr);
 	}
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1703568

FromSandy Huang <sandy.huang@rock-chips.com>
Date2017-08-04 03:00 +0200
Message-ID<uaz85-7YP-3@gated-at.bofh.it>
In reply to#1699866

在 2017/7/31 17:49, Mark Yao 写道:
> VOP pitch register is word align, need align to word.
> 
> VOP_WIN0_VIR:
>    bit[31:16] win0_vir_stride_uv
>      Number of words of Win0 uv Virtual width
>    bit[15:0] win0_vir_width
>      Number of words of Win0 yrgb Virtual width
>      ARGB888 : win0_vir_width
>      RGB888 : (win0_vir_width*3/4) + (win0_vir_width%3)
>      RGB565 : ceil(win0_vir_width/2)
>      YUV : ceil(win0_vir_width/4)
> 
> Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Sandy huang <sandy.huang@rock-chips.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web