Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp691093lqh; Fri, 31 May 2024 13:22:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFY9ylqWvMhRF0PFFC+2Vj0vgl4WUtbodp0SUL1f/gKEIdzgi2L2uK6mZuWyT/KdRaEVHi4XUVSnquqFSkRncp7fHmjeQNW0zYTOo6gA== X-Google-Smtp-Source: AGHT+IFd+OOxUN/RFzMllSr9HCQIJfaLNNKqqkzbV24WDE6l26MTYMs65n/fj7vGPKImGkSZxbLO X-Received: by 2002:a17:90a:a410:b0:2c0:76b:f466 with SMTP id 98e67ed59e1d1-2c1dc56c2e1mr2840994a91.5.1717186949673; Fri, 31 May 2024 13:22:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717186949; cv=pass; d=google.com; s=arc-20160816; b=EmW/3n9NVMC+C2qWbFmFCB9vnbsQC4FHsNvqsT2P5LOZ8Ao5oh5JL5JyF/PUvtcIBI m1O+L0R0Mc2gKZ6rZMIXQcMP0cww/DTXN4j/96ZkrmnVM6P1keN1pOrFqcm5vIUxIeVN oE5tew3HC2tTYimS1IAexDAFX0mKkHfl55Od2i39TlmQWQAGDyfi3zXex8RuoO0suLVb murv7R82VvPW0SZf0B2cg24HMRFoc/AgYew/qmniqgpCSWspURE3dAeN3tcUAKSNlKYY Ij+8XGrAHpoPlzZOJ5iw+CgdLhYgoL8x+oLhWJsOnaFV07H3TmqJH2a0kcMoDRVaVjYU EMLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=FiLWZR73FzG1cBUuGAjbn5LfyouiORitTo/38HE0+Xs=; fh=ND6fSaxEIM9HvMxy9RJi1fFz62iENVuL3U5P3y9kqqw=; b=LJnLwOxRGFwJc2SFguKedc76rKl/yiK9OlpJ/GK9+AozpWh3OgSJJcGkqCKH2sNavq xzxrCVhtORa6qVlk4TZwANzKnXxpB9KyisXFQoI3PGqYtRfuPPNRGjDfWAHyKkERpJwO Trr7g6Cy2Jm/xwKAOaDOU6id4mv5nSor8W8hhbhR4CZzsmiUXYzs/2bkrBeFsa+VqhPt 29o9LhyP9BkVq6cLrrsdj6wVo2oJo9WY19CBKbEB9dlvSHeiJIWuRExD6j8DI8ZuTOYp R6KaVaoyLIRC3IDq9UtZk2KtbVKDIkZGqd2/FBUEznHf5+/6NFjkSPQAtnXf0Q09ZN5/ WG2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=it+qPrXF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1a77c4824si3989572a91.132.2024.05.31.13.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=it+qPrXF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E3CCAB285DD for ; Fri, 31 May 2024 20:08:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01257182D3C; Fri, 31 May 2024 20:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="it+qPrXF" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4FF017F514 for ; Fri, 31 May 2024 20:07:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186058; cv=none; b=iz/hCs+wq36zXLt4uhwLOO/Jq1/7z95Pd9r3P1G//puzJLUbakKYbQdfYMtysPcmXvBrlrrXA7Au57G0r98wfLKrB2+mOIJ1UXekL33wZ5hdQVWpOCthH7nqhRWpQXHKJ6oMpmRJn4YQ1WiKs9PFNAPlbqWxKlj8d4pGhxmMwtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186058; c=relaxed/simple; bh=UWUILZSKKGNyx193zjImsEEpRTHfS6fkYYigZ43zbQc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bvljf3jcn/OwJPzrG2XIMU2kv1R85z2wTLFGkmkf+orczZUV3sxMS/WDkK3L/IrGDAPamQHpD11Qe7tIcWvNHiy0aFUxe9vZxDBkN6DOC65PzbGdeSPPFU8yqSawGvcVlzz+ttFy6Df71rmHewfmpRK5odNAkdKM2NALH93vv9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=it+qPrXF; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2ea903cd11bso19147121fa.1 for ; Fri, 31 May 2024 13:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717186055; x=1717790855; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FiLWZR73FzG1cBUuGAjbn5LfyouiORitTo/38HE0+Xs=; b=it+qPrXFtIC1z2FD4D+sO+YkW5HpRl+kGY6XtMEsjmM7u2ZZDNs+ZxsJ1UsDtRx812 KB+zhrgeUgxARWK2ayA2aoWqkaWO0lcGTTxl+RtMhwlosufOeFWoMR+CyCj5auM+a6Bn hnfjMMnJi+Tvfs/S1pLe+pVBNbLQo/dkQfNY3nsfvAm53qA169pAsT0XH0bIL6YjYYO0 HXekAQTzad4IjBh/miTZr18XruULvZDIOFpIwCwawkofyOsnFi6g3EoJUsDVFn5KfBM9 sbTy1gqfnM7gzC6jF73gGW8TWxXHpabSvtq4bHgS5ONNpquOWkVnCuN1RPWrf7CXrckd 5PWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717186055; x=1717790855; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FiLWZR73FzG1cBUuGAjbn5LfyouiORitTo/38HE0+Xs=; b=CbSkHVJHzDmg+dfgZqE5TswsIcq1QBEM7UpQDSu8PvC94hlKjO/vzv1gCnaHdW8d+P xi0etOun824ObK4cKIAuf0S0zFEWiqfEzdgaBUBmQDrIOiPXPhrp+1FZ5bpDjPgkJUsA b2fdcnhHxtzw5AVJsZL4kBVPDgrvsiNnJkNfvvCYmnqiFFKuLEEexrTFI41Ho1R4r4MY 91lrcIP53YRChAEdOObc8mV9uUbXj1YtaFX4Z0T46pi+l4IcxlPyPz6Q1+Q1WZjotdDP EX5wIP8Kgy2u+iVbaCXAL8Ib3GA1tlcaE5RKvisTMU3J206Y7sMvY458GPtP+q1dl1V0 aj6w== X-Forwarded-Encrypted: i=1; AJvYcCV/3bVKnl7SjfhBVDA/vK/oOUwwcVU8+9oZJrSHiR8Q/q6gCrUMy5B8Drs6Sn1PL2d9p1gCZjru7CizV8sPCIpiHgLQrKJeAFnJoePn X-Gm-Message-State: AOJu0Yy+QPttMv/v5Ojl+JL4rrigwe6uEcSYFYhtGieeMp5Drtf8CyWr QSKTqV9AGOHMlS/egR7CmQt/Zjv2qZ0rYNdd997S4UkzjxO+o1Qxe5JprB4lp/Y= X-Received: by 2002:a2e:b693:0:b0:2e9:8852:3d20 with SMTP id 38308e7fff4ca-2ea951e4c52mr23923571fa.41.1717186054220; Fri, 31 May 2024 13:07:34 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ea91cf0b83sm4022111fa.116.2024.05.31.13.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:07:33 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 31 May 2024 23:07:28 +0300 Subject: [PATCH v4 5/9] drm/msm/hdmi: turn mode_set into atomic_enable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240531-bridge-hdmi-connector-v4-5-5110f7943622@linaro.org> References: <20240531-bridge-hdmi-connector-v4-0-5110f7943622@linaro.org> In-Reply-To: <20240531-bridge-hdmi-connector-v4-0-5110f7943622@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3487; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=UWUILZSKKGNyx193zjImsEEpRTHfS6fkYYigZ43zbQc=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmWi4A5VAxSNzIvkri0KCvCvKC+3PtYIkHbBwQf Y+oSMDUI96JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlouAAAKCRCLPIo+Aiko 1W3/B/9hxuzoStd2MFOr27dsWDaQLvdDfDKq6OitbAFUenCZ+yoDz5INHgYLgNAFKeLcQY97zk7 oi/xQrziuDyC8cYUzfBovdERtp6AbdklpswZ+qzOXYDBDmE62EDkfOTTf4JLYKS/Gmkny+96+6J uWPoLmdWkj7jT1ndF3RNxt4hE+HU/PkBp8A8s67dkotwqviDsyUpG7UqzVZflZ2cvMNMXkdTgsN SVneGeLuMUXeDLryp0nZwyspdFGdySGkKqSAlQisz1ZQf6X2NBbgeDg4Nob6bvmCn8s0w2bV2zE AKSxqnDsWh1Dk0Bzlfe9s+lWijwVpfzA0OPpeBulpM9dheKA X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The mode_set callback is deprecated, it doesn't get the drm_bridge_state, just mode-related argumetns. Turn it into the atomic_enable callback as suggested by the documentation. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index d839c71091dc..f259d6268c0f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -129,12 +129,25 @@ static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi) static void msm_hdmi_bridge_atomic_pre_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { + struct drm_atomic_state *state = old_bridge_state->base.state; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; struct hdmi_phy *phy = hdmi->phy; + struct drm_encoder *encoder = bridge->encoder; + struct drm_connector *connector; + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + const struct drm_display_mode *mode; DBG("power up"); + connector = drm_atomic_get_new_connector_for_encoder(state, encoder); + conn_state = drm_atomic_get_new_connector_state(state, connector); + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + mode = &crtc_state->adjusted_mode; + + hdmi->pixclock = mode->clock * 1000; + if (!hdmi->power_on) { msm_hdmi_phy_resource_enable(phy); msm_hdmi_power_on(bridge); @@ -177,18 +190,24 @@ static void msm_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge, } } -static void msm_hdmi_bridge_mode_set(struct drm_bridge *bridge, - const struct drm_display_mode *mode, - const struct drm_display_mode *adjusted_mode) +static void msm_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { + struct drm_atomic_state *state = old_bridge_state->base.state; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; + struct drm_encoder *encoder = bridge->encoder; + struct drm_connector *connector; + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + const struct drm_display_mode *mode; int hstart, hend, vstart, vend; uint32_t frame_ctrl; - mode = adjusted_mode; - - hdmi->pixclock = mode->clock * 1000; + connector = drm_atomic_get_new_connector_for_encoder(state, encoder); + conn_state = drm_atomic_get_new_connector_state(state, connector); + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + mode = &crtc_state->adjusted_mode; hstart = mode->htotal - mode->hsync_start; hend = mode->htotal - mode->hsync_start + mode->hdisplay; @@ -305,8 +324,8 @@ static const struct drm_bridge_funcs msm_hdmi_bridge_funcs = { .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, .atomic_pre_enable = msm_hdmi_bridge_atomic_pre_enable, + .atomic_enable = msm_hdmi_bridge_atomic_enable, .atomic_post_disable = msm_hdmi_bridge_atomic_post_disable, - .mode_set = msm_hdmi_bridge_mode_set, .mode_valid = msm_hdmi_bridge_mode_valid, .edid_read = msm_hdmi_bridge_edid_read, .detect = msm_hdmi_bridge_detect, -- 2.39.2