From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812AbbGBGNd (ORCPT ); Thu, 2 Jul 2015 02:13:33 -0400 Received: from regular1.263xmail.com ([211.150.99.140]:58080 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbbGBGNZ (ORCPT ); Thu, 2 Jul 2015 02:13:25 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: mark.yao@rock-chips.com X-FST-TO: tfiga@chromium.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: mark.yao@rock-chips.com X-UNIQUE-TAG: <7de987a06897cfaf2471e40cd70c02e6> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5594D677.20202@rock-chips.com> Date: Thu, 02 Jul 2015 14:13:11 +0800 From: Mark yao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Tomasz Figa CC: dri-devel , David Airlie , Heiko Stuebner , Daniel Kurtz , Philipp Zabel , Daniel Vetter , Rob Clark , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Rockchip SoC..." , "linux-kernel@vger.kernel.org" , sandy.huang@rock-chips.com, dkm@rock-chips.com, zwl@rock-chips.com, xw@rock-chips.com Subject: Re: [PATCH v2 1/5] drm/rockchip: vop: optimize virtual stride calculate References: <1435313249-4549-1-git-send-email-mark.yao@rock-chips.com> <1435313249-4549-2-git-send-email-mark.yao@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015年07月02日 12:59, Tomasz Figa wrote: > On Fri, Jun 26, 2015 at 7:07 PM, Mark Yao wrote: >> vir_stride need number words of the virtual width, and fb->pitches >> save bytes_per_pixel, so just div 4 switch to stride. >> >> Signed-off-by: Mark Yao >> --- >> Changes in v2: None >> >> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c >> index 6188221..3c9f4f3 100644 >> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c >> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c >> @@ -644,7 +644,7 @@ static int vop_update_plane_event(struct drm_plane *plane, >> offset += (src.y1 >> 16) * fb->pitches[0]; >> yrgb_mst = rk_obj->dma_addr + offset; >> >> - y_vir_stride = fb->pitches[0] / (fb->bits_per_pixel >> 3); >> + y_vir_stride = fb->pitches[0] >> 2; > If the unit of y_vir_stride is words then doesn't it mean that the > calculation before this patch was just invalid? If yes, shouldn't the > subject actually say "Fix virtual stride calculation"? > > Best regards, > Tomasz > > > Hi Tomasz the calculation thinking before is that: fb->pitches[0] = surface_width * bytes_per_pixel surface_width = fb->pitches[0] / bytes_per_pixel = fb->pitches[0] / (fb->bits_per_pixel >> 3) means that "y_vir_stride = surface_width", ARGB888 one pixel is word size, So that is right for ARGB888, but wrong for other formats. You are right, subject say "Fix virtual stride calculation" is suitable. Best regards, -- Mark Yao