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=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 D9E67C4361B for ; Mon, 7 Dec 2020 14:08:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EBE423447 for ; Mon, 7 Dec 2020 14:08:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EBE423447 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GDVZcZBtX887GUArtU3OH8Odsy7/gHiSgMqzilr3WeM=; b=ozQBYAdLZGDmvvTYQFxb3x4Rr vjneL4Eyyz0eJLd4yTEkbGZHMwf3bEUyPqJ9N8PFXQmJmRsa9MXWO95SeCXk48+dzpfuGPEoR2Lgp P2NGdSHeXocOqJz8KgY1+sgGHLUIQroNGeUBVXpgMELlxiwDQEAQOoQrA4Z7+1wEjxVMHOlCuIxyw i7HyZ00Nf3o4UNVo6Es7vxAp+7QoNRUKliASdW0oSySCTQkJgtwGyJFZGJZSypNkm0on8KmB7m9KU vl2UvrsH6a8f3sxgFM3x3fVrcXiowRTzu3KLx64YVqOULU+ZTMw+IATGSk52o+FQ+jEOqYw4bQYog +gAq2n/Og==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmHB6-0001lT-6H; Mon, 07 Dec 2020 14:07:48 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmHB3-0001ka-9X; Mon, 07 Dec 2020 14:07:46 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 075D2ABE9; Mon, 7 Dec 2020 14:07:44 +0000 (UTC) Subject: Re: [PATCH v4 4/8] drm/vc4: hdmi: Create a custom connector state To: Maxime Ripard , Maarten Lankhorst , Daniel Vetter , David Airlie , Eric Anholt References: <20201207133948.2109194-1-maxime@cerno.tech> <20201207133948.2109194-5-maxime@cerno.tech> From: Thomas Zimmermann Message-ID: <44d7142b-37f0-39f0-4e4e-a0934eb71dc9@suse.de> Date: Mon, 7 Dec 2020 15:07:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201207133948.2109194-5-maxime@cerno.tech> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201207_090745_569325_8583BDAE X-CRM114-Status: GOOD ( 26.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Dave Stevenson Content-Type: multipart/mixed; boundary="===============3566579090636189411==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============3566579090636189411== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="doIXx6N55a2SIUCHJdCqev5tZ1pWclCYl" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --doIXx6N55a2SIUCHJdCqev5tZ1pWclCYl Content-Type: multipart/mixed; boundary="S7hDljSzjcxVdU8J3bz2IzoBdWvYe7ob2"; protected-headers="v1" From: Thomas Zimmermann To: Maxime Ripard , Maarten Lankhorst , Daniel Vetter , David Airlie , Eric Anholt Cc: bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Dave Stevenson Message-ID: <44d7142b-37f0-39f0-4e4e-a0934eb71dc9@suse.de> Subject: Re: [PATCH v4 4/8] drm/vc4: hdmi: Create a custom connector state References: <20201207133948.2109194-1-maxime@cerno.tech> <20201207133948.2109194-5-maxime@cerno.tech> In-Reply-To: <20201207133948.2109194-5-maxime@cerno.tech> --S7hDljSzjcxVdU8J3bz2IzoBdWvYe7ob2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 07.12.20 um 14:39 schrieb Maxime Ripard: > When run with a higher bpc than 8, the clock of the HDMI controller nee= ds > to be adjusted. Let's create a connector state that will be used at > atomic_check and atomic_enable to compute and store the clock rate > associated to the state. >=20 > Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 27 +++++++++++++++++++++++++-- > drivers/gpu/drm/vc4/vc4_hdmi.h | 10 ++++++++++ > 2 files changed, 35 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_h= dmi.c > index 112c09873eb4..862c93708e9a 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -170,18 +170,41 @@ static int vc4_hdmi_connector_get_modes(struct dr= m_connector *connector) > =20 > static void vc4_hdmi_connector_reset(struct drm_connector *connector)= > { > - drm_atomic_helper_connector_reset(connector); > + struct vc4_hdmi_connector_state *conn_state =3D kzalloc(sizeof(*conn_= state), GFP_KERNEL); > + > + if (connector->state) > + __drm_atomic_helper_connector_destroy_state(connector->state); > + > + kfree(connector->state); > + > + __drm_atomic_helper_connector_reset(connector, &conn_state->base); > =20 > if (connector->state) > drm_atomic_helper_connector_tv_reset(connector); > } > =20 > +static struct drm_connector_state * > +vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) > +{ > + struct drm_connector_state *conn_state =3D connector->state; > + struct vc4_hdmi_connector_state *vc4_state =3D conn_state_to_vc4_hdmi= _conn_state(conn_state); > + struct vc4_hdmi_connector_state *new_state; > + > + new_state =3D kzalloc(sizeof(*new_state), GFP_KERNEL); > + if (!new_state) > + return NULL; > + > + __drm_atomic_helper_connector_duplicate_state(connector, &new_state->= base); > + > + return &new_state->base; > +} > + > static const struct drm_connector_funcs vc4_hdmi_connector_funcs =3D = { > .detect =3D vc4_hdmi_connector_detect, > .fill_modes =3D drm_helper_probe_single_connector_modes, > .destroy =3D vc4_hdmi_connector_destroy, > .reset =3D vc4_hdmi_connector_reset, > - .atomic_duplicate_state =3D drm_atomic_helper_connector_duplicate_sta= te, > + .atomic_duplicate_state =3D vc4_hdmi_connector_duplicate_state, > .atomic_destroy_state =3D drm_atomic_helper_connector_destroy_state,= > }; > =20 > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_h= dmi.h > index 0526a9cf608a..2cf5362052e2 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.h > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h > @@ -180,6 +180,16 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) > return container_of(_encoder, struct vc4_hdmi, encoder); > } > =20 > +struct vc4_hdmi_connector_state { > + struct drm_connector_state base; > +}; > + > +static inline struct vc4_hdmi_connector_state * > +conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_sta= te) > +{ > + return container_of(conn_state, struct vc4_hdmi_connector_state, base= ); > +} > + > void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi, > struct drm_display_mode *mode); > void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi); >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --S7hDljSzjcxVdU8J3bz2IzoBdWvYe7ob2-- --doIXx6N55a2SIUCHJdCqev5tZ1pWclCYl Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAl/ONy4FAwAAAAAACgkQlh/E3EQov+DI rA//d9SUoFa/wVAk2m4muvVfjeLZnUx8qOxnnaEDcSq1Lt6K9x89eBIYb1Khm3zhDcvPNyxx68AM GrOt2HpQ3Rb05Aa9NnLtKEq4AdDhaGckqCNXzbD3ufZbYAwQiHOGlBm1BnZF1SgZ/Sv86id/EmOX xiPa1h2cvQuQWD9P7L2AOT1f1w9brT+lg2z2Grhuw2ZagOIMj0nMXrlypA9WW2F6MxrkzLqJKpZ7 zxLR3HHL0fKORY/WiiQ/3nlM2bmtphOPZGkCXes7XfqsPjrkIB7iwlO0GejY1kbtkbnq2rLMQaoc LzshhpIZinz19DwPHZJMdU5ePmyz6MVkPQRvf2SwR5iey+4Epwd/hskxuFbOEExflDfVMp/UB8+z I5V0Bkq6F4GI5su7N9WHbYw60v+vIU0CL9uEVUiIuAplBNNqFYsulP7W6vbZA7PP3QA9HzQf7Kvm yUcAFl15/H2sF1bI9lJkSqXqwa3YJpiLjP9LAptLGSL+XFqT2i8zFJ82ATTKGPhqkeqcrvVsCS0w V7f0Y6zR/JH+8ROnerixefwaO+zycYD6ysTYYI3FZYmh1r7W76G7ctXzqkDjbu4EM1TpSgk/jwqR RayMOjXTXs+rvUL+wejpPyl39oAwX2eEb2NpLqZGYFsnvAz46hhHp+6b8UXWAbynKe6gT++n9bs+ MaI= =9uOJ -----END PGP SIGNATURE----- --doIXx6N55a2SIUCHJdCqev5tZ1pWclCYl-- --===============3566579090636189411== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3566579090636189411==--