diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 79bde563ae4..9c7c923a831 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -3906,11 +3906,18 @@ isl_surf_get_mcs_surf(const struct isl_device *dev, UNREACHABLE("Invalid sample count"); } + /* isl_genX(surf_fill_state_s) will assert on us if the QPitch is not + * aligned by the main surface's vertical alignment. Align the height of + * the image so that the QPitch follows. + */ + const uint32_t aligned_height = isl_align(surf->logical_level0_px.height, + surf->image_alignment_el.height); + return isl_surf_init(dev, mcs_surf, .dim = ISL_SURF_DIM_2D, .format = mcs_format, .width = surf->logical_level0_px.width, - .height = surf->logical_level0_px.height, + .height = aligned_height, .depth = 1, .levels = 1, .array_len = surf->logical_level0_px.array_len, diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 936885f106d..068f98ff0f7 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -911,8 +911,15 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, * doesn't expect our definition of the compression, it expects qpitch * in units of samples on the main surface. */ - s.AuxiliarySurfaceQPitch = - isl_surf_get_array_pitch_sa_rows(info->aux_surf) >> 2; + uint32_t aux_qpitch = isl_surf_get_array_pitch_sa_rows(info->aux_surf); + + /* From RENDER_SURFACE_STATE::AuxiliarySurfaceQPitch on BDW+, + * + * This field must be set to an integer multiple of the Surface + * Vertical Alignment + */ + assert(aux_qpitch % image_align.h == 0); + s.AuxiliarySurfaceQPitch = aux_qpitch >> 2; #endif } #endif