Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1183365lqb; Thu, 30 May 2024 02:51:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4Ekah1Pkk2p3tcm9gD+sFYk70UEJxJ9pDG0hFuTIE9Z/zv7ZYYQmrHA3fu/XKELh+iVUYZOP3ML3R17qDFkk4VphsPByB1rgYGr/crQ== X-Google-Smtp-Source: AGHT+IFipSNcO/7I/Rq3wsOsXTlPsct7/i82wKkc/hlj/Ba1TSl9wCuTEaEv0ski3NtlD0KheVO/ X-Received: by 2002:a50:8ad8:0:b0:57a:588:747c with SMTP id 4fb4d7f45d1cf-57a1791aa62mr821062a12.32.1717062667994; Thu, 30 May 2024 02:51:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717062667; cv=pass; d=google.com; s=arc-20160816; b=Kvc7QU2ZUp5GqYy7Xxofgx80xGdEcuSX7qHmXGt4cOfA4BmJSAyLJ1ErM0EIMamIzu N+mOJWzlLgbv7djL4rTKDCP10yBDUDDEkt6qiRX6ZGqpxLOaJvL9xDtJd6ivzCxzs8na r26ilPZTQgX0nsxZQRTF/+7YbS9qDqxaMu+JZZpFGNEe/DLn2xOlKYxKobVV9/4z+Qel 8u+2isAb8jRyIb8kM7Ymk7UoDzAj3WWFSH8jXNTSqLMtb7aASbilAun4OKU3xkkxj/ne yuYU20GbkuOPgTTOMNqTtxDOOYmCZX+tqij2ZRBDJJdTBfosKc6gNo39w27njWMWZCUk tNEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=uxW3c1qum3YvbkJyiB8ZfNCsUxF/LLwa29zaFh9WBSo=; fh=Su8xmMczvzujqv752oBtXbY6nNbit+O0Os3ROMe+Lt0=; b=vdvSyCmuHZGLkTgWqbPSP8Su5BSxEjUpuwJwej0bsaCfnIRc13UpwrHIoMMuN30RmD uaLqxKQV5mh7C/miu/G0mZA2F9zlzMPuSbzqenP9KsYD1PjEqim75N+17W3vuPwIApbi iEp245H4JQYHNs3ebkHfN404lkcCGoxgRwSTFpKvS+01hiy26pKICtGXusOiGw31Q0WV w9OT69rP85mtn24Rl1wq1vqZlmq44MkEWaqbTjDnAf1KV9qGCfVG9NWEJUP51MTDgq+f SEgEbhfaJ9CSa294Fl7cAJK9v4dGnV3MtgM5Xfx/6lNLp6dy3mwaLeqIc7vdjGMJzSzu VWNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jNNl3YLE; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-195217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c4401cdesi5789434a12.274.2024.05.30.02.51.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 02:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jNNl3YLE; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-195217-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id B4A061F210C4 for ; Thu, 30 May 2024 09:51:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80799155336; Thu, 30 May 2024 09:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="jNNl3YLE" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB04B18396D for ; Thu, 30 May 2024 09:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717062658; cv=none; b=Dt2m++9/tbeeehNKOi2TFm6iwK5/LNK5NrGsBgi4xE0vrNxcf7x/S+tsX7VpAHxoZya0o1nX0UIEJkfxOr4WtwNxPFM7VLD5le75u8s4fhXgp7BBK1qXu4NohGn3mvBh9UlHf+KCajjnStXq8Baxk0sbUs/5ExIyuEhdDQkaC6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717062658; c=relaxed/simple; bh=1sgCNFfhsLJPmuD7eeGzunJ4rWvci9DlA10mhqBH0wg=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=HnYbbY74yCup6axv01WH/cLa+cnRiogeHJbmSmLhdMmgtSk7QiV6EV/Z5O9YYynKlAStExXsWSTsxYRj0hWJ9LWab2f3p0lWzIYspK8bGHi7vDDysk6TFnkzfnBwpGRIrZzp3v6DBwLzG482s9NFqmzQizJOL8cnS538wA2ukR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=jNNl3YLE; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44U9ofeI000674; Thu, 30 May 2024 04:50:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717062641; bh=uxW3c1qum3YvbkJyiB8ZfNCsUxF/LLwa29zaFh9WBSo=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=jNNl3YLEEGo1noulLDWchtMGhwcqU7HMX4oBAWoqivxTgbaVDdQjrkC1FEbSjSyEc U+FNpjwRkzY0WqCFIYlhJyggeLdQaktZUp7u2GxJQCJdZSwYc2GRrX96GyNz4Y9eY8 CWQBpVgeHc26dww5Kkvbmnx6cw+8YHJmuqX0gjh4= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44U9ofST063338 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 May 2024 04:50:41 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 30 May 2024 04:50:41 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 30 May 2024 04:50:41 -0500 Received: from [172.24.227.102] (jayesh-hp-probook-440-g8-notebook-pc.dhcp.ti.com [172.24.227.102]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44U9oZbA020286; Thu, 30 May 2024 04:50:36 -0500 Message-ID: Date: Thu, 30 May 2024 15:20:35 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/2] drm/bridge: Add pixel clock check in atomic_check To: Maxime Ripard CC: , , , , , , , , , , , , , , References: <20240530092930.434026-1-j-choudhary@ti.com> <20240530092930.434026-3-j-choudhary@ti.com> <20240530-spiked-psychedelic-monkey-ddd0b0@houat> Content-Language: en-US From: Jayesh Choudhary In-Reply-To: <20240530-spiked-psychedelic-monkey-ddd0b0@houat> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hello Maxime, On 30/05/24 15:04, Maxime Ripard wrote: > Hi, > > On Thu, May 30, 2024 at 02:59:30PM GMT, Jayesh Choudhary wrote: >> Check the pixel clock for the mode in atomic_check and ensure that >> it is within the range supported by the bridge. >> >> Signed-off-by: Jayesh Choudhary >> --- >> drivers/gpu/drm/bridge/sii902x.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c >> index 6a6055a4ccf9..1bf2f14a772d 100644 >> --- a/drivers/gpu/drm/bridge/sii902x.c >> +++ b/drivers/gpu/drm/bridge/sii902x.c >> @@ -494,6 +494,12 @@ static int sii902x_bridge_atomic_check(struct drm_bridge *bridge, >> struct drm_crtc_state *crtc_state, >> struct drm_connector_state *conn_state) >> { >> + if (crtc_state->mode.clock < SII902X_MIN_PIXEL_CLOCK_KHZ) >> + return MODE_CLOCK_LOW; >> + >> + if (crtc_state->mode.clock > SII902X_MAX_PIXEL_CLOCK_KHZ) >> + return MODE_CLOCK_HIGH; >> + > > atomic_check doesn't return drm_mode_status but regular error codes (0 > on success, negative error code on failure) Okay. Will club together both conditions and return -EINVAL. Warm Regards, Jayesh > > Maxime