From 106b4a2a78b2a2f14885604891957b84bba502db Mon Sep 17 00:00:00 2001 From: Adrian Betschart Date: Fri, 11 Sep 2026 17:13:14 +0200 Subject: drm/amd/display: Try RGB before YCbCr 4:4:4 in stream validation amdgpu_dm_create_validate_stream_for_sink() walks encoding_order[] and uses the first encoding that validates. YCbCr 4:4:4 is listed before RGB, so an HDMI sink that advertises 4:4:4 gets YCbCr 4:4:4 whenever the "color format" property is left at AUTO, even though RGB fits the same link. That contradicts the documented AUTO behaviour for HDMI in enum drm_connector_color_format (RGB, falling back to YCbCr 4:2:0 only when the bandwidth is not available or the mode is 4:2:0-only), which the amdgpu implementation of the property also describes. It also leaves the "Broadcast RGB" property without effect on such sinks, since the quantization range it selects only applies to RGB output. Try RGB first. The mask still holds every encoding the sink supports, so a mode that cannot carry RGB falls back exactly as before. For reference, v7.2 picked RGB here unless YCbCr 4:4:4 was forced through debugfs, while earlier kernels picked YCbCr 4:4:4 for any HDMI sink that advertised it. Fixes: 0b0ff65d3ca1 ("drm/amd/display: Refactor stream validation") Suggested-by: Adolfo Rodrigues Assisted-by: Claude Code:claude-fable-5-1 Signed-off-by: Adrian Betschart Reviewed-by: Fangzhi Zuo Tested-by: Adolfo Rodrigues Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher (cherry picked from commit 7de432bc753133764dc40d37f9388da56de251e7) --- drivers/comedi/proc.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 drivers/comedi/proc.c (limited to 'drivers/comedi/proc.c') diff --git a/drivers/comedi/proc.c b/drivers/comedi/proc.c new file mode 100644 index 000000000..2e4496633 --- /dev/null +++ b/drivers/comedi/proc.c @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * /proc interface for comedi + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998 David A. Schleef + */ + +/* + * This is some serious bloatware. + * + * Taken from Dave A.'s PCL-711 driver, 'cuz I thought it + * was cool. + */ + +#include +#include "comedi_internal.h" +#include +#include + +static int comedi_read(struct seq_file *m, void *v) +{ + int i; + int devices_q = 0; + struct comedi_driver *driv; + + seq_printf(m, "comedi version " COMEDI_RELEASE "\nformat string: %s\n", + "\"%2d: %-20s %-20s %4d\", i, driver_name, board_name, n_subdevices"); + + for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) { + struct comedi_device *dev = comedi_dev_get_from_minor(i); + + if (!dev) + continue; + + down_read(&dev->attach_lock); + if (dev->attached) { + devices_q = 1; + seq_printf(m, "%2d: %-20s %-20s %4d\n", + i, dev->driver->driver_name, + dev->board_name, dev->n_subdevices); + } + up_read(&dev->attach_lock); + comedi_dev_put(dev); + } + if (!devices_q) + seq_puts(m, "no devices\n"); + + mutex_lock(&comedi_drivers_list_lock); + for (driv = comedi_drivers; driv; driv = driv->next) { + seq_printf(m, "%s:\n", driv->driver_name); + for (i = 0; i < driv->num_names; i++) + seq_printf(m, " %s\n", + *(char **)((char *)driv->board_name + + i * driv->offset)); + + if (!driv->num_names) + seq_printf(m, " %s\n", driv->driver_name); + } + mutex_unlock(&comedi_drivers_list_lock); + + return 0; +} + +void __init comedi_proc_init(void) +{ + if (!proc_create_single("comedi", 0444, NULL, comedi_read)) + pr_warn("comedi: unable to create proc entry\n"); +} + +void comedi_proc_cleanup(void) +{ + remove_proc_entry("comedi", NULL); +} -- cgit v1.3.1