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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2691FC433F5 for ; Wed, 9 Feb 2022 12:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbiBIMIO (ORCPT ); Wed, 9 Feb 2022 07:08:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233251AbiBIMGl (ORCPT ); Wed, 9 Feb 2022 07:06:41 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B1A3E016CC3 for ; Wed, 9 Feb 2022 03:12:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644405172; x=1675941172; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=uZij4IDv+vUY5n09X0g+EIbDNmB2ib4d4JtdcfO9h7Q=; b=XfLkLFuxtGwfbai4ixhTJ1AueruBaet03kI4v8h9L1AHKwHZKfBjwlu3 McKx/QDAtbzFVlp+BZM+7V7fWgwpmFGzEa+r4Xts7x9RnmnHu0SRFW/t7 uy7StUBjKxg1pnINaqmxxZpzcpNGJ01EprLTATpX2riBiWHQvgsAuSCfN M4ctBNVNNs6UMcWOjEBHuQ2UH82Pr9TZ6BD0rR6KOGmxejZU36T1IqPrL WyvKMBpSC9M74y8OjuQbnO4p7rIWUL/6vpa4/Z/9y9egZsbKJnRw3mtMm MYue8vbND0l0ydyIhTYhvsYDwTdBDn6l+b0o7IX3DWmEkaVMesnQUsfWB g==; X-IronPort-AV: E=McAfee;i="6200,9189,10252"; a="249128121" X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="249128121" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 03:12:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="541049566" Received: from rcallina-mobl3.ger.corp.intel.com (HELO localhost) ([10.252.18.41]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 03:12:48 -0800 From: Jani Nikula To: Sascha Hauer , David Airlie Cc: devicetree@vger.kernel.org, Benjamin Gaignard , Peter Geis , Sandy Huang , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Michael Riesch , kernel@pengutronix.de, Andy Yan , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 01/23] drm/encoder: Add of_graph port to struct drm_encoder In-Reply-To: <20220209100736.GV18637@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220209095350.2104049-1-s.hauer@pengutronix.de> <20220209095350.2104049-2-s.hauer@pengutronix.de> <20220209100736.GV18637@pengutronix.de> Date: Wed, 09 Feb 2022 13:12:45 +0200 Message-ID: <87fsospa36.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, 09 Feb 2022, Sascha Hauer wrote: > David, Daniel, > > I'll need a word from you regarding this patch. It's needed in patch > 22/23 in this series. > vop2_crtc_atomic_enable() needs to control the mux which routes the > display output to the different encoders. Which encoder is used is > described in the of_graph port, so I need a way to identify the encoder > in the device tree. I think the question is how useful is this going to be in general. IMO we should not be adding members that are useful in a single driver only. For example i915 wraps encoders with: struct intel_encoder { struct drm_encoder base; /* i915 specific stuff here*/ }; So that we can add stuff of our own there. Of course, it does mean a bunch of overhead for the first time you need to do it. But adding driver specific stuff to struct drm_encoder adds overhead for everyone. All that said, *I* don't know how useful the port member would be in drivers that use device tree. Maybe it's worth it. BR, Jani. > > Sascha > > On Wed, Feb 09, 2022 at 10:53:28AM +0100, Sascha Hauer wrote: >> Add a device node to drm_encoder which corresponds with the port node >> in the DT description of the encoder. This allows drivers to find the >> of_graph link between a crtc and an encoder. >> >> Signed-off-by: Sascha Hauer >> --- >> include/drm/drm_encoder.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h >> index 6e91a0280f31..3acd054b1eb3 100644 >> --- a/include/drm/drm_encoder.h >> +++ b/include/drm/drm_encoder.h >> @@ -99,6 +99,8 @@ struct drm_encoder { >> struct drm_device *dev; >> struct list_head head; >> >> + struct device_node *port; >> + >> struct drm_mode_object base; >> char *name; >> /** >> -- >> 2.30.2 >> >> -- Jani Nikula, Intel Open Source Graphics Center