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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A17C5C433FE for ; Mon, 15 Nov 2021 11:31:33 +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 76C6861C32 for ; Mon, 15 Nov 2021 11:31:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76C6861C32 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D90B96E86B; Mon, 15 Nov 2021 11:31:28 +0000 (UTC) Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9DA846E8D6 for ; Mon, 15 Nov 2021 11:31:27 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 671162B0117B; Mon, 15 Nov 2021 06:31:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 15 Nov 2021 06:31:27 -0500 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=fm1; bh=emAg6UBlVNzZP hSNA76cyLaGjlis3w532X60JIapIkQ=; b=g0z0TCdSUZrYrv77tLBJzX1c+2u7p /2UbkZF9Q/mmSdBi/4we3DcN0Gli3l6+fgRmbd0JnxuL27OylmYwJg53KqgkJBan t00xU3jI6rzHt147aS3dFgjtqFEW8X30uArLZyX55IoEqMcTuSuERrmgPKOR0G9X Oa3qeX0ViN7W2jda/gI9o1P87hKAdZLsi88eZbfAmI7fSWZnCogB5rxKmoVE3c5P M922c81zLpn1GgJjyT9t+QYqlkshaPu+XxrU7mOYlUs3yV160aeDBmwDOykttJFE 9Ocerp1PfLS7nohopBE6TOZResW1O3nsf1SxEWf570b/5TOXv9mzeKFHg== 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= fm1; bh=emAg6UBlVNzZPhSNA76cyLaGjlis3w532X60JIapIkQ=; b=G+lDhbjC Fd98apLljwTXdCZhFxoL96cpm2vOQPICEzkSifFExasUvyDvYWWSsCm6F8IexMpZ OWoBeYWRn6J9ky2XTVRhdRV5ptbiA0121NKoBBDsoMOCIgIXWiX0eQ7LzMnTOKn5 IMVBfOMKiJEofuW5UaVQ8zfLsMhMqKjzLHgpRpdkTVV70JvWfE2b++8bPZ7yxIoU GIs8E/EZBv43F6Jb33F4OudthnV1j7VKpIlJ6dXVL8bO9t5/7/lFfUbF3dG8CykS 6wCWNgX0lpnaUGv7+pDAHvXmn31/ZXmx4UFjUkqkNrIb5Rx2GLXpbuCnIoZeKO9x bLsFLf6S7//Vfg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfedtgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Nov 2021 06:31:25 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie Subject: [PATCH 5/6] drm/vc4: kms: Don't duplicate pending commit Date: Mon, 15 Nov 2021 12:31:04 +0100 Message-Id: <20211115113105.103275-6-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115113105.103275-1-maxime@cerno.tech> References: <20211115113105.103275-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Dom Cobley , Tim Gover , Dave Stevenson , Jian-Hong Pan , dri-devel@lists.freedesktop.org, Phil Elwell Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Our HVS global state, when duplicated, will also copy the pointer to the drm_crtc_commit (and increase the reference count) for each FIFO if the pointer is not NULL. However, our atomic_setup function will overwrite that pointer without putting the reference back leading to a memory leak. Since the commit is only relevant during the atomic commit process, it doesn't make sense to duplicate the reference to the commit anyway. Let's remove it. Fixes: 9ec03d7f1ed3 ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 217a2009c651..6533f3360e75 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -671,12 +671,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj) for (i = 0; i < HVS_NUM_CHANNELS; i++) { state->fifo_state[i].in_use = old_state->fifo_state[i].in_use; - - if (!old_state->fifo_state[i].pending_commit) - continue; - - state->fifo_state[i].pending_commit = - drm_crtc_commit_get(old_state->fifo_state[i].pending_commit); } return &state->base; -- 2.33.1