From patchwork Fri Mar 1 12:56:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 10835215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55C1E1805 for ; Fri, 1 Mar 2019 12:56:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44D472F516 for ; Fri, 1 Mar 2019 12:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38F342F514; Fri, 1 Mar 2019 12:56:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD0FC2F517 for ; Fri, 1 Mar 2019 12:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HFZ/gmIW7OtODeP2mBc5dSCVATKGybxiIveSYTEB7dU=; b=G7lJoZjNPC0wVM QYrPoFaDfquWRWA48HiN9ihxmdQYTKVWEgqdCnUHxzFlE84mYpejH6QKbh6HM89QYiEZDfQBLOn18 H/fH62tqrl0OluLsny2NaKf8ob/CvnDGHsfrMOh9wLCHIinUC6KpvQQ0X2Ah7YYwRyfRyPWJ0gdjN 8L3k4SK6HQrQSAzNEu4u9JYowBC7K3VSoFmGtBCg62M43Eby4V1buMh/Lgex8trly5HSP1qDOTn24 kUeJIo4KvTYOYKc0FmhbbSxwD+im9e6VUvmPrSVZR1E4s8S6hCLqLuOE4gkL/DI3N7YJMqiPWa67Z 0bcWTZti08aeZFHPknZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzhiX-0002sj-Cx; Fri, 01 Mar 2019 12:56:45 +0000 Received: from mblankhorst.nl ([2a02:2308::216:3eff:fe92:dfa3]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzhiU-0002sA-5Q for linux-rockchip@lists.infradead.org; Fri, 01 Mar 2019 12:56:43 +0000 From: Maarten Lankhorst To: dri-devel@lists.freedesktop.org Subject: [PATCH 13/17] drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset. Date: Fri, 1 Mar 2019 13:56:23 +0100 Message-Id: <20190301125627.7285-14-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190301125627.7285-1-maarten.lankhorst@linux.intel.com> References: <20190301125627.7285-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_045642_344710_6E61424D X-CRM114-Status: UNSURE ( 7.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, intel-gfx@lists.freedesktop.org, Maarten Lankhorst , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Convert rockchip to using __drm_atomic_helper_crtc_reset(), instead of writing its own version. Instead of open coding destroy_state(), call it directly for freeing the old state. Signed-off-by: Maarten Lankhorst Cc: Sandy Huang Cc: "Heiko Stübner" Cc: linux-rockchip@lists.infradead.org Reviewed-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c7d4c6073ea5..1cf1658f1c01 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1201,17 +1201,6 @@ static void vop_crtc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); } -static void vop_crtc_reset(struct drm_crtc *crtc) -{ - if (crtc->state) - __drm_atomic_helper_crtc_destroy_state(crtc->state); - kfree(crtc->state); - - crtc->state = kzalloc(sizeof(struct rockchip_crtc_state), GFP_KERNEL); - if (crtc->state) - crtc->state->crtc = crtc; -} - static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) { struct rockchip_crtc_state *rockchip_state; @@ -1233,6 +1222,17 @@ static void vop_crtc_destroy_state(struct drm_crtc *crtc, kfree(s); } +static void vop_crtc_reset(struct drm_crtc *crtc) +{ + struct rockchip_crtc_state *crtc_state = + kzalloc(sizeof(*crtc_state), GFP_KERNEL); + + if (crtc->state) + vop_crtc_destroy_state(crtc, crtc->state); + + __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base); +} + #ifdef CONFIG_DRM_ANALOGIX_DP static struct drm_connector *vop_get_edp_connector(struct vop *vop) {