diff --git a/video/out/gpu/ra.c b/video/out/gpu/ra.c index 855f9b6bb20a8..e310a6be7a486 100644 --- a/video/out/gpu/ra.c +++ b/video/out/gpu/ra.c @@ -300,23 +300,30 @@ bool ra_get_imgfmt_desc(struct ra *ra, int imgfmt, struct ra_imgfmt_desc *out) res.num_planes = regfmt.num_planes; res.component_bits = regfmt.component_size * 8; res.component_pad = regfmt.component_pad; + MP_DBG(ra, "Found %d planes for format %s.\n", res.num_planes, mp_imgfmt_to_name(imgfmt)); for (int n = 0; n < regfmt.num_planes; n++) { struct mp_regular_imgfmt_plane *plane = ®fmt.planes[n]; res.planes[n] = find_plane_format(ra, regfmt.component_size, plane->num_components, regfmt.component_type); - if (!res.planes[n]) + if (!res.planes[n]) { + MP_DBG(ra, "No planes found for format: %s\n", mp_imgfmt_to_name(imgfmt)); return false; + } for (int i = 0; i < plane->num_components; i++) res.components[n][i] = plane->components[i]; // Dropping LSBs when shifting will lead to dropped MSBs. if (res.component_bits > res.planes[n]->component_depth[0] && - res.component_pad < 0) + res.component_pad < 0) { + MP_DBG(ra, "Bad LSB/MSB shifting for format: %s\n", mp_imgfmt_to_name(imgfmt)); return false; + } // Renderer restriction, but actually an unwanted corner case. if (res.component_type != RA_CTYPE_UNKNOWN && - res.component_type != res.planes[n]->ctype) + res.component_type != res.planes[n]->ctype) { + MP_DBG(ra, "RA_CTYPE_UNKNOWN edgecase for format: %s\n", mp_imgfmt_to_name(imgfmt)); return false; + } res.component_type = res.planes[n]->ctype; } res.chroma_w = 1 << regfmt.chroma_xs; @@ -332,6 +339,7 @@ bool ra_get_imgfmt_desc(struct ra *ra, int imgfmt, struct ra_imgfmt_desc *out) } // Unsupported format + MP_DBG(ra, "Format, %s\n, is not supported.", mp_imgfmt_to_name(imgfmt)); return false; supported: diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 037d93ca2623d..1a6294ef40685 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -4093,14 +4093,18 @@ bool gl_video_showing_interpolated_frame(struct gl_video *p) return p->is_interpolated; } -static bool is_imgfmt_desc_supported(struct gl_video *p, +static bool is_imgfmt_desc_supported(struct gl_video *p, int mp_format, const struct ra_imgfmt_desc *desc) { - if (!desc->num_planes) + if (!desc->num_planes) { + MP_DBG(p, "No planes found for format: %s\n", mp_imgfmt_to_name(mp_format)); return false; + } - if (desc->planes[0]->ctype == RA_CTYPE_UINT && p->forced_dumb_mode) + if (desc->planes[0]->ctype == RA_CTYPE_UINT && p->forced_dumb_mode) { + MP_DBG(p, "RA_CTYPE_UNIT and dumb mode for: %s\n", mp_imgfmt_to_name(mp_format)); return false; + } return true; } @@ -4109,7 +4113,7 @@ bool gl_video_check_format(struct gl_video *p, int mp_format) { struct ra_imgfmt_desc desc; if (ra_get_imgfmt_desc(p->ra, mp_format, &desc) && - is_imgfmt_desc_supported(p, &desc)) + is_imgfmt_desc_supported(p, mp_format, &desc)) return true; if (ra_hwdec_get(&p->hwdec_ctx, mp_format)) return true; diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 74b8620307ad2..baa7c4ed95832 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1194,6 +1194,7 @@ static int query_format(struct vo *vo, int format) if (!planes) return false; + MP_DBG(vo, "Found %d planes for format %s.\n", planes, mp_imgfmt_to_name(format)); for (int i = 0; i < planes; i++) { if (!pl_plane_find_fmt(p->gpu, NULL, &data[i])) return false;