From: Mark yao <mark.yao@rock-chips.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
David Airlie <airlied@linux.ie>, Heiko Stuebner <heiko@sntech.de>,
Daniel Kurtz <djkurtz@chromium.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Daniel Vetter <daniel@ffwll.ch>, Rob Clark <robdclark@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <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
Date: Thu, 02 Jul 2015 14:13:11 +0800 [thread overview]
Message-ID: <5594D677.20202@rock-chips.com> (raw)
In-Reply-To: <CAAFQd5B-W2uWFXo9me_MPdp0LDp0CK+mG6Rsbro9+JQSUBA4bw@mail.gmail.com>
On 2015年07月02日 12:59, Tomasz Figa wrote:
> On Fri, Jun 26, 2015 at 7:07 PM, Mark Yao <mark.yao@rock-chips.com> 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 <mark.yao@rock-chips.com>
>> ---
>> 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
next prev parent reply other threads:[~2015-07-02 6:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 10:07 [PATCH v2 0/5] drm/rockchip: support yuv overlay and plane scale Mark Yao
2015-06-26 10:07 ` [PATCH v2 1/5] drm/rockchip: vop: optimize virtual stride calculate Mark Yao
2015-07-02 4:59 ` Tomasz Figa
2015-07-02 6:13 ` Mark yao [this message]
2015-06-26 10:07 ` [PATCH v2 2/5] drm/rockchip: vop: fix yuv plane support Mark Yao
2015-07-02 6:00 ` Tomasz Figa
2015-07-02 6:53 ` Mark yao
2015-07-02 7:07 ` Tomasz Figa
2015-06-26 10:07 ` [PATCH v2 3/5] drm/rockchip: vop: support plane scale Mark Yao
2015-07-03 7:46 ` Tomasz Figa
2015-07-03 9:17 ` Mark yao
2015-07-03 9:58 ` Tomasz Figa
2015-07-03 10:14 ` Russell King - ARM Linux
2015-07-03 10:22 ` Mark yao
2015-07-03 14:37 ` Tomasz Figa
2015-06-26 10:07 ` [PATCH v2 4/5] drm/rockchip: vop: switch cursor plane to window 3 Mark Yao
2015-07-03 7:55 ` Tomasz Figa
2015-07-21 7:38 ` Tomasz Figa
2015-06-26 10:10 ` [PATCH v2 5/5] drm/rockchip: default enable win2/3 area0 bit Mark Yao
2015-07-03 8:02 ` Tomasz Figa
2015-07-03 8:19 ` Mark yao
2015-07-03 9:24 ` Tomasz Figa
2015-07-03 10:08 ` Mark yao
2015-07-21 7:33 ` Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5594D677.20202@rock-chips.com \
--to=mark.yao@rock-chips.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=djkurtz@chromium.org \
--cc=dkm@rock-chips.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=robdclark@gmail.com \
--cc=sandy.huang@rock-chips.com \
--cc=tfiga@chromium.org \
--cc=xw@rock-chips.com \
--cc=zwl@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox