[v3] broadcom/vc4: Expand width of dst surface

Submitted by Zhaowei Yuan on Sept. 3, 2019, 2:58 a.m.

Details

Message ID 1567479539-1060-1-git-send-email-zhaowei.yuan@samsung.com
State New
Headers show
Series "broadcom/vc4: Expand width of dst surface" ( rev: 3 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhaowei Yuan Sept. 3, 2019, 2:58 a.m.
Four bytes of src_surf will be compressed into a 32-bits data
and stored into dst_surf, and dst_surf is read as z-order,so
its width must be aligned to multiples of 8(4x2) before divided
by 2.

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111266
---
 src/gallium/drivers/vc4/vc4_blit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/vc4/vc4_blit.c b/src/gallium/drivers/vc4/vc4_blit.c
index d3cc515..d379bcc 100644
--- a/src/gallium/drivers/vc4/vc4_blit.c
+++ b/src/gallium/drivers/vc4/vc4_blit.c
@@ -360,7 +360,7 @@  vc4_yuv_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
                 util_blitter_unset_running_flag(vc4->blitter);
                 return false;
         }
-        dst_surf->width /= 2;
+        dst_surf->width = align(dst_surf->width, 8) / 2;
         if (dst->cpp == 1)
                 dst_surf->height /= 2;
 

Comments

I used git send-email to send this patch to mailing list and cc you, but 
your email address is not in the cc list finally, so I forward it to  
you again

On 2019/9/3 10:58 AM, Zhaowei Yuan wrote:
> Four bytes of src_surf will be compressed into a 32-bits data
> and stored into dst_surf, and dst_surf is read as z-order,so
> its width must be aligned to multiples of 8(4x2) before divided
> by 2.
>
> Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111266
> ---
>   src/gallium/drivers/vc4/vc4_blit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/vc4/vc4_blit.c b/src/gallium/drivers/vc4/vc4_blit.c
> index d3cc515..d379bcc 100644
> --- a/src/gallium/drivers/vc4/vc4_blit.c
> +++ b/src/gallium/drivers/vc4/vc4_blit.c
> @@ -360,7 +360,7 @@ vc4_yuv_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
>                   util_blitter_unset_running_flag(vc4->blitter);
>                   return false;
>           }
> -        dst_surf->width /= 2;
> +        dst_surf->width = align(dst_surf->width, 8) / 2;
>           if (dst->cpp == 1)
>                   dst_surf->height /= 2;
>
Just pushed, thanks for the patch.

On 3/9/19 4:58, Zhaowei Yuan wrote:
> Four bytes of src_surf will be compressed into a 32-bits data
> and stored into dst_surf, and dst_surf is read as z-order,so
> its width must be aligned to multiples of 8(4x2) before divided
> by 2.
>
> Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111266
> ---
>   src/gallium/drivers/vc4/vc4_blit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/vc4/vc4_blit.c b/src/gallium/drivers/vc4/vc4_blit.c
> index d3cc515..d379bcc 100644
> --- a/src/gallium/drivers/vc4/vc4_blit.c
> +++ b/src/gallium/drivers/vc4/vc4_blit.c
> @@ -360,7 +360,7 @@ vc4_yuv_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
>                   util_blitter_unset_running_flag(vc4->blitter);
>                   return false;
>           }
> -        dst_surf->width /= 2;
> +        dst_surf->width = align(dst_surf->width, 8) / 2;
>           if (dst->cpp == 1)
>                   dst_surf->height /= 2;
>