diff options
author | Jason Ekstrand <[email protected]> | 2017-08-10 10:43:46 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-09-20 17:21:06 -0700 |
commit | f395d0abc835c16e4fcea97086183660910af000 (patch) | |
tree | e8c236ad916e02ef87265e99bd1eb3e97ce77404 /src/intel/blorp | |
parent | 1e5fd2f839187c647b7cbb7256d6c950b219eba3 (diff) |
intel/blorp: Internally expose surf_convert_to_uncompressed
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/blorp')
-rw-r--r-- | src/intel/blorp/blorp_blit.c | 29 | ||||
-rw-r--r-- | src/intel/blorp/blorp_priv.h | 5 |
2 files changed, 21 insertions, 13 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 9c921cc044d..11c2116a758 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -2325,11 +2325,11 @@ bitcast_color_value_to_uint(union isl_color_value color, return bits; } -static void -surf_convert_to_uncompressed(const struct isl_device *isl_dev, - struct brw_blorp_surface_info *info, - uint32_t *x, uint32_t *y, - uint32_t *width, uint32_t *height) +void +blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev, + struct brw_blorp_surface_info *info, + uint32_t *x, uint32_t *y, + uint32_t *width, uint32_t *height) { const struct isl_format_layout *fmtl = isl_format_get_layout(info->surf.format); @@ -2356,10 +2356,12 @@ surf_convert_to_uncompressed(const struct isl_device *isl_dev, *height = DIV_ROUND_UP(*height, fmtl->bh); } - assert(*x % fmtl->bw == 0); - assert(*y % fmtl->bh == 0); - *x /= fmtl->bw; - *y /= fmtl->bh; + if (x || y) { + assert(*x % fmtl->bw == 0); + assert(*y % fmtl->bh == 0); + *x /= fmtl->bw; + *y /= fmtl->bh; + } info->surf.logical_level0_px.width = DIV_ROUND_UP(info->surf.logical_level0_px.width, fmtl->bw); @@ -2477,14 +2479,15 @@ blorp_copy(struct blorp_batch *batch, isl_format_get_layout(params.dst.view.format)->channels.r.bits; if (src_fmtl->bw > 1 || src_fmtl->bh > 1) { - surf_convert_to_uncompressed(batch->blorp->isl_dev, ¶ms.src, - &src_x, &src_y, &src_width, &src_height); + blorp_surf_convert_to_uncompressed(batch->blorp->isl_dev, ¶ms.src, + &src_x, &src_y, + &src_width, &src_height); wm_prog_key.need_src_offset = true; } if (dst_fmtl->bw > 1 || dst_fmtl->bh > 1) { - surf_convert_to_uncompressed(batch->blorp->isl_dev, ¶ms.dst, - &dst_x, &dst_y, NULL, NULL); + blorp_surf_convert_to_uncompressed(batch->blorp->isl_dev, ¶ms.dst, + &dst_x, &dst_y, NULL, NULL); wm_prog_key.need_dst_offset = true; } diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h index 81bf8c66c66..7bbf0f04c20 100644 --- a/src/intel/blorp/blorp_priv.h +++ b/src/intel/blorp/blorp_priv.h @@ -74,6 +74,11 @@ brw_blorp_surface_info_init(struct blorp_context *blorp, void blorp_surf_convert_to_single_slice(const struct isl_device *isl_dev, struct brw_blorp_surface_info *info); +void +blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev, + struct brw_blorp_surface_info *info, + uint32_t *x, uint32_t *y, + uint32_t *width, uint32_t *height); struct brw_blorp_coord_transform |