Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7144340rwp; Tue, 18 Jul 2023 10:39:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlGX6Ul8pRz+ZlpMfJwkd1VeWfW9scZRxKBb8z50z8VcxX9Ls9IM/JD2fycT0ERUj4KNM9B0 X-Received: by 2002:a17:906:6499:b0:993:d90e:3102 with SMTP id e25-20020a170906649900b00993d90e3102mr335376ejm.6.1689701958189; Tue, 18 Jul 2023 10:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689701958; cv=none; d=google.com; s=arc-20160816; b=NzacM+YyqfU2eRuZyo/SEPZWFhb1Z4Stse6JPX1fxsm8gdInCr7Rrg1ZTX/jNJiEh3 ssVg3owWyK0a/hIMxxyujrOyD89AIzmyIvi9AeX9Cb4dbfS9nBHQe/FzkZAbP8Qlv3hZ ayIOmHRsYijJ472b3A16HWGsDJ5pEZk/3H3eKzYkp9BrH9AORe1pXun649jlaLjAvgRs P6EpFBOxntJOzCiopJgNvHOKnBpsiluCrIFHfA4p1fS+trTBTheoUA77gX4itqOA4NDF oDZ9e/GgdBhwR7SZnTfJCR0ghG8R357+g+20qdXWiVwvVl7fvI7rhl++se4uRdRasuxT 6/aA== 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; bh=ul9UXjtwc2+MChZtDmNbJu+8g+rucKVvFJVt1GHpGQA=; fh=Ople2ijcDVdvBJwvAg2RvyZp0qNZK7It46SN0LxlrVk=; b=XTHAg50iKI/9N5EKhgDocAbpzFV3pDkB9ZCD6JS9/BiutC2zkXsDLX/rOaBQheAXzY g4J+e5SoNLBijLIrPgDVOBqxC0oXjCkvkuSG/IdfQ6xkyGCVSTmNhAYNh5GHD61M4PHB nLbVaMja8IpjYDg0Yjn3CQDrAADAXfAs995Gjc1fs5xjT8dGV0IeZmfS+2YUXXY+Pv0j CVwx9x5i0XL9e6xpfrDy/bLS8D936UxbR5SvpnGnHbJ+Y08XEloQ2BLXtdASIKxsbpiU 8tVc1lqHHoh61jHds6E0eYT4FzBvXoFI6BpMS7EIL4K1S9tcSuxY3m3YAbaxfcRU7Ohs AOkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rs23-20020a170907037700b00983f3f76dd0si1582500ejb.155.2023.07.18.10.38.54; Tue, 18 Jul 2023 10:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbjGRQ4f (ORCPT + 99 others); Tue, 18 Jul 2023 12:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232972AbjGRQzG (ORCPT ); Tue, 18 Jul 2023 12:55:06 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDBC31BDB for ; Tue, 18 Jul 2023 09:54:55 -0700 (PDT) Received: from ramsan.of.borg ([84.195.187.55]) by michel.telenet-ops.be with bizsmtp id Ngus2A0031C8whw06gusXc; Tue, 18 Jul 2023 18:54:53 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qLnyD-001nZv-PM; Tue, 18 Jul 2023 18:54:51 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qLnyN-000geA-QP; Tue, 18 Jul 2023 18:54:51 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Laurent Pinchart Subject: [PATCH v2 38/41] drm: renesas: shmobile: Use suspend/resume helpers Date: Tue, 18 Jul 2023 18:54:43 +0200 Message-Id: <87d57df9eb40198a2530fa92a9a3f44f60829017.1689698048.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the custom suspend/resume handling by calls into drm_mode_config_helper_{suspend,resume}(). Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- v2: - Add Reviewed-by. --- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 13 ------------- drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h | 2 -- drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 13 +++---------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index 5c0575eed3ab6833..a176cd3e494ed2fd 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -287,19 +287,6 @@ static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) scrtc->started = false; } -void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc) -{ - shmob_drm_crtc_stop(scrtc); -} - -void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc) -{ - if (scrtc->dpms != DRM_MODE_DPMS_ON) - return; - - shmob_drm_crtc_start(scrtc); -} - static inline struct shmob_drm_crtc *to_shmob_crtc(struct drm_crtc *crtc) { return container_of(crtc, struct shmob_drm_crtc, base); diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h index fe41e42d6cc55275..37380c815f1f5a08 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h @@ -40,8 +40,6 @@ struct shmob_drm_connector { int shmob_drm_crtc_create(struct shmob_drm_device *sdev); void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc); -void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc); -void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc); int shmob_drm_encoder_create(struct shmob_drm_device *sdev); int shmob_drm_connector_create(struct shmob_drm_device *sdev, diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c index e4e88e66de5c3d3b..b7643884b49f0bc8 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -115,22 +116,14 @@ static int shmob_drm_pm_suspend(struct device *dev) { struct shmob_drm_device *sdev = dev_get_drvdata(dev); - drm_kms_helper_poll_disable(&sdev->ddev); - shmob_drm_crtc_suspend(&sdev->crtc); - - return 0; + return drm_mode_config_helper_suspend(&sdev->ddev); } static int shmob_drm_pm_resume(struct device *dev) { struct shmob_drm_device *sdev = dev_get_drvdata(dev); - drm_modeset_lock_all(&sdev->ddev); - shmob_drm_crtc_resume(&sdev->crtc); - drm_modeset_unlock_all(&sdev->ddev); - - drm_kms_helper_poll_enable(&sdev->ddev); - return 0; + return drm_mode_config_helper_resume(&sdev->ddev); } static int shmob_drm_pm_runtime_suspend(struct device *dev) -- 2.34.1