From patchwork Fri Nov 15 21:09:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13876861 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 E73C21E630D for ; Fri, 15 Nov 2024 21:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731704987; cv=none; b=bgma1FxmaeNqvb03P5TlVsj2NyXMa/x6ZHVLIn5E6Yej/18MiFpMqyxyuCjkOeWOcZPNo4Q2vtXtLCy90v+Hl3GZrsNiOY5kkvFJOHCg5b8Esx1o3nfLu4PVmXvn4HEHRVQJZkcCcOJolIcRixrNxbRdftTjjckrYpnd6ltUpEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731704987; c=relaxed/simple; bh=7MG/OwsNfTmDVn/mH57oaixvVZgNtOEeYuE42na1NvM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pFV3NaPrcxoaMCddpwHIVkqP7IdTzZQ18ewkfCn8IaQnQgG2QJhveba0nEITqQ/fuCNtpAOwLt0DotNC05Li7PZ3l0/2tx+T9RKlQJG2ANY5gzS7pzkF8buf2ycBK2P/fDt2m+Uk4TAber8UMBncnu5H9GQDMBxSBAh2eZuzRmo= 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=loM0moXc; arc=none smtp.client-ip=209.85.208.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="loM0moXc" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5c9c28c1ecbso3108611a12.0 for ; Fri, 15 Nov 2024 13:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731704983; x=1732309783; darn=lists.linux.dev; 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=FriEhyugYOxuqzJsZUFAkaGrF7e8rD4Q/ahhoiQ1cKE=; b=loM0moXcIfKkjtENY7w06v/fWY2g1ht2wWjBtoS0h+1sv13HGhuN3JF85zVnYcmG+2 p0Lc85q6B25ctc/LWvGeNypP3sMHDfY0USdLsf5aqWPyTU/AB92ev6v+v7G9//GpgSGa zmzbuN0nRWgSI8qDGmuICi/9awZYr0HSrPftllduEm/GINcsOAhAwN+1T6m6CPEzHh5p 3Qa6EroFph/q4jq/7b9IW+AyDUw4knh3DtzxxWVWzKnpypGn5jrd83vZG/y/+A0pAaFn 8tMZzUl74Ibyx8mZLYj8dHixZHG6ZY6fuImsQEghkCB+ALeerEMpwIQr50K2rWFbj+su C7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731704983; x=1732309783; 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=FriEhyugYOxuqzJsZUFAkaGrF7e8rD4Q/ahhoiQ1cKE=; b=wv1/f+QsEBJ9wpPSvQyKSzY4MFcn5z5/5fy6dSL9I7UYA31QgiIqbm/RFL6Lw93q35 G6ntGsPQ0qkpmp4gS4d0nG1gsvXVu7nNT9lMJvTDnQu+gxO/0CJkBm5Yfo5BmEz0pRjk eZn51GDU1ZBq+n5nvxJtYDVU1K7ojy7YC448Xmm0dXunjNPBieaUSXu5bRcBRPXy4TZp 4VHe++9hzVt6rrIfmX1d4UMoZwykwsHx4WxigSwxJTTiRuALt5ly/xbH5uchWXvErynC WSOWAPKiEfemFDNoZxnQNdxCuppR5/f0YIN5G4gu5Xju0Ga1yy8iefR71srGq/iYucV/ okgQ== X-Forwarded-Encrypted: i=1; AJvYcCWUbaQ/4CPFcR3DKSBXwQoM7qjIWVGEHEJsnRRmlxkqK3niBQ2VQXAURG6RqewIdFhvHKA=@lists.linux.dev X-Gm-Message-State: AOJu0YzhASaUb3KZOv8gJmNBdkGkdGmupdMDkM/EDS3Dnomv3h+zs3vs AtSroQ/pbZBkd/JFieBuiLVbuAimf66DNmebBFgFfwJiWEtUSeUTOmK0BscegxQ= X-Google-Smtp-Source: AGHT+IGKIQ3xiZstYvdstCjBR8aVG15Cn1mMCwtoW2X8A1GwZn6dftD3n4aChlS1ng3pveIgM00eUw== X-Received: by 2002:a17:907:1c29:b0:a9e:df65:3a81 with SMTP id a640c23a62f3a-aa483554f81mr289025866b.59.1731704983120; Fri, 15 Nov 2024 13:09:43 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa20df51648sm219626366b.62.2024.11.15.13.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 13:09:42 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 15 Nov 2024 23:09:28 +0200 Subject: [PATCH 3/5] drm/sti: hda: pass const struct drm_display_mode* to hda_get_mode_idx() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241115-drm-connector-mode-valid-const-v1-3-b1b523156f71@linaro.org> References: <20241115-drm-connector-mode-valid-const-v1-0-b1b523156f71@linaro.org> In-Reply-To: <20241115-drm-connector-mode-valid-const-v1-0-b1b523156f71@linaro.org> To: Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Karol Herbst , Lyude Paul , Danilo Krummrich , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , Alain Volmat , Raphael Gallais-Pou , Liviu Dudau , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Peter Senna Tschudin , Ian Ray , Martyn Welch , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Stefan Agner , Alison Wang , Patrik Jakobsson , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Dave Airlie , Gerd Hoffmann , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Chen-Yu Tsai , Samuel Holland , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Gurchetan Singh , Chia-I Wu , Zack Rusin , Broadcom internal kernel review list Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2152; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7MG/OwsNfTmDVn/mH57oaixvVZgNtOEeYuE42na1NvM=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7r5jg5+cbXA1P3G+YHK+zSPn1YT5s95n2QvGvrowOXVb 9iWBV7uZDRmYWDkYpAVU2TxKWiZGrMpOezDjqn1MINYmUCmMHBxCsBEPKez/1PR33Ng1s+rcm9z bL6yZ2fqWfuGFpQ4u9z4GVuXumtWcOlGnSMB2qnnxJ4eF9XP/DLX5dEcPpvbW02qHPJYP081f1S R0eTwZ9vjD9tVdf4UhJ7l6Cvf6C+ga+Cju8q9ePq21HD1AwL+wQsaVH81cp99b2P6mWum9Kfbaa rNLEVT5yw5VD2l0TxiqkzHJI/o35q9/R91hRms7Tr10mJvaIdz/n0c56Ym/2BNh5/uMmkV3zy9m c8DtyodM1RMvpkaULjJfcJekUSGSQ3LZiws29kicizgVU7lO5XzB4+4h6u/SIyY4v5ghdNHLoP4 +aG20Tznxdbs6GmO6jLMj3/wyWJ70bFLMao7uGWcf3ACAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Make hda_get_mode_idx() accept const struct drm_display_mode pointer instead of just raw struct drm_display_mode. This is a preparation to converting the mode_valid() callback of drm_connector to accept const struct drm_display_mode argument. Signed-off-by: Dmitry Baryshkov Reviewed-by: Laurent Pinchart Acked-by: Raphael Gallais-Pou --- drivers/gpu/drm/sti/sti_hda.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index f18faad974aa2eda58c1e49537f8337db119d4b7..829dc4b034e8a79a908bda60485c2b94ef96890c 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -280,12 +280,12 @@ static void hda_write(struct sti_hda *hda, u32 val, int offset) * * Return true if mode is found */ -static bool hda_get_mode_idx(struct drm_display_mode mode, int *idx) +static bool hda_get_mode_idx(const struct drm_display_mode *mode, int *idx) { unsigned int i; for (i = 0; i < ARRAY_SIZE(hda_supported_modes); i++) - if (drm_mode_equal(&hda_supported_modes[i].mode, &mode)) { + if (drm_mode_equal(&hda_supported_modes[i].mode, mode)) { *idx = i; return true; } @@ -443,7 +443,7 @@ static void sti_hda_pre_enable(struct drm_bridge *bridge) if (clk_prepare_enable(hda->clk_hddac)) DRM_ERROR("Failed to prepare/enable hda_hddac clk\n"); - if (!hda_get_mode_idx(hda->mode, &mode_idx)) { + if (!hda_get_mode_idx(&hda->mode, &mode_idx)) { DRM_ERROR("Undefined mode\n"); return; } @@ -526,7 +526,7 @@ static void sti_hda_set_mode(struct drm_bridge *bridge, drm_mode_copy(&hda->mode, mode); - if (!hda_get_mode_idx(hda->mode, &mode_idx)) { + if (!hda_get_mode_idx(&hda->mode, &mode_idx)) { DRM_ERROR("Undefined mode\n"); return; } @@ -614,7 +614,7 @@ sti_hda_connector_mode_valid(struct drm_connector *connector, = to_sti_hda_connector(connector); struct sti_hda *hda = hda_connector->hda; - if (!hda_get_mode_idx(*mode, &idx)) { + if (!hda_get_mode_idx(mode, &idx)) { return MODE_BAD; } else { result = clk_round_rate(hda->clk_pix, target);