Mesa (main): v3d: Use u_box_pixels_to_blocks helper
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jan 10 23:44:42 UTC 2022
Module: Mesa
Branch: main
Commit: 6f07159a1df2b32203f506663edf9c0ab4d2ea17
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f07159a1df2b32203f506663edf9c0ab4d2ea17
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Tue Jan 4 16:18:42 2022 -0500
v3d: Use u_box_pixels_to_blocks helper
Rather than open-coding.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14370>
---
src/gallium/drivers/v3d/v3d_resource.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c
index 7719525b1de..bd75b089bb4 100644
--- a/src/gallium/drivers/v3d/v3d_resource.c
+++ b/src/gallium/drivers/v3d/v3d_resource.c
@@ -283,12 +283,7 @@ v3d_resource_transfer_map(struct pipe_context *pctx,
*pptrans = ptrans;
/* Our load/store routines work on entire compressed blocks. */
- ptrans->box.x /= util_format_get_blockwidth(format);
- ptrans->box.y /= util_format_get_blockheight(format);
- ptrans->box.width = DIV_ROUND_UP(ptrans->box.width,
- util_format_get_blockwidth(format));
- ptrans->box.height = DIV_ROUND_UP(ptrans->box.height,
- util_format_get_blockheight(format));
+ u_box_pixels_to_blocks(&ptrans->box, &ptrans->box, format);
struct v3d_resource_slice *slice = &rsc->slices[level];
if (rsc->tiled) {
More information about the mesa-commit
mailing list