From patchwork Wed Jun 21 22:33:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13288010 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DB05EB64D7 for ; Wed, 21 Jun 2023 22:34:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-ID:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=p0IMGVJpwm/8x16RwlMTZv2MKQbIaJbFDRR5HWvtSX8=; b=zP2jEx1SXTlAf1 ppy7afYyMJeP2qrLCkZQJOVUN9XR/cYAHXkPyZQMvCRpZ6wYO1YpXfE0692ZE1Ev0GiH44vqjeagU TEx+m2aATffuRdW46NTVf/9QBEqUBOKacu3lggNkwTjdigYo2ueuI8qIeIGS6fdqoXLypQxitlggN E0so7dD14S8aJ2AC31CpoWFo9Z1F1XVl2KeDyLTZGv2Ywz9A6X0bgWYAkmqtB79rcol7wGex6Kkh0 vu0QoCAKRCVhH2G6tGTFTmoLdUJILtCEpc4j59XF/mbMIcw6YVFJK2u2ltt7wsi1wO/I3J2cEmcj7 oP/RTfHx/fsl95tosKBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qC6OR-00FvNy-1U; Wed, 21 Jun 2023 22:33:39 +0000 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC6OA-00FvAB-0o for linux-arm-kernel@lists.infradead.org; Wed, 21 Jun 2023 22:33:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=Pv1U1EEqpR4gm7kxbWZCerK7wt2q95EyqJhSl+womJE=; b=FkXsUOsXaFkwZrliDf9C2YwjNTIUEVvciEnSKJ9DTDBt+k27cbXeShchjqIG62qoBEXH b0W+UdYOsXPSNmZl5/Pa8sDZfJN5aeForP98D+/3H6KELBuaDRZL2xHCv6G3oK6M/dQmyK AMXMyqWZr86H/epaKAB4V5YO6jAJtDnPWYeG4EX3ygxWvztz3IhdGcfbov+QuCNbGM+LFl lFhpBrEdkWwITScZKCVx/GAr3/k1aFutWnpGJzunVRusb7gmRM6uuMYpj8CKxUYbLSu4oG i8u8jJfV7em/W//1XTI598X82qwaAx4/LdMfQCu/XA2/mKmYkdUdxX1yww99Iarw== Received: by filterdrecv-65f68489c8-b6w8z with SMTP id filterdrecv-65f68489c8-b6w8z-1-64937AAA-5C 2023-06-21 22:33:15.071715387 +0000 UTC m=+3625023.840218965 Received: from bionic.localdomain (unknown) by geopod-ismtpd-0 (SG) with ESMTP id Vsg4Okx2QpydLWx1dvgG5Q Wed, 21 Jun 2023 22:33:14.503 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 0/5] drm/rockchip: Fix crtc duplicate state and crtc reset funcs Date: Wed, 21 Jun 2023 22:33:15 +0000 (UTC) Message-ID: <20230621223311.2239547-1-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-SG-EID: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0hwAj6JtqDVdUtl/svEfHTEBPZGZPV0oT8N0cvVyWZgOlphJJAE1JguJuHu+WRw0387JHRl7AW9o30oWLdB+uU347/p8RfLgH0X8cAch6OEif3g0ihyzClcHJyprEMgnf/JOWMGkZjyouLRoUbhaKUrnyXKGyepnItGlMSBbK7EsMSBmXuQ3b45Ndu7jiJiQ0lw== To: Sandy Huang , Heiko Stuebner , David Airlie , Daniel Vetter Cc: Mark Yao , Maarten Lankhorst , Andy Yan , Sascha Hauer , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_153322_369281_EE4091F7 X-CRM114-Status: GOOD ( 10.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series fixes a reset of state in duplicate state crtc funcs for VOP driver, a possible crash and ensure crtc reset helper is called in VOP2 driver. Patch 1 use kmemdup instead of kzalloc to duplicate the crtc state. Patch 2 change to use crtc and plane cleanup helpers directly. Patch 3 adds a null guard for allocation failure. Patch 4 adds a crash guard for empty crtc state. Patch 5 adds a missing call to crtc reset helper. This is the next part of an ongoing effort to upstream HDMI 2.0 support used in LibreELEC for the past 3+ years. Changes in v2: - Handle possible allocation failure in crtc reset funcs - Collect r-b tags This series is also available at [1]. [1] https://github.com/Kwiboo/linux-rockchip/commits/next-20230621-duplicate-state Jonas Karlman (5): drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs drm/rockchip: vop: Use cleanup helper directly as destroy funcs drm/rockchip: vop: Fix call to crtc reset helper drm/rockchip: vop2: Don't crash for invalid duplicate_state drm/rockchip: vop2: Add missing call to crtc reset helper drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 24 +++++------- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 39 ++++++++++---------- 2 files changed, 28 insertions(+), 35 deletions(-)