From patchwork Fri Oct 5 21:04:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10628741 X-Patchwork-Delegate: agross@codeaurora.org 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 2440916B1 for ; Fri, 5 Oct 2018 21:04:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 140F629C1A for ; Fri, 5 Oct 2018 21:04:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0892B29C21; Fri, 5 Oct 2018 21:04:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2D8229C1A for ; Fri, 5 Oct 2018 21:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725772AbeJFEEm (ORCPT ); Sat, 6 Oct 2018 00:04:42 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:35219 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbeJFEEl (ORCPT ); Sat, 6 Oct 2018 00:04:41 -0400 Received: by mail-yb1-f196.google.com with SMTP id o63-v6so6022089yba.2 for ; Fri, 05 Oct 2018 14:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=alvTvEDAGgWezDm3pyixy2bxD9Ng/Gt/Cx1lDRuKKZw=; b=mRiAlCmpd5lZ/XxZJExnFyNhYqgDJUT30IByl81tLU7ZXWYbZVzNwCypLl4lX5Wujt sDnVxGMpAZQlDmZ5ETWWiEC9EcdzUvjd7LCU5Ts1aa+2H1Ks1Rh9T49wetDs8BkSfC6g GJ5QatZG1AOxiVo3VuvHmVl+Wq08Fu8r2apRc= 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=alvTvEDAGgWezDm3pyixy2bxD9Ng/Gt/Cx1lDRuKKZw=; b=OzbeU9m/6Yxah8KFiF9gpREEdYb6OOE0ehju6Ct2As3snZTajIvJvsUHat3L90dNe+ HamlvZ/GdxG+cKZqUhzEIMAQf15OyH2/fnVNxC72Vb5UG+3iBzm8x1gnwVJ+kPtpSfBy Uo6AYJn4oshrnxVzgzish3LKb9QAt8Seg5gDDua3umm0GhnL6jlwLmOUr1BBT1h0c8bM k5Dbj3p76gIG9EofQUCZtlDT26FVM0JMIa3OJHWMWtv3tzbdHQlsl1WZMThJMVxXJZgQ JhVZGj2Apn7WvHVtAv0YTGm1b2nzl8cDltM2BsPPbikpX6u/gynAKgfKbfje7DMQSt7+ yeyg== X-Gm-Message-State: ABuFfohx4POBglhsY/MlJKzRlmmBLXE87VQMHKvwjpcBwEUNGJYOYAd7 0FhQQ2FQELRuKT90fP7ge8hP6Q== X-Google-Smtp-Source: ACcGV60qQhipY9bGgOpJuzg+fIXRPGl+GF1NVjLODj+7N8j2phgFnE7mJqI8d9CK963bbf7d/Ejhwg== X-Received: by 2002:a25:cdc4:: with SMTP id d187-v6mr7322591ybf.313.1538773452127; Fri, 05 Oct 2018 14:04:12 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id f5-v6sm3496141ywa.39.2018.10.05.14.04.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 14:04:10 -0700 (PDT) From: Bruce Wang To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: seanpaul@chromium.org, jsanka@codeaurora.org, robdclark@gmail.com, abhinavk@codeaurora.org, jcrouse@codeaurora.org Subject: [PATCH v3 4/4] drm/msm/dpu: Replace dpu_crtc_reset by atomic helper Date: Fri, 5 Oct 2018 17:04:03 -0400 Message-Id: <20181005210403.54615-5-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20181005210403.54615-1-bzwang@chromium.org> References: <20181005210403.54615-1-bzwang@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we removed all suspend logic from the crtc code (see patch 3/4), dpu_crtc_reset does the same things as drm_atomic_helper_crtc_reset, so let's just replace it with a call to the atomic helper. v3: added patch to patchset Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 39 +----------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index ac604055a824..c5ba753d441c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -844,43 +844,6 @@ static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc) return &cstate->base; } -/** - * dpu_crtc_reset - reset hook for CRTCs - * Resets the atomic state for @crtc by freeing the state pointer (which might - * be NULL, e.g. at driver load time) and allocating a new empty state object. - * @crtc: Pointer to drm crtc structure - */ -static void dpu_crtc_reset(struct drm_crtc *crtc) -{ - struct dpu_crtc *dpu_crtc; - struct dpu_crtc_state *cstate; - - if (!crtc) { - DPU_ERROR("invalid crtc\n"); - return; - } - - /* revert suspend actions, if necessary */ - if (dpu_kms_is_suspend_state(crtc->dev)) - _dpu_crtc_set_suspend(crtc, false); - - /* remove previous state, if present */ - if (crtc->state) { - dpu_crtc_destroy_state(crtc, crtc->state); - crtc->state = 0; - } - - dpu_crtc = to_dpu_crtc(crtc); - cstate = kzalloc(sizeof(*cstate), GFP_KERNEL); - if (!cstate) { - DPU_ERROR("failed to allocate state\n"); - return; - } - - cstate->base.crtc = crtc; - crtc->state = &cstate->base; -} - static void dpu_crtc_handle_power_event(u32 event_type, void *arg) { struct drm_crtc *crtc = arg; @@ -1499,7 +1462,7 @@ static const struct drm_crtc_funcs dpu_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .destroy = dpu_crtc_destroy, .page_flip = drm_atomic_helper_page_flip, - .reset = dpu_crtc_reset, + .reset = drm_atomic_helper_crtc_reset, .atomic_duplicate_state = dpu_crtc_duplicate_state, .atomic_destroy_state = dpu_crtc_destroy_state, .late_register = dpu_crtc_late_register,