Skip to content

Commit

Permalink
Rebase dri3.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
MastaG committed Oct 7, 2024
1 parent bdfc14a commit 93ec500
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions turnip-patches/dri3.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/freedreno/vulkan/tu_shader.cc b/src/freedreno/vulkan/tu_shader.cc
index 44f4e5f62ef..1ad32f2cdba 100644
index 199d7478fd3..fc011650926 100644
--- a/src/freedreno/vulkan/tu_shader.cc
+++ b/src/freedreno/vulkan/tu_shader.cc
@@ -2110,10 +2110,10 @@ tu_upload_shader(struct tu_device *dev,
@@ -2112,10 +2112,10 @@ tu_upload_shader(struct tu_device *dev,
size += vpc_size;
}

Expand All @@ -15,7 +15,7 @@ index 44f4e5f62ef..1ad32f2cdba 100644

if (result != VK_SUCCESS)
return result;
@@ -2143,9 +2143,9 @@ tu_upload_shader(struct tu_device *dev,
@@ -2145,9 +2145,9 @@ tu_upload_shader(struct tu_device *dev,

result = tu_setup_pvtmem(dev, shader, &pvtmem_config, pvtmem_size, per_wave);
if (result != VK_SUCCESS) {
Expand All @@ -27,7 +27,7 @@ index 44f4e5f62ef..1ad32f2cdba 100644
return result;
}

@@ -2841,10 +2841,10 @@ tu_empty_shader_create(struct tu_device *dev,
@@ -2855,10 +2855,10 @@ tu_empty_shader_create(struct tu_device *dev,
if (!shader)
return VK_ERROR_OUT_OF_HOST_MEMORY;

Expand All @@ -40,7 +40,7 @@ index 44f4e5f62ef..1ad32f2cdba 100644

if (result != VK_SUCCESS) {
vk_free(&dev->vk.alloc, shader);
@@ -2956,9 +2956,9 @@ tu_shader_destroy(struct tu_device *dev,
@@ -2970,9 +2970,9 @@ tu_shader_destroy(struct tu_device *dev,
tu_cs_finish(&shader->cs);
TU_RMV(resource_destroy, dev, &shader->bo);

Expand Down Expand Up @@ -68,10 +68,10 @@ index 57cf9048b07..4b397e741cf 100644
physical_device->wsi_device.can_present_on_device =
tu_wsi_can_present_on_device;
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 898bdd7bcdb..83d1feb59b8 100644
index cd63a008c05..c40344449dd 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -1543,7 +1543,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
@@ -1552,7 +1552,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
#endif
}

Expand All @@ -80,7 +80,7 @@ index 898bdd7bcdb..83d1feb59b8 100644
wsi->WaitForFences(device, 1, &swapchain->fences[image_index],
true, ~0ull);

@@ -2181,7 +2181,7 @@ wsi_configure_cpu_image(const struct wsi_swapchain *chain,
@@ -2190,7 +2190,7 @@ wsi_configure_cpu_image(const struct wsi_swapchain *chain,
const struct wsi_cpu_image_params *params,
struct wsi_image_info *info)
{
Expand All @@ -90,7 +90,7 @@ index 898bdd7bcdb..83d1feb59b8 100644
chain->blit.type == WSI_SWAPCHAIN_BUFFER_BLIT);

diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 014cb718b17..a70a607c0a2 100644
index eebf519e6bc..805d427617e 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -178,6 +178,7 @@ struct wsi_device {
Expand All @@ -102,7 +102,7 @@ index 014cb718b17..a70a607c0a2 100644
/* Set to true if the implementation is ok with linear WSI images. */
bool wants_linear;
diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c
index f2049101a3f..f2e76ddf37b 100644
index ff57a259046..dff8ae077a6 100644
--- a/src/vulkan/wsi/wsi_common_display.c
+++ b/src/vulkan/wsi/wsi_common_display.c
@@ -176,6 +176,12 @@ struct wsi_display_sync {
Expand Down Expand Up @@ -228,10 +228,10 @@ index 9835f8f990b..ba73f679cf9 100644

static VkResult
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 0c0c489d893..41eb565d0d1 100644
index 03980b8d583..66e82988a47 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -149,22 +149,7 @@ static bool
@@ -148,22 +148,7 @@ static bool
wsi_x11_check_dri3_compatible(const struct wsi_device *wsi_dev,
xcb_connection_t *conn)
{
Expand All @@ -253,27 +253,29 @@ index 0c0c489d893..41eb565d0d1 100644
- return match;
+ return true;
}
#endif

static bool
@@ -1402,7 +1387,6 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
if (chain->has_dri3_modifiers)
options |= XCB_PRESENT_OPTION_SUBOPTIMAL;
#endif

- xshmfence_reset(image->shm_fence);

if (!chain->base.image_info.explicit_sync) {
++chain->sent_image_count;
@@ -1771,9 +1755,6 @@ x11_acquire_next_image(struct wsi_swapchain *anv_chain,
@@ -1775,11 +1759,6 @@ x11_acquire_next_image(struct wsi_swapchain *anv_chain,
return result;

assert(*image_index < chain->base.image_count);
-#ifdef HAVE_X11_DRM
- if (chain->images[*image_index].shm_fence &&
- !chain->base.image_info.explicit_sync)
- xshmfence_await(chain->images[*image_index].shm_fence);
-#endif

return result;
}
@@ -2139,15 +2120,24 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
@@ -2142,15 +2121,24 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
if (fd == -1)
return VK_ERROR_OUT_OF_HOST_MEMORY;

Expand Down Expand Up @@ -307,7 +309,7 @@ index 0c0c489d893..41eb565d0d1 100644
}

error = xcb_request_check(chain->conn, cookie);
@@ -2177,6 +2167,9 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
@@ -2180,6 +2168,9 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
}
#endif

Expand All @@ -317,14 +319,16 @@ index 0c0c489d893..41eb565d0d1 100644
out_fence:
fence_fd = xshmfence_alloc_shm();
if (fence_fd < 0)
@@ -2218,10 +2211,6 @@ x11_image_finish(struct x11_swapchain *chain,
@@ -2222,12 +2213,6 @@ x11_image_finish(struct x11_swapchain *chain,
{
xcb_void_cookie_t cookie;

if (!chain->base.wsi->sw || chain->has_mit_shm) {
-#ifdef HAVE_X11_DRM
- cookie = xcb_sync_destroy_fence(chain->conn, image->sync_fence);
- xcb_discard_reply(chain->conn, cookie.sequence);
- xshmfence_unmap_shm(image->shm_fence);
-#endif
-
cookie = xcb_free_pixmap(chain->conn, image->pixmap);
xcb_discard_reply(chain->conn, cookie.sequence);

#ifdef HAVE_X11_DRM

0 comments on commit 93ec500

Please sign in to comment.