Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7123450rwp; Tue, 18 Jul 2023 10:19:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEVQOdtTVaVGePitBpblSYehWlEJeo1PS/tgOi2a7Bgvz2OPfpfYfIS33OId2PFQHOUHY+K X-Received: by 2002:a05:6a21:9993:b0:133:b3db:c78b with SMTP id ve19-20020a056a21999300b00133b3dbc78bmr12952697pzb.36.1689700770675; Tue, 18 Jul 2023 10:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689700770; cv=none; d=google.com; s=arc-20160816; b=jR+a6J0HtePaGH4VGCdA9aY0jAY8Q6HgggeaSw+RHHJuxF9ZYgGAUacfmPANjCgekc TWW4r63ULLfJW5ar7HOyuNNsTRbiN3218GTMByoIT7VaHh6FtKz/CzQ0bK+PeIvldy9I SLXhCO0xR8LB7mt7yw7Zyq1Q3NG1V8I57R1QiN5ULgRNGSLzBplJmHr2X7fRz5eQMIQG p54HyvQarLhFbVpng/sk3Vq+uiiBq3uG+reWyTTlOx0KNeCVF27xKZeA7LuL9FLm5FF2 WSnql72C1FtcJdUGSGYN9N9PaJVRU+E9pMx8Y7m4js5HKc/kWL1Z086cUksxhJDIisf/ J5dA== 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=UV/IyTM0vw3ATBj3HgD+CxN0o+XXCmo3PqbuGIPYVCQ=; fh=tA0tLsibEoQ30Z7eqHvQDapDuvXXp6os5IletQHgjxM=; b=LnC0ZguX9a8qT1tycTyCmue7+XwLRfeP3w3yaP58H/QAScKoHRc8nZG3LiPifgv8H+ wNAOi/asjEreXpYA1egqcjosKjaYZCRuSzkLMr5fsUAKpCnqyTkxpO+QzyoSG2Gedavg Nfh3Hf3T8iUQ2+hMuUswEQjSYQIvQ2o9CgWSj+9hf3gG5S9icZmxaEXLHdnOKGx9jUTq OBJ7Jj9IYmLwKB5Ne6NYqZB9imspDYE9SDOg3RW8mLFR45+ukE4ABtV22+2zMgdNWcL/ kYVcm2aBDJ4a03ZP1sYxjpkZOYC+lChLngLA5sOB9det8QbAzWd3F/3FJNORzqwLMgZU BLNQ== 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 l5-20020a63ba45000000b0054fdd51a9a4si1829137pgu.396.2023.07.18.10.19.18; Tue, 18 Jul 2023 10:19:30 -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 S233607AbjGRQ5K (ORCPT + 99 others); Tue, 18 Jul 2023 12:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233137AbjGRQzI (ORCPT ); Tue, 18 Jul 2023 12:55:08 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0605319A3 for ; Tue, 18 Jul 2023 09:54:54 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5803:2d6d:5bbc:e252]) by baptiste.telenet-ops.be with bizsmtp id Ngur2A0100ucMBo01gurDY; Tue, 18 Jul 2023 18:54:52 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qLnyD-001nZr-Oe; Tue, 18 Jul 2023 18:54:51 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qLnyN-000ge4-Pj; 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 Subject: [PATCH v2 37/41] drm: renesas: shmobile: Atomic conversion part 2 Date: Tue, 18 Jul 2023 18:54:42 +0200 Message-Id: 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=unavailable 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 Implement atomic mode setting for the CRTC, using the existing dpms callback. Signed-off-by: Geert Uytterhoeven --- This works, but I had expected that crtc_helper_funcs.atomic_check should point to drm_crtc_helper_atomic_check() instead, as the primary plane cannot be disabled. However in doing so, when drm_atomic_helper_check_crtc_primary_plane() fails: [drm:drm_atomic_helper_check_crtc_primary_plane] [CRTC:41:crtc-0] primary plane missing the display fails to restore after running "modetest -s", until I run modetest without -s. Letting shmob_drm_plane_atomic_check() return -EINVAL if !new_plane_state->crtc && is_primary would fix that, but causes an ugly warning: WARNING: CPU: 0 PID: 21 at drivers/gpu/drm/drm_framebuffer.c:1130 drm_framebuffer_remove+0x374/0x4b0 atomic remove_fb failed with -22 v2: - No changes. --- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c index c277f93668825e1c..5c0575eed3ab6833 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -319,27 +320,6 @@ static void shmob_drm_crtc_dpms(struct drm_crtc *crtc, int mode) scrtc->dpms = mode; } -static void shmob_drm_crtc_mode_prepare(struct drm_crtc *crtc) -{ - shmob_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); -} - -static void shmob_drm_crtc_mode_commit(struct drm_crtc *crtc) -{ - shmob_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON); -} - -static int shmob_drm_crtc_atomic_check(struct drm_crtc *crtc, - struct drm_atomic_state *state) -{ - return 0; -} - -static void shmob_drm_crtc_atomic_begin(struct drm_crtc *crtc, - struct drm_atomic_state *state) -{ -} - static void shmob_drm_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state) { @@ -356,13 +336,22 @@ static void shmob_drm_crtc_atomic_flush(struct drm_crtc *crtc, } } +static void shmob_drm_crtc_atomic_enable(struct drm_crtc *crtc, + struct drm_atomic_state *state) +{ + shmob_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON); +} + +static void shmob_drm_crtc_atomic_disable(struct drm_crtc *crtc, + struct drm_atomic_state *state) +{ + shmob_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); +} + static const struct drm_crtc_helper_funcs crtc_helper_funcs = { - .dpms = shmob_drm_crtc_dpms, - .prepare = shmob_drm_crtc_mode_prepare, - .commit = shmob_drm_crtc_mode_commit, - .atomic_check = shmob_drm_crtc_atomic_check, - .atomic_begin = shmob_drm_crtc_atomic_begin, .atomic_flush = shmob_drm_crtc_atomic_flush, + .atomic_enable = shmob_drm_crtc_atomic_enable, + .atomic_disable = shmob_drm_crtc_atomic_disable, }; static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, -- 2.34.1