Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1892185lqb; Mon, 27 May 2024 00:25:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSoQEIHlBV70kGDVZPeaaDprhBRNyoOp/7z/u5MCb/rD1YvITgYMpC5AzpgzaAKOtC+9SS+9o0kddQXuJvyNfAPqp6GVVuYZEA3pjoTw== X-Google-Smtp-Source: AGHT+IEC4bYWU1Oj9UmPR+Pvs1VWJHplmdM/8+lgGVyghYUW1DG7Bckbw50F/iVTyO1/nlDxK/qO X-Received: by 2002:a05:6a00:418a:b0:6ea:bb00:dbb6 with SMTP id d2e1a72fcca58-6f8f2d730abmr9723336b3a.8.1716794720360; Mon, 27 May 2024 00:25:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716794720; cv=pass; d=google.com; s=arc-20160816; b=wFNc+DnR5EtNkSVH5/xUyqthxgHKhIwdMDhLji9u0O3VDAPtbLzW9olyDB0v+Dsew3 UkmM56W1sMqSGryQ8rDiQu2e3QNL6ggOm1MAjocYoKcIXhxXtthbrBVAY3U8xAB/EMys TwzfU0h6eSj2iv437vZIkzah1cU8RAuYCTYYJOJ6A7VGyXSN8KiD7MsaLInR7uMGFJdr rBq+ur8q7KJAMArR4Oj82CHd0eHBoRZz/EjgYLMd9v6zVl+nfEu2vPchnHs8b2wb5Nj3 RnsDSyfmWHt8AjzLpTEbIsdCtMMEbI09UihpmjtbYyp7cwBegSrqkA62RAPPJQFDRS7z ZVPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=snx6Ph4uQVjQek/swj+K0VorNZB+1Jjhdc3Cuw8ryaI=; fh=KBdYAOTcm79U89BgzksRiVu0JrXhfixxMMFw7oGmeBw=; b=ufjWu6xgML1schfZspJAfM1lR0yMcV1h6hbyM2Ytdx/XgS9sbX8g/3xFdUQF5rCdkm F+IueeTgMj3aZSZdRv77cToXMDDqS++1144WZ66wRicvb9nzDRJKtbU1E7yIAsDIsX2C uUCmw/7ouEu1Xptbm0d5QDAB0euvfBDVI86GWHOn+2WGBL7fcnK3EOgp37GUea39O/vp YfAV1n3ADjCqjVJ5+kILCIcIt6JfSI10UNtdhWKwrhRMgBdcrd6ljzizhSerJ1J3SyRx mXrubi4LqTyCzz8MX7SPyLutYqJlCzvWioHTzXT+e8WuWFZIqJC9qnfwHeODGgUin4Og ZZKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DEd+ktRV; 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-190139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fcfd9c31si5671986b3a.185.2024.05.27.00.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 00:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DEd+ktRV; 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-190139-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190139-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F3BA1280C7E for ; Mon, 27 May 2024 07:25:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 802283C482; Mon, 27 May 2024 07:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="DEd+ktRV" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 D4DCB17C8D for ; Mon, 27 May 2024 07:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716794673; cv=none; b=Zh5RE1xD291GHoHMx1arNq93Gin4lL75B7idMi2b6B8jJ0J7F3gKc5g3J9ESHKz22rmbSHbZPcn7IA1ztCL+wAzgOMkSHzRQD1spmVZAwLJnD7cHTUaSWnNyVqkX0MWyZ1RS1vi6CCwf18FndI1Z5/hKyvqNxjgn6Q4RI914Bro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716794673; c=relaxed/simple; bh=wC/VHPlG/K7p6CUmEsrG1n6NOqLLTQKeyKQryX1tK8w=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=oR3WEPbel6EndyrUfI0oQArE2ZpJmhGK9GlMKjxf8eakIxcY0f78HhmUPhO3QvnLhQpc1+HcTgMC7g1wdHrfwDLZOJobUdOzImk2btQh4YoTnK6f8Yrbe0KVCw2VKUwQe7DcN2L1bCss1gL3MQcg5TSCnPjyYIhhOvStAL2HEuU= 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=DEd+ktRV; arc=none smtp.client-ip=198.47.19.142 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 lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44R7NxZW088786; Mon, 27 May 2024 02:23:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1716794639; bh=snx6Ph4uQVjQek/swj+K0VorNZB+1Jjhdc3Cuw8ryaI=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=DEd+ktRVrjIlbm14MNfdqAYORqaMMqdN5NYOvM4ujIOoycoMApi15Awu+rhO8VW3j 767GmphGs63Cj3WJyYBtuKEWIFUv0P2oGYlczI8LRDJo4Q53QTQl5PXTae20sBqQLW davT8oQMqHh1nKkfioiWv/7COG26jjsAEuAcGbDg= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44R7NxZm007598 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 May 2024 02:23:59 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 27 May 2024 02:23:59 -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; Mon, 27 May 2024 02:23:58 -0500 Received: from [172.24.227.102] (jayesh-hp-probook-440-g8-notebook-pc.dhcp.ti.com [172.24.227.102]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44R7NsIg083020; Mon, 27 May 2024 02:23:54 -0500 Message-ID: <5bf589c6-6ba9-434a-b7da-eb0c09284dcd@ti.com> Date: Mon, 27 May 2024 12:53:53 +0530 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 v3 1/2] drm/bridge: sii902x: Fix mode_valid hook To: Dmitry Baryshkov CC: , , , , , , , , , , , , , , References: <20240524093509.127189-1-j-choudhary@ti.com> <20240524093509.127189-2-j-choudhary@ti.com> <4cd64cf5-d2b0-4aa9-b958-6b6fc54f0bf2@ti.com> Content-Language: en-US From: Jayesh Choudhary In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 25/05/24 01:16, Dmitry Baryshkov wrote: > On Fri, May 24, 2024 at 05:54:02PM +0530, Jayesh Choudhary wrote: >> Hello Dmitry, >> >> On 24/05/24 15:11, Dmitry Baryshkov wrote: >>> On Fri, May 24, 2024 at 03:05:08PM +0530, Jayesh Choudhary wrote: >>>> Currently, mode_valid hook returns all mode as valid and it is >>>> defined only in drm_connector_helper_funcs. With the introduction of >>>> 'DRM_BRIDGE_ATTACH_NO_CONNECTOR', connector is not initialized in >>>> bridge_attach call for cases when the encoder has this flag enabled. >>>> So add the mode_valid hook in drm_bridge_funcs as well with proper >>>> clock checks for maximum and minimum pixel clock supported by the >>>> bridge. >>>> >>>> Signed-off-by: Jayesh Choudhary >> >> [...] >> >>>> + >>>> static enum drm_mode_status sii902x_mode_valid(struct drm_connector *connector, >>>> struct drm_display_mode *mode) >>>> { >>>> - /* TODO: check mode */ >>>> + struct sii902x *sii902x = connector_to_sii902x(connector); >>>> + const struct drm_display_mode *mod = mode; >>>> - return MODE_OK; >>>> + return sii902x_validate(sii902x, mod); >>> >>> There is no need to. The drm_bridge_chain_mode_valid() should take care >>> of calling bridge's mode_valid callback and rejecting the mode if it is >>> not accepted. >> >> I need some clarity here. >> >> IIRC, if the bridge does initialize the connector in case >> where the encoder does not attach the bridge with the >> DRM_BRIDGE_ATTACH_NO_CONNECTOR (DBANC) flag (referring to tidss >> encoder before we implemented the DBANC feature), then >> drm_connector_helper_func are called and drm_bridge_funcs >> are NOT called (atleast from what I have seen in detect >> hook for cdns-mhdp-8546 driver which is there in both >> structures). > > There are different kinds of bridge_funcs. detect is a part of the > connector-related interface, so it is not called by the drm core. On the > other hand functions like mode_valid, enable/disable, etc. are called > for all bridges. > Oh okay! Thanks for clarifying. >> I do not have any platform to test non-DBANC encoders. >> And I did not want to break any platform that were still using >> bridge_attach without DBANC flag. >> That is why I kept mode_valid hook in both structures. >> >> Are you implying that if connector_helper_funcs are not there >> then there will be some sort of fallback to bridge_funcs instead >> of passthrough for mode_valid check? Because that goes against my >> previous observations. > > Not quite. See how drm_atomic_heler uses bridge_funcs. > I will do that and spin another revision with the suggested changes. Warm Regards, Jayesh