On 16/01/18 17:10, Jason Ekstrand wrote:
> I'm a bit unclear here.  Was ISL crashing before or was it returning
> false and anv crashing?  If it was anv crashing due to an assert(ok),
> then maybe it's best to just make anv fail gracefully with
> VK_ERROR_OUT_OF_DEVICE_MEMORY.  Setting size to UINT64_MAX seems
> really ugly to me.
>

It was returning false and ANV crashing. The thing is that isl can also
return false if the surface pitch is not right, so I preferred to mark
the actual memory problem by marking UINT64_MAX as the size, which is
invalid. However, if you prefer just making anv fail gracefully, I am
going to send a patch now with it.

Sam

> On Mon, Jan 15, 2018 at 4:03 AM, Samuel Iglesias Gonsálvez
> <sigles...@igalia.com <mailto:sigles...@igalia.com>> wrote:
>
>     The HW has some limits but, according to the spec, we can create
>     the image as it has not yet any memory backing it. This patch
>     logs a debug error and set the size to the UINT64_MAX in order to
>     avoid allocating actual memory later.
>
>     Fixes the crashes on BDW for the following tests:
>
>     dEQP-VK.pipeline.render_to_image.core.2d_array.huge.*
>     dEQP-VK.pipeline.render_to_image.core.cube_array.huge.*
>
>     Signed-off-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com
>     <mailto:sigles...@igalia.com>>
>     ---
>      src/intel/isl/isl.c | 13 +++++++++----
>      1 file changed, 9 insertions(+), 4 deletions(-)
>
>     diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
>     index 59f512fc050..cd7f2fcd4cb 100644
>     --- a/src/intel/isl/isl.c
>     +++ b/src/intel/isl/isl.c
>     @@ -26,6 +26,7 @@
>      #include <stdio.h>
>
>      #include "genxml/genX_bits.h"
>     +#include "common/intel_log.h"
>
>      #include "isl.h"
>      #include "isl_gen4.h"
>     @@ -1481,8 +1482,10 @@ isl_surf_init_s(const struct isl_device *dev,
>             *
>             * This comment is applicable to all Pre-gen9 platforms.
>             */
>     -      if (size > (uint64_t) 1 << 31)
>     -         return false;
>     +      if (size > (uint64_t) 1 << 31) {
>     +         intel_logd("%s: Surface size is bigger than the
>     supported by the HW: %ld > (1 << 31)", __func__, size);
>     +         size = UINT64_MAX;
>     +      }
>         } else {
>            /* From the Skylake PRM Vol 5, Maximum Surface Size in Bytes:
>             *    "In addition to restrictions on maximum height,
>     width, and depth,
>     @@ -1490,8 +1493,10 @@ isl_surf_init_s(const struct isl_device *dev,
>             *     All pixels within the surface must be contained
>     within 2^38 bytes
>             *     of the base address."
>             */
>     -      if (size > (uint64_t) 1 << 38)
>     -         return false;
>     +      if (size > (uint64_t) 1 << 38) {
>     +         intel_logd("%s: Surface size is bigger than the
>     supported by the HW: %ld > (1 << 38)", __func__, size);
>     +         size = UINT64_MAX;
>     +      }
>         }
>
>         *surf = (struct isl_surf) {
>     --
>     2.14.1
>
>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to