Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp310414rdb; Sat, 19 Aug 2023 02:44:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHG3r0+SEMYuzwg1ewSBjCoJBVKvPRlNCM39oyFJqwXYXcZ35CvyNBw4nOEi2I25E2v7nM8 X-Received: by 2002:a17:903:1d2:b0:1bb:c2b1:9c19 with SMTP id e18-20020a17090301d200b001bbc2b19c19mr1933769plh.6.1692438287312; Sat, 19 Aug 2023 02:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692438287; cv=none; d=google.com; s=arc-20160816; b=Y1LadOG5mfifXdBVrBCps8vqBVd4zrxsN/XbKs9qz1lBZO8y2nlS8FkPAYlrAm7XSi ijI3Mmo1NZk7DQ/vafGwGM1MquDzavb4fntt0xc5CG2XmREXVShnj+uvE58xNxtAUpXU ys1GIVey9HPYacR77ye2MgtHQAkbvkFoZjipxWd/gJ44JjhCvTmkteCoeGlV4nvK6HSU YRbkXi2k7htnDnGWw6t8CCUWqU2F/hrg5jH9BrRs2niK4zxOdrrq2zpPGum4ZiUQLj0/ GJdW+HK2oXV4m60v1oa7nmzW8+1wh3o1AXyEMZ++w4QzfQfgd1dTrf7QJPOG1DTXe7D/ jT1g== 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=sq8vkyIGMDKLw7TJeiZN5sSSmEcl9nST9DbqU3/UJk8=; fh=UWUHlpYIyaM7sVynBT5Ky7qldVK8D81neqNGmwj4p+c=; b=lTdHl63KpvNq65vjxu3t7Y8SF19lrUkNAIvaebovNTvMFVU1ixeANGpGWKe03Idb74 7mzgde4h2KGmDkbi28iAmmhHxVBdRRI/20mgzlz5KB/2Kpya0HvN05DiHTajSAU0smqE AsksypcbNu4/pkXB46x6DoTQUOpHOu+wZRHWK4ll73ztakECo/Go409niFhklCQbb/IJ cxwQ1nzsH/Ep+9NQuUvL2z6KL9Iheh5YAWDGL1H0uPubMFsEWBAZx0vcqhW1e5xeFBrY wYBSDnNsSng/wmhUS5LhZp0gVQo02VMOVuJ8Tbti5kssMiB6BKjmaJvB4yY5+ONMkxNB xPtw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i14-20020a170902c94e00b001bb993ef74dsi3284340pla.461.2023.08.19.02.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 02:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C56C32F44F; Sat, 19 Aug 2023 01:28:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244055AbjHPKpN (ORCPT + 99 others); Wed, 16 Aug 2023 06:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244032AbjHPKo6 (ORCPT ); Wed, 16 Aug 2023 06:44:58 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47FD2D55 for ; Wed, 16 Aug 2023 03:44:42 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5d0c:f209:12a7:4ce5]) by xavier.telenet-ops.be with bizsmtp id aAkf2A00f45ualL01AkfwM; Wed, 16 Aug 2023 12:44:40 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qWE0v-000or8-88; Wed, 16 Aug 2023 12:44:39 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWDAx-006774-4L; Wed, 16 Aug 2023 11:50:51 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 37/41] drm: renesas: shmobile: Atomic conversion part 2 Date: Wed, 16 Aug 2023 11:50:44 +0200 Message-Id: <6386b4805a880f907e963b9045dc3ba34936c97e.1692178020.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=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no 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 v3: - No changes, 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