diff --git a/video/out/drm_common.c b/video/out/drm_common.c index 2e82c3fa37..6292f84710 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -1365,8 +1365,7 @@ bool vo_drm_set_hdr_metadata(struct vo *vo, bool force_sdr) destroy_hdr_blob(drm); drm->target_params = target_params; - drm->supported_colorspace = target_params_supported_by_display(drm); - bool use_sdr = !drm->supported_colorspace || force_sdr; + bool use_sdr = !target_params_supported_by_display(drm) || force_sdr; // For any HDR, the BT2020 drm colorspace is the only one that works in practice. struct drm_atomic_context *atomic_ctx = drm->atomic_context; diff --git a/video/out/drm_common.h b/video/out/drm_common.h index ad984e9a2d..5849530969 100644 --- a/video/out/drm_common.h +++ b/video/out/drm_common.h @@ -138,7 +138,6 @@ struct vo_drm_state { const struct di_edid_chromaticity_coords *chromaticity; const struct di_cta_hdr_static_metadata_block *hdr_static_metadata; const struct di_cta_colorimetry_block *colorimetry; - bool supported_colorspace; bool active; bool redraw; diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h index dd0f99f83f..c20e76420a 100644 --- a/video/out/gpu/context.h +++ b/video/out/gpu/context.h @@ -44,10 +44,6 @@ struct ra_ctx_fns { // display size etc. are determined by it. bool (*reconfig)(struct ra_ctx *ctx); - // Signal if the underlying context can use colorspace/hdr related functionality - // on its own. - bool (*pass_colorspace)(struct ra_ctx *ctx); - // This behaves exactly like vo_driver.control(). int (*control)(struct ra_ctx *ctx, int *events, int request, void *arg); diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index fc78f13f0e..e5c33b7b71 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -654,11 +654,6 @@ static bool drm_egl_reconfig(struct ra_ctx *ctx) return true; } -static bool drm_egl_pass_colorspace(struct ra_ctx *ctx) -{ - return ctx->vo->drm->supported_colorspace; -} - static int drm_egl_control(struct ra_ctx *ctx, int *events, int request, void *arg) { @@ -681,7 +676,6 @@ const struct ra_ctx_fns ra_ctx_drm_egl = { .name = "drm", .description = "DRM/EGL", .reconfig = drm_egl_reconfig, - .pass_colorspace = drm_egl_pass_colorspace, .control = drm_egl_control, .init = drm_egl_init, .uninit = drm_egl_uninit, diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 3f0b18f4d4..11d379c8d8 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1082,7 +1082,6 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) struct ra_swapchain *sw = p->ra_ctx->swapchain; - bool pass_colorspace = false; struct pl_color_space target_csp = {0}; // TODO: Implement this for all backends if (sw->fns->target_csp) @@ -1178,8 +1177,6 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) hint.hdr.max_cll = target->hdr.max_cll; hint.hdr.max_fall = target->hdr.max_fall; } - if (p->ra_ctx->fns->pass_colorspace && p->ra_ctx->fns->pass_colorspace(p->ra_ctx)) - pass_colorspace = true; if (opts->target_prim) hint.primaries = opts->target_prim; if (opts->target_gamut) { @@ -1226,8 +1223,7 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) // Update again after possible max_luma change if (p->icc_profile) hint = p->icc_profile->csp; - if (!pass_colorspace) - pl_swapchain_colorspace_hint(p->sw, &hint); + pl_swapchain_colorspace_hint(p->sw, &hint); } else if (!target_hint) { if (!hint.hdr.min_luma) hint.hdr.min_luma = target_csp.hdr.min_luma; @@ -1258,7 +1254,7 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) // Calculate target struct pl_frame target; pl_frame_from_swapchain(&target, &swframe); - bool strict_sw_params = target_hint && !pass_colorspace && p->next_opts->target_hint_strict; + bool strict_sw_params = target_hint && p->next_opts->target_hint_strict; apply_target_options(p, &target, hint.hdr.min_luma, strict_sw_params); if (target.color.transfer == PL_COLOR_TRC_SRGB && frame->current && ((opts->sdr_adjust_gamma == 0 && opts->target_trc == PL_COLOR_TRC_UNKNOWN) || @@ -1414,7 +1410,7 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) ? swframe.fbo->params.format->name : NULL, .w = mp_rect_w(p->dst), .h = mp_rect_h(p->dst), - .color = pass_colorspace ? hint : target.color, + .color = target.color, .repr = target.repr, .rotate = target.rotation, };