Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp423139lqb; Fri, 24 May 2024 02:36:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkYTATWF3NYO2uNAWsDK9NELhNiKUrKos/+yVQnvFcV5FtR+zHnIetc/2KKZyYK9zEY7jCw6S257TOfYI5P5JgSLBHUjPQQHMwNv6Lug== X-Google-Smtp-Source: AGHT+IFhoYD3rdzEKDwBlyGl68H73sbbmSsUX9dpGxYbNSxflB7glqhXcGLtVmUWiAFc/l8a0VTx X-Received: by 2002:a17:902:cec4:b0:1f3:a14:5203 with SMTP id d9443c01a7336-1f448d30a54mr18883855ad.38.1716543368948; Fri, 24 May 2024 02:36:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716543368; cv=pass; d=google.com; s=arc-20160816; b=VuKvrKvBkz6sbB3OP7/36H7Fxvx82N6GFeqBWz6mpe4LLwmlU7Azstag4M+Gp9B004 xcWj8D5xJkctP2wH/wAtpmrflUs81jNrU/NFtFmAza0NPMK091W/8DvXYu3RDYf+NWVN QFIIiFTSDxYcNBSuWwZjaaD9pqF3AgrGV/5Y9NaDadYV/VRhiu5Nblk5FGr861QofDWZ KiihGB0bQQ8HleeCd/G2Us+sI2Hif7ATUVhUMa8QscfuNCV9p4roGzVXDABNhSv2Tbmn C3LCwJ4PPPBBPJx9Eh1XC+wUOC5EapvbjkVVn6emAfQjlmVnefYN93NxOv7/LnmfPuoD flZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yNHllYLZp8VUFajO1ZSbz4JR76BCSglDPm2k6Bn2KIA=; fh=Uq66CT/HgOh+vaL5Ml5wdwssk2XkMfmyTbY+C42W2Fg=; b=m9IYZvZvhLeXdxwS2k5n+nMjNV/XOx9IZxnWYQPnMUTIzvPPyGwsZ27tUWjC64dKHW AS/4gIwUhoniC3HZZ06//34H/UZzoRafChw9D2dbSEn6kdtv9XQOCJAu6UMoo+gnP62+ dM4Ba/4c19TU2buAqw0zzLYX5cKxVgx0QWZRld2GpYZpVUqD8sYDSOFpIa1BbrxdGUV5 xccP47QKvCeSQ3nC2K4AuAsjvCTMSTcxTLB7Zc06mGasf71nLnKgpJJgLOMoQnc8O5kN 4/KNKgZ0B49WhKyJE8xbWUHYJRpB2zSu3L2VnEZkTmAAH7twHBqpUXbe/YFb8EH6V4Ez bHdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gX6P6YzF; 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-188561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188561-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c9bfc75si10445265ad.495.2024.05.24.02.36.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 02:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gX6P6YzF; 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-188561-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188561-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1DE432820AC for ; Fri, 24 May 2024 09:36:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 819AB85942; Fri, 24 May 2024 09:35:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="gX6P6YzF" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 3364C8593F for ; Fri, 24 May 2024 09:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716543337; cv=none; b=IMtgExU1MFy+lyyKZlAyGPR6URjTg7pgXnGp+eTawWChq7dAKAsZurpDZSd3m472JUsvm3yMNJ3JLpBzqod+EGbVaCKJlQ2+zjI5BaTKow95LacD3e5qOiaPSLUZGppURXAB5Wf+72TUu1WRu2miOLQZPP0g0Q+D7V4RObPuD1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716543337; c=relaxed/simple; bh=QuINseyPMWbtjzxt+mFdDX14hPa0Dkxx2vMcHqZDm6g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gaGmCSoWyO0bfreP4pyBOntlpm0t7c/dFM79ebmkhdC8XsxDdF3C3VOf0+JaVEDflP0eHY+WMqZrDzlosvBbhCMUWFwNgibLtZAqLV1QMtvboebdNK1EoT6BNzJd/Omn4uwkXMLFa+v9OwOluG26u4szb8EFd5CGLo5sqjXhUnw= 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=gX6P6YzF; arc=none smtp.client-ip=198.47.19.142 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 lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44O9ZE0n082222; Fri, 24 May 2024 04:35:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1716543314; bh=yNHllYLZp8VUFajO1ZSbz4JR76BCSglDPm2k6Bn2KIA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gX6P6YzFTFejJpJKeYuvr0RfqeRPqqIj8R2Vs7J/xpACKm9Z/W6G5lVRXqZ3nXTkD 1mVF/8hmK0orpiprTF7g8ak5RlOGBCtkNmlnYeud1qgo+SF4F6y7l4h8tyUAqkR+G5 oXduSJdUZdjMcvLK179ueoN2ipOWV69LgtWFoVB4= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44O9ZExV023870 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 May 2024 04:35:14 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 24 May 2024 04:35:14 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE108.ent.ti.com (157.170.170.38) 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; Fri, 24 May 2024 04:35:14 -0500 Received: from localhost (jayesh-hp-probook-440-g8-notebook-pc.dhcp.ti.com [172.24.227.102] (may be forged)) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44O9ZDcO040590; Fri, 24 May 2024 04:35:14 -0500 From: Jayesh Choudhary To: , , , , , , , , CC: , , , , , , Subject: [PATCH v3 2/2] drm/bridge: Add pixel clock check in atomic_check Date: Fri, 24 May 2024 15:05:09 +0530 Message-ID: <20240524093509.127189-3-j-choudhary@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240524093509.127189-1-j-choudhary@ti.com> References: <20240524093509.127189-1-j-choudhary@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 bae551e107f9..a5b7ee1e3bbe 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -517,6 +517,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; + /* * There might be flags negotiation supported in future but * set the bus flags in atomic_check statically for now. -- 2.25.1