vo: replace max swapchain depth magic number

This commit is contained in:
Dudemanguy 2023-11-06 15:27:03 -06:00
parent bd4bf6e383
commit cf69fa03ca
5 changed files with 6 additions and 5 deletions

View File

@ -216,7 +216,7 @@ static const m_option_t mp_vo_opt_list[] = {
#if HAVE_EGL_ANDROID
{"android-surface-size", OPT_SIZE_BOX(android_surface_size)},
#endif
{"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, 8)},
{"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, VO_MAX_SWAPCHAIN_DEPTH)},
{"override-display-fps", OPT_REPLACED("display-fps-override")},
{0}
};

View File

@ -1030,7 +1030,7 @@ bool vo_drm_init(struct vo *vo)
drm->ev.version = DRM_EVENT_CONTEXT_VERSION;
drm->ev.page_flip_handler = &drm_pflip_cb;
drm->present = mp_present_initialize(drm, 8); // max swapchain depth allowed
drm->present = mp_present_initialize(drm, VO_MAX_SWAPCHAIN_DEPTH);
return true;

View File

@ -192,6 +192,7 @@ enum {
};
#define VO_MAX_REQ_FRAMES 10
#define VO_MAX_SWAPCHAIN_DEPTH 8
struct vo;
struct osd_state;

View File

@ -2280,10 +2280,10 @@ bool vo_wayland_init(struct vo *vo)
if (wl->presentation) {
wl->fback_pool = talloc_zero(wl, struct vo_wayland_feedback_pool);
wl->fback_pool->wl = wl;
wl->fback_pool->len = 8; // max swapchain depth allowed
wl->fback_pool->len = VO_MAX_SWAPCHAIN_DEPTH;
wl->fback_pool->fback = talloc_zero_array(wl->fback_pool, struct wp_presentation_feedback *,
wl->fback_pool->len);
wl->present = mp_present_initialize(wl, 8); // max swapchain depth allowed
wl->present = mp_present_initialize(wl, VO_MAX_SWAPCHAIN_DEPTH);
} else {
MP_VERBOSE(wl, "Compositor doesn't support the %s protocol!\n",
wp_presentation_interface.name);

View File

@ -626,7 +626,7 @@ bool vo_x11_init(struct vo *vo)
x11_error_output = x11->log;
XSetErrorHandler(x11_errorhandler);
x11->present = mp_present_initialize(x11, 8); // max swapchain depth allowed
x11->present = mp_present_initialize(x11, VO_MAX_SWAPCHAIN_DEPTH);
dispName = XDisplayName(NULL);