Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp123348lqb; Tue, 16 Apr 2024 10:26:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzsM87DgWYahZVFGGYJpVpg4lIte5Je8vec0m+/4egWgIH0c+m7Cy1sBOITAjgyK2VCTjCNegrooRpRFSS5ZPx1ZWE95YCqDI7TSv+lg== X-Google-Smtp-Source: AGHT+IGyM0asQlDYCXiQlrH5egLE+Qmy3MtMnULaS/syeolSQ90qRSzAuC3f6DVvRW8ZvbRjU4PS X-Received: by 2002:a05:6808:2225:b0:3c5:f65a:e4b3 with SMTP id bd37-20020a056808222500b003c5f65ae4b3mr16182107oib.0.1713288410326; Tue, 16 Apr 2024 10:26:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713288410; cv=pass; d=google.com; s=arc-20160816; b=VHIgumrXjnD3r8P4MuatHvvGVLCWEs/fMkX6qYzVxP9STTCYZPB8z/0uHzN06/Ujln RKVdE7IZqB+/bYdHbyPUbybuNeCeHq3QbzDetJafVVn6SGiM8BKkhsFDszvncROZFwsi MmbbSAlJWj384xogb2LJnMZVsCXRpclb3QJ8M9glAOOaA4w6lS6JV/IhPAsWMSs9M9Jb 63/jjwd2wwbJiIbyIxcC5L2v1y2UVLFlzC84QKXLTwHQNI+RloO351hI34QMIH+xiLIg QfN0o0RtxUyVkDZzFxXkDKZFvYlZ7W+TCOhxi2tuXGOZ26Dyc3Qi2CDVDuQsEnF3qaRJ UOpg== 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=Jd+nt3fmyXD50oBfG5XnSNjtPxILTMpUWQgZzEhJnGo=; fh=CC7FhhwwMBMjPdovXTVgsJePqVPx8TrpVildsGj6+bE=; b=ClSPwUxfZirPkN/vW5oEeXrMVZb+4qTfILyp3m7FpmcnSdt+YoaE1nQnAXIm5RpwRA g2ouPnNb5+L3UhI5RjZMz2IiApQGMGgPzMviCNQ8ALY5CdC7M+9SJxbWdguFYaZMUkTs CIfUr8zTIzCWxxeQM/UICMva7IM4ExYo/os/CzJoyusBo6LF3WjlWOlRAss7Hmzumw2/ CZBkw+sMFxGtM/owFF+6T0TXFLdjiFT+h3k/TvosB/vyRaE/jQLJJxiqIRV8X+Q/S0lx iB7fbSfnykLbOpaRSo8onEuJ9rH1tc9SaNV/sT68bGdDvKa2ASUvUyHCNPwyvp5sRNZE 2C9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g8DGBmgM; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-146910-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146910-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vv10-20020a05620a562a00b0078d757489f3si13030424qkn.295.2024.04.16.10.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146910-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=g8DGBmgM; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-146910-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146910-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3AD9F1C21181 for ; Tue, 16 Apr 2024 13:51:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC4BA12C819; Tue, 16 Apr 2024 13:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="g8DGBmgM" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04CE8129A72; Tue, 16 Apr 2024 13:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713275467; cv=none; b=Ut3LE2dVMFOAXLWgr67jky17qUyIVUGgC9tC+z+9QQychkAtntjY/GBOueRah/htfJGohGmMAVc7ClxPTnq6/dMvW9zZXXrIcQ+0eSjVzV420+CCMYS2G8nM1sB7H1uAOaUQO31GQ0fV2dkbJhTGKW9H4RMkMrl7V/TeBiIM0ZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713275467; c=relaxed/simple; bh=0w4Qc7WXMLbaRzifUCliR1koxDw/02VJz+GXV0lhkDc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uMSzujdSe44pBgY5SkylBA0yOTEFjsn3UbAIfjDkGvRHFGrDbEVzxHyPAjW8Gl+RT29+6c/l86CDLqvBcKGXidC6iwZ8j4rknI79fmVHj5Ed+Ko1jcl7QYXx6l8XAF+Q5gtcYNSH0YApZtCQJtAZhThHo6HdUpgENvc0ne9uRYU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=g8DGBmgM; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713275465; x=1744811465; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=0w4Qc7WXMLbaRzifUCliR1koxDw/02VJz+GXV0lhkDc=; b=g8DGBmgMlBqfJTeP0sSOktZeWZ5BqBKVB22+5sdDKakNn1HIp++/n1oS dJWgVfbrgZVoXk31bjhLbeM5xHJe1HNPa+xlIcpV0MU/I7QfgsZ/E2j95 XFuH96eBLVcmnuMjMNKV989RldtuWocXmnP2GhoCCAZBBcc2XkGdKZCoW qyfhiUsKSg1mGFIlab5sUPIW5p/JTrSWTpfMjUQW8zINvoNUZggiUrrPQ 9HDMKG5AM6s38kXVy8wn1jytbrK/aS57iIx06OJJDdOegp1dRhFp0bbub jbYYXZ+1DWtaBoKG3ZpxtkcjltwVCSfuejPldulUAHUgrxYdLMGDQhOLe g==; X-CSE-ConnectionGUID: JdSBxudhTXePk8yBMI5O4w== X-CSE-MsgGUID: ew0jU3VYSN29jaP0pt26QQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="8824659" X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="8824659" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 06:51:04 -0700 X-CSE-ConnectionGUID: c+JjeaBqTCWC77Oty0dwcw== X-CSE-MsgGUID: Tagd3zvzR26QEzV5CtxoYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,206,1708416000"; d="scan'208";a="22331130" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 16 Apr 2024 06:50:59 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 16 Apr 2024 16:50:58 +0300 Date: Tue, 16 Apr 2024 16:50:58 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Corbet , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Hans Verkuil , Sebastian Wick , 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 v11 15/28] drm/connector: hdmi: Compute bpc and format automatically Message-ID: References: <20240326-kms-hdmi-connector-state-v11-0-c5680ffcf261@kernel.org> <20240326-kms-hdmi-connector-state-v11-15-c5680ffcf261@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: <20240326-kms-hdmi-connector-state-v11-15-c5680ffcf261@kernel.org> X-Patchwork-Hint: comment On Tue, Mar 26, 2024 at 04:40:19PM +0100, 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. > > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/display/drm_hdmi_state_helper.c | 197 ++++++++++++++++++++- > drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 25 ++- > 2 files changed, 210 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..b9bc0fb027ea 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,110 @@ 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))) { These are the capabilities of the souce I take it? > + 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"); > + > + if (!(info->color_formats & DRM_COLOR_FORMAT_RGB444)) > + return false; and this is the sink. Maybe we should use the same bits for both? Anyways, that seems like material for a followup series. > + > + 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; > + } Did something change around here from the last time? > + > + 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; > + } > + > + 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 +192,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 +306,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.44.0 -- Ville Syrj?l? Intel