Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp273328rwd; Tue, 16 May 2023 00:27:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fKXmBzoB5HP14SrgKrcC3EJqNkQWmQJZWLgupAewGJg7ZSw06sg51zioN8Pl7lAzDJvw1 X-Received: by 2002:a17:902:f682:b0:1a9:6dfb:4b09 with SMTP id l2-20020a170902f68200b001a96dfb4b09mr47104840plg.67.1684222047315; Tue, 16 May 2023 00:27:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684222047; cv=none; d=google.com; s=arc-20160816; b=qlphlE1UqRsxZulMwif17NFi05AZ8NFB2JZEREb3dzhP/hr8LPzCogu7p+DtDW0xHB rvX8WFYaGzrmhuEQCCmb42tuhfVnV+UlGr9/YGw2v3aRDQ2sMvBVHOHDTh31GogVOCe3 xP2OUVDCErH9CByXWElyMsjIA1ASc/eTTg0NCMDsi3zv4u/y0eakauX0avWoRq7RkgDe EQckhP31k9bY3NHH+xoKdt2AWFbxzJEXPOyOM8UuD/FQoTNI7hZSL3jkMU8i5RkxvxIO fo+QzXbmcoyizNIcZmC607wpCRP2OZ6t0yj7McDQ235iyt6kgWwzvEiHrp+xQNgaWwUI gJGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:content-language:subject:reply-to :from:user-agent:mime-version:date:message-id:dkim-signature; bh=oiBlv5aXhyE1YrAkeylL1umyw4Re1O8pIBJgTabc1FQ=; b=0HbR4IHK2hH4MPDZxym+oD3dCBF3HOZz4yCVY1uZWS//PZGktiKpUhsGO6PUeqbQkj D0rBdMYUe03o5F0dMQAL83elvYafNy7VlYvKbWgeSbpueGfLCj/vPn0jxcmWupBEEC0x qODvgnvk7ZQjQPaYSE4AIZCxTtYJg7wt3NCw4vheMYRIT9XyYXhlPF2mrW170lEAORPS DmeHB9b2zHxjylibpKfE0oNFMKfdR329RTV08+pO1K9cv3m1PftYutLLQ91mV3at0xwy mmi0lHhLmPSwvkvP9XWv4Wo6GcHYknvhGXwlvngODqtIjLgxqYjxXlJeOl9Xx/MVa9iG 2S/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RbJEbnh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a17090332c200b001ac62935789si19808001plr.468.2023.05.16.00.27.12; Tue, 16 May 2023 00:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RbJEbnh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbjEPHQ3 (ORCPT + 99 others); Tue, 16 May 2023 03:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231200AbjEPHQQ (ORCPT ); Tue, 16 May 2023 03:16:16 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C9949F8 for ; Tue, 16 May 2023 00:16:13 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f42711865eso62216895e9.0 for ; Tue, 16 May 2023 00:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684221371; x=1686813371; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=oiBlv5aXhyE1YrAkeylL1umyw4Re1O8pIBJgTabc1FQ=; b=RbJEbnh1z/xaER3RNUgf5EOZSOC80EEKBoUosRbeqy1rFudkKmVyHLaAVDOa2P6d5y ZqJGkrbz2RiezmpZ/BwBMtj3wNNKYReGLRfghwy+QDxWtOE89Tz2oFFEixsgt44LhGEi pyEPMh8brRRXj0yC2KDo1Rf9EpBUb7D8CHOxPY1lxlCSCaNfOlrPJVv6ijXvfGWJyyW5 hbf+2U9/XPVPZ+k/074/0ZmE2x6BgTPwxbU/+4jLpatsvlclPa1dQkYM3kGghrz4MCg2 j+2rObxkblkWZq72m9uOJ1BGeTjXKk7Dbzh9a4H8umoQGcETd/fqfneuyhg0v/6MARm0 c6VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684221371; x=1686813371; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oiBlv5aXhyE1YrAkeylL1umyw4Re1O8pIBJgTabc1FQ=; b=HXCXR/jW+IHFit5lD4VxbvPyGi4i4BS/0TsxXPqmL7bmvGl8ntdH0gbUtsKwbnXgVC UqErWfEDTiaP/8Sjt52ymGV9Ah/yZstUqMfWMORPkNTRNCDwAYBgoTZkO14bY5ov34k+ NHd4ph3MZbV4MKELoPDlFHwroYSOcRI5FTFVBZp1p/eUjblbq0TudrWS5S31Y+Fcg8Lm wIa3jCKnkIaFVshYKR53Ds0bUWtxy3vHmSHTlFRAZe+dozlfM9lKhOR384IsxYLWkPnj woiyj75wB5GGiGyWE6tMurDUBXbN8SxzpY7ShXopEio+sW9prBOcdt+zLjXxNrAYc4MH dhJA== X-Gm-Message-State: AC+VfDxsiqA6yYsjxhSzhEqf0FgMZ4aHAcPTPlC+w2H4na9Sz7TUTwUW 7AVNBPBUXRCJ2R7Xe//qPX/D+Q== X-Received: by 2002:a05:600c:2101:b0:3f4:2174:b28f with SMTP id u1-20020a05600c210100b003f42174b28fmr21031622wml.2.1684221371369; Tue, 16 May 2023 00:16:11 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:86be:97a:a043:77a8? ([2a01:e0a:982:cbb0:86be:97a:a043:77a8]) by smtp.gmail.com with ESMTPSA id g2-20020a056000118200b003079ed1f0a0sm1526408wrx.44.2023.05.16.00.16.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 May 2023 00:16:10 -0700 (PDT) Message-ID: Date: Tue, 16 May 2023 09:16:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 From: Neil Armstrong Reply-To: neil.armstrong@linaro.org Subject: Re: [PATCH v6 5/8] drm/bridge: sii902x: Support format negotiation hooks Content-Language: en-US To: Aradhya Bhatia , Tomi Valkeinen , Jyri Sarha , David Airlie , Daniel Vetter , Laurent Pinchart , Andrzej Hajda , Robert Foss , Jonas Karlman , Jernej Skrabec , Rahul T R , Swapnil Jakhade , Boris Brezillon , Francesco Dolcini Cc: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jayesh Choudhary References: <20230509093036.3303-1-a-bhatia1@ti.com> <20230509093036.3303-6-a-bhatia1@ti.com> Organization: Linaro Developer Services In-Reply-To: <20230509093036.3303-6-a-bhatia1@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/05/2023 11:30, Aradhya Bhatia wrote: > With new connector model, sii902x will not create the connector, when > DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and SoC driver will rely on format > negotiation to setup the encoder format. > > Support format negotiations hooks in the drm_bridge_funcs. > Use helper functions for state management. > > Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is > the case with older model. > > Signed-off-by: Aradhya Bhatia > --- > drivers/gpu/drm/bridge/sii902x.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c > index ef66461e7f7c..662b6cb4aa62 100644 > --- a/drivers/gpu/drm/bridge/sii902x.c > +++ b/drivers/gpu/drm/bridge/sii902x.c > @@ -473,6 +473,28 @@ static struct edid *sii902x_bridge_get_edid(struct drm_bridge *bridge, > return sii902x_get_edid(sii902x, connector); > } > > +static u32 *sii902x_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > + struct drm_bridge_state *bridge_state, > + struct drm_crtc_state *crtc_state, > + struct drm_connector_state *conn_state, > + u32 output_fmt, > + unsigned int *num_input_fmts) > +{ > + u32 *input_fmts; > + u32 default_bus_format = MEDIA_BUS_FMT_RGB888_1X24; > + > + *num_input_fmts = 0; > + > + input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL); > + if (!input_fmts) > + return NULL; > + > + input_fmts[0] = default_bus_format; > + *num_input_fmts = 1; > + > + return input_fmts; > +} > + > static const struct drm_bridge_funcs sii902x_bridge_funcs = { > .attach = sii902x_bridge_attach, > .mode_set = sii902x_bridge_mode_set, > @@ -480,6 +502,10 @@ static const struct drm_bridge_funcs sii902x_bridge_funcs = { > .enable = sii902x_bridge_enable, > .detect = sii902x_bridge_detect, > .get_edid = sii902x_bridge_get_edid, > + .atomic_reset = drm_atomic_helper_bridge_reset, > + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, > + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, > + .atomic_get_input_bus_fmts = sii902x_bridge_atomic_get_input_bus_fmts, > }; > > static int sii902x_mute(struct sii902x *sii902x, bool mute) Reviewed-by: Neil Armstrong