mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
Revert "wsi: Implements scaling controls for DRI3 presentation."
This reverts commit a219308867.
It's failing most of the tests on Anv :
$ ./deqp-vk -n dEQP-VK.wsi.xlib.maintenance1.scaling.*
Test run totals:
Passed: 88/2422 (3.6%)
Failed: 576/2422 (23.8%)
Not supported: 1758/2422 (72.6%)
Warnings: 0/2422 (0.0%)
Waived: 0/2422 (0.0%)
The only passing tests seem to be with this pattern :
dEQP-VK.wsi.xlib.maintenance1.scaling.*.same_size_and_aspect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37904>
This commit is contained in:
parent
abcaa46f6c
commit
2baa3b8c06
2 changed files with 8 additions and 57 deletions
|
|
@ -201,9 +201,6 @@ struct wsi_swapchain {
|
|||
VkAllocationCallbacks alloc;
|
||||
VkFence* fences;
|
||||
VkPresentModeKHR present_mode;
|
||||
VkPresentGravityFlagsEXT present_gravity_x;
|
||||
VkPresentGravityFlagsEXT present_gravity_y;
|
||||
|
||||
/**
|
||||
* Timeline for presents completing according to VK_KHR_present_wait. The
|
||||
* present should complete as close as possible (before or after!) to the
|
||||
|
|
|
|||
|
|
@ -810,10 +810,11 @@ x11_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface,
|
|||
}
|
||||
|
||||
case VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT: {
|
||||
/* Unsupported. */
|
||||
VkSurfacePresentScalingCapabilitiesEXT *scaling = (void *)ext;
|
||||
scaling->supportedPresentScaling = VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT;
|
||||
scaling->supportedPresentGravityX = VK_PRESENT_GRAVITY_MIN_BIT_EXT | VK_PRESENT_GRAVITY_MAX_BIT_EXT | VK_PRESENT_GRAVITY_CENTERED_BIT_EXT;
|
||||
scaling->supportedPresentGravityY = VK_PRESENT_GRAVITY_MIN_BIT_EXT | VK_PRESENT_GRAVITY_MAX_BIT_EXT | VK_PRESENT_GRAVITY_CENTERED_BIT_EXT;
|
||||
scaling->supportedPresentScaling = 0;
|
||||
scaling->supportedPresentGravityX = 0;
|
||||
scaling->supportedPresentGravityY = 0;
|
||||
scaling->minScaledImageExtent = caps->surfaceCapabilities.minImageExtent;
|
||||
scaling->maxScaledImageExtent = caps->surfaceCapabilities.maxImageExtent;
|
||||
break;
|
||||
|
|
@ -1458,46 +1459,7 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
|
|||
.serial = serial,
|
||||
};
|
||||
|
||||
int16_t x_off = 0;
|
||||
int16_t y_off = 0;
|
||||
|
||||
xcb_get_geometry_reply_t *geometry =
|
||||
xcb_get_geometry_reply(chain->conn, xcb_get_geometry(chain->conn, chain->window), NULL);
|
||||
|
||||
if (geometry) {
|
||||
switch (chain->base.present_gravity_x) {
|
||||
case VK_PRESENT_GRAVITY_MIN_BIT_EXT:
|
||||
x_off = 0;
|
||||
break;
|
||||
case VK_PRESENT_GRAVITY_MAX_BIT_EXT:
|
||||
x_off = geometry->width - chain->extent.width;
|
||||
break;
|
||||
case VK_PRESENT_GRAVITY_CENTERED_BIT_EXT:
|
||||
x_off = (geometry->width / 2) - (chain->extent.width / 2);
|
||||
break;
|
||||
default:
|
||||
x_off = 0;
|
||||
}
|
||||
|
||||
switch (chain->base.present_gravity_y) {
|
||||
case VK_PRESENT_GRAVITY_MIN_BIT_EXT:
|
||||
y_off = 0;
|
||||
break;
|
||||
case VK_PRESENT_GRAVITY_MAX_BIT_EXT:
|
||||
y_off = geometry->height - chain->extent.height;
|
||||
break;
|
||||
case VK_PRESENT_GRAVITY_CENTERED_BIT_EXT:
|
||||
y_off = (geometry->height / 2) - (chain->extent.height / 2);
|
||||
break;
|
||||
default:
|
||||
y_off = 0;
|
||||
}
|
||||
|
||||
free(geometry);
|
||||
}
|
||||
|
||||
xcb_void_cookie_t cookie;
|
||||
|
||||
#ifdef HAVE_DRI3_EXPLICIT_SYNC
|
||||
if (chain->base.image_info.explicit_sync) {
|
||||
uint64_t acquire_point = image->base.explicit_sync[WSI_ES_ACQUIRE].timeline;
|
||||
|
|
@ -1509,8 +1471,8 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
|
|||
serial,
|
||||
0, /* valid */
|
||||
image->update_area, /* update */
|
||||
x_off, /* x_off */
|
||||
y_off, /* y_off */
|
||||
0, /* x_off */
|
||||
0, /* y_off */
|
||||
XCB_NONE, /* target_crtc */
|
||||
image->dri3_syncobj[WSI_ES_ACQUIRE], /* acquire_syncobj */
|
||||
image->dri3_syncobj[WSI_ES_RELEASE], /* release_syncobj */
|
||||
|
|
@ -1529,8 +1491,8 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
|
|||
serial,
|
||||
0, /* valid */
|
||||
image->update_area, /* update */
|
||||
x_off, /* x_off */
|
||||
y_off, /* y_off */
|
||||
0, /* x_off */
|
||||
0, /* y_off */
|
||||
XCB_NONE, /* target_crtc */
|
||||
XCB_NONE,
|
||||
image->sync_fence,
|
||||
|
|
@ -2788,14 +2750,6 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
|
|||
chain->has_mit_shm = wsi_conn->has_mit_shm;
|
||||
chain->has_async_may_tear = present_caps & XCB_PRESENT_CAPABILITY_ASYNC_MAY_TEAR;
|
||||
|
||||
const VkSwapchainPresentScalingCreateInfoEXT* scaling_info =
|
||||
vk_find_struct_const(pCreateInfo->pNext, SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT);
|
||||
|
||||
if (scaling_info) {
|
||||
chain->base.present_gravity_x = scaling_info->presentGravityX;
|
||||
chain->base.present_gravity_y = scaling_info->presentGravityY;
|
||||
}
|
||||
|
||||
/* When images in the swapchain don't fit the window, X can still present them, but it won't
|
||||
* happen by flip, only by copy. So this is a suboptimal copy, because if the client would change
|
||||
* the chain extents X may be able to flip
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue