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=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 C0AC0C4363D for ; Fri, 25 Sep 2020 16:02:20 +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 689DF20759 for ; Fri, 25 Sep 2020 16:02:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yLhWid1t"; dkim=temperror (0-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="ru4Xrfle"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rl7O50ou" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 689DF20759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech 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:References:Message-ID:Subject:To:From:Date: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=AaQc+PzplK3rfNi7RTrg+VfV6+FF0xJOC7gHYsA1GVM=; b=yLhWid1tMOyskKTdjPygv+4VB xPCi41veivDzKJ8xq755fgcF1ulGGfR0u1TWZarkaWXwg/2TO96qCW2tDj5/Bx61DmaS0nOXSeW2E zxb6qXVZDg5NXEtPltPntrJ+2EvWc6BWvlPS4CGDRx71w1YjLhvasSFQfQUMNmpnoFrpqBB266Pym HJprl6kvnRQk8LfJaLmrohc3eCCMaUsmfWH/Shp+5a1+OcCzw+49CohYu9EwmskyWGq9VA32UcB2A y7RUzSDuMBV6GKUZ2WsMzo6Vj5XDT3m9zaN9Y15h7upX/GkRWc0FyTICBWOssvZ9pgueesaf7l1F+ P2vG8ighg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLq9h-00059f-27; Fri, 25 Sep 2020 16:01:05 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLpA8-00016I-Pq; Fri, 25 Sep 2020 14:57:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 64E08560; Fri, 25 Sep 2020 10:57:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 25 Sep 2020 10:57:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=B1dEF+CGw5EeEFhU9sVTINfHayv /iFEBrY6kEJImUqE=; b=ru4XrfleDL/ypPKESiZ9rcmc6yhpenjO2PMQLQtx4am HFxOoT1A7ZxBKUJy6rHXhyGWjD9QJXIIf+XQUNYSIg5d32vgmQFXnNiBPmPJPeNb yteCtlZT1E73RIayQBmIIjYqK0/ChrxSZQ6xrHC59LXCP5C4NCOBzo5HMZEEj8dI kN04pWgmtDL5MNfSyGNIi1YDDydIBURXgPG/q1yVOCn3wFibDFpOJHDWW5URSH6g ud7xmriOc7c2dCfOughNrjtvdXVktD4/O1Ho0mxZsk5IeINThLO8gJbd4ji4Fr7I yXlHHryBK22uRhC1zJBzIYwDzrfd1MCnUbpT0LtLCDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=fm3; bh=B1dEF+ CGw5EeEFhU9sVTINfHayv/iFEBrY6kEJImUqE=; b=Rl7O50oudGAcoIPgtiwiit g6mAJrbxf+flahUmLODrBPXdoRS0DLTH1qb0j0zlrbm3FZ4hJ08eCvuClgWvppku Ky5Q5B5s14hyXx4eoTv50p9EgWIWz9h/Dzuj5udWWrP8F7ZQOyNsSgN54rTNtEuE VPh/QEfl0RsPCkqp7bgKiArXym9CSfI47za3qKrRVrsJkig0df+vWJjSvCg9B+i8 i45z4rf4JTjpx46vxWfL/4b5+mnTXuYE/FhC8NT0Za+kOlDejqCCtRFsRGiCi2t0 Q2pPf0d6ZQFLWbMLHfWVXjxNDdPEBsjqmAcQBhfupiFVl0Sa+SBd1+hT8vu4kUgQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelkeeghefhuddtleejgfeljeffheffgfeijefhgfeufefhtdevteegheeiheeg udenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh 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 853923280067; Fri, 25 Sep 2020 10:57:22 -0400 (EDT) Date: Fri, 25 Sep 2020 16:57:21 +0200 From: Maxime Ripard To: Dave Stevenson Subject: Re: [PATCH v2 1/2] drm/vc4: crtc: Rework a bit the CRTC state code Message-ID: <20200925145721.2s5zyfyyqy4egvjj@gilmour.lan> References: <20200923084032.218619-1-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200925_105729_334053_329E0AF3 X-CRM114-Status: GOOD ( 21.55 ) 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: Tim Gover , DRI Development , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0727564716110645556==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0727564716110645556== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2fuxyhc5zfqry4ai" Content-Disposition: inline --2fuxyhc5zfqry4ai Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 23, 2020 at 03:59:04PM +0100, Dave Stevenson wrote: > Hi Maxime >=20 > On Wed, 23 Sep 2020 at 09:40, Maxime Ripard wrote: > > > > The current CRTC state reset hook in vc4 allocates a vc4_crtc_state > > structure as a drm_crtc_state, and relies on the fact that vc4_crtc_sta= te > > embeds drm_crtc_state as its first member, and therefore can be safely > > casted. >=20 > s/casted/cast >=20 > > However, this is pretty fragile especially since there's no check for t= his > > in place, and we're going to need to access vc4_crtc_state member at re= set > > so this looks like a good occasion to make it more robust. > > > > Signed-off-by: Maxime Ripard > > Tested-by: Dave Stevenson >=20 > Based on the issue I perceived with the previous patch, I'm happy. I > haven't thought about how the framework handles losing the state, but > that's not the driver's problem. >=20 > There is still an implicit assumption that drm_crtc_state is the first > member from the implementation of to_vc4_crtc_state in vc4_drv.h. To > make it even more robust that could be a container_of instead. I > haven't checked for any other places that make the assumption though. >=20 > Reviewed-by: Dave Stevenson Applied 1 and 2, with the typo fixed (and the fixes tag suggested by Daniel) Maxime --2fuxyhc5zfqry4ai Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX24FUQAKCRDj7w1vZxhR xUHTAP9p611rq4mT+RJdvpocTSngpm0vmVm/yVEsjh18mq68cAEAkcQqrlQvCd58 2eaU9z2PgEANC8ulHvG1EV3RvLhxTg8= =XMzd -----END PGP SIGNATURE----- --2fuxyhc5zfqry4ai-- --===============0727564716110645556== 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 --===============0727564716110645556==-- 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=-6.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 148E9C2D0A8 for ; Mon, 28 Sep 2020 07:06:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 AA0A223119 for ; Mon, 28 Sep 2020 07:06:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA0A223119 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B10406E2D8; Mon, 28 Sep 2020 07:06:26 +0000 (UTC) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 067776ED0B for ; Fri, 25 Sep 2020 14:57:27 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 64E08560; Fri, 25 Sep 2020 10:57:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 25 Sep 2020 10:57:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=B1dEF+CGw5EeEFhU9sVTINfHayv /iFEBrY6kEJImUqE=; b=ru4XrfleDL/ypPKESiZ9rcmc6yhpenjO2PMQLQtx4am HFxOoT1A7ZxBKUJy6rHXhyGWjD9QJXIIf+XQUNYSIg5d32vgmQFXnNiBPmPJPeNb yteCtlZT1E73RIayQBmIIjYqK0/ChrxSZQ6xrHC59LXCP5C4NCOBzo5HMZEEj8dI kN04pWgmtDL5MNfSyGNIi1YDDydIBURXgPG/q1yVOCn3wFibDFpOJHDWW5URSH6g ud7xmriOc7c2dCfOughNrjtvdXVktD4/O1Ho0mxZsk5IeINThLO8gJbd4ji4Fr7I yXlHHryBK22uRhC1zJBzIYwDzrfd1MCnUbpT0LtLCDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type: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=fm3; bh=B1dEF+ CGw5EeEFhU9sVTINfHayv/iFEBrY6kEJImUqE=; b=Rl7O50oudGAcoIPgtiwiit g6mAJrbxf+flahUmLODrBPXdoRS0DLTH1qb0j0zlrbm3FZ4hJ08eCvuClgWvppku Ky5Q5B5s14hyXx4eoTv50p9EgWIWz9h/Dzuj5udWWrP8F7ZQOyNsSgN54rTNtEuE VPh/QEfl0RsPCkqp7bgKiArXym9CSfI47za3qKrRVrsJkig0df+vWJjSvCg9B+i8 i45z4rf4JTjpx46vxWfL/4b5+mnTXuYE/FhC8NT0Za+kOlDejqCCtRFsRGiCi2t0 Q2pPf0d6ZQFLWbMLHfWVXjxNDdPEBsjqmAcQBhfupiFVl0Sa+SBd1+hT8vu4kUgQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelkeeghefhuddtleejgfeljeffheffgfeijefhgfeufefhtdevteegheeiheeg udenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh 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 853923280067; Fri, 25 Sep 2020 10:57:22 -0400 (EDT) Date: Fri, 25 Sep 2020 16:57:21 +0200 From: Maxime Ripard To: Dave Stevenson Subject: Re: [PATCH v2 1/2] drm/vc4: crtc: Rework a bit the CRTC state code Message-ID: <20200925145721.2s5zyfyyqy4egvjj@gilmour.lan> References: <20200923084032.218619-1-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-Mailman-Approved-At: Mon, 28 Sep 2020 07:06:24 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Gover , DRI Development , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0572823927==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============0572823927== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2fuxyhc5zfqry4ai" Content-Disposition: inline --2fuxyhc5zfqry4ai Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 23, 2020 at 03:59:04PM +0100, Dave Stevenson wrote: > Hi Maxime >=20 > On Wed, 23 Sep 2020 at 09:40, Maxime Ripard wrote: > > > > The current CRTC state reset hook in vc4 allocates a vc4_crtc_state > > structure as a drm_crtc_state, and relies on the fact that vc4_crtc_sta= te > > embeds drm_crtc_state as its first member, and therefore can be safely > > casted. >=20 > s/casted/cast >=20 > > However, this is pretty fragile especially since there's no check for t= his > > in place, and we're going to need to access vc4_crtc_state member at re= set > > so this looks like a good occasion to make it more robust. > > > > Signed-off-by: Maxime Ripard > > Tested-by: Dave Stevenson >=20 > Based on the issue I perceived with the previous patch, I'm happy. I > haven't thought about how the framework handles losing the state, but > that's not the driver's problem. >=20 > There is still an implicit assumption that drm_crtc_state is the first > member from the implementation of to_vc4_crtc_state in vc4_drv.h. To > make it even more robust that could be a container_of instead. I > haven't checked for any other places that make the assumption though. >=20 > Reviewed-by: Dave Stevenson Applied 1 and 2, with the typo fixed (and the fixes tag suggested by Daniel) Maxime --2fuxyhc5zfqry4ai Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX24FUQAKCRDj7w1vZxhR xUHTAP9p611rq4mT+RJdvpocTSngpm0vmVm/yVEsjh18mq68cAEAkcQqrlQvCd58 2eaU9z2PgEANC8ulHvG1EV3RvLhxTg8= =XMzd -----END PGP SIGNATURE----- --2fuxyhc5zfqry4ai-- --===============0572823927== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0572823927==--