From patchwork Thu Dec 7 15:49:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 175234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4875663vqy; Thu, 7 Dec 2023 07:52:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpiNHRDPHiWYNJ4BGxM/o+WwKB5mbgISQFD8E8os/zNpBiZGasGETa5iBLkbVRFIpG//WV X-Received: by 2002:a17:902:ef89:b0:1d0:6ffd:ae0c with SMTP id iz9-20020a170902ef8900b001d06ffdae0cmr1899827plb.115.1701964344192; Thu, 07 Dec 2023 07:52:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964344; cv=none; d=google.com; s=arc-20160816; b=xB1MVPac35ySA2//6JWApygzmgy9SOgMkIf4TQHLQWGRBUGBqZqi/cjh5rfmALl42K QGdAXlK/XiV+pqjybV6UDF9JSWHUhdzwFP90UAp7AcDtXpkApyIGW0kS2RMXXjfrj6fp 1/lgRMQ88ki8RRTGznU76JUQorPRuOx13whEFdUebBtf9OY2WMNI4drwKdzc4mEKuDv5 LpLtoV/th53IUK0zXSWxt9bpJA1vA2062fn+xIB/6O+tH/DoUfjX/Q8wvR92wGGoXIhc UKxaz4YcOPvw+Zyx5YgB9x/hNdQYYF6RKKqONEV7X41ifYXUKdm6CYauun+fS58NqzcA traA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=raqR7DmsMt1nEp5MrCwcNM/f9uNTqeH1jYehFtj8jXo=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=jGe1iXM6tlogP57cMbnFlePz30HrqsCm1ImJqDPiNiF+54yHLkScfsQnv7Ff3FWYJf 0cwAruPJlDCkhyLvUNRBjquKkC2QStsKlpoOBCH8zvJN6j5xw/D/CxNuZAtrgvlX1S4T Pw4dnIt1GgG7tdpup4+3ES+hcoh4rC3/UKe56P1j2gsOHvPfHt27Iy67+ILeEvWQmSPU 0a8dNh01jt3tuDkQdTPiL+yyBq/B5kLct3Jmln1RMKb5XipFZ64TPdqtH8b6u7HQGHb+ Ya87TwjC8wtDD5U4nLIxIe36Tqh85kTYCp8u67eS8pJPddZJsY0Y4oNzaT6GXITP6pBf E3Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GA7tIsJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j4-20020a170902da8400b001d00c80f3b3si1362973plx.280.2023.12.07.07.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:52:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GA7tIsJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9836B804083A; Thu, 7 Dec 2023 07:52:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443605AbjLGPvw (ORCPT + 99 others); Thu, 7 Dec 2023 10:51:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443669AbjLGPvX (ORCPT ); Thu, 7 Dec 2023 10:51:23 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6C38213A for ; Thu, 7 Dec 2023 07:50:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04327C433CD; Thu, 7 Dec 2023 15:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964243; bh=Ox0y4JDexQBxvJ40xD4jKEkeShMLHDYRNsoF7fP2Kbw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GA7tIsJB4+7FsMQ2ypBz3zOmwmmB0rogh5GVD/9X3VAvFpMTLczrjsRnjzbMR9OMA LHoyEIzqHGP6L5jaDOcYkc/NTClHzoqMSqku4DjniPxcOH3cIWLRYgjkHbQdegUAt2 DAOVjtFZl+T/7E7i1G5c2EWjb17hKGF5EbCJ+6vCTbTk/tAhUv7jtOgY9Omy9THxGm PwKUS9SrsuDQLzOWAH3KaO7fEBn4MiIXAtNeVwdwNgEHNC/XRxEgF0+X2TmHBKpcsW 2IPE6XTGbkWtyAys+OVajU+6PI+/Z/6iKYB+YIRmvvLbTDohUP3ySTVglcYy9WhLuf wV7WwHVRYrkYA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:48 +0100 Subject: [PATCH v5 25/44] drm/rockchip: inno_hdmi: Get rid of mode_set MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-25-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=mripard@kernel.org; h=from:subject:message-id; bh=Ox0y4JDexQBxvJ40xD4jKEkeShMLHDYRNsoF7fP2Kbw=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9tEj7MWfrQxmvQ/+emJRu0lHsdFVr/LkTnkPXfyv 2iZG+aJHaUsDGJcDLJiiiwxwuZL4k7Net3JxjcPZg4rE8gQBi5OAZhI3CaGP9wJs2pSfhnpfNun fD2why2h2HR2e6vku38zN+o9ttlyN4WR4YXWloRysYQLJxQqctUD76tk5VesC74gUe0gs4FNKDy XCwA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:52:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784638964256792795 X-GMAIL-MSGID: 1784638964256792795 We're not doing anything special in atomic_mode_set so we can simply merge it into atomic_enable. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index cc86d273ca4a..4db18195246e 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -490,21 +490,22 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } -static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; - struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, adj_mode); -} - static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; + + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; + + inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } @@ -533,7 +534,6 @@ static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .atomic_check = inno_hdmi_encoder_atomic_check, .atomic_enable = inno_hdmi_encoder_enable, .atomic_disable = inno_hdmi_encoder_disable, - .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status