Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp47930lqj; Sat, 1 Jun 2024 07:33:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqbUUPihsdKAQ8PJIbfihaki8cEG6j4SRDdCdfWIwpQPXZkNJZiH51c5STkPTGe21H9/jSQ7u1uAlejsD1jkYtazYsebGRWBqwKcSGoA== X-Google-Smtp-Source: AGHT+IFI3YS8G8gSHBVHiaEXhbHHotEXBYvCI2aZMw5JBEXfvVu9QjY0iiwnApXRTziHegrPjs+g X-Received: by 2002:a05:6808:2129:b0:3c9:6a21:8cb4 with SMTP id 5614622812f47-3d1e34953e9mr6678788b6e.18.1717252429102; Sat, 01 Jun 2024 07:33:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717252429; cv=pass; d=google.com; s=arc-20160816; b=ZUlphw1OJWvub/NtM11PJML7YxTov5gvXNbhV34Tk3aKX5wkAIO5GZAUyUqPRTEySe ALb9hfxqcQClZKNDMJN8c10dRms23/yPX6eTSMx87M6yFuRyGeAUf4VeuR/Rfabwe6tX xrpsaLo0tPb8dpnbT06ZXGcVTQN8TeupCP/1cz1PvklbYRGLjmoGwGxdqk3rvGSLqyr+ Lklj7+L8VYqI4gyaeESw4dMJqyP+3XVpoq7o7BpOLX4DD5AsNAFRoMKJ5HxC9MubRUbr lTBtmiXSyPhFWHiTeqkDi0ncwVZmOv4IWazfoQNr4Q1BX0C0Mxw8F7QQSyfHbXhLrgZZ NJiw== 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:dkim-signature; bh=oPiP+6Xv1rauIECXZ7PSRSg8wkxsNMowRof7mkzrmGE=; fh=GfxYdUUnf1b28cP12DaclX7VW8sIQe6o2l1QwV4fb1I=; b=ke5WtlLs6uGY3ifEXQFS8ijR8U/qRmJtUXmQ5BrGou9NHfgOHD2B/aX0KQea/C+ZuG AGJcbr/dwyQ3JpDkW8wvmhqpfx546+9oaNyaMc6yw16ZrD6K+Kwzmsbw7LdgL8tQDcF+ OiTO9Onln7xN6+8WLWNR/mpzQc7m8GccVCp8hHON13a8T0/nDEhiv55Tgz6dXDIirioS +1eTuPFNGLWCX6F6R6wekQ2aqc6E9VTq1tatSSKsSlCE/6wNQ0VzNpLcdJwqiXxZnGTw mj+CXjAXChpPJaqnMmiiLtGOoTcCvl7KEUEFDzKl9X037kqp484IFJX0IKxOLeVfPJr8 SHWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa1 header.b=sXNBlm5r; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed1; arc=pass (i=1 dkim=pass dkdomain=ravnborg.org); spf=pass (google.com: domain of linux-kernel+bounces-197893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197893-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42b4fbsi44261076d6.459.2024.06.01.07.33.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 07:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197893-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=@ravnborg.org header.s=rsa1 header.b=sXNBlm5r; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed1; arc=pass (i=1 dkim=pass dkdomain=ravnborg.org); spf=pass (google.com: domain of linux-kernel+bounces-197893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197893-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A79DF1C20D78 for ; Sat, 1 Jun 2024 14:33:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 774EA152504; Sat, 1 Jun 2024 14:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b="sXNBlm5r"; dkim=permerror (0-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b="FPI6mhQl" Received: from mailrelay3-1.pub.mailoutpod2-cph3.one.com (mailrelay3-1.pub.mailoutpod2-cph3.one.com [46.30.211.178]) (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 B1C33824A7 for ; Sat, 1 Jun 2024 14:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.30.211.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717252420; cv=none; b=iS4RaIcs8QjJwlV0VWH+hHfuGZZNSS7FvH6L8moFDqwdR7+4rkBXH32ZnSXE9lLI3nXOe6OYDuPSPpk5F3n6vUgMkrvCnVjJNVlubHwcrx+r4Q4VwnSRrwRTITFVXzIJaYpv1nh4MT0YACDD8U7SaNzT13jORHHbBA4QTWOINiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717252420; c=relaxed/simple; bh=7lcCSZYjgUMhT7hjgnWq0PuqXk4GYQpRlGM9G6xmAH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t2GcDSW5XeEQz5w26PcgGeUn7pUSGku4VaKBWfIA1qFlIacparkQ5QMcoLYhqXKHByzHuRwE1aBwSzqbGo+U/MC1FQUtyWtgO4Pr6vd7Qb5bqtSkf9oMYo7vXEcTj0565dEBQySY7fHFz7BZauUVxPdMwh6JxeS/O0QXnC+hU/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org; spf=none smtp.mailfrom=ravnborg.org; dkim=pass (2048-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b=sXNBlm5r; dkim=permerror (0-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b=FPI6mhQl; arc=none smtp.client-ip=46.30.211.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ravnborg.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=oPiP+6Xv1rauIECXZ7PSRSg8wkxsNMowRof7mkzrmGE=; b=sXNBlm5ryO6M0p5a7pA1/4QYhsHRvE38MIidYWZOfWQeTs0FdE6QWI0LGwbLCW2xdPAfIJL3CBvxV q8Iu5tbSlIJj/59QIbQbHHK7pvWFSX3sqT55cIfuEuPHYEac11ZiBgNeQl8Pef+MhCLuf60bDS4KL4 Q8P/mGQ9UGP57YyhZI4HrLID4vbYsxwcTFSvQbRKXSPnGIqeczO2itnIGmlq6Rd7xV2FQiFW0Mvbs7 xZDoqDciCtpBvVILXpDig22SZm5LXC7BhJiDvLdbVONuvytkC/gVFAB9EEnT7jUjwUOEwq++qosN7G AaY0R8NIb4Ng+Mmf0Mr7o9SOJCycUbg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed1; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=oPiP+6Xv1rauIECXZ7PSRSg8wkxsNMowRof7mkzrmGE=; b=FPI6mhQlC0kwcyQqIsi1QkIyx9Vj8DYZFZ2KTdLErhSprnjhhecaQvLK0h1HXbFwDA8NchK91faYb utsak4IBQ== X-HalOne-ID: c44c843a-2023-11ef-b19f-79f4c2873f57 Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay3.pub.mailoutpod2-cph3.one.com (Halon) with ESMTPSA id c44c843a-2023-11ef-b19f-79f4c2873f57; Sat, 01 Jun 2024 14:32:28 +0000 (UTC) Date: Sat, 1 Jun 2024 16:32:26 +0200 From: Sam Ravnborg To: Cristian Ciocaltea Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Yao , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, kernel@collabora.com, Alexandre ARNOUD , Luis de Arquer , Algea Cao Subject: Re: [PATCH 13/14] drm/bridge: synopsys: Add DW HDMI QP TX controller driver Message-ID: <20240601143226.GA2003970@ravnborg.org> References: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> <20240601-b4-rk3588-bridge-upstream-v1-13-f6203753232b@collabora.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240601-b4-rk3588-bridge-upstream-v1-13-f6203753232b@collabora.com> Hi Cristian, a few drive-by comments below. Sam > + > +static const struct drm_connector_funcs dw_hdmi_qp_connector_funcs = { > + .fill_modes = drm_helper_probe_single_connector_modes, > + .detect = dw_hdmi_connector_detect, > + .destroy = drm_connector_cleanup, > + .force = dw_hdmi_qp_connector_force, > + .reset = drm_atomic_helper_connector_reset, > + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, > + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, > +}; > + > +static int dw_hdmi_qp_bridge_attach(struct drm_bridge *bridge, > + enum drm_bridge_attach_flags flags) > +{ > + struct dw_hdmi *hdmi = bridge->driver_private; > + > + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > + return drm_bridge_attach(bridge->encoder, hdmi->next_bridge, > + bridge, flags); > + > + return dw_hdmi_connector_create(hdmi, &dw_hdmi_qp_connector_funcs); > +} Are there any users left that requires the display driver to create the connector? In other words - could this driver fail if DRM_BRIDGE_ATTACH_NO_CONNECTOR is not passed and drop dw_hdmi_connector_create()? I did not try to verify this - just a naive question. > + > +static enum drm_mode_status > +dw_hdmi_qp_bridge_mode_valid(struct drm_bridge *bridge, > + const struct drm_display_info *info, > + const struct drm_display_mode *mode) > +{ > + struct dw_hdmi *hdmi = bridge->driver_private; > + const struct dw_hdmi_plat_data *pdata = hdmi->plat_data; > + enum drm_mode_status mode_status = MODE_OK; > + > + if (pdata->mode_valid) > + mode_status = pdata->mode_valid(hdmi, pdata->priv_data, info, > + mode); > + > + return mode_status; > +} > + > +static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge, > + struct drm_bridge_state *old_state) > +{ > + struct dw_hdmi *hdmi = bridge->driver_private; > + > + mutex_lock(&hdmi->mutex); > + hdmi->disabled = true; > + hdmi->curr_conn = NULL; > + dw_hdmi_qp_update_power(hdmi); > + dw_handle_plugged_change(hdmi, false); > + mutex_unlock(&hdmi->mutex); > +} > + > +static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge, > + struct drm_bridge_state *old_state) > +{ > + struct dw_hdmi *hdmi = bridge->driver_private; > + struct drm_atomic_state *state = old_state->base.state; > + struct drm_connector *connector; > + > + connector = drm_atomic_get_new_connector_for_encoder(state, > + bridge->encoder); > + > + mutex_lock(&hdmi->mutex); > + hdmi->disabled = false; > + hdmi->curr_conn = connector; > + dw_hdmi_qp_update_power(hdmi); > + dw_handle_plugged_change(hdmi, true); > + mutex_unlock(&hdmi->mutex); > +} > + > +static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { > + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, > + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, > + .atomic_reset = drm_atomic_helper_bridge_reset, > + .attach = dw_hdmi_qp_bridge_attach, > + .detach = dw_hdmi_bridge_detach, > + .atomic_check = dw_hdmi_bridge_atomic_check, > + .atomic_enable = dw_hdmi_qp_bridge_atomic_enable, > + .atomic_disable = dw_hdmi_qp_bridge_atomic_disable, > + .mode_set = dw_hdmi_bridge_mode_set, The use of mode_set is deprecated - see drm_bridge.h