<p dir="ltr"></p>
<p dir="ltr">On Sep 5, 2016 10:39 PM, "Pohjolainen, Topi" <<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>> wrote:<br>
><br>
> On Fri, Sep 02, 2016 at 03:50:42PM -0700, Jason Ekstrand wrote:<br>
> > ---<br>
> > src/intel/isl/isl.h | 2 ++<br>
> > src/intel/isl/isl_format.c | 30 ++++++++++++++++++++++++++++++<br>
> > src/intel/isl/isl_gen6.c | 19 +------------------<br>
> > src/intel/isl/isl_gen7.c | 16 +---------------<br>
> > src/intel/isl/isl_gen8.c | 4 +---<br>
> > 5 files changed, 35 insertions(+), 36 deletions(-)<br>
> ><br>
> > diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h<br>
> > index ecedc05..cb7c22d 100644<br>
> > --- a/src/intel/isl/isl.h<br>
> > +++ b/src/intel/isl/isl.h<br>
> > @@ -989,6 +989,8 @@ bool isl_format_supports_vertex_fetch(const struct brw_device_info *devinfo,<br>
> > enum isl_format format);<br>
> > bool isl_format_supports_lossless_compression(const struct brw_device_info *devinfo,<br>
> > enum isl_format format);<br>
> > +bool isl_format_supports_multisampling(const struct brw_device_info *devinfo,<br>
> > + enum isl_format format);<br>
> ><br>
> > bool isl_format_has_unorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;<br>
> > bool isl_format_has_snorm_channel(enum isl_format fmt) ATTRIBUTE_CONST;<br>
> > diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c<br>
> > index 8507cc5..5d43fe7 100644<br>
> > --- a/src/intel/isl/isl_format.c<br>
> > +++ b/src/intel/isl/isl_format.c<br>
> > @@ -429,6 +429,36 @@ isl_format_supports_lossless_compression(const struct brw_device_info *devinfo,<br>
> > return format_gen(devinfo) >= format_info[format].lossless_compression;<br>
> > }<br>
> ><br>
> > +bool<br>
> > +isl_format_supports_multisampling(const struct brw_device_info *devinfo,<br>
> > + enum isl_format format)<br>
> > +{<br>
> > + /* From the Sandybridge PRM, Volume 4 Part 1 p72, SURFACE_STATE, Surface<br>
> > + * Format:<br>
> > + *<br>
> > + * If Number of Multisamples is set to a value other than<br>
> > + * MULTISAMPLECOUNT_1, this field cannot be set to the following<br>
> > + * formats:<br>
> > + *<br>
> > + * - any format with greater than 64 bits per element<br>
> > + * - any compressed texture format (BC*)<br>
> > + * - any YCRCB* format<br>
> > + *<br>
> > + * The restriction on the format's size is removed on Broadwell. Also,<br>
> > + * there is an exception for HiZ which we treat as a compressed format and<br>
> > + * is allowed to be multisampled on Broadwell and earlier.<br>
> > + */<br>
> > + if (devinfo->gen < 8 && isl_format_get_layout(format)->bpb > 64) {<br>
> > + return false;<br>
> > + } else if (isl_format_is_compressed(format)) {<br>
> > + return false;<br>
><br>
> I'm merely studying here a little while waiting for jenkins: HiZ case hits<br>
> this condition with ISL_TXC_HIZ. Where is the exception you mention in the<br>
> comment?</p>
<p dir="ltr">In another patch. That hunk of the convent should probably be moved.</p>
<p dir="ltr">> > + } else if (isl_format_is_yuv(format)) {<br>
> > + return false;<br>
> > + } else {<br>
> > + return true;<br>
> > + }<br>
> > +}<br>
> > +<br>
> > static inline bool<br>
> > isl_format_has_channel_type(enum isl_format fmt, enum isl_base_type type)<br>
> > {<br>
> > diff --git a/src/intel/isl/isl_gen6.c b/src/intel/isl/isl_gen6.c<br>
> > index 2c52e38..b30998d 100644<br>
> > --- a/src/intel/isl/isl_gen6.c<br>
> > +++ b/src/intel/isl/isl_gen6.c<br>
> > @@ -30,8 +30,6 @@ gen6_choose_msaa_layout(const struct isl_device *dev,<br>
> > enum isl_tiling tiling,<br>
> > enum isl_msaa_layout *msaa_layout)<br>
> > {<br>
> > - const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);<br>
> > -<br>
> > assert(ISL_DEV_GEN(dev) == 6);<br>
> > assert(info->samples >= 1);<br>
> ><br>
> > @@ -40,22 +38,7 @@ gen6_choose_msaa_layout(const struct isl_device *dev,<br>
> > return false;<br>
> > }<br>
> ><br>
> > - /* From the Sandybridge PRM, Volume 4 Part 1 p72, SURFACE_STATE, Surface<br>
> > - * Format:<br>
> > - *<br>
> > - * If Number of Multisamples is set to a value other than<br>
> > - * MULTISAMPLECOUNT_1, this field cannot be set to the following<br>
> > - * formats:<br>
> > - *<br>
> > - * - any format with greater than 64 bits per element<br>
> > - * - any compressed texture format (BC*)<br>
> > - * - any YCRCB* format<br>
> > - */<br>
> > - if (fmtl->bpb > 64)<br>
> > - return false;<br>
> > - if (isl_format_is_compressed(info->format))<br>
> > - return false;<br>
> > - if (isl_format_is_yuv(info->format))<br>
> > + if (!isl_format_supports_multisampling(dev->info, info->format))<br>
> > return false;<br>
> ><br>
> > /* From the Sandybridge PRM, Volume 4 Part 1 p85, SURFACE_STATE, Number of<br>
> > diff --git a/src/intel/isl/isl_gen7.c b/src/intel/isl/isl_gen7.c<br>
> > index 02273f8..7b40291 100644<br>
> > --- a/src/intel/isl/isl_gen7.c<br>
> > +++ b/src/intel/isl/isl_gen7.c<br>
> > @@ -30,8 +30,6 @@ gen7_choose_msaa_layout(const struct isl_device *dev,<br>
> > enum isl_tiling tiling,<br>
> > enum isl_msaa_layout *msaa_layout)<br>
> > {<br>
> > - const struct isl_format_layout *fmtl = isl_format_get_layout(info->format);<br>
> > -<br>
> > bool require_array = false;<br>
> > bool require_interleaved = false;<br>
> ><br>
> > @@ -43,19 +41,7 @@ gen7_choose_msaa_layout(const struct isl_device *dev,<br>
> > return true;<br>
> > }<br>
> ><br>
> > - /* From the Ivybridge PRM, Volume 4 Part 1 p63, SURFACE_STATE, Surface<br>
> > - * Format:<br>
> > - *<br>
> > - * If Number of Multisamples is set to a value other than<br>
> > - * MULTISAMPLECOUNT_1, this field cannot be set to the following<br>
> > - * formats: any format with greater than 64 bits per element, any<br>
> > - * compressed texture format (BC*), and any YCRCB* format.<br>
> > - */<br>
> > - if (fmtl->bpb > 64)<br>
> > - return false;<br>
> > - if (isl_format_is_compressed(info->format))<br>
> > - return false;<br>
> > - if (isl_format_is_yuv(info->format))<br>
> > + if (!isl_format_supports_multisampling(dev->info, info->format))<br>
> > return false;<br>
> ><br>
> > /* From the Ivybridge PRM, Volume 4 Part 1 p73, SURFACE_STATE, Number of<br>
> > diff --git a/src/intel/isl/isl_gen8.c b/src/intel/isl/isl_gen8.c<br>
> > index b456d70..0049614 100644<br>
> > --- a/src/intel/isl/isl_gen8.c<br>
> > +++ b/src/intel/isl/isl_gen8.c<br>
> > @@ -79,9 +79,7 @@ gen8_choose_msaa_layout(const struct isl_device *dev,<br>
> > /* More obvious restrictions */<br>
> > if (isl_surf_usage_is_display(info->usage))<br>
> > return false;<br>
> > - if (isl_format_is_compressed(info->format))<br>
> > - return false;<br>
> > - if (isl_format_is_yuv(info->format))<br>
> > + if (!isl_format_supports_multisampling(dev->info, info->format))<br>
> > return false;<br>
> ><br>
> > if (isl_surf_usage_is_depth_or_stencil(info->usage) ||<br>
> > --<br>
> > 2.5.0.400.gff86faf<br>
> ><br>
> > _______________________________________________<br>
> > mesa-dev mailing list<br>
> > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br></p>