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.133.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 21C1325B08A for ; Tue, 12 May 2026 18:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778612060; cv=none; b=jGiomFsgbKCI2PdsEWNhO2/7d5tmZ+hsomReOZf7WoWeu8zy7+OFyemPYXY88SMpaFTD+hoakjY1AGfvB0ruGHKBy/4UH3/NVbsWwwY7On8Ed8LR10zQwCm/SGsYUxk6wqUGUk5yjHWn83cgsUotTyKMFMZ3BXWW5mpkpwgjfxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778612060; c=relaxed/simple; bh=STibCC5lUL9wkskVe0TOsSSOV837pCPluShmMdCoLn4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=e+LLr8AjiOkdhBtXgUTPfSPyfBz7LHp+tiSRORCMesNu3ZudrYmTZ3FKygD33MH/Wx3PBUE/g0+W7OHfqeT3oNdbIJar0jmgZiUcah3l+cigrz0yfbtSNR+ig3vOUeTa2684QdImWDVZIlrUWUrMmPc9ootH72mVD85ElV41N7c= 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=AjxVdcy0; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=R2Tavxx5; arc=none smtp.client-ip=170.10.133.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="AjxVdcy0"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="R2Tavxx5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778612058; 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=mEOPZvdhBJuzwZH+mKw19MN5xnTiK9IYMBeM17pNMak=; b=AjxVdcy0DmQiWoM+ivvSlG+l8iYh0Hnti4UD9eQP5ND+VLdt1wyFPinz4UsNHuZry/yGtn FfzZSUgNGPTVO10mr1ow1uIjNOryfGWqcSInuo8NL5PKgDigB4Sk0qaob2qUYlTkrS2qjE lGh32jOmAJLoPzxGWS+xqXKPHRysmVQ= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-340-UZQg_IJsM-CL9SUcHi--yQ-1; Tue, 12 May 2026 14:54:16 -0400 X-MC-Unique: UZQg_IJsM-CL9SUcHi--yQ-1 X-Mimecast-MFC-AGG-ID: UZQg_IJsM-CL9SUcHi--yQ_1778612056 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-44ffa15dc8cso3722935f8f.1 for ; Tue, 12 May 2026 11:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1778612056; x=1779216856; 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=mEOPZvdhBJuzwZH+mKw19MN5xnTiK9IYMBeM17pNMak=; b=R2Tavxx5v1s11rwg3omZFom9Cek2g/MYjn8kkMKssw0rPnWasQzY4tNSKeTJkQF/YU baJo28LW9i0gMroTiQokrvk8TnddeSEv2WiJLvBtUXf5uLB4OVfZYyJeXZNTlpHPbbQb FxGPm1KpS7cz0vYoxKuvaMFb28tZNu6mK1pFqZWnKhweW7T3nhS1UIj27nqvqEM5hZ6d J1nqCMMU0aEHcFyr1gOqS6dLLBgGhxcbVAOrXtoCvv7oVGT+QHKCjOgcTsZ2o3SKz+tK v5Y4oHRBCxmLkYFjzZE/pN5C+bF87icPjCk5072AprJgznQ02B5nPrx72cxUVXBikJIE J01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778612056; x=1779216856; 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=mEOPZvdhBJuzwZH+mKw19MN5xnTiK9IYMBeM17pNMak=; b=RkaLeO4Nfi3eR0/OTVRb4zuXs3f0fMQOt+oXg8CbfUIA066+qqXI+b6jshy9l4w2C4 XeHK8m+708r5zn35vrSzCt1EiISEbvRs7BBpqUUSZfNGpC3vuTCAvOumiCjiW9kn+8qX r+NeMuVCPcJkKj8awHl5eOgsNwZcj3p4lL3wy7YGmnNgb/Be4Mq7X4Iw2yjJsTcUyhDp mC/AAB6yonc1aTal01OK+meucaJC8uRVNgv8pie1NPeyX1taPMBGtEH20XXf33RhfAzM Ld8ozBd3j0rgUFzq4Q3p9d0mMJPat6oiMPoCi7mIkkKXLkaV8FwWEhrJEe41cZkR6IGl y19g== X-Gm-Message-State: AOJu0YxH6TltIMcwAattnve+hERczglF0C6m7rxrPSCi/OPpnwVXiJYT p0bGvSrUKl4g4xxGm7YdvAwS8t333ByfB8JvlBZM9DsX85GOk1ej+6HKpjBrYdv0xKugad70gHP ZfW+zCHaprE2PrBZlyKOKJza2187gvDmlUUId8/DOvNJlTT+XHilhzJTKBP+RkJU9Gg== X-Gm-Gg: Acq92OFb2lxvI3/g9fkwXBN7JIz4Yby9pSTHG0HxEcJuADiENyrGfFAJsMgIHQafIIm CLPHhUMfMwLrCApn1Tjsjx8VQrBjr5qU7j2rh2FCri2UnLmDt+ajPkm5LKaBl1rXzR7VEsvoFP1 cRYvA4Fc/XkoOUk8kDI8hGZ5frb3LOkS7TNsOffVFUV1qovDObP2byoNEwEtN4jE2ktE7B/CzqB 9BwB3jbVaCf9aDn8g0q2HUPq3W5JrB8AUTo+43n33vyLie6z6aA/LtHQTlU5mKzmTFmHdxfa0m5 O/dB3OH4SfNy2w/xq5YUm8RG8edztQMzNtBMK3r9PYMbSZ2AlbB20WNTYYGoaL1+R4yzzKrTp5w 99gTN5+oeCRQ9w0u31CYUTI+eJkkMZu/o/ppUfkjwa9d45hRHztIkLhVkXX2oDEa1Urwv9BjfaU 2FbBhG X-Received: by 2002:a05:6000:61e:b0:43d:7508:c9c9 with SMTP id ffacd0b85a97d-45c59bd6100mr7962f8f.27.1778612055460; Tue, 12 May 2026 11:54:15 -0700 (PDT) X-Received: by 2002:a05:6000:61e:b0:43d:7508:c9c9 with SMTP id ffacd0b85a97d-45c59bd6100mr7924f8f.27.1778612054959; Tue, 12 May 2026 11:54:14 -0700 (PDT) Received: from localhost (62-151-111-63.jazzfree.ya.com. [62.151.111.63]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-454916df968sm35967004f8f.25.2026.05.12.11.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2026 11:54:13 -0700 (PDT) From: Javier Martinez Canillas To: Maxime Ripard Cc: linux-kernel@vger.kernel.org, Andrzej Hajda , David Airlie , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Luca Ceresoli , Maarten Lankhorst , Neil Armstrong , Phong LE , Robert Foss , Simona Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: Re: [PATCH v3 1/2] drm/bridge: ite-it66121: Set TX mode in the .atomic_enable callback In-Reply-To: <20260512-romantic-qualified-hound-b5f9b9@houat> References: <20260512132232.333654-1-javierm@redhat.com> <20260512132232.333654-2-javierm@redhat.com> <20260512-romantic-qualified-hound-b5f9b9@houat> Date: Tue, 12 May 2026 20:54:13 +0200 Message-ID: <87tsscxxuy.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: Thanks again for your feedback! > Hi, > > On Tue, May 12, 2026 at 03:22:15PM +0200, Javier Martinez Canillas wrote: >> The HDMI transmission mode set and AVI infoframes enable are done in the >> .mode_set callback, but it is more correct to do this in .atomic_enable. >> >> Because the information about the sink type is in the struct drm_connector >> display_info.is_hdmi and this might not be available when the .mode_set >> callback is executed. >> >> Currently the driver is not checking display info to determine whether the >> mode has to be set to HDMI or DVI, but this is a bug that will be fixed by >> a follow-up change. >> >> Signed-off-by: Javier Martinez Canillas >> --- >> >> (no changes since v1) >> >> drivers/gpu/drm/bridge/ite-it66121.c | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c >> index 19a027d75b61..648ca50712df 100644 >> --- a/drivers/gpu/drm/bridge/ite-it66121.c >> +++ b/drivers/gpu/drm/bridge/ite-it66121.c >> @@ -669,6 +669,22 @@ static int it66121_set_mute(struct it66121_ctx *ctx, bool mute) >> IT66121_PKT_GEN_CTRL_ON | IT66121_PKT_GEN_CTRL_RPT); >> } >> >> +static void it66121_set_tx_mode(struct it66121_ctx *ctx) >> +{ >> + mutex_lock(&ctx->lock); >> + >> + /* Enable AVI infoframe */ >> + if (regmap_write(ctx->regmap, IT66121_AVI_INFO_PKT_REG, >> + IT66121_AVI_INFO_PKT_ON | IT66121_AVI_INFO_PKT_RPT)) >> + goto unlock; >> + >> + /* Set TX mode to HDMI */ >> + regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HDMI); >> + >> +unlock: >> + mutex_unlock(&ctx->lock); >> +} >> + >> #define MAX_OUTPUT_SEL_FORMATS 1 >> >> static u32 *it66121_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, >> @@ -729,6 +745,8 @@ static void it66121_bridge_enable(struct drm_bridge *bridge, >> ctx->connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); >> >> it66121_set_mute(ctx, false); >> + >> + it66121_set_tx_mode(ctx); >> } > > Having some part of it in mode_set and some part in enable is still kind > of weird. The best there would be to put everything in enable (and > pre_enable), and drop mode_set entirely. > I agree that this will be the correct approach. I wonder though if could be acceptable to land the changes in this series as a minimal fix for the DVI mode issue, and then do further refactoring as a follow-up. Note that what I'm doing in this version is aligned to what the sii902x bridge driver also does: static void sii902x_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_atomic_commit *state) { ... u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI; connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); if (connector && connector->display_info.is_hdmi) output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI; ... regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA, SII902X_SYS_CTRL_OUTPUT_MODE, output_mode); ... } So that driver would also need the cleanup to get rid of the legacy .mode_set. -- Best regards, Javier Martinez Canillas Core Platforms Red Hat