Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1271441lqp; Mon, 15 Apr 2024 00:40:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWhI6QB+I5LeQht1HIlLR0kKIsgC4v3bC/nx57YFLw9f6X3bXTzQihKLJvmu+h0KO4/F+KPU2MBIx35MxO4XQXJ68t9J1NPlZzUmLVvYQ== X-Google-Smtp-Source: AGHT+IGWbf9ArmH1TKhPKhZpmcRkFXbgsZiPmd1ifN9miLz5YUTP9T3boB0LBWoJG6MyvlVyPtz+ X-Received: by 2002:a0c:fa84:0:b0:69b:5e44:59e8 with SMTP id o4-20020a0cfa84000000b0069b5e4459e8mr7717248qvn.37.1713166856920; Mon, 15 Apr 2024 00:40:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713166856; cv=pass; d=google.com; s=arc-20160816; b=xQwrYNvNRKq54/yTgPkk+h1hrbjpmuzf+B37dVWLN1y6heJSZjO1DImVQBTz3KQMEM sS4wrl6q8UbneLMY9q9S/l/cco1JDUM84/tytfrSa2BsE89irZXrLLd49amH9RDqi3K3 5jXRGG6hgqUregrSwHWRenIf0S1whc1xgJbR0VPhbzl9n9q1xX1TQE722k+my4U6j2nK J4h3B3/a1Vq8bl5eIRzzxJbEkZzol+CiajFeDumOOSBo6XXD5yC2GUHphT2hg4vpbgJO wXlz8MUzyEGXCzK8D3O8fBSPQWCyIPDsd2154u3FJj0c1xP21ZPEOSF+zb/SGfpcc2/x AnVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9NIdB30Vx81uaKC6mbOZmaa4hWNdRYfHBwdUi3ZygfU=; fh=8rL1CnLEBbKasZ0mHPnDvh3NPHhffU1eEPiS0sH/LCI=; b=TgL5WAgy/c5sUFNBUwWSzQku9CIT5aNR/EJRSfar14WQg97W1Pj4L4azz8cxs8XPO8 qD2OFWdRyM2IuheJq2KnWEmwGc/ggKr+dsq+jLGP6lFF8vv9R+0IAmNcasgsWNC34HxA KWRJ2dgih6sYbPQ1Dpc6Kp8X6QhSEhlu6GaT86nlXnWTFxJNiC3GMzx2oxINDQS3V2KX BLEOlZuVu8evB6aBNAHdc53RmVc5VEvftK8u/5Mgio282RGKR2UQgyf52L0x6jzZ+ylk 5VzndK5Zxj2KttUU8fpuUvpI2aAwiuj/R3HmEENDkknekmub1c9Vlg3s9Gax7zmjlyW2 unhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lRCJGlko; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-144688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144688-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id im11-20020a056214246b00b0069b1f0bc4a2si10313239qvb.307.2024.04.15.00.40.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 00:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144688-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=@kernel.org header.s=k20201202 header.b=lRCJGlko; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-144688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144688-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A49161C20EDA for ; Mon, 15 Apr 2024 07:40:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A50A12D022; Mon, 15 Apr 2024 07:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lRCJGlko" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CCBAF2C848 for ; Mon, 15 Apr 2024 07:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713166850; cv=none; b=AlGcuzu/gifMVCujtfYO73pOL8DwIo73K5JIqBSjbR9NgVym0RzdYzo7BjU5+eviGdx9f93qG7Z4BTHG++N2iqxOmRfQ4WpOCXz8dVj4EzRVLQF9LlDi2SftsEmQZHMiBhJ+rXhpNYiPFkg4OaeCi4Ti0tE7TJlnO3ai2abB3lc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713166850; c=relaxed/simple; bh=mU5ztxbRn9xd/nrlhCRKZk2Z+vt7yYgz8ynF5gGmUNQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NJ2C3ixVOo/TPwuj7+dpbusYT5gaDdDA9lne9bgNIBEtc5ggMNFjRcJnCtyB2KlwZrQBrS2frlk0lkFWRyjtg60LS2evxZG72SCR1gpAhPCCVU1i4H/0Dzx/LgInuCgfuaWYiLuVZXOerjgeoVwhuAx4wZxBRyUkQi5GTfd2mV0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lRCJGlko; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0E0BC113CC; Mon, 15 Apr 2024 07:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713166850; bh=mU5ztxbRn9xd/nrlhCRKZk2Z+vt7yYgz8ynF5gGmUNQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lRCJGlkoCFHTA+sY1wtiRIMqfP72his3/NguZSwaXq+SB9hZitRl/Pfzpi0gCNjfF k7iZZznr/bU5yJX8Kom5LOWAxxASbmos29twQxM0f6AnDvNQ8at+mUhaXPTxZGeyot SwteJi54uhw7tsi5LA3ZP7elKT4sN+cgc38yqHHV8iB066t5kfkZHh7OF0t0S8gk7T uNEInAFYABiEXy7nXdc5q1+W/ViJnEytOGN/BmE5T9P44Y8WDFKxJGgjqu1WmrYZjU IDVuiUUlUs+t1GI6NJtZbk5TWXXKukKk02XI64ATazsIdRjXgK4KWV2OddAUnIZEiF UxX66CZ48eI4w== Date: Mon, 15 Apr 2024 09:40:47 +0200 From: Maxime Ripard To: Jayesh Choudhary Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: sii902x: Fix mode_valid hook Message-ID: <20240415-venomous-enthusiastic-wildebeest-a7a446@houat> References: <20240408081435.216927-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-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="yll3teyvqekwzxye" Content-Disposition: inline In-Reply-To: <20240408081435.216927-1-j-choudhary@ti.com> --yll3teyvqekwzxye Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Apr 08, 2024 at 01:44:35PM +0530, Jayesh Choudhary wrote: > Currently, mode_valid hook returns all mode as valid. Add the check > for the maximum and minimum pixel clock that the bridge can support > while validating a mode. >=20 > Signed-off-by: Jayesh Choudhary > --- > drivers/gpu/drm/bridge/sii902x.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/si= i902x.c > index 8f84e98249c7..658819199c84 100644 > --- a/drivers/gpu/drm/bridge/sii902x.c > +++ b/drivers/gpu/drm/bridge/sii902x.c > @@ -163,6 +163,16 @@ > =20 > #define SII902X_AUDIO_PORT_INDEX 3 > =20 > +/* > + * The maximum resolution supported by the HDMI bridge is 1080p@60Hz > + * and 1920x1200 requiring a pixel clock of 165MHz and the minimum > + * resolution supported is 480p@60Hz requiring a pixel clock of 25MHz > + * > + * (drm_display_mode clock is in kHz) > + */ > +#define SII902X_MIN_PIXEL_CLOCK 25000 > +#define SII902X_MAX_PIXEL_CLOCK 165000 > + You should probably add a KHZ suffix or something to make it obvious. The natural unit for a frequency is Hertz. > struct sii902x { > struct i2c_client *i2c; > struct regmap *regmap; > @@ -313,7 +323,11 @@ static int sii902x_get_modes(struct drm_connector *c= onnector) > static enum drm_mode_status sii902x_mode_valid(struct drm_connector *con= nector, > struct drm_display_mode *mode) > { > - /* TODO: check mode */ > + if (mode->clock < SII902X_MIN_PIXEL_CLOCK) > + return MODE_CLOCK_LOW; > + > + if (mode->clock > SII902X_MAX_PIXEL_CLOCK) > + return MODE_CLOCK_HIGH; > =20 > return MODE_OK; > } It's something you should do in atomic_check too Maxime --yll3teyvqekwzxye Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCZhzZ/wAKCRAnX84Zoj2+ dvLmAX92oWeHZLr5hIKDGhemdrwUZRCEUzbQueD4PKBREYfIyJO/eJTudbScwDNA vK/3U9EBgLvM/IuxlOU3CjE7cy0J+aLjzjXCPtdZi8mR1O3D/rXUwzHq8uCReJ94 lQRjoduC1w== =+Fmk -----END PGP SIGNATURE----- --yll3teyvqekwzxye--