From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 1027437703A for ; Wed, 20 May 2026 08:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266215; cv=none; b=oQOxH0dKvA2ucJALeTf5UjS2XNxMXUzky0vpOgBoIXPuBBzpP/STGZDhi8rNE7YVqoecHu1qUPIQD/aI+GOFx4ParajlQETPbNRFzN0Iq44wraXchX6O3MnNMN9VUewcctedfY3z6ij8SSb5CFwYKilL306eIoRMTAiYLopkBoE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779266215; c=relaxed/simple; bh=O4tsN25tahkcAsHFovGmdauUCgGBxqabK8aC0fha2Uc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=OSUUpt2I+t9KCG9SdSGLAC+KwhNlzR7VGgSMab/7ZP72Q5e6az38W/NvZBPRfGnsUu3hHZjlOXLW0SrZGtsyL8pcTe13W32T1+ax3qcWG94uCte4k4lVJAFDVrlVjCVnP4alT3Ptavw70FVVGFWqVlAbzrVlGzJxma/7gtdI23k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ec3Tdbmv; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=D6ycVRWh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ec3Tdbmv"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="D6ycVRWh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779266210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bKCOj9ctJvrcgjU6TqlSQaQ7SYSoxCFQc2iMU4O21Y4=; b=Ec3TdbmvZj55r+Ip/Z4PYrd9/hTCgiOaoZUsZuQr1HiF5zDaKHCoh7VrCA5r3jIy/p8Kuu yESYHcfu/hUJBGjnIxZIDfeEIA7xn0Ir7Kj+D3f+af1SuaCPZ4A4MYDPvP++uXQ7smwmdQ vSFIv6S/SFKIlEqEefyDb1/AKM4YhPE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-OMI-SiGGMEu9B4__lQmiNA-1; Wed, 20 May 2026 04:36:48 -0400 X-MC-Unique: OMI-SiGGMEu9B4__lQmiNA-1 X-Mimecast-MFC-AGG-ID: OMI-SiGGMEu9B4__lQmiNA_1779266208 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-48fe24773c8so23868535e9.3 for ; Wed, 20 May 2026 01:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779266207; x=1779871007; darn=vger.kernel.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bKCOj9ctJvrcgjU6TqlSQaQ7SYSoxCFQc2iMU4O21Y4=; b=D6ycVRWhwjqqNw/8u33blQzbC7kq8Fpg8R00ZaOgH+bEO7D7kuz7GNayUeZUlENXOD 7l5Ozueo8+wKMG0lSyReWYw0QSP2zpFEh3vQothwshWIXt4tmafVV8ozo6nXaGgArpJ9 zCzQkCjUWoNGOcTmpwU0p/RTnjo1C0O3ijAOaqTxWtJRHUHQPP1KkcL3CALt3utBFK0R IjN1fHjMA5eIl1ww1edCw5VjFGkTvFhJEZvXRSjEsA4tJhTUiy7c+OZnuqgvxT6o3Ow6 8L8ZTbk+nzcBsN+byd+IrHNwQqPXEpwPSo1QZAQblAJHWtBHNzHJvHs2389kb9z1/Lg/ o9og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779266207; x=1779871007; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bKCOj9ctJvrcgjU6TqlSQaQ7SYSoxCFQc2iMU4O21Y4=; b=LnBDL8Ir1MuDCr/y9Xi1NIjM2YctjxDhCXZBiqlLrWrXX5ebO7wcdODyT7tcXO7rwD ILwdJoLSAPvvoRtPLhTLiqoDk2DsRgGw4oj5T9E3SrPUgr5qa6DpQ0ChlYDYuONJjCT0 fR6pzkXch4+3Zf/Ft7v9FiegQBf9hgycxyJaBHev4HxNRZ17juU+ZtmgTA3sa4Ls5lQt K76wD/43hunzeO3d3Svcj0RwW8NgF5h3GhvAxYq4wXqujhafZP4BHHx5ZDT1VgmpfBeV Wu2UVNBnS3bb1A4urhFARGaMdbiOfu+qQ1leNDBOVlq3yFQ1zwKNPCayWoVJiufEr1qg 9G/g== X-Forwarded-Encrypted: i=1; AFNElJ/gHH9RT9MpwP6k8pY2PUYl3YUqP+hMxztB0tSXuJ1Ac/mQ5gMKINynlWnZu4JTmAL446tL7H7HnGGG2AE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz93d7/lEkfTuCd/hns5+YeCVdg2fSJNwAxSrLZ7E9JqXuOFn2r 4tx8Xn/8sPfZF4oP/2GCx6lRR7WC4JfapK8aJ/64LvPS2LI4OWjr7qTFGiAAauT156Czt1M6v/c el3+ys2jmxkksKXfvzb19bYG3xsF9HRG1DkuAsPeKFYc9bEQewaQOJ8wocMgApJuAJg== X-Gm-Gg: Acq92OHePKo7ZHBCMxBsImVnxiA1Ff8OS6KLmxGNPmZ+XnfJJFiK/WDMueqRhQkq5Cd EDD3lqgQzZJ7/Ev8Oa++2ExNyKmwEpaEqecrujVL3SSYYVUhxQrJEc2RSKDcxxjJKfjHDULfery E383F+OpVLPfgEJetDHdJB2gISOHOBNdBwGZlRes4cQN6kEyO3KctSZLtcQt2eRBsepkDssGJ+D JuPOftJxOOqKQTw1qvAQTXAxsRQGtB0ad30ff6bI1aOiQQDeixVDzRbkUuYNEznnQOjA5oabfKO 9hjQybQx1pytwuq7LDBnu/SaoN6ueh1CLLwEhHLFYlPqzO0UVWgrQtnH3jwSlMmlLrcD4+5BE8B ZHFR4EyeQArWaj9XMbD+VTYkDFJ7Zw+bL6or0Zry7k+M8XibbHUGGbXSrE8rxmBKzlwyaJWFAsN jw1X+THtdB6hxtqXI= X-Received: by 2002:a05:600c:858d:b0:48f:e230:80a3 with SMTP id 5b1f17b1804b1-48fe6514c31mr278323395e9.33.1779266207552; Wed, 20 May 2026 01:36:47 -0700 (PDT) X-Received: by 2002:a05:600c:858d:b0:48f:e230:80a3 with SMTP id 5b1f17b1804b1-48fe6514c31mr278323075e9.33.1779266207096; Wed, 20 May 2026 01:36:47 -0700 (PDT) Received: from localhost (62-151-111-63.jazzfree.ya.com. [62.151.111.63]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fffb9aac4sm501908955e9.9.2026.05.20.01.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 01:36:46 -0700 (PDT) From: Javier Martinez Canillas To: Maxime Ripard Cc: Jani Nikula , linux-kernel@vger.kernel.org, David Airlie , Dmitry Baryshkov , Nicolas Frattaroli , Simona Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 1/8] drm/display: hdmi: Add common TMDS character rate constants In-Reply-To: <20260520-yellow-panther-of-dew-de32eb@penduick> References: <20260519144712.1418302-1-javierm@redhat.com> <20260519144712.1418302-2-javierm@redhat.com> <78506dc5f7ff02a2bdd05de1170a1cb3e33e1abe@intel.com> <875x4iy1em.fsf@ocarina.mail-host-address-is-not-set> <20260520-yellow-panther-of-dew-de32eb@penduick> Date: Wed, 20 May 2026 10:36:45 +0200 Message-ID: <8733zmxysi.fsf@ocarina.mail-host-address-is-not-set> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Maxime Ripard writes: > On Wed, May 20, 2026 at 09:40:17AM +0200, Javier Martinez Canillas wrote: >> Jani Nikula writes: >> >> Hello Jani, >> >> > On Tue, 19 May 2026, Javier Martinez Canillas wrote: >> >> [...] >> >> >> >> >> +/* HDMI spec TMDS character rate limits (in Hz) */ >> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MIN 25000000 >> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_0 165000000 >> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_3 340000000 >> >> +#define DRM_HDMI_TMDS_CHAR_RATE_MAX_2_0 600000000 >> > >> > Usually everything in DRM is in kHz, and Hz is the exception. >> > >> >> That is correct but in this case these constants are to be used with the >> HDMI helpers. Both struct drm_connector_hdmi_state.tmds_char_rate and >> the struct drm_bridge_funcs.hdmi_tmds_char_rate_valid() callback expect >> the TMDS char rate to be defined in Hz. >> >> If we define these in kHz, it means that drivers will have to * 1000 at >> every call site. > > As long as the unit is obvious from the name, I think we'll be fine, and Yes, I agree. > we can even have both Hz and kHz defines if we want to. > >> > I'm also not sure the 1_0, 1_3, and 2_0 really help anyone reading the >> > code. I won't remember what they mean in Hz or kHz, and I'll have to >> > look them up every single time. >> > >> >> I discussed this with Maxime before posting the patches since I wondered >> the same. He suggested that the max TMDS character rate was linked to the >> HDMI spec versions and that it would be more readable to name it using >> the spec version rather than the resolution. > > As usual, it's both the spec and hardware capabilities. But some like > the HDMI 1.3/1.4 max is used to know where to setup the scrambler for > example, and is used everywhere. > > I still think it has value, but we don't have to force anyone to use > them either. > > I'd prefer to use the DRM_HDMI_$SPEC_TMDS_CHAR_RATE_MAX_HZ though > Ok, I'll change it in v2. >> The other naming I suggested was: >> >> /* HDMI spec TMDS character rate limits (in Hz) */ >> #define DRM_HDMI_TMDS_CHAR_RATE_MIN 25000000 >> #define DRM_HDMI_TMDS_CHAR_RATE_74_25MHZ 74250000 >> #define DRM_HDMI_TMDS_CHAR_RATE_148_5MHZ 148500000 >> #define DRM_HDMI_TMDS_CHAR_RATE_297MHZ 297000000 >> #define DRM_HDMI_TMDS_CHAR_RATE_MAX_1_4 340000000 > > Honestly, I'm not sure if it's worth defining if we'll have the > frequency in the define name. > Fair. I think is still worth it but I agree with your opinion that having the $SPEC in the name makes more sense. > Maxime -- Best regards, Javier Martinez Canillas Core Platforms Red Hat