From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 39470263C8C for ; Thu, 25 Jun 2026 08:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782376044; cv=none; b=fgdS5Vw40PY6r4iuTpHLXI4WX/LkvIOf94ZuaId41zM8HmLjmvX/XByU7kBtgPEehbQsA51D7OsU57xr9sqRAOJyaSt0QuyvgURBGUf7bNjeYvkstoh1O2o7X6ttJjaJ8WAdZJB6PYk7/moh1iD7l1pVDJRU/scuo4xY7JiP7sU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782376044; c=relaxed/simple; bh=3/LY8KlTihlMDpw21vo/W499ESW2H40mbT2W0+IKHaE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Pw9eca7ngFX1Tt/4W8WaA2Ge7IrxjbYjJ2q6ZGW+1Dae7qBqHKuf7hCsPqchhHXK4AKv79ooeyTp8HNA95ZXsMLHIjPQMuNYxA9jvvOXbtMN5ozN+jsqkowRVTpmaq5uEki3jq9Yaff3BSMH7nUjsGhNvDjQLJBXF8YFJUv8zQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=lpwEnTR6; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="lpwEnTR6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1782376041; bh=3/LY8KlTihlMDpw21vo/W499ESW2H40mbT2W0+IKHaE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lpwEnTR69cAw6BGZ8RcZ1Y0OKSSYaUSXjXIwI1l5nxNRP0Lldb+D9gIul57l6dhRu 040xDbSq8R70JI2jTOjWwi6hrSvb1AI5W1EP9G74ykG7Brusm1zEiIGnMWVG5KMQ9o FxPRFv0/lCmeVlEoba4KDbhxqpQ8mm8uo92G9b3B+egsmOgOlXgyUSG11gDRoKgHSb WlE8NkQmscThLBWOx9Zjj4OrjN0xCunXHlz1+nlwaNgBNyyltBjGUMtJ3zERFNxgOQ 3N0gjN604GcjfnkEW6Xs5OYvwPIn4bePFmHhn0k3SjULJAYtniYPtoso6EYLLPomh8 BR04vvdB51zuQ== Received: from [100.64.0.241] (unknown [100.64.0.241]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9355B17E02B5; Thu, 25 Jun 2026 10:27:20 +0200 (CEST) Message-ID: <0e8ae8b8-3a6e-49e1-acdd-27ce4921bd21@collabora.com> Date: Thu, 25 Jun 2026 11:27:20 +0300 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 v7 04/30] drm/display: scdc_helper: Add HDMI 2.0 scrambling management helpers To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Sandy Huang , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Andy Yan , Daniel Stone , Dave Stevenson , =?UTF-8?Q?Ma=C3=ADra_Canal?= , Raspberry Pi Kernel Maintenance , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20260602-dw-hdmi-qp-scramb-v7-0-445eb54ee1ed@collabora.com> <20260602-dw-hdmi-qp-scramb-v7-4-445eb54ee1ed@collabora.com> <20260625-screeching-uptight-elephant-5bdaed@houat> Content-Language: en-US From: Cristian Ciocaltea In-Reply-To: <20260625-screeching-uptight-elephant-5bdaed@houat> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/25/26 11:05 AM, Maxime Ripard wrote: > On Tue, Jun 02, 2026 at 01:44:04AM +0300, Cristian Ciocaltea wrote: >> +static int drm_scdc_reset_crtc(struct drm_connector *connector, >> + struct drm_modeset_acquire_ctx *ctx) >> +{ >> + struct drm_device *dev = connector->dev; >> + struct drm_crtc *crtc; >> + u8 config; >> + int ret; >> + >> + if (!ctx) >> + return 0; >> + >> + /* >> + * This is normally part of .detect_ctx() call path, which already holds >> + * connection_mutex through @ctx. However, re-acquiring it with the >> + * same context is a no-op and makes the helper safe under any caller. >> + */ >> + ret = drm_modeset_lock(&dev->mode_config.connection_mutex, ctx); >> + if (ret) >> + return ret; >> + >> + if (!connector->state) >> + return 0; >> + >> + crtc = connector->state->crtc; >> + if (!crtc) >> + return 0; >> + >> + ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config); >> + if (ret) { >> + drm_scdc_dbg(connector, "Failed to read TMDS config: %d\n", ret); >> + return ret; >> + } >> + >> + if ((config & SCDC_SCRAMBLING_ENABLE) && >> + (config & SCDC_TMDS_BIT_CLOCK_RATIO_BY_40)) >> + return 0; > > I don't think we should care about the bit clock ratio here. From a > technical standpoint, and since you ignore low rates for the scrambler > for now, they are indeed equivalents. But semantically, scrambler can be > enabled for any rate, and the bit clock ratio should be changed only for > rates higher than 340MHz. > > This function makes sure to trigger a modeset when the scrambler is > enabled or not. From a spec point of view, it's somewhat orthogonal to > the bit clock ratio. From a function name point of view, it's > misleading. > > So yeah, I'd just drop the check on the bit clock ratio here. Drivers > will then get to enable either when the commit actually happens. Ack. Thanks, Cristian