From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC3EEC433E0 for ; Tue, 26 May 2020 12:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92BC32086A for ; Tue, 26 May 2020 12:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731773AbgEZM7U (ORCPT ); Tue, 26 May 2020 08:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731765AbgEZM7T (ORCPT ); Tue, 26 May 2020 08:59:19 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96C86C03E96D for ; Tue, 26 May 2020 05:59:19 -0700 (PDT) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 176592A2CE4; Tue, 26 May 2020 13:59:17 +0100 (BST) Date: Tue, 26 May 2020 14:59:13 +0200 From: Boris Brezillon To: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Andrzej Hajda , Jernej Skrabec , Jonas Karlman , Neil Armstrong , Sam Ravnborg , Kieran Bingham , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Andrey Gusakov , Chris Zhong , Enric Balletbo i Serra , Guido =?UTF-8?B?R8O8bnRoZXI=?= , Icenowy Zheng , Jacopo Mondi , Jyri Sarha , Lubomir Rintel , Maciej Purski , Peter Ujfalusi , Philippe Cornu , Russell King , Tomasz Stanislawski , Tomi Valkeinen Subject: Re: [PATCH 10/27] drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() Message-ID: <20200526145913.3b13b0ee@collabora.com> In-Reply-To: <20200526011505.31884-11-laurent.pinchart+renesas@ideasonboard.com> References: <20200526011505.31884-1-laurent.pinchart+renesas@ideasonboard.com> <20200526011505.31884-11-laurent.pinchart+renesas@ideasonboard.com> Organization: Collabora X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org On Tue, 26 May 2020 04:14:48 +0300 Laurent Pinchart wrote: > When validating a mode, bridges may need to do so in the context of a > display, as specified by drm_display_info. An example is the meson > dw-hdmi bridge that needs to consider the YUV 4:2:0 output format to > perform clock calculations. > > Bridges that need the display info currently retrieve it from the > drm_connector created by the bridge. This gets in the way of moving > connector creation out of bridge drivers. To make this possible, pass > the drm_display_info to drm_bridge_funcs .mode_valid(). > > Changes to the bridge drivers have been performed with the following > coccinelle semantic patch and have been compile-tested. > > @ rule1 @ > identifier funcs; > identifier fn; > @@ > struct drm_bridge_funcs funcs = { > ..., > .mode_valid = fn > }; > > @ depends on rule1 @ > identifier rule1.fn; > identifier bridge; > identifier mode; > @@ > enum drm_mode_status fn( > struct drm_bridge *bridge, > + const struct drm_display_info *info, > const struct drm_display_mode *mode > ) > { > ... > } > > Signed-off-by: Laurent Pinchart Reviewed-by: Boris Brezillon