Re: [Mesa-dev] [PATCH 1/1] vulkan/wsi: Destroy swapchain images after terminating FIFO queues
Thanks, I've pushed it. On 8 June 2018 at 10:38, Lionel Landwerlin wrote: > Sorry for missing that. > > Fixes: e73d136a023080 ("vulkan/wsi/x11: Implement FIFO mode.") > Reviewed-by: Lionel Landwerlin > > > On 01/06/18 12:16, Cameron Kumar wrote: > >> The queue_manager thread can access the images from x11_present_to_x11, >> hence this reorder prevents dereferencing of dangling pointers. >> >> Cc: "18.1" >> --- >> src/vulkan/wsi/wsi_common_x11.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/src/vulkan/wsi/wsi_common_x11.c >> b/src/vulkan/wsi/wsi_common_x11.c >> index 1bfbc7c300..20d7cf5a2c 100644 >> --- a/src/vulkan/wsi/wsi_common_x11.c >> +++ b/src/vulkan/wsi/wsi_common_x11.c >> @@ -1235,9 +1235,6 @@ x11_swapchain_destroy(struct wsi_swapchain >> *anv_chain, >> struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; >> xcb_void_cookie_t cookie; >> - for (uint32_t i = 0; i < chain->base.image_count; i++) >> - x11_image_finish(chain, pAllocator, >images[i]); >> - >> if (chain->threaded) { >> chain->status = VK_ERROR_OUT_OF_DATE_KHR; >> /* Push a UINT32_MAX to wake up the manager */ >> @@ -1247,6 +1244,9 @@ x11_swapchain_destroy(struct wsi_swapchain >> *anv_chain, >> wsi_queue_destroy(>present_queue); >> } >> + for (uint32_t i = 0; i < chain->base.image_count; i++) >> + x11_image_finish(chain, pAllocator, >images[i]); >> + >> xcb_unregister_for_special_event(chain->conn, chain->special_event); >> cookie = xcb_present_select_input_checked(chain->conn, >> chain->event_id, >>chain->window, >> > > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/1] vulkan/wsi: Destroy swapchain images after terminating FIFO queues
Sorry for missing that. Fixes: e73d136a023080 ("vulkan/wsi/x11: Implement FIFO mode.") Reviewed-by: Lionel Landwerlin On 01/06/18 12:16, Cameron Kumar wrote: The queue_manager thread can access the images from x11_present_to_x11, hence this reorder prevents dereferencing of dangling pointers. Cc: "18.1" --- src/vulkan/wsi/wsi_common_x11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 1bfbc7c300..20d7cf5a2c 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1235,9 +1235,6 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain, struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; xcb_void_cookie_t cookie; - for (uint32_t i = 0; i < chain->base.image_count; i++) - x11_image_finish(chain, pAllocator, >images[i]); - if (chain->threaded) { chain->status = VK_ERROR_OUT_OF_DATE_KHR; /* Push a UINT32_MAX to wake up the manager */ @@ -1247,6 +1244,9 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain, wsi_queue_destroy(>present_queue); } + for (uint32_t i = 0; i < chain->base.image_count; i++) + x11_image_finish(chain, pAllocator, >images[i]); + xcb_unregister_for_special_event(chain->conn, chain->special_event); cookie = xcb_present_select_input_checked(chain->conn, chain->event_id, chain->window, ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/1] vulkan/wsi: Destroy swapchain images after terminating FIFO queues
Any feedback on this? On 1 June 2018 at 12:16, Cameron Kumar wrote: > The queue_manager thread can access the images from x11_present_to_x11, > hence this reorder prevents dereferencing of dangling pointers. > > Cc: "18.1" > --- > src/vulkan/wsi/wsi_common_x11.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_ > x11.c > index 1bfbc7c300..20d7cf5a2c 100644 > --- a/src/vulkan/wsi/wsi_common_x11.c > +++ b/src/vulkan/wsi/wsi_common_x11.c > @@ -1235,9 +1235,6 @@ x11_swapchain_destroy(struct wsi_swapchain > *anv_chain, > struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; > xcb_void_cookie_t cookie; > > - for (uint32_t i = 0; i < chain->base.image_count; i++) > - x11_image_finish(chain, pAllocator, >images[i]); > - > if (chain->threaded) { >chain->status = VK_ERROR_OUT_OF_DATE_KHR; >/* Push a UINT32_MAX to wake up the manager */ > @@ -1247,6 +1244,9 @@ x11_swapchain_destroy(struct wsi_swapchain > *anv_chain, >wsi_queue_destroy(>present_queue); > } > > + for (uint32_t i = 0; i < chain->base.image_count; i++) > + x11_image_finish(chain, pAllocator, >images[i]); > + > xcb_unregister_for_special_event(chain->conn, chain->special_event); > cookie = xcb_present_select_input_checked(chain->conn, > chain->event_id, > chain->window, > -- > 2.14.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/1] vulkan/wsi: Destroy swapchain images after terminating FIFO queues
The queue_manager thread can access the images from x11_present_to_x11, hence this reorder prevents dereferencing of dangling pointers. Cc: "18.1" --- src/vulkan/wsi/wsi_common_x11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 1bfbc7c300..20d7cf5a2c 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -1235,9 +1235,6 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain, struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; xcb_void_cookie_t cookie; - for (uint32_t i = 0; i < chain->base.image_count; i++) - x11_image_finish(chain, pAllocator, >images[i]); - if (chain->threaded) { chain->status = VK_ERROR_OUT_OF_DATE_KHR; /* Push a UINT32_MAX to wake up the manager */ @@ -1247,6 +1244,9 @@ x11_swapchain_destroy(struct wsi_swapchain *anv_chain, wsi_queue_destroy(>present_queue); } + for (uint32_t i = 0; i < chain->base.image_count; i++) + x11_image_finish(chain, pAllocator, >images[i]); + xcb_unregister_for_special_event(chain->conn, chain->special_event); cookie = xcb_present_select_input_checked(chain->conn, chain->event_id, chain->window, -- 2.14.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev