Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp775045lqb; Fri, 24 May 2024 12:47:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRenNfuxxPs2oziYVkrS97Of+oR7QKDdses5GZdacoxjM2YUUcQtx22iToEz2wDla0QM+BHpFofPR1W2F5dwp+3lot2UiUFHSf6BgoeQ== X-Google-Smtp-Source: AGHT+IHdS6EOR6aK/VbXxCW/sMu6awXnMCS4X0EM2zFAfwOio3/blhu5QoSo+laSJKbcdD09urDK X-Received: by 2002:a17:906:2189:b0:a59:ca33:683f with SMTP id a640c23a62f3a-a62642dac81mr209448266b.28.1716580025766; Fri, 24 May 2024 12:47:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716580025; cv=pass; d=google.com; s=arc-20160816; b=yvmOdIYW+NP1YOocsXjG8Bus5QahKvhmbYLOEYh694/g9oTqi/rPMCOQmf/lnyD2+N 6FlJ4XQX5H6Lsf2Xg39KCUKt12p4bHhj8j/90UlD7lrDNe04ObjKMTmCUcknsbyBDIMR FSuDnb3mqRq/SROK0xliVc0uRTUbyEpgQJFVbcptkefEiAmSYSbvhTLRn7jCnGVc0jEz hvTAqAwDTVGCpI8Yw9K7lvX6hS0b0mUz74CgcLr6Cf1h+30Lyn30Fyv2xSaJxmXVAimz 5A81EaAVSuJ3pCTwcOZds4N0TbjnsZxl4q96OO4vlYR6+XNp714G9WIQlkhVgA1dJBnh /91g== 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=Quo9VUto6uPX81U21h21/Sote2mqJ5XSyeYi0dVaj0I=; fh=DCy5e4tuw3JwAvYKxtGj78XJBJtsb2L+T01PoIXs9rE=; b=vLUNnjoadQ2pJLb2b549EgMdKDeHbBVLpDJXw/xT+ekC1MSh24hT6GvopgPr8rK+4n Bdy2pM4wuiX0WWDgEnFTIWWnHw5kEFoT+m84R2VkklvlbMuBfVsBe/9yuZobRl5xhWaq PmdSKsjO6KGBc6f8uQNmxsAq7l0wImxXQ2op/7UuOkl4TTMpok93vObCvgJbkJhJa8Bd Ch/++FCyOIKOXsNpHhNTuknulsnti5JY7SpWQaBIkMh+OowiDVfCahrfUHU3JCbOguF3 Vew+ybnQ4/iOGBFkUJLj0nJye3k4Wm9K1zg0QvP/33wKASVLBXLJNOeLW4PcDma4bH90 vBHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NVaFpX52; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-189060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc6336esi111597466b.493.2024.05.24.12.47.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 12:47:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NVaFpX52; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-189060-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189060-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 524231F216E9 for ; Fri, 24 May 2024 19:47:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32B5F43AAE; Fri, 24 May 2024 19:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NVaFpX52" Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7480F25757 for ; Fri, 24 May 2024 19:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716580018; cv=none; b=hViV86aNpuHxy+QFQ5Qs35GTb4++1c9XRw4m3TYekgpQtnhxCQuaUg6piRV//vku421S5DrgLFDFnFe05Ldm+tG+B1+5JVKys10OW58Bo7bJSRZ2psUyyRxENZfrSre7Ms96YlBo7TzeSo4j9CSHEn41eKaaDHrsVH6/NXf33dI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716580018; c=relaxed/simple; bh=hqoGfP2ngsyi75wjK/7UVPy1G49ajBOguF0CykV81S8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aJ4O4NRRB3hdNpq0Lx5LHvFQSd8h3Of+qGWdjrDpWS2B+uvS1eQEudCpnxjJLeu5tQ37h/8ls5XT2TTIazdvzYD21Jcz3KuhYrQqpM27UekgWDRI2+XNyrzGZHq8VqPXYf4TafbjZjJ8eCTgO0NYTz4DsnWA1crY/i/tVWYPj6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NVaFpX52; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2e72b8931caso68962501fa.0 for ; Fri, 24 May 2024 12:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716580014; x=1717184814; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Quo9VUto6uPX81U21h21/Sote2mqJ5XSyeYi0dVaj0I=; b=NVaFpX52RbA0jt5wHoA3J7cbasoJ60Lq2ovvvvAwcQj8RqVi2R5ou50YzMhmPRBBeq kNqOqUSOG+fNFOlDUfpesKgb+y261us8576doKV74avyMUGE79ukXgNzA1oVbi/mIN79 HI2NxMC4qxMLcXDO2CKb8BXf7+9wpA+zLWPV50tKRzWJOYjkUsTrRc335BtEcVXx9eP1 S5TWUe/EIWxJTprbJbwjaFqsKcgJljpmA0g+nnKOZAuGWtekZYUpWLQJZrbF3MMXEVIk cMd692zYp0LdExPMXQJopJCkmKK/qUF2EkOgEhlFFWxE+dzt4s6eEIJ0u+8AnHDlZn6u zGsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716580014; x=1717184814; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Quo9VUto6uPX81U21h21/Sote2mqJ5XSyeYi0dVaj0I=; b=tAFnQop9Mhh02t3hC+OaBoPTYnkEM8uYKQp6vY06nzVfGiOwkqGXQ4MvfxplhEuFjf V+gdDKK218LOmqgJIhDdm68lW/d5cTivTBfpm7RNa14y/RTgzeYlQeL3ZrdNblZls5Bf 12Q5DkNXLbp3vwh9X7uynRFiNM7VS135t3/W2MVLBFF8lkVHNh7ezuTRqVr9BfyZOr6O iELJpdd8xYHpuEjgrvCS5JQXqaz1V7qG1y51Uung9DUf/RDgTvjJeRAnLAxzUU+emvbh 61s+8mhCAXPzDoLBBe9SPI/BkE4sRP0WwVGsK22qURXHJb7YnVJOsNZe2DiPo8RMBy3a dhMg== X-Gm-Message-State: AOJu0YxsjQYnXJyc0TJlL9Gpr3V4+OgZRknsEYqSD8S1Y63eMS6Unxg/ eUeVbRUYQOoI2M4jlGC2SGLMtu4JE+GbQGgWjO9pOSu6bIDmsrqRwPQbSpstBpKV8+/90magA1o b X-Received: by 2002:a2e:3209:0:b0:2d8:34ec:54e6 with SMTP id 38308e7fff4ca-2e95b24dee7mr21133711fa.33.1716580014516; Fri, 24 May 2024 12:46:54 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e95be00a0dsm3111601fa.105.2024.05.24.12.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 12:46:54 -0700 (PDT) Date: Fri, 24 May 2024 22:46:52 +0300 From: Dmitry Baryshkov To: Jayesh Choudhary Cc: linux-kernel@vger.kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, sam@ravnborg.org, mripard@kernel.org, dri-devel@lists.freedesktop.org, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, a-bhatia1@ti.com Subject: Re: [PATCH v3 1/2] drm/bridge: sii902x: Fix mode_valid hook Message-ID: References: <20240524093509.127189-1-j-choudhary@ti.com> <20240524093509.127189-2-j-choudhary@ti.com> <4cd64cf5-d2b0-4aa9-b958-6b6fc54f0bf2@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4cd64cf5-d2b0-4aa9-b958-6b6fc54f0bf2@ti.com> 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. > 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. -- With best wishes Dmitry