freedreno/fdl: Don't pre-shift image view pitch

We'll need the unshifted pitch for doing CPU reads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20304>
This commit is contained in:
Connor Abbott 2022-11-16 16:02:14 +01:00 committed by Marge Bot
parent 012e8f5c61
commit 31a9ac7f4e
3 changed files with 9 additions and 4 deletions

View file

@ -329,6 +329,8 @@ fdl6_view_init(struct fdl6_view *view, const struct fdl_layout **layouts,
!util_format_is_pure_integer(args->format) &&
!util_format_is_depth_or_stencil(args->format);
view->pitch = pitch;
view->SP_PS_2D_SRC_INFO =
A6XX_SP_PS_2D_SRC_INFO_COLOR_FORMAT(storage_format) |
A6XX_SP_PS_2D_SRC_INFO_TILE_MODE(tile_mode) |
@ -345,7 +347,6 @@ fdl6_view_init(struct fdl6_view *view, const struct fdl_layout **layouts,
A6XX_SP_PS_2D_SRC_SIZE_HEIGHT(height);
/* note: these have same encoding for MRT and 2D (except 2D PITCH src) */
view->PITCH = A6XX_RB_DEPTH_BUFFER_PITCH(pitch);
view->FLAG_BUFFER_PITCH =
A6XX_RB_DEPTH_FLAG_BUFFER_PITCH_PITCH(ubwc_pitch) |
A6XX_RB_DEPTH_FLAG_BUFFER_PITCH_ARRAY_PITCH(layout->ubwc_layer_size >> 2);

View file

@ -308,8 +308,9 @@ struct fdl6_view {
*/
uint32_t storage_descriptor[FDL6_TEX_CONST_DWORDS];
uint32_t pitch;
/* pre-filled register values */
uint32_t PITCH;
uint32_t FLAG_BUFFER_PITCH;
uint32_t RB_MRT_BUF_INFO;

View file

@ -118,7 +118,7 @@ tu_is_r8g8_compatible(enum pipe_format format)
void
tu_cs_image_ref(struct tu_cs *cs, const struct fdl6_view *iview, uint32_t layer)
{
tu_cs_emit(cs, iview->PITCH);
tu_cs_emit(cs, A6XX_RB_MRT_PITCH(0, iview->pitch).value);
tu_cs_emit(cs, iview->layer_size >> 6);
tu_cs_emit_qw(cs, iview->base_addr + iview->layer_size * layer);
}
@ -144,7 +144,10 @@ tu_cs_image_ref_2d(struct tu_cs *cs, const struct fdl6_view *iview, uint32_t lay
{
tu_cs_emit_qw(cs, iview->base_addr + iview->layer_size * layer);
/* SP_PS_2D_SRC_PITCH has shifted pitch field */
tu_cs_emit(cs, iview->PITCH << (src ? 9 : 0));
if (src)
tu_cs_emit(cs, A6XX_SP_PS_2D_SRC_PITCH(.pitch = iview->pitch).value);
else
tu_cs_emit(cs, A6XX_RB_2D_DST_PITCH(iview->pitch).value);
}
void