[Mesa-dev] [PATCH 41/43] i965: Round copy size to the nearest block in intel_miptree_copy

Kenneth Graunke kenneth at whitecape.org
Fri May 26 07:59:12 UTC 2017


On Tuesday, May 16, 2017 3:45:35 PM PDT Jason Ekstrand wrote:
> The width and height of the copy don't have to be aligned to the block
> size if they specify the right or bottom edges of the image.  (See also
> the comment and asserts right above).  We need to round them up when we
> do the division in order to get it 100% right.
> 
> Cc: "17.0 17.1" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/drivers/dri/i965/intel_blit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
> index 568ed54..2925fc2 100644
> --- a/src/mesa/drivers/dri/i965/intel_blit.c
> +++ b/src/mesa/drivers/dri/i965/intel_blit.c
> @@ -411,8 +411,8 @@ intel_miptree_copy(struct brw_context *brw,
>  
>        src_x /= (int)bw;
>        src_y /= (int)bh;
> -      src_width /= (int)bw;
> -      src_height /= (int)bh;
> +      src_width = DIV_ROUND_UP(src_width, (int)bw);
> +      src_height = DIV_ROUND_UP(src_height, (int)bh);
>     }
>     src_x += src_image_x;
>     src_y += src_image_y;
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170526/6bd4af5a/attachment.sig>


More information about the mesa-dev mailing list