<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 11/01/18 23:27, Jason Ekstrand
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOFGe96v2o2EN6VtpsEureZu4Z_yJSYNWyrMGj=XAsPu7txo=A@mail.gmail.com">
<div dir="ltr">Sorry. It's taken a bit of time but the WG has a
decision and that is that we are supposed to throw
VK_ERROR_OUT_OF_DEVICE_MEMORY in this case. I believe you had
an alternate version of the patch that did something like that.
If so, we should revive it.<br>
</div>
<div class="gmail_extra"><br>
</div>
</blockquote>
<br>
Thanks for the info!<br>
<br>
I am thinking on keep this patch and add the following one on top
like this:<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c
b/src/intel/vulkan/anv_image.c<br>
index ba932ba47c3..652f28460d9 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -335,6 +335,9 @@ make_surface(const struct anv_device *dev,<br>
*/<br>
assert(ok);<br>
<br>
+ if (anv_surf->isl.size == UINT64_MAX)<br>
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;<br>
+<br>
image->planes[plane].aux_usage = ISL_AUX_USAGE_NONE;<br>
<br>
add_surface(image, anv_surf, plane);<br>
<br>
Hence, we fail in vkCreateImage() with VK_ERROR_OUT_OF_DEVICE_MEMORY
as the suggested change to the spec, with zero changes to other
users of isl_surf_init() . If you agree, I will send both patches
again for review.<br>
<br>
Sam<br>
<br>
<blockquote type="cite"
cite="mid:CAOFGe96v2o2EN6VtpsEureZu4Z_yJSYNWyrMGj=XAsPu7txo=A@mail.gmail.com">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Jan 11, 2018 at 5:04 AM, Samuel
Iglesias Gonsálvez <span dir="ltr"><<a
href="mailto:siglesias@igalia.com" target="_blank"
moz-do-not-send="true">siglesias@igalia.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">This patch is still unreviewed.<br>
<br>
</span>Sam<br>
<div class="HOEnZb">
<div class="h5"><br>
<br>
On 14/11/17 09:45, Samuel Iglesias Gonsálvez wrote:<br>
> The HW has some limits but, according to the spec,
we can create<br>
> the image as it has not yet any memory backing it.
This patch<br>
> logs a debug error and set the size to the
UINT64_MAX in order to<br>
> avoid allocating actual memory later.<br>
><br>
> Fixes the crashes on BDW for the following tests:<br>
><br>
> dEQP-VK.pipeline.render_to_<wbr>image.core.2d_array.huge.*<br>
> dEQP-VK.pipeline.render_to_<wbr>image.core.cube_array.huge.*<br>
><br>
> Signed-off-by: Samuel Iglesias Gonsálvez <<a
href="mailto:siglesias@igalia.com"
moz-do-not-send="true">siglesias@igalia.com</a>><br>
> ---<br>
> src/intel/isl/isl.c | 13 +++++++++----<br>
> 1 file changed, 9 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/intel/isl/isl.c
b/src/intel/isl/isl.c<br>
> index 59f512fc050..cd7f2fcd4cb 100644<br>
> --- a/src/intel/isl/isl.c<br>
> +++ b/src/intel/isl/isl.c<br>
> @@ -26,6 +26,7 @@<br>
> #include <stdio.h><br>
><br>
> #include "genxml/genX_bits.h"<br>
> +#include "common/intel_log.h"<br>
><br>
> #include "isl.h"<br>
> #include "isl_gen4.h"<br>
> @@ -1481,8 +1482,10 @@ isl_surf_init_s(const struct
isl_device *dev,<br>
> *<br>
> * This comment is applicable to all
Pre-gen9 platforms.<br>
> */<br>
> - if (size > (uint64_t) 1 << 31)<br>
> - return false;<br>
> + if (size > (uint64_t) 1 << 31) {<br>
> + intel_logd("%s: Surface size is bigger
than the supported by the HW: %ld > (1 << 31)",
__func__, size);<br>
> + size = UINT64_MAX;<br>
> + }<br>
> } else {<br>
> /* From the Skylake PRM Vol 5, Maximum
Surface Size in Bytes:<br>
> * "In addition to restrictions on
maximum height, width, and depth,<br>
> @@ -1490,8 +1493,10 @@ isl_surf_init_s(const struct
isl_device *dev,<br>
> * All pixels within the surface must be
contained within 2^38 bytes<br>
> * of the base address."<br>
> */<br>
> - if (size > (uint64_t) 1 << 38)<br>
> - return false;<br>
> + if (size > (uint64_t) 1 << 38) {<br>
> + intel_logd("%s: Surface size is bigger
than the supported by the HW: %ld > (1 << 38)",
__func__, size);<br>
> + size = UINT64_MAX;<br>
> + }<br>
> }<br>
><br>
> *surf = (struct isl_surf) {<br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>