Lionel Landwerlin ea84b36592 anv: fix incorrect blorp dynamic state heap usage
Found with valgrind :

==253563== Invalid free() / delete / delete[] / realloc()
==253563==    at 0x6EEBB88: anv_state_pool_free (anv_allocator.c:962)
==253563==    by 0x6EFB563: anv_device_finish_blorp (anv_blorp.c:143)
==253563==    by 0x6F204F8: anv_DestroyDevice (anv_device.c:4063)
==253563==    by 0x6DE1CD7: loader_layer_destroy_device (loader.c:4387)
==253563==    by 0x6DF1D5E: vkDestroyDevice (trampoline.c:1025)
==253563==    by 0x407C54: vk::refdetails::Deleter<vk::VkDevice_s*>::operator()(vk::VkDevice_s*) const (vkRef.hpp:131)
==253563==    by 0x42C016: vk::refdetails::RefBase<vk::VkDevice_s*>::reset() (vkRef.hpp:303)
==253563==    by 0x40B385: vk::refdetails::RefBase<vk::VkDevice_s*>::~RefBase() (vkRef.hpp:296)
==253563==    by 0x40A95D: vk::refdetails::Unique<vk::VkDevice_s*>::~Unique() (vkRef.hpp:376)
==253563==    by 0x402501: vkt::DefaultDevice::~DefaultDevice() (vktTestCase.cpp:658)
==253563==    by 0x444807: de::DefaultDeleter<vkt::DefaultDevice>::operator()(vkt::DefaultDevice*) const (deDefs.hpp:112)
==253563==    by 0x43922D: de::details::UniqueBase<vkt::DefaultDevice, de::DefaultDeleter<vkt::DefaultDevice> >::reset() (deUniquePtr.hpp:90)
==253563==  Address 0xd3df000 is 0 bytes inside a block of size 272 client-defined
==253563==    at 0x6EEBA0B: anv_state_pool_alloc (anv_allocator.c:940)
==253563==    by 0x6EFA610: anv_state_pool_emit_data (anv_private.h:852)
==253563==    by 0x6EFB206: upload_dynamic_state (anv_blorp.c:106)
==253563==    by 0x6FC8C31: blorp_init_dynamic_states (blorp_genX_exec_brw.h:2211)
==253563==    by 0x6FCD02D: gfx9_blorp_init_dynamic_states (genX_blorp_exec.c:507)
==253563==    by 0x6EFB47E: anv_device_init_blorp (anv_blorp.c:129)
==253563==    by 0x6F1FBBA: anv_CreateDevice (anv_device.c:3908)
==253563==    by 0x840B669: vk_tramp_CreateDevice (vk_dispatch_trampolines.c:78)
==253563==    by 0x6DE663A: terminator_CreateDevice (loader.c:5836)
==253563==    by 0x6DE3E39: loader_create_device_chain (loader.c:4940)
==253563==    by 0x6DE1AC5: loader_layer_create_device (loader.c:4320)
==253563==    by 0x6DF1CBF: vkCreateDevice (trampoline.c:1005)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: fe1baa6481 ("anv: reduce blorp dynamic state emissions")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28578>
2024-04-05 09:50:41 +00:00
2024-04-02 10:05:05 +00:00
2022-11-22 19:04:13 +00:00
2024-03-13 15:21:07 +00:00
2024-04-04 13:18:00 +00:00
2024-01-24 10:02:10 +00:00
2023-11-02 11:37:46 +00:00
2024-01-24 10:53:14 +00:00
2024-01-11 11:05:47 +00:00

`Mesa <https://mesa3d.org>`_ - The 3D Graphics Library
======================================================


Source
------

This repository lives at https://gitlab.freedesktop.org/mesa/mesa.
Other repositories are likely forks, and code found there is not supported.


Build & install
---------------

You can find more information in our documentation (`docs/install.rst
<https://mesa3d.org/install.html>`_), but the recommended way is to use
Meson (`docs/meson.rst <https://mesa3d.org/meson.html>`_):

.. code-block:: sh

  $ mkdir build
  $ cd build
  $ meson ..
  $ sudo ninja install


Support
-------

Many Mesa devs hang on IRC; if you're not sure which channel is
appropriate, you should ask your question on `OFTC's #dri-devel
<irc://irc.oftc.net/dri-devel>`_, someone will redirect you if
necessary.
Remember that not everyone is in the same timezone as you, so it might
take a while before someone qualified sees your question.
To figure out who you're talking to, or which nick to ping for your
question, check out `Who's Who on IRC
<https://dri.freedesktop.org/wiki/WhosWho/>`_.

The next best option is to ask your question in an email to the
mailing lists: `mesa-dev\@lists.freedesktop.org
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>`_


Bug reports
-----------

If you think something isn't working properly, please file a bug report
(`docs/bugs.rst <https://mesa3d.org/bugs.html>`_).


Contributing
------------

Contributions are welcome, and step-by-step instructions can be found in our
documentation (`docs/submittingpatches.rst
<https://mesa3d.org/submittingpatches.html>`_).

Note that Mesa uses gitlab for patches submission, review and discussions.
S
Description
No description provided
Readme 538 MiB
Languages
C 75.5%
C++ 17.2%
Python 2.7%
Rust 1.8%
Assembly 1.5%
Other 1%