Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1047800ybm; Wed, 27 May 2020 14:51:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDUNN+Uh+SW/5GexqNPUZW+NRXi9dxU+hFXrB3zpH4Xq+k+fmcJp8J9zojKYE4rjjWoPhN X-Received: by 2002:a17:906:3b9a:: with SMTP id u26mr331449ejf.456.1590616313196; Wed, 27 May 2020 14:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590616313; cv=none; d=google.com; s=arc-20160816; b=gcawHjEyDI5WYmg4v2RliJsJ1z3oBwCgB7rdCmjwqGmXh+hi+PeCJiMg6ZtSI546gx 8AHFCx086H5nhwQ7CBVsc4CCfGE+ZaSxBbIF8HW64jUY0AQw8f6gOu80wE+f+UI8zdO5 qNNFsazK+kim7E/WjuYz6Stcg77mB+GhJbwGM66d9VLL013qhxq9ODjMbzpp8RDXhcT6 qsdsMMeRjvtzAhADqQvbaHlCfCAQC2aWRmXPzdRaOuHs3f8oqG9g5jggeJLjFY4WreNd avgei6Y2X3uQ5VrQz8or2rp2fQIcwobXtM90a84FZ3+ArD2Ny7kkQ1DQ1yR76KWDZhWa hnJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Vhm4fEWJWlUEGaQauSi80gJQzxJCgTq/nY+Q2pByVBs=; b=aTz0slTe5xia5Bq2PwIlL2WK+qDaGxN/6rwdK4+QydMjIwAMy9a60GFnpJr/btewFw P/uoIKQj62ftdiI/IvQcAFxIktyHD6oeSNbVAa/5yokrCTSg/7Ye3UIznwBdyylj61HL n+TWGQUkrnmD8kc4Whk6CKepK4CywOLcZBAooLkqc3AJHZILpAG5DuTF/d6CMapCrzdD uJHjIfayPcO4GYF2SWCfnFdrZVtsASlhF0guMNtYA+WORyrn6+3VvW3fseTkttdQqKvT dv5Du/sHB+u0/yW4UKUJxNOKazhDuGqMAjUUX3JhExEardFbMRuRh7YIhPmxCVlubJiN ZQDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=mQlvsgjT; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dNNufGWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd16si2593597ejb.649.2020.05.27.14.51.30; Wed, 27 May 2020 14:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=mQlvsgjT; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dNNufGWG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390406AbgE0PwK (ORCPT + 98 others); Wed, 27 May 2020 11:52:10 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:44695 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390314AbgE0PvW (ORCPT ); Wed, 27 May 2020 11:51:22 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id AA96B581453; Wed, 27 May 2020 11:51:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 27 May 2020 11:51:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=Vhm4fEWJWlUEG aQauSi80gJQzxJCgTq/nY+Q2pByVBs=; b=mQlvsgjTgutd24DeiFZPZaoT6Qt0c 1vxZw0WZaGdTjUL282MWWjTmslQTfFxztbnf9b17DHRG/YInTLsRipb3zPUPOHS9 eWWcieGktP2qEI8A7IpVAn3Vax/RM6t19PJe6ti/XQlB15JQY05J4aJz3ODU3kyY LIZxvRk61OLzQy9H+O84pGlz1FNxmXM0ruuowbOygaRHVFSPSX6ScHYqqgnxqme4 D/vjtJSm7XhXDrRnpx/ujNE+TSghe2Y+rUJmJ9RXvgc+gYyfsUhpISXVIA4aF7LO Z4gNzI36QZrhrvD+0h5HY9+666XBVB/iRKDWq2FT47vx7TN+yyDldqzdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Vhm4fEWJWlUEGaQauSi80gJQzxJCgTq/nY+Q2pByVBs=; b=dNNufGWG bYRltRuYH9wgvVRdIx1VXMMhsdVr99xMEzXMDC5fDINQ3SAvVAwxkK+Xb0Mzhm7k HX/3IDpkaRMd5oJ0e50njcWltX/S6hLsbykH++QyTarJP9PCft3A9Ewz1aOMCT5W j8AD36sRpCLqGU9p4jMlOvLfSzOc5n+eSxzJFRZRbNvxuAy+Wf7Pyr8diRpq6Yz/ OTA6Wr7JrMHy8oKcKYTnIn0fVnLIFOyfssFhGG54IRLJ+IaMFDEgk4G7p45ttjcD w95VzNKgWfjIp2cHxXn0GSznDHV3cHnlW6scSbWy2CuEDNOY2tUmvVzIw/pVVKQ2 9TGqn3CvQ+xigQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvgedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepieeugeefgfeiieelveekheehhedtueetueehkedtfffgvedtvdeijeduieff veevnecuffhomhgrihhnpegshihtvghsrdgurghtrgenucfkphepledtrdekledrieekrd ejieenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm rgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 3DA12328005A; Wed, 27 May 2020 11:51:20 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard Subject: [PATCH v3 078/105] drm/vc4: hdmi: Remove vc4_hdmi_connector Date: Wed, 27 May 2020 17:48:48 +0200 Message-Id: <46734e1f79ca5983f0f0b92b04fb3240fa68816d.1590594512.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vc4_hdmi_connector was only used to switch between drm_connector to drm_encoder. However, we can now use vc4_hdmi to do the switch, so that structure is redundant. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 19 ++++++++----------- drivers/gpu/drm/vc4/vc4_hdmi.h | 23 ++--------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 850111665839..963be5bc1d5f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -189,13 +189,10 @@ static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = static int vc4_hdmi_connector_init(struct drm_device *dev, struct vc4_hdmi *vc4_hdmi) { - struct vc4_hdmi_connector *hdmi_connector = &vc4_hdmi->connector; - struct drm_connector *connector = &hdmi_connector->base; + struct drm_connector *connector = &vc4_hdmi->connector; struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; int ret; - hdmi_connector->encoder = encoder; - drm_connector_init_with_ddc(dev, connector, &vc4_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA, @@ -284,7 +281,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); - struct drm_connector *connector = &vc4_hdmi->connector.base; + struct drm_connector *connector = &vc4_hdmi->connector; struct drm_connector_state *cstate = connector->state; struct drm_crtc *crtc = encoder->crtc; const struct drm_display_mode *mode = &crtc->state->adjusted_mode; @@ -663,7 +660,7 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, { struct vc4_hdmi *vc4_hdmi = dai_to_hdmi(dai); struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; - struct drm_connector *connector = &vc4_hdmi->connector.base; + struct drm_connector *connector = &vc4_hdmi->connector; int ret; if (vc4_hdmi->audio.substream && vc4_hdmi->audio.substream != substream) @@ -837,7 +834,7 @@ static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, { struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component); - struct drm_connector *connector = &vc4_hdmi->connector.base; + struct drm_connector *connector = &vc4_hdmi->connector; uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; uinfo->count = sizeof(connector->eld); @@ -850,7 +847,7 @@ static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, { struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component); - struct drm_connector *connector = &vc4_hdmi->connector.base; + struct drm_connector *connector = &vc4_hdmi->connector; memcpy(ucontrol->value.bytes.data, connector->eld, sizeof(connector->eld)); @@ -1301,7 +1298,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) if (ret < 0) goto err_destroy_conn; - cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector.base); + cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); HDMI_WRITE(VC4_HDMI_CPU_MASK_SET, 0xffffffff); @@ -1338,7 +1335,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) err_delete_cec_adap: cec_delete_adapter(vc4_hdmi->cec_adap); err_destroy_conn: - vc4_hdmi_connector_destroy(&vc4_hdmi->connector.base); + vc4_hdmi_connector_destroy(&vc4_hdmi->connector); #endif err_destroy_encoder: drm_encoder_cleanup(encoder); @@ -1362,7 +1359,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, struct vc4_hdmi *vc4_hdmi = snd_soc_card_get_drvdata(card); cec_unregister_adapter(vc4_hdmi->cec_adap); - vc4_hdmi_connector_destroy(&vc4_hdmi->connector.base); + vc4_hdmi_connector_destroy(&vc4_hdmi->connector); drm_encoder_cleanup(&vc4_hdmi->encoder.base.base); clk_disable_unprepare(vc4_hdmi->hsm_clock); diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 749a807cd1f3..88794136d2e4 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -21,23 +21,6 @@ to_vc4_hdmi_encoder(struct drm_encoder *encoder) return container_of(encoder, struct vc4_hdmi_encoder, base.base); } -/* VC4 HDMI connector KMS struct */ -struct vc4_hdmi_connector { - struct drm_connector base; - - /* Since the connector is attached to just the one encoder, - * this is the reference to it so we can do the best_encoder() - * hook. - */ - struct drm_encoder *encoder; -}; - -static inline struct vc4_hdmi_connector * -to_vc4_hdmi_connector(struct drm_connector *connector) -{ - return container_of(connector, struct vc4_hdmi_connector, base); -} - /* HDMI audio information */ struct vc4_hdmi_audio { struct snd_soc_card card; @@ -56,7 +39,7 @@ struct vc4_hdmi { struct platform_device *pdev; struct vc4_hdmi_encoder encoder; - struct vc4_hdmi_connector connector; + struct drm_connector connector; struct vc4_hdmi_audio audio; @@ -81,9 +64,7 @@ struct vc4_hdmi { static inline struct vc4_hdmi * connector_to_vc4_hdmi(struct drm_connector *connector) { - struct vc4_hdmi_connector *_connector = to_vc4_hdmi_connector(connector); - - return container_of(_connector, struct vc4_hdmi, connector); + return container_of(connector, struct vc4_hdmi, connector); } static inline struct vc4_hdmi * -- git-series 0.9.1