Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp376793lqb; Fri, 24 May 2024 00:33:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVA7aZeKLdFe5tNnErXL2U0HARdnxOA4E9NNGWilmyahUpjTbVlpADILTrppVh0ujhqYPhJFyq66qzdEYPUBEx2haP4Vz2LDMyJ304+nw== X-Google-Smtp-Source: AGHT+IG35QgmLwVXnL3xFoc77Mf2dgmShlmiFsL0s+MFI444ZOUkIgyK4QRm6ljgCM6b0JGwhk+1 X-Received: by 2002:ac8:7f44:0:b0:43a:cc86:569e with SMTP id d75a77b69052e-43fb0e514d8mr14897671cf.9.1716536026038; Fri, 24 May 2024 00:33:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716536026; cv=pass; d=google.com; s=arc-20160816; b=RFvFpd8W9P9rze5yCQG+y4FYECn45bWohEKw+E7FhF1kjXpLSfJ6nqJ7kGO6+Z9zX5 KvjElpCwSMNX52gKP/sFnV/QhnLNFXBg5L5dHJWV+q1SGB+4uLM/CEMgkOIFd9XQcq42 9j3GNsBhJ0F4FXV4gm0cnmYdq0JzzLs8jrT+97+HqlXeuBdwuQbcV8/GeqHzdhjpuj38 /A094X2vsfP3cFFIOumLdDuPBTAgI62qshHVUmzDuzVKTP0Enh93ZdTdU2qo/W1sNKQQ EuhonlLEhEdtGljK++WJNcTsgQ8gsb9fqLt/uqR5pWZfzr3Tyjf7zm0Ru0KotX+5Pcin 3p3A== 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=YH5PH07tuO/Z/7lFniOpGFT1BozCx5yNjTbNGs3pDHI=; fh=4PZpdvD3NlEdHQwbOtwYg9G87uLcgk5bCTHVCswGtMw=; b=nbgi3hps3ansdIIH74YeBG1wZqlAuXlx0S53JxBmy+alEepYzq9pK3YU6/4DyJ945t eS+IKS07hJvP3WDHgqEVUcFolyUGR1OQ/0Ngj+BNkNHSrgFnwZOYESNNx0F7u/EONYSv jjOArWFjSpTIJDFVyn7pZzrjUbcIcD7590GcZfbtfId5WEJtVVaBXfA0S6v4z/Y2Rhrc xjsed2L5y45hTc7fQ+jPZ1N7J3c+/9iBYszG3xQR824JyPRMObVMmIciF4G1WzBHiqxe fsSP6qJ7NtNRU3pdlfN+J1GSGp37nuKMH4hYptA0zWhtuFz6RgGBKfxee7Qmt1LachNb VecQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="e1y/Pb5b"; 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-188400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18ed9e1si12037701cf.806.2024.05.24.00.33.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 00:33:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="e1y/Pb5b"; 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-188400-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188400-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C05831C20BB9 for ; Fri, 24 May 2024 07:33:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD5FF128830; Fri, 24 May 2024 07:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="e1y/Pb5b" 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 90D3738FA3 for ; Fri, 24 May 2024 07:33:35 +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=1716536017; cv=none; b=NWuAArTUlCI6QbpE1RSNFhtHkL8hlEdqWv2ryC1PR8YrhfFQJMBHp1CvGgMHyyrebCpZvzVMDp0/bT2DQjpAnkE1QL9CRDXkr1+Xzy8tKipjb1n/rLQ8WOatWb6t9QZExGORxXzVOuFSyde3DG7TL1wXdW3dZwOqqKXxN517AC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716536017; c=relaxed/simple; bh=vAf4OfqTxkekOhU7imfeBrfQM61hNqtAsmvljSXG2/g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sm8J5dQ9HFKj/f4ZZkWC+iauibBG4c/kweptxrYqZHj2sLcUDmQALeYNa5pCY5+n4+VQQreMJV1gWdGK0/B1RRg2SBl6s+WsDwVnARwduF3uPOxvydvajEFUnnebl+f0vZAwqHKCMdnixRQLSYiXXRGVNR65aRRSv3rKFaTIkss= 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=e1y/Pb5b; 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 fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44O7X9HJ023868; Fri, 24 May 2024 02:33:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1716535989; bh=YH5PH07tuO/Z/7lFniOpGFT1BozCx5yNjTbNGs3pDHI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=e1y/Pb5be7uy8jXpG1K3Fwau7TxmNL64SMYE7Kk+5mhUtaaZAS18LLr1f9SPytRvs 4EaX9vM37ybYKUIz/DkMIxb8OcquXfI7LASXZB4AqFKHAHHWOnmvznMZN542cSVWe6 p5RWG7LS6Icp2YGyxV3x3raOmYvnNGBB9Kfz53Oo= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44O7X9L3033627 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 May 2024 02:33:09 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE108.ent.ti.com (10.64.6.29) 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 02:33:09 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE101.ent.ti.com (10.64.6.22) 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 02:33:09 -0500 Received: from localhost (jayesh-hp-probook-440-g8-notebook-pc.dhcp.ti.com [172.24.227.102] (may be forged)) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44O7X8Uh121725; Fri, 24 May 2024 02:33:09 -0500 From: Jayesh Choudhary To: , , , , , , , CC: , , , , , , Subject: [PATCH v2 2/2] drm/bridge: Add pixel clock check in atomic_check Date: Fri, 24 May 2024 13:03:05 +0530 Message-ID: <20240524073305.107293-3-j-choudhary@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240524073305.107293-1-j-choudhary@ti.com> References: <20240524073305.107293-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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index ef7c3ab3386c..a5b7ee1e3bbe 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -517,11 +517,16 @@ 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. */ - bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags; return 0; -- 2.25.1