Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1007671lqp; Fri, 22 Mar 2024 02:45:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6PYa985uh6NbzbUb5biBEh4KN3Qh6mTQRHSrmWy+kxajJkx5kCLhjegg0DqwVn52KEoaGh7get0v8+wYuCQ4fTPiYJiKVh1Y0rziXrw== X-Google-Smtp-Source: AGHT+IGy6c6/6A48UjF/AqlPZVoglGEInygnxaeaeqYqTGItcbwt89vnyO0fVQRI8KsvQG+UjNV1 X-Received: by 2002:a17:906:af87:b0:a47:34d8:e052 with SMTP id mj7-20020a170906af8700b00a4734d8e052mr510421ejb.36.1711100742279; Fri, 22 Mar 2024 02:45:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711100742; cv=pass; d=google.com; s=arc-20160816; b=yGklSpNBZdQCDJG1h4T92ls1p2He08ZuNAZgptrTsm9FMVm3YTK+47+boI0HchVA79 y9WiysHmN0TfWHQYyJGp34BzTGmkVkkhRtvDWoOSRI6ckXltwow1DrfY692vmIyImv+e 9799APrkhdllN2bBomrsxpzb/vOhuv340Z3aRs0u2SmpHfwbwNi+aEYZwfqFBjkdDTlf H2WO+I9fEUXMiQLvSvfPvIG5/BXyVb14Im5V/55yH+ye7j1/BcKsHNqAn571CuBWJbn3 EEMMxZmKsl/t00jpcw0tbf5wi835F85uRvow511oWgiP8N53PiOA05LnGBCQN0i8d/wS PQ8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dF+xB69y3V2PPd8uZQXwDJy+YquPCTTQlr76zPrUaXA=; fh=GmQ8u4OYO6Lr01A/4suilDmgvGeJhSxrPF7qFO7SCMQ=; b=ZbcqOPOjvabZwIw4feBue8o0arZVBS+OS71e6l1b/v55Mh9nGctA9ksej3pTZiHs4c VC5bU3Vgq80N7AehUOrQomds2ez57l5rc0JqBFqtenAgM7/1qE5/H2kNax6CxrxGZYgQ EUMQcCA4+hBgWsmLUN/yKSYoIP5me1Y6qhqv2cDt5tsxQiOjDLhFYUzqM7K3U073B+jY jvKm6vyor5Jj85eBUzKzM0FHKYOkUMxfIC8YY4lH0YVND8g0L0KGvKvnJY8VlJpJXD8y pLuRUqrVOL16OaURMIuwmtzpLn5SK4crpiW4EfEPyLScI7bA3t8EQtD/n6D0cT+OJbbM nsTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFOMEHjq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x11-20020a170906710b00b00a439ab2bbb9si767739ejj.284.2024.03.22.02.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 02:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFOMEHjq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111241-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id CA4C11F22D8F for ; Fri, 22 Mar 2024 09:45:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F2882556E; Fri, 22 Mar 2024 09:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fFOMEHjq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A9C8A20DDB; Fri, 22 Mar 2024 09:44:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711100683; cv=none; b=EwCfi8bHOjzBcVyouC0dYxcbAhbn/wRD5BV0sbauGgjm27H2Cy7vsMYAUXPFnlgYaGlOiZLet0VJffZqojwYX9UKNjVEe+WCham83jqs/ek7lu7JFoGV+8C3y2c8cQq6cCRIKd+lU+dfzAnjn1f66AU36mThS/SrjBstWfr4+s8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711100683; c=relaxed/simple; bh=OZqpPoXf8aJkADsczKIGarXC5e1A9XxkW7dY7qOHVMA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nt4OdrU5Q1S6zKB0RPo4uTpLFfRVxr07XqFeByy0+piIWvwnFDnHLsxeX0q2w857O5qcRcEzRriMQsozNKK4ZN5M2Uc3ChiKj+7HjhFV1IqKUzzxp/q0b/Db2yFl+cJSRq73QjpNPWaDghZkJ24Wbl0JUuYdwhe6iFN5d6+/TH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fFOMEHjq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5231C433C7; Fri, 22 Mar 2024 09:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711100683; bh=OZqpPoXf8aJkADsczKIGarXC5e1A9XxkW7dY7qOHVMA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fFOMEHjq54SRHxeKXjaSwOAZiHZy1xazKROl3fzTVMwCy37ptelwATh3bQJhVFt8S VXHm6L3eP+NlzF3AVZ4SN2F+UbUQ9PRtVf30kIi0TVuzTai9QCAZWrTDk9x+tP6Kt/ DDvt6u3Vo2Wk9aDWCvbekfveX+io31HME0FBWdjDRJxKghyestGVFmDuIl2pkysgzQ 5wst5bO6ogoyvM+RYK6KBUzw+RRXFryVHUtKgJ2JrssN3wc7rDAW2EJBP1uZaazgD0 itLs5cjY9aeGCqjOLxraqgGThcR9cPhiCPV2RxNukKfqv3wAClgERfFsKHBwKW77cv AZiI3rJrTq/lg== Date: Fri, 22 Mar 2024 10:44:40 +0100 From: Maxime Ripard To: Anatoliy Klymenko Cc: Laurent Pinchart , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Michal Simek , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mauro Carvalho Chehab , Tomi Valkeinen , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH v3 7/9] drm/atomic-helper: Add select_output_bus_format callback Message-ID: <20240322-passionate-lyrebird-of-trust-819718@houat> References: <20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com> <20240321-dp-live-fmt-v3-7-d5090d796b7e@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ycce5r5gilwxfcpp" Content-Disposition: inline In-Reply-To: <20240321-dp-live-fmt-v3-7-d5090d796b7e@amd.com> --ycce5r5gilwxfcpp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 21, 2024 at 01:43:45PM -0700, Anatoliy Klymenko wrote: > diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c > index 2dafc39a27cb..f2e12a3c4e5f 100644 > --- a/drivers/gpu/drm/drm_crtc_helper.c > +++ b/drivers/gpu/drm/drm_crtc_helper.c > @@ -1055,3 +1055,39 @@ int drm_helper_force_disable_all(struct drm_device *dev) > return ret; > } > EXPORT_SYMBOL(drm_helper_force_disable_all); > + > +/** > + * drm_helper_crtc_select_output_bus_format - Select output media bus format > + * @crtc: The CRTC to query > + * @crtc_state: The new CRTC state > + * @supported_fmts: List of media bus format options to pick from > + * @num_supported_fmts: Number of media bus formats in @supported_fmts list > + * > + * Encoder drivers may call this helper to give the connected CRTC a chance to > + * select compatible or preffered media bus format to use over the CRTC encoder > + * link. Encoders should provide list of supported input MEDIA_BUS_FMT_* for > + * CRTC to pick from. CRTC driver is expected to select preferred media bus > + * format from the list and, once enabled, generate the signal accordingly. > + * > + * Returns: > + * Selected preferred media bus format or 0 if CRTC does not support any from > + * @supported_fmts list. > + */ > +u32 drm_helper_crtc_select_output_bus_format(struct drm_crtc *crtc, > + struct drm_crtc_state *crtc_state, > + const u32 *supported_fmts, > + unsigned int num_supported_fmts) > +{ > + if (!crtc || !supported_fmts || !num_supported_fmts) > + return 0; > + > + if (!crtc->helper_private || > + !crtc->helper_private->select_output_bus_format) > + return supported_fmts[0]; > + > + return crtc->helper_private->select_output_bus_format(crtc, > + crtc_state, > + supported_fmts, > + num_supported_fmts); > +} Again, the output of that selection must be found in the CRTC state, otherwise CRTCs have no way to know which have been selected. Maxime --ycce5r5gilwxfcpp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZf1TBwAKCRDj7w1vZxhR xZGhAPsFZUpxcGfjLfAI6mcBYPDnCRhbOkvpKYaxj2+CXYWFeQD/W04VlpRLf4Fw 17ZdokR9h0XPytwkCVdQft75epzqgQY= =VFYJ -----END PGP SIGNATURE----- --ycce5r5gilwxfcpp--