From nobody Mon May 11 00:07:43 2026 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 C31CCC433EF for ; Wed, 20 Apr 2022 11:45:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378235AbiDTLsb (ORCPT ); Wed, 20 Apr 2022 07:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377999AbiDTLs0 (ORCPT ); Wed, 20 Apr 2022 07:48:26 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED1E04162A for ; Wed, 20 Apr 2022 04:45:40 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id u17-20020a05600c211100b0038eaf4cdaaeso3493874wml.1 for ; Wed, 20 Apr 2022 04:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vxAaLTkBoUBaCL/O3581iu7gQKfuo3i9c87P/ALffLw=; b=glNX7oyFIiDjUhuM/RiuAr+tK3D1huhhvWxzoQlzfMk8Gksi5NXqlb2Y3BJdneoA6J UsCP2Sfbwc5F++EVTRcrOae335Zwn+ngDNnD0cGmaan2pOGxdcv9QitSYBBkWVsovkGm 0jxZGGPGbk5sxYXjX8fqVegGG2sXm/pJuDZmkAB3BBSRDB3MwBFpnim4fwcIH8OsHlB+ Ipuhq1cRD4TJKuuJYCu2j7k/C9VDTGQv2ozoUdurNkmSINkMjrNb7sxaGP6egzkZl+j7 uv/Ntefi1ZY6rOEFU7netp0P+Ta/cF9NHNx66RJEDoKMAcg79VFlIhuZ6OKW903nHptM xuBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vxAaLTkBoUBaCL/O3581iu7gQKfuo3i9c87P/ALffLw=; b=OJK4TH4aslNiqo23myrXLq/U81lPl5F60OuiA25BW3gu8JI5hNEWg82yN6yBvR0i1C xJ7YOw2WW3J5aFUj1/8YJJ2c/qFM9cjn2wibHOR7RgsPhXpjLD5mHcuZhM+X7/bAxTgf af+tzcO126DbOAj4c1i2dWrJ6oL3bhf+h29tT/M6Pb8JBZ45zn/TfGSQGmtd/0TX2We3 99qFskpuy7W7wk4W9E8Z5PCjaXj2AdCaMfWzH3SWcCVODNvsSSDVtG/qvBEhrs/8X1UK 4YPvuut61IngYn9WbA+haimd4aMGJCaFV6mF2/Jc9JqfBLdx0oxmcEHDdJswXieTUBoC /dQQ== X-Gm-Message-State: AOAM531Dez7fzfD+sPaYo2j/AsreDcAQWV9yp5tFkt+7nxSH5zrT0OHW yQRLKCcfJTaUuXN14OJ1izL2TlfgVLW39g== X-Google-Smtp-Source: ABdhPJxyCesVNQOMZOE2I3so6+MUSyrfDzSvRYyfLFcfGCB8v9AzI2UMpkSbtsil4zNu5fGHiuiIJw== X-Received: by 2002:a05:600c:1f11:b0:392:aaf8:df7c with SMTP id bd17-20020a05600c1f1100b00392aaf8df7cmr3128422wmb.148.1650455139381; Wed, 20 Apr 2022 04:45:39 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id i74-20020adf90d0000000b0020373ba7beesm17798204wri.0.2022.04.20.04.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 04:45:39 -0700 (PDT) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: emma@anholt.net Cc: mripard@kernel.org, laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Subject: [PATCH v3 1/2] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi Date: Wed, 20 Apr 2022 13:44:59 +0200 Message-Id: <20220420114500.187664-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220420114500.187664-1-jose.exposito89@gmail.com> References: <20220420114500.187664-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Once EDID is parsed, the monitor HDMI support information is cached in drm_display_info.is_hdmi by drm_parse_hdmi_vsdb_video(). This driver calls drm_detect_hdmi_monitor() to receive the same information and stores its own cached value in vc4_hdmi_encoder.hdmi_monitor, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead. This also allows to remove vc4_hdmi_encoder.hdmi_monitor. drm_detect_hdmi_monitor() is called in vc4_hdmi_connector_detect() and vc4_hdmi_connector_get_modes(). In both cases it is safe to rely on drm_display_info.is_hdmi as shown by ftrace: $ sudo trace-cmd record -p function_graph -l "vc4_hdmi_*" -l "drm_*" vc4_hdmi_connector_detect: vc4_hdmi_connector_detect() { drm_get_edid() { drm_connector_update_edid_property() { drm_add_display_info() { drm_reset_display_info(); drm_for_each_detailed_block.part.0(); drm_parse_cea_ext() { drm_find_cea_extension(); drm_parse_hdmi_vsdb_video(); /* drm_display_info.is_hdmi is cached here */ } } } } /* drm_display_info.is_hdmi is used here */ } vc4_hdmi_connector_get_modes: vc4_hdmi_connector_get_modes() { drm_get_edid() { drm_connector_update_edid_property() { drm_add_display_info() { drm_reset_display_info(); drm_for_each_detailed_block.part.0(); drm_parse_cea_ext() { drm_find_cea_extension(); drm_parse_hdmi_vsdb_video(); /* drm_display_info.is_hdmi is cached here */ } } } } /* drm_display_info.is_hdmi is used here */ drm_connector_update_edid_property(); } Signed-off-by: Jos=C3=A9 Exp=C3=B3sito --- drivers/gpu/drm/vc4/vc4_hdmi.c | 17 ++++++----------- drivers/gpu/drm/vc4/vc4_hdmi.h | 1 - 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 6c58b0fd13fb..9c73a211ae80 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -107,9 +107,9 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct= drm_display_mode *mode) static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi, const struct drm_display_mode *mode) { - struct vc4_hdmi_encoder *vc4_encoder =3D &vc4_hdmi->encoder; + struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; =20 - return !vc4_encoder->hdmi_monitor || + return !display->is_hdmi || drm_default_rgb_quant_range(mode) =3D=3D HDMI_QUANTIZATION_RANGE_FULL; } =20 @@ -216,7 +216,6 @@ vc4_hdmi_connector_detect(struct drm_connector *connect= or, bool force) =20 if (edid) { cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid); - vc4_hdmi->encoder.hdmi_monitor =3D drm_detect_hdmi_monitor(edid); kfree(edid); } } @@ -242,7 +241,6 @@ static void vc4_hdmi_connector_destroy(struct drm_conne= ctor *connector) static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) { struct vc4_hdmi *vc4_hdmi =3D connector_to_vc4_hdmi(connector); - struct vc4_hdmi_encoder *vc4_encoder =3D &vc4_hdmi->encoder; int ret =3D 0; struct edid *edid; =20 @@ -255,8 +253,6 @@ static int vc4_hdmi_connector_get_modes(struct drm_conn= ector *connector) goto out; } =20 - vc4_encoder->hdmi_monitor =3D drm_detect_hdmi_monitor(edid); - drm_connector_update_edid_property(connector, edid); ret =3D drm_add_edid_modes(connector, edid); kfree(edid); @@ -578,13 +574,12 @@ static void vc4_hdmi_set_infoframes(struct drm_encode= r *encoder) static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, struct drm_display_mode *mode) { - struct vc4_hdmi_encoder *vc4_encoder =3D to_vc4_hdmi_encoder(encoder); struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; =20 lockdep_assert_held(&vc4_hdmi->mutex); =20 - if (!vc4_encoder->hdmi_monitor) + if (!display->is_hdmi) return false; =20 if (!display->hdmi.scdc.supported || @@ -1147,7 +1142,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct = drm_encoder *encoder, { struct vc4_hdmi *vc4_hdmi =3D encoder_to_vc4_hdmi(encoder); struct drm_display_mode *mode =3D &vc4_hdmi->saved_adjusted_mode; - struct vc4_hdmi_encoder *vc4_encoder =3D to_vc4_hdmi_encoder(encoder); + struct drm_display_info *display =3D &vc4_hdmi->connector.display_info; bool hsync_pos =3D mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos =3D mode->flags & DRM_MODE_FLAG_PVSYNC; unsigned long flags; @@ -1168,7 +1163,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct = drm_encoder *encoder, HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_BLANKPIX); =20 - if (vc4_encoder->hdmi_monitor) { + if (display->is_hdmi) { HDMI_WRITE(HDMI_SCHEDULER_CONTROL, HDMI_READ(HDMI_SCHEDULER_CONTROL) | VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -1195,7 +1190,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct = drm_encoder *encoder, "!VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); } =20 - if (vc4_encoder->hdmi_monitor) { + if (display->is_hdmi) { spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); =20 WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 1076faeab616..44977002445f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -11,7 +11,6 @@ /* VC4 HDMI encoder KMS struct */ struct vc4_hdmi_encoder { struct vc4_encoder base; - bool hdmi_monitor; }; =20 static inline struct vc4_hdmi_encoder * --=20 2.25.1 From nobody Mon May 11 00:07:43 2026 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 D631EC433EF for ; Wed, 20 Apr 2022 11:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378241AbiDTLsf (ORCPT ); Wed, 20 Apr 2022 07:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378229AbiDTLsa (ORCPT ); Wed, 20 Apr 2022 07:48:30 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9C10419B8 for ; Wed, 20 Apr 2022 04:45:44 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id r4-20020a05600c35c400b0039295dc1fc3so1050767wmq.3 for ; Wed, 20 Apr 2022 04:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lFCKgPdJ/CCqTu3x/1Yy2jf+PG8b00IGqwXiUi0yBIA=; b=GXNF/fFbx9d6DuyiAMIllf2dfw0igvuN4n6cSYK5HEVSZ9Fu49GJl9W68c5f3BLVqI 0IfqhTFSjoK+Rw3wvl6N/Ca+dotjOcYSkaRiIJZkU3fv9C9u6fm7JzHTv5P2h8Xhn1lB bNabk8Mnoy3OhlN7bZdPxhz5p3HGJ9GTVh0zoghFFu9z9pb/P02Diuow4ilWP4eZmFiB g3tsZWBBO5vBUEzPPq1yKSp85A8a4LMPFjNRDBLNziyjXhtqqDWqq1/u3Szjnk9Zeka4 AL0mz460HRrdMlxPDSd+VeeSdfiBbynFLVCezYe1RVLccYnmmY3VCZIFsrxzvNuBUqq6 BpOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lFCKgPdJ/CCqTu3x/1Yy2jf+PG8b00IGqwXiUi0yBIA=; b=MkwjuklF9TVbuje03+0h1zX03M5sr4PE74EtPWCDNRNa9ZXSbaHq/Sk6aeL9t881a7 eQNsawY7pgm7INNjkm6USj5gS2cq2B7nkR8aHOtLIS0I7FH+TKZJI/NTJvEZxjl5Vj/9 lFUK9U8uy4z7WKLpc95wRKMMjAkMwuK6BRVOgh5aT1nfFzSJgTC0nzoBaZFse0hKoWpS qFLCe92d16LZz+gpFBgUkmVeVAsbWkFrZ8aGzugZ/xQq6gGlmGgAj8Hmx29zBBOMoLqa XpkhwfDvz3zWnml4HqSZ/In3spOB44f9jaIKtG7DxgbMU5V+YloK/wg6H7YQJIbZ50XJ jKjw== X-Gm-Message-State: AOAM5335E3V7QQa7c2RR9LiYOEfnQ+QuDY/RN2gWQN+S3uuBd9biMJrq lgH27Rs5VJ8XcU1sTLzMpJA= X-Google-Smtp-Source: ABdhPJxp2lXZMiX4io4AGVzFr7xka+KP2mq55THxYO6xGRXowX9g0V8G+19xuvrq8yDlfolUQx2n1A== X-Received: by 2002:a1c:6a02:0:b0:38b:3661:47f1 with SMTP id f2-20020a1c6a02000000b0038b366147f1mr3211899wmc.5.1650455143489; Wed, 20 Apr 2022 04:45:43 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id i74-20020adf90d0000000b0020373ba7beesm17798204wri.0.2022.04.20.04.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 04:45:43 -0700 (PDT) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: emma@anholt.net Cc: mripard@kernel.org, laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Subject: [PATCH v3 2/2] drm/vc4: hdmi: Remove vc4_hdmi_encoder Date: Wed, 20 Apr 2022 13:45:00 +0200 Message-Id: <20220420114500.187664-3-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220420114500.187664-1-jose.exposito89@gmail.com> References: <20220420114500.187664-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vc4_hdmi_encoder struct was used exclusively to cache the value returned by drm_detect_hdmi_monitor() in order to avoid calling it multiple times. Now that drm_detect_hdmi_monitor() has been replaced with drm_display_info.is_hdmi, there is no need to have an extra struct. Remove vc4_hdmi_encoder. Signed-off-by: Jos=C3=A9 Exp=C3=B3sito --- drivers/gpu/drm/vc4/vc4_hdmi.c | 24 ++++++++++++------------ drivers/gpu/drm/vc4/vc4_hdmi.h | 16 ++-------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 9c73a211ae80..f8d662fde5e0 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -220,7 +220,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connect= or, bool force) } } =20 - vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base.base); + vc4_hdmi_enable_scrambling(&vc4_hdmi->encoder.base); pm_runtime_put(&vc4_hdmi->pdev->dev); mutex_unlock(&vc4_hdmi->mutex); return connector_status_connected; @@ -357,7 +357,7 @@ static int vc4_hdmi_connector_init(struct drm_device *d= ev, struct vc4_hdmi *vc4_hdmi) { struct drm_connector *connector =3D &vc4_hdmi->connector; - struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base.base; + struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base; int ret; =20 drm_connector_init_with_ddc(dev, connector, @@ -1463,7 +1463,7 @@ static int vc4_hdmi_audio_startup(struct device *dev,= void *data) =20 static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) { - struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base.base; + struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base; struct device *dev =3D &vc4_hdmi->pdev->dev; unsigned long flags; int ret; @@ -1553,7 +1553,7 @@ static int vc4_hdmi_audio_prepare(struct device *dev,= void *data, struct hdmi_codec_params *params) { struct vc4_hdmi *vc4_hdmi =3D dev_get_drvdata(dev); - struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base.base; + struct drm_encoder *encoder =3D &vc4_hdmi->encoder.base; unsigned int sample_rate =3D params->sample_rate; unsigned int channels =3D params->channels; unsigned long flags; @@ -2506,13 +2506,13 @@ static int vc4_hdmi_bind(struct device *dev, struct= device *master, void *data) INIT_DELAYED_WORK(&vc4_hdmi->scrambling_work, vc4_hdmi_scrambling_wq); =20 dev_set_drvdata(dev, vc4_hdmi); - encoder =3D &vc4_hdmi->encoder.base.base; - vc4_hdmi->encoder.base.type =3D variant->encoder_type; - vc4_hdmi->encoder.base.pre_crtc_configure =3D vc4_hdmi_encoder_pre_crtc_c= onfigure; - vc4_hdmi->encoder.base.pre_crtc_enable =3D vc4_hdmi_encoder_pre_crtc_enab= le; - vc4_hdmi->encoder.base.post_crtc_enable =3D vc4_hdmi_encoder_post_crtc_en= able; - vc4_hdmi->encoder.base.post_crtc_disable =3D vc4_hdmi_encoder_post_crtc_d= isable; - vc4_hdmi->encoder.base.post_crtc_powerdown =3D vc4_hdmi_encoder_post_crtc= _powerdown; + encoder =3D &vc4_hdmi->encoder.base; + vc4_hdmi->encoder.type =3D variant->encoder_type; + vc4_hdmi->encoder.pre_crtc_configure =3D vc4_hdmi_encoder_pre_crtc_config= ure; + vc4_hdmi->encoder.pre_crtc_enable =3D vc4_hdmi_encoder_pre_crtc_enable; + vc4_hdmi->encoder.post_crtc_enable =3D vc4_hdmi_encoder_post_crtc_enable; + vc4_hdmi->encoder.post_crtc_disable =3D vc4_hdmi_encoder_post_crtc_disabl= e; + vc4_hdmi->encoder.post_crtc_powerdown =3D vc4_hdmi_encoder_post_crtc_powe= rdown; vc4_hdmi->pdev =3D pdev; vc4_hdmi->variant =3D variant; =20 @@ -2674,7 +2674,7 @@ static void vc4_hdmi_unbind(struct device *dev, struc= t device *master, vc4_hdmi_cec_exit(vc4_hdmi); vc4_hdmi_hotplug_exit(vc4_hdmi); vc4_hdmi_connector_destroy(&vc4_hdmi->connector); - drm_encoder_cleanup(&vc4_hdmi->encoder.base.base); + drm_encoder_cleanup(&vc4_hdmi->encoder.base); =20 pm_runtime_disable(dev); =20 diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 44977002445f..71768915cc4b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -8,17 +8,6 @@ =20 #include "vc4_drv.h" =20 -/* VC4 HDMI encoder KMS struct */ -struct vc4_hdmi_encoder { - struct vc4_encoder base; -}; - -static inline struct vc4_hdmi_encoder * -to_vc4_hdmi_encoder(struct drm_encoder *encoder) -{ - return container_of(encoder, struct vc4_hdmi_encoder, base.base); -} - struct vc4_hdmi; struct vc4_hdmi_register; struct vc4_hdmi_connector_state; @@ -127,7 +116,7 @@ struct vc4_hdmi { struct platform_device *pdev; const struct vc4_hdmi_variant *variant; =20 - struct vc4_hdmi_encoder encoder; + struct vc4_encoder encoder; struct drm_connector connector; =20 struct delayed_work scrambling_work; @@ -230,8 +219,7 @@ connector_to_vc4_hdmi(struct drm_connector *connector) static inline struct vc4_hdmi * encoder_to_vc4_hdmi(struct drm_encoder *encoder) { - struct vc4_hdmi_encoder *_encoder =3D to_vc4_hdmi_encoder(encoder); - + struct vc4_encoder *_encoder =3D to_vc4_encoder(encoder); return container_of(_encoder, struct vc4_hdmi, encoder); } =20 --=20 2.25.1