From patchwork Tue May 25 13:13:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 447180 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp4258536jac; Tue, 25 May 2021 06:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmTYg/rZoFN+EZshaJy3Htq+9YseRKmyWAg5sCVY9vz5qhqbG243EvzheXHdJcuR4DxvP2 X-Received: by 2002:a17:906:5917:: with SMTP id h23mr29088016ejq.457.1621948404763; Tue, 25 May 2021 06:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621948404; cv=none; d=google.com; s=arc-20160816; b=VEKa+ibdG48nasezenkL2zt0HOTmYwkn/E6zDA1icJSMaOtt3IK8mpxuVq2mnLm69Q 2aUR+/SBc1xTwDs9fxvFXQ3u2jyxMRQVnoWEJrXdPscwU7zY4GZuS+8CexPZVNP52Qqh DAqOiz9zkV1DhP4nT+dsN84eX2kE9zS4BQc4p0ze9uqLGQjGBh0lFqv2Jbw1jElBoacg 5MS9ED0m5DugFUggMCEH3fsSnieFnGAfnqH+aGShIxKRVlPnaGHVerquFP3BH7ZTTrHp PFdR9/0zGssElik537ShUqnLPVMUvTL9pGF4Z7Rn0LtXvgfGfffpUjEszvib0THDzws+ s5Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=j5KrzNiLkEZ7U9hbHrWEVr0lVINK2iN1124OgJJTqJA=; b=OiSP+WGvgv1huJfjtIhTpEfIYRXL2s5w1aD8XeNTgzK7TykZpNDHwhTaDxVIePMSDX I+lXNKhVL1rhTv31Pdh2NWvQZMiFn8VjqNExGjiLrbLSMn0iGAerE3Wp+T7HUbib/hSp oi6WXlVLIY66rxCNvQAfVieiOJgmgAYU3oSdzfJTdMErVdBJBahCxMo05lAcIHQP+dKB hB0GwJ8hZajibU4dRwv/0IAkxODHGWoTZLGKceJ1Fd+zVL2C+bpRt/WOdxMlpjbFJIJa LI87ovDujar5PHlQvyeoBLyTFX0kC7RtPxfpO4OQltzhhhRz/5Z+DcWQwKTNiU7+3lBk KYmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9rxBoOK; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh4si15556805ejb.79.2021.05.25.06.13.24; Tue, 25 May 2021 06:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9rxBoOK; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233060AbhEYNOw (ORCPT + 17 others); Tue, 25 May 2021 09:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233097AbhEYNOu (ORCPT ); Tue, 25 May 2021 09:14:50 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91388C061756 for ; Tue, 25 May 2021 06:13:20 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id w7so24689280lji.6 for ; Tue, 25 May 2021 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j5KrzNiLkEZ7U9hbHrWEVr0lVINK2iN1124OgJJTqJA=; b=q9rxBoOKQtZeh7mPEbFoNf7mSDDUN77dp1k+9wiOKLfYn/mpwMtYrNRFMtbVUv0rxk O73NTGeM4qzA0qKeZGi++ZIrwWdOxqtsWT9FokqRqDFYyZG/bBnEBrgD6/Gw6MepZ+hz 1NTd4jHlBsGaRydFIcvH7vV3M4zmKbrqs2OJl9kVBqS5YxlX/h3EuG49cvC3Sq/iPOOI tSWZuy0xRCPzpSghvM/TsDPLQyAoVUMjxMtVcAULEukAtsQhNYhYnLYQdum8umkeWDgL 7A88iVaPBGwFiG0loCmxONvWt5A1rIlAz8sAS/85n8SVSxtJZFvChm5fpvaxFFs5FDg2 gZsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j5KrzNiLkEZ7U9hbHrWEVr0lVINK2iN1124OgJJTqJA=; b=uCb9NRNR5pa+JNXet36pxnHgN/9Po8HxOTb/w25Uhbmd0HxRuz+u2u1cnM96yxbIRf 77DQhJBs6wQe5XyygUYQOmLvIZ8easIXk92/7cVjHi6qd+e7OcmL/ea/i1gCM0U9PGbs u+yerZFL5TQE1/EzxSq82sjtVeKfCLr1+P/0QH6D4vnrg6Ws8YUgO3ZF/V3YUec5vNbI LktH/fUGfBoqw+wZXWMWjYL4MBu6xWbH1+orOYN4t6TgbrztjjyEgf0V/UbIPOgsW/Gp fhF4MiJGfZb/dwG12GofJDEdZi7N+j/nlnbrMRX1bHUDO9Y0sAr66TLaSQss9fZPlfJy wMiA== X-Gm-Message-State: AOAM5323Vb3ODGO1aUWTFiZ6r0QvHLZapVk2pwOwnzYA0VtN1RCyyD1e VbDkdEu8vgPhwJ02f3agtzV40w== X-Received: by 2002:a05:651c:3cf:: with SMTP id f15mr19851585ljp.404.1621948398936; Tue, 25 May 2021 06:13:18 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t20sm2101108lji.53.2021.05.25.06.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 06:13:18 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/7] drm/msm/mdp5: use drm atomic helpers to handle base drm plane state Date: Tue, 25 May 2021 16:13:10 +0300 Message-Id: <20210525131316.3117809-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210525131316.3117809-1-dmitry.baryshkov@linaro.org> References: <20210525131316.3117809-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Use generic helpers code to manage drm_plane_state part of mdp5_plane state instead of manually coding all the details. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 8c9f2f492178..8c29026d770d 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -176,8 +176,8 @@ static void mdp5_plane_reset(struct drm_plane *plane) { struct mdp5_plane_state *mdp5_state; - if (plane->state && plane->state->fb) - drm_framebuffer_put(plane->state->fb); + if (plane->state) + __drm_atomic_helper_plane_destroy_state(plane->state); kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); @@ -191,9 +191,7 @@ static void mdp5_plane_reset(struct drm_plane *plane) else mdp5_state->zpos = STAGE0 + drm_plane_index(plane); - mdp5_state->base.plane = plane; - - plane->state = &mdp5_state->base; + __drm_atomic_helper_plane_reset(plane, &mdp5_state->base); } static struct drm_plane_state *