[Mesa-dev] [PATCH 18/22] isl/surface_state: Handle ISL_AUX_USAGE_HIZ
Jason Ekstrand
jason at jlekstrand.net
Thu Jan 12 05:06:17 UTC 2017
On Wed, Jan 11, 2017 at 5:55 PM, Nanley Chery <nanleychery at gmail.com> wrote:
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
> src/intel/isl/isl_surface_state.c | 38 ++++++++++++++++++++++++++++++
> +++++---
> 1 file changed, 35 insertions(+), 3 deletions(-)
>
> diff --git a/src/intel/isl/isl_surface_state.c
> b/src/intel/isl/isl_surface_state.c
> index b9093cc951..54e48eb5da 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -498,11 +498,14 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
> assert(info->y_offset_sa % y_div == 0);
> s.XOffset = info->x_offset_sa / x_div;
> s.YOffset = info->y_offset_sa / y_div;
> -#else
> - assert(info->x_offset_sa == 0);
> - assert(info->y_offset_sa == 0);
> #endif
>
> + /* If Auxiliary Surface Mode is not AUX_NONE, this field must be zero.
> */
> + if ((GEN_GEN == 4 && !GEN_IS_G4X) || info->aux_usage !=
> ISL_AUX_USAGE_NONE) {
> + assert(info->x_offset_sa == 0);
> + assert(info->y_offset_sa == 0);
>
I believe we already handle this higher up.
> + }
> +
> #if GEN_GEN >= 7
> if (info->aux_surf && info->aux_usage != ISL_AUX_USAGE_NONE) {
> struct isl_tile_info tile_info;
> @@ -520,6 +523,26 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
> s.AuxiliarySurfaceQPitch =
> isl_surf_get_array_pitch_sa_rows(info->aux_surf) >> 2;
> s.AuxiliarySurfaceBaseAddress = info->aux_address;
> +
> + if (info->aux_usage == ISL_AUX_USAGE_HIZ) {
> + /* The number of samples must be 1 */
> + assert(info->surf->samples == 1);
> +
> + /* The dimension must not be 3D */
> + assert(info->surf->dim != ISL_SURF_DIM_3D);
> +
> + /* The format must be one of the following: */
> + switch (info->view->format) {
>
How about
assert(info->view->format == ISL_FORMAT_R32_FLOT ||
info->view->format...
Mostly cosmatic. Doesn't really matter.
> + case ISL_FORMAT_R32_FLOAT:
> + case ISL_FORMAT_R24_UNORM_X8_TYPELESS:
> + case ISL_FORMAT_R16_UNORM:
> + break;
> + default:
> + assert(!"Incompatible HiZ Sampling format");
> + break;
> + }
> + }
> +
> s.AuxiliarySurfaceMode = isl_to_gen_aux_mode[info->aux_usage];
> #else
> assert(info->aux_usage == ISL_AUX_USAGE_MCS ||
> @@ -548,6 +571,15 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
> s.SamplerL2BypassModeDisable = true;
> break;
> default:
> + /* From the SKL PRM, Programming Note under Sampler Output
> Channel
> + * Mapping:
> + *
> + * If a surface has an associated HiZ Auxilliary surface, the
> + * Sampler L2 Bypass Mode Disable field in the
> RENDER_SURFACE_STATE
> + * must be set.
> + */
> + if (GEN_GEN >= 9 && info->aux_usage == ISL_AUX_USAGE_HIZ)
> + s.SamplerL2BypassModeDisable = true;
> break;
> }
> }
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170111/0660a6b4/attachment.html>
More information about the mesa-dev
mailing list