[Mesa-dev] [PATCH 02/16] blorp: handle out of memory without crashing in various batch emissions

Jason Ekstrand jason at jlekstrand.net
Tue Mar 7 16:38:25 UTC 2017


As Topi said, you're missing a number of cases.

On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> ---
>  src/intel/blorp/blorp_genX_exec.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/intel/blorp/blorp_genX_exec.h
> b/src/intel/blorp/blorp_genX_exec.h
> index 8f322b0..dc1b773 100644
> --- a/src/intel/blorp/blorp_genX_exec.h
> +++ b/src/intel/blorp/blorp_genX_exec.h
> @@ -276,6 +276,8 @@ blorp_emit_vertex_buffers(struct blorp_batch *batch,
>
>     const unsigned num_dwords = 1 + GENX(VERTEX_BUFFER_STATE_length) * 2;
>     uint32_t *dw = blorp_emitn(batch, GENX(3DSTATE_VERTEX_BUFFERS),
> num_dwords);
> +   if (!dw)
> +      return;
>
>     for (unsigned i = 0; i < 2; i++) {
>        GENX(VERTEX_BUFFER_STATE_pack)(batch, dw, &vb[i]);
> @@ -381,6 +383,8 @@ blorp_emit_vertex_elements(struct blorp_batch *batch,
>     const unsigned num_dwords =
>        1 + GENX(VERTEX_ELEMENT_STATE_length) * num_elements;
>     uint32_t *dw = blorp_emitn(batch, GENX(3DSTATE_VERTEX_ELEMENTS),
> num_dwords);
> +   if (!dw)
> +      return;
>
>     for (unsigned i = 0; i < num_elements; i++) {
>        GENX(VERTEX_ELEMENT_STATE_pack)(batch, dw, &ve[i]);
> @@ -1021,6 +1025,9 @@ blorp_emit_depth_stencil_state(struct blorp_batch
> *batch,
>     uint32_t offset = 0;
>     uint32_t *dw = blorp_emit_dwords(batch,
>                                      GENX(3DSTATE_WM_DEPTH_STENCIL_
> length));
> +   if (!dw)
> +      return 0;
> +
>     GENX(3DSTATE_WM_DEPTH_STENCIL_pack)(NULL, dw, &ds);
>  #else
>     uint32_t offset;
> --
> 2.7.4
>
> _______________________________________________
> 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/20170307/391b158f/attachment.html>


More information about the mesa-dev mailing list