Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp891072lqp; Thu, 23 May 2024 03:15:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqp5pV24xPbnRi+/5JsMZBuXp5Q5W3XtTT/CmrsTJkaeVMYCjEfiXDo/yd40/afDLxPcH2mja/3o1ztfANjURD6ECrwyvknWjcF+dIMQ== X-Google-Smtp-Source: AGHT+IEpQ2vynYyi7IpknAKcJ3EnIGHNhdxDhQGivZhZ0K3yeKVVxdepCQhJ9revga9/q98XFoYr X-Received: by 2002:a17:902:e752:b0:1f3:16ac:8b06 with SMTP id d9443c01a7336-1f31ca35263mr70913685ad.59.1716459321239; Thu, 23 May 2024 03:15:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716459321; cv=pass; d=google.com; s=arc-20160816; b=XCWtdZJnouGveWb6u2xlWrAWySMUybC2Ip0SbhNL3TMUNu+Rx2TZXkiNRD7ivECHA/ 071UrrHwjOYyg4WUekhHmTygHvIP0YdjQTTwNlphqRdGFBVgEhLKixHKK9hVhCtQiAcD 6cZ5qyg4YuysCNHnZZaDeNQqOv8eM0DbBoSrKpwX3+G32kXVJGQ1jSP8b/TAiAAvSkXE IHJokgovfcUYi4wewrF2hxt7bgBIJ9TQwKC6bl10hyLTG7fk1+pmt1QOVgtVejbaw2sC /ccBsCVkRZaYKKTMwh43tkoDKT2I7QV/4uQ6Wc/oPjmf2MkrftWIFWr4vovRYqM7LvXK Lmdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9QM5VzG76QHcCqcCe0wnilEYwkFQSlzi+agUdhNJ33A=; fh=YL86WKCBX/YBHBjMWiErO8QkOYqI1yfGdQhpVbtQkOk=; b=JqMQtJ9yus0gzeKMn9M6hxEueQ+f0QCGTzNV4LTvmJZYyMewjmq2Q8Gnnivso0L2fx fEHbm2d74NjHvudHROUeJNlj43u5F0th8Wy+eDDL3eAv6+taY3E9RvkWXKtgmrAF/RVL OI3ag/iab6rgfu2joOr93QPlCA4SDLw/yV5WWwvgI+r2YkZx0Pa6Lf5Tuym5VO2PP/Qy G6ReAyGPlM9ocUuI3GAXfNgzEtzzFHDe6bo7etrqMH6cQi54xfi9nJYdwDGLjXuYb7hL y3sAxwzaHOKuTrXULgCOw3YxrSiS3JDqNa53TsPkTmevjrlA0sfaEqW8U6OCr0DePGbJ KLMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ee4jQ0ru; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-187317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f333e05226si16757995ad.100.2024.05.23.03.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ee4jQ0ru; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-187317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D2BDE2833FD for ; Thu, 23 May 2024 10:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 120A1140E2F; Thu, 23 May 2024 10:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ee4jQ0ru" Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 671CA140391 for ; Thu, 23 May 2024 10:15:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459308; cv=none; b=ctzSb0G+4tE+LZ1U83uqqB777ftQ4xe6KSJ0riUVMuEXdluWxh5fL69FvP3pfSyLxlXOksxJFGLS73MdBw+0wV8eU3S+fRNr4oALXeTWaD8ALRoyM+MMjD1RIZUoOnYsnaRXSZd49TVM+j9Fjj2aj+k2nhPj+YyOvxe0LNmC3P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459308; c=relaxed/simple; bh=NCQ1/pWCoZ4u539HaqG0r+AT5wuC6YibWhWPyc6vbd8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Jz8L8+kzH9Io4T1yR2qpKNP22Zzb76GNmMEBxWcce7HUo/NYJG+cpygN3YsclHWtXBx3J+7WXPJANy5OWHFhnq7K59SMcdzUXsiGAetX0JKqFxtA5Q++xlpShfd9cyiDAql2SU06lBorDqMJy7vsbcmxui4OVbPGzdk0kcBvzxc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ee4jQ0ru; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52388d9ca98so11197189e87.0 for ; Thu, 23 May 2024 03:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716459304; x=1717064104; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=9QM5VzG76QHcCqcCe0wnilEYwkFQSlzi+agUdhNJ33A=; b=ee4jQ0ruZQw7zOoZlfnKncvWAUPg4ZaKbXeYmOX+qrRBYYSs8dEfbPo0jyBv/rQrqj 8VSjij3ygu86VSLsSqMIwwj+QF5AsQp7v9alb6MZMUUcWUNOC155FMj7kHT5hyCi2jVe 3Tb9pkA/SppOjIbv9BKwV9Kjbx8d848K+svNF8if92Y3eN13o2DmzRpCi7myfzxY2Roj LzCUIL5AHxm1uMaEMA3LtmZfo0/BSGKMIKjFlH6vo5nqW3KUpb0AFE0ENQG1dGG+rHGg fNO+KQsZP1LpVH9wvu7VD57660l9WvzlFJMoQsDYzsf4Pm9yUoBDGVecJKLGG5pq8o4H PL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716459304; x=1717064104; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9QM5VzG76QHcCqcCe0wnilEYwkFQSlzi+agUdhNJ33A=; b=nMnVtEwZCR25RiVrYOrAEJ6cJ0lWrvPy9W9FhIb9Mjn1AHl9KYcz3lmMdbJ5jhL1P/ c2L4AjdWiqrhK35J8uAYZLKwctR2EuH8mtEBMLkfhU1OGF6HmJteB+vWfMdqCxGMMe3G WL/vwjMadzq0vCX4CaSTUcL31XbDVira3iQsdDkqdMOXuahxtOQFAbXDmkoBrx2w1tlq HvMIs+ZIvHDbMhTgGSy77HvrwClI1bvD4kTMEm0vqedYMjjqUbRPaFlMkoqoB6KjMs61 mb37d6xwAnnbQuvbH0gNidaYu5pDZykDzIOMKMrMX7VNjfZ46cDfThXWq8PF69KF7OKo WuRw== X-Forwarded-Encrypted: i=1; AJvYcCWx0soMq+deFhkGsMCWDv7JKGtWIFSHBu/o5WAHixpEFVvZfS7WNK1qvGDCTrF9LlRylCQlZP/c8PC9QbNB6PgBBXi7rTIwf6RNFS86 X-Gm-Message-State: AOJu0YyaAm+tkVwubvsMQNo47W8odcEi1R8wprkr8KAITqRviV366hvS bYGguiJXNEKlaNEzvsXMExRMjA96H3PQrjT4o45HwfENHTRnIhl8g7NJS3tHH9E= X-Received: by 2002:a19:6a0c:0:b0:51d:9291:6945 with SMTP id 2adb3069b0e04-526c0b5dbbcmr3664728e87.44.1716459304484; Thu, 23 May 2024 03:15:04 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52753dd576bsm390832e87.108.2024.05.23.03.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:15:03 -0700 (PDT) Date: Thu, 23 May 2024 13:15:01 +0300 From: Dmitry Baryshkov To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Corbet , Sandy Huang , Heiko =?utf-8?Q?St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andy Yan , Hans Verkuil , Sebastian Wick , Ville =?utf-8?B?U3lyasOkbMOk?= , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v14 15/28] drm/connector: hdmi: Compute bpc and format automatically Message-ID: References: <20240521-kms-hdmi-connector-state-v14-0-51950db4fedb@kernel.org> <20240521-kms-hdmi-connector-state-v14-15-51950db4fedb@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240521-kms-hdmi-connector-state-v14-15-51950db4fedb@kernel.org> On Tue, May 21, 2024 at 12:13:48PM +0200, Maxime Ripard wrote: > Now that we have all the infrastructure needed, we can add some code > that will, for a given connector state and mode, compute the best output > format and bpc. > > The algorithm is equivalent to the one already found in i915 and vc4. > > Cc: Ville Syrj?l? > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/display/drm_hdmi_state_helper.c | 205 ++++++++++++++++++++- > drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 25 ++- > 2 files changed, 218 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > index 063421835dba..93cb30dba86e 100644 > --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c > +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c > @@ -1,9 +1,11 @@ > // SPDX-License-Identifier: MIT > > #include > #include > +#include > +#include > > #include > #include > > /** > @@ -46,10 +48,118 @@ connector_state_get_mode(const struct drm_connector_state *conn_state) > return NULL; > > return &crtc_state->mode; > } > > +static bool > +sink_supports_format_bpc(const struct drm_connector *connector, > + const struct drm_display_info *info, > + const struct drm_display_mode *mode, > + unsigned int format, unsigned int bpc) > +{ > + struct drm_device *dev = connector->dev; > + u8 vic = drm_match_cea_mode(mode); > + > + /* > + * CTA-861-F, section 5.4 - Color Coding & Quantization states > + * that the bpc must be 8, 10, 12 or 16 except for the default > + * 640x480 VIC1 where the value must be 8. > + * > + * The definition of default here is ambiguous but the spec > + * refers to VIC1 being the default timing in several occasions > + * so our understanding is that for the default timing (ie, > + * VIC1), the bpc must be 8. > + */ > + if (vic == 1 && bpc != 8) { > + drm_dbg_kms(dev, "VIC1 requires a bpc of 8, got %u\n", bpc); > + return false; > + } > + > + if (!info->is_hdmi && > + (format != HDMI_COLORSPACE_RGB || bpc != 8)) { > + drm_dbg_kms(dev, "DVI Monitors require an RGB output at 8 bpc\n"); > + return false; > + } > + > + if (!(connector->hdmi.supported_formats & BIT(format))) { > + drm_dbg_kms(dev, "%s format unsupported by the connector.\n", > + drm_hdmi_connector_get_output_format_name(format)); > + return false; > + } > + > + switch (format) { > + case HDMI_COLORSPACE_RGB: > + drm_dbg_kms(dev, "RGB Format, checking the constraints.\n"); > + > + /* > + * In some cases, like when the EDID readout fails, or > + * is not an HDMI compliant EDID for some reason, the > + * color_formats field will be blank and not report any > + * format supported. In such a case, assume that RGB is > + * supported so we can keep things going and light up > + * the display. > + */ > + if (!(info->color_formats & DRM_COLOR_FORMAT_RGB444)) > + drm_warn(dev, "HDMI Sink doesn't support RGB, something's wrong.\n"); > + > + if (bpc == 10 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30)) { > + drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n"); > + return false; > + } > + > + if (bpc == 12 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_36)) { > + drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n"); > + return false; > + } > + > + drm_dbg_kms(dev, "RGB format supported in that configuration.\n"); > + > + return true; > + > + case HDMI_COLORSPACE_YUV422: > + drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n"); > + > + if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR422)) { > + drm_dbg_kms(dev, "Sink doesn't support YUV422.\n"); > + return false; > + } > + > + if (bpc != 12) { > + drm_dbg_kms(dev, "YUV422 only supports 12 bpc.\n"); > + return false; > + } Maybe I'm misunderstanding the spec for YUV 4:2:2 > + > + drm_dbg_kms(dev, "YUV422 format supported in that configuration.\n"); > + > + return true; > + > + case HDMI_COLORSPACE_YUV444: > + drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n"); > + > + if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR444)) { > + drm_dbg_kms(dev, "Sink doesn't support YUV444.\n"); > + return false; > + } > + > + if (bpc == 10 && !(info->edid_hdmi_ycbcr444_dc_modes & DRM_EDID_HDMI_DC_30)) { > + drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n"); > + return false; > + } > + > + if (bpc == 12 && !(info->edid_hdmi_ycbcr444_dc_modes & DRM_EDID_HDMI_DC_36)) { > + drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n"); > + return false; > + } > + > + drm_dbg_kms(dev, "YUV444 format supported in that configuration.\n"); > + > + return true; So for 4:2:0 this code will always return false? I think a dev_dbg / todo / comment would be nice. There is a todo later on, but it is in a different code block. > + } > + > + return false; > +} > + > static enum drm_mode_status > hdmi_clock_valid(const struct drm_connector *connector, > const struct drm_display_mode *mode, > unsigned long long clock) > { > @@ -90,10 +200,101 @@ hdmi_compute_clock(const struct drm_connector *connector, > conn_state->hdmi.tmds_char_rate = clock; > > return 0; > } > > +static bool > +hdmi_try_format_bpc(const struct drm_connector *connector, > + struct drm_connector_state *conn_state, > + const struct drm_display_mode *mode, > + unsigned int bpc, enum hdmi_colorspace fmt) > +{ > + const struct drm_display_info *info = &connector->display_info; > + struct drm_device *dev = connector->dev; > + int ret; > + > + drm_dbg_kms(dev, "Trying %s output format\n", > + drm_hdmi_connector_get_output_format_name(fmt)); > + > + if (!sink_supports_format_bpc(connector, info, mode, fmt, bpc)) { > + drm_dbg_kms(dev, "%s output format not supported with %u bpc\n", > + drm_hdmi_connector_get_output_format_name(fmt), > + bpc); > + return false; > + } > + > + ret = hdmi_compute_clock(connector, conn_state, mode, bpc, fmt); > + if (ret) { > + drm_dbg_kms(dev, "Couldn't compute clock for %s output format and %u bpc\n", > + drm_hdmi_connector_get_output_format_name(fmt), > + bpc); > + return false; > + } > + > + drm_dbg_kms(dev, "%s output format supported with %u (TMDS char rate: %llu Hz)\n", > + drm_hdmi_connector_get_output_format_name(fmt), > + bpc, conn_state->hdmi.tmds_char_rate); > + > + return true; > +} > + > +static int > +hdmi_compute_format(const struct drm_connector *connector, > + struct drm_connector_state *conn_state, > + const struct drm_display_mode *mode, > + unsigned int bpc) > +{ > + struct drm_device *dev = connector->dev; > + > + /* > + * TODO: Add support for YCbCr420 output for HDMI 2.0 capable > + * devices, for modes that only support YCbCr420. > + */ > + if (hdmi_try_format_bpc(connector, conn_state, mode, bpc, HDMI_COLORSPACE_RGB)) { > + conn_state->hdmi.output_format = HDMI_COLORSPACE_RGB; > + return 0; > + } > + > + drm_dbg_kms(dev, "Failed. No Format Supported for that bpc count.\n"); > + > + return -EINVAL; > +} > + > +static int > +hdmi_compute_config(const struct drm_connector *connector, > + struct drm_connector_state *conn_state, > + const struct drm_display_mode *mode) > +{ > + struct drm_device *dev = connector->dev; > + unsigned int max_bpc = clamp_t(unsigned int, > + conn_state->max_bpc, > + 8, connector->max_bpc); > + unsigned int bpc; > + int ret; > + > + for (bpc = max_bpc; bpc >= 8; bpc -= 2) { > + drm_dbg_kms(dev, "Trying with a %d bpc output\n", bpc); > + > + ret = hdmi_compute_format(connector, conn_state, mode, bpc); > + if (ret) > + continue; > + > + conn_state->hdmi.output_bpc = bpc; > + > + drm_dbg_kms(dev, > + "Mode %ux%u @ %uHz: Found configuration: bpc: %u, fmt: %s, clock: %llu\n", > + mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), > + conn_state->hdmi.output_bpc, > + drm_hdmi_connector_get_output_format_name(conn_state->hdmi.output_format), > + conn_state->hdmi.tmds_char_rate); > + > + return 0; > + } > + > + return -EINVAL; > +} > + > /** > * drm_atomic_helper_connector_hdmi_check() - Helper to check HDMI connector atomic state > * @connector: DRM Connector > * @state: the DRM State object > * > @@ -113,13 +314,11 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, > drm_atomic_get_new_connector_state(state, connector); > const struct drm_display_mode *mode = > connector_state_get_mode(new_conn_state); > int ret; > > - ret = hdmi_compute_clock(connector, new_conn_state, mode, > - new_conn_state->hdmi.output_bpc, > - new_conn_state->hdmi.output_format); > + ret = hdmi_compute_config(connector, new_conn_state, mode); > if (ret) > return ret; > > if (old_conn_state->hdmi.output_bpc != new_conn_state->hdmi.output_bpc || > old_conn_state->hdmi.output_format != new_conn_state->hdmi.output_format) { > diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c > index ead998a691e7..a49a544d7b49 100644 > --- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c > +++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c > @@ -70,13 +70,10 @@ static int light_up_connector(struct kunit *test, > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state); > > conn_state = drm_atomic_get_connector_state(state, connector); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state); > > - conn_state->hdmi.output_bpc = connector->max_bpc; > - conn_state->hdmi.output_format = HDMI_COLORSPACE_RGB; > - > ret = drm_atomic_set_crtc_for_connector(conn_state, crtc); > KUNIT_EXPECT_EQ(test, ret, 0); > > crtc_state = drm_atomic_get_crtc_state(state, crtc); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state); > @@ -251,14 +248,19 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) > priv = drm_atomic_helper_connector_hdmi_init(test, > BIT(HDMI_COLORSPACE_RGB), > 10); > KUNIT_ASSERT_NOT_NULL(test, priv); > > + conn = &priv->connector; > + ret = set_connector_edid(test, conn, > + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, > + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); > + KUNIT_ASSERT_EQ(test, ret, 0); > + > ctx = drm_kunit_helper_acquire_ctx_alloc(test); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); > > - conn = &priv->connector; > preferred = find_preferred_mode(conn); > KUNIT_ASSERT_NOT_NULL(test, preferred); > > drm = &priv->drm; > crtc = priv->crtc; > @@ -272,15 +274,15 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test) > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, new_conn_state); > > old_conn_state = drm_atomic_get_old_connector_state(state, conn); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, old_conn_state); > > - new_conn_state->hdmi.output_bpc = 8; > + new_conn_state->max_requested_bpc = 8; > > KUNIT_ASSERT_NE(test, > - old_conn_state->hdmi.output_bpc, > - new_conn_state->hdmi.output_bpc); > + old_conn_state->max_requested_bpc, > + new_conn_state->max_requested_bpc); > > ret = drm_atomic_check_only(state); > KUNIT_ASSERT_EQ(test, ret, 0); > > old_conn_state = drm_atomic_get_old_connector_state(state, conn); > @@ -320,14 +322,19 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test) > priv = drm_atomic_helper_connector_hdmi_init(test, > BIT(HDMI_COLORSPACE_RGB), > 10); > KUNIT_ASSERT_NOT_NULL(test, priv); > > + conn = &priv->connector; > + ret = set_connector_edid(test, conn, > + test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz, > + ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz)); > + KUNIT_ASSERT_EQ(test, ret, 0); > + > ctx = drm_kunit_helper_acquire_ctx_alloc(test); > KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); > > - conn = &priv->connector; > preferred = find_preferred_mode(conn); > KUNIT_ASSERT_NOT_NULL(test, preferred); > > drm = &priv->drm; > crtc = priv->crtc; > @@ -670,11 +677,11 @@ static void drm_test_check_format_value(struct kunit *test) > 8); > KUNIT_ASSERT_NOT_NULL(test, priv); > > conn = &priv->connector; > conn_state = conn->state; > - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); > + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, 0); > } > > /* > * Test that the value of the output format property out of reset is set > * to 0, and will be computed at atomic_check time. > > -- > 2.45.0 > -- With best wishes Dmitry