diff options
author | Jason Ekstrand <[email protected]> | 2017-05-18 14:00:48 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-06-01 15:33:56 -0700 |
commit | b178762d051bad0f373631908b8ce7b5e9ba8d05 (patch) | |
tree | e56e69a28dd50f313eec094643403066b45fb8e6 /src/intel/isl | |
parent | 757f7087a5d9b106767220393772043ba70c157b (diff) |
intel/isl: Make get_intratile_offset_el take the element size in bits
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/isl')
-rw-r--r-- | src/intel/isl/isl.c | 7 | ||||
-rw-r--r-- | src/intel/isl/isl.h | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 1227238b186..fb4e170bfc0 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -2147,7 +2147,7 @@ isl_surf_get_image_offset_el(const struct isl_surf *surf, void isl_tiling_get_intratile_offset_el(enum isl_tiling tiling, - uint8_t bs, + uint32_t bpb, uint32_t row_pitch, uint32_t total_x_offset_el, uint32_t total_y_offset_el, @@ -2156,15 +2156,14 @@ isl_tiling_get_intratile_offset_el(enum isl_tiling tiling, uint32_t *y_offset_el) { if (tiling == ISL_TILING_LINEAR) { + assert(bpb % 8 == 0); *base_address_offset = total_y_offset_el * row_pitch + - total_x_offset_el * bs; + total_x_offset_el * (bpb / 8); *x_offset_el = 0; *y_offset_el = 0; return; } - const uint32_t bpb = bs * 8; - struct isl_tile_info tile_info; isl_tiling_get_info(tiling, bpb, &tile_info); diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index 4bb3de78973..8b2d264f8b2 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -1601,7 +1601,7 @@ isl_surf_get_image_offset_el(const struct isl_surf *surf, */ void isl_tiling_get_intratile_offset_el(enum isl_tiling tiling, - uint8_t bs, + uint32_t bpb, uint32_t row_pitch, uint32_t total_x_offset_el, uint32_t total_y_offset_el, @@ -1621,8 +1621,6 @@ isl_tiling_get_intratile_offset_sa(enum isl_tiling tiling, { const struct isl_format_layout *fmtl = isl_format_get_layout(format); - assert(fmtl->bpb % 8 == 0); - /* For computing the intratile offsets, we actually want a strange unit * which is samples for multisampled surfaces but elements for compressed * surfaces. @@ -1632,7 +1630,7 @@ isl_tiling_get_intratile_offset_sa(enum isl_tiling tiling, const uint32_t total_x_offset = total_x_offset_sa / fmtl->bw; const uint32_t total_y_offset = total_y_offset_sa / fmtl->bh; - isl_tiling_get_intratile_offset_el(tiling, fmtl->bpb / 8, row_pitch, + isl_tiling_get_intratile_offset_el(tiling, fmtl->bpb, row_pitch, total_x_offset, total_y_offset, base_address_offset, x_offset_sa, y_offset_sa); |