Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5530213rwr; Tue, 9 May 2023 02:51:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5v8eitv3Sqeq4WF9Xh0EhDnMvYBR8c7PqBIwBweQBQMs2aW/j3UENrMlaa2cZVX5zQ0MC9 X-Received: by 2002:a17:90a:ce0a:b0:250:aa60:b4bc with SMTP id f10-20020a17090ace0a00b00250aa60b4bcmr2358151pju.10.1683625881287; Tue, 09 May 2023 02:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683625881; cv=none; d=google.com; s=arc-20160816; b=gkBgPtEGay1N2gpj7myNqZzEjPBjmA1XpRKP4V3/QPpQXc8vY3smESkfwZe+XGcpzE ubObEbwArpsPUEvlIYYK1T7NaPO7yLGrZ8i4sAIN7Uk4V5BZErQG0Cg+tMn37RtA3ToY DYOVnCVCAZRmwDAcq9phlMf+vUw0TRklDR5UAmHJK0VQ/5rtvO7SqE7nFemt2CcBrNmf QVdm3L66imJb5R1U20qH7RSNEh9bBk1wFShyJJpew2nx1gZZf+lq6aKWXe023xQE3Rrr oyJw+0EqQv4V7t4YlB4WYw7eED3Z2Re2P0VUolc9daLrRGzBHVvYNjnK5RGMEey6ve07 9ltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vY3Q3GCHsjquVCmMgoZ2yhC4R121K3G0gkk1ot9VvUo=; b=0Gla7mr4/t9cxKs2GPUzVj7HFJ5R783OyclKOsNVIslfKmUXVatkpp0kMpvCTNg5vd pb+DQNj49UHu8Pgo7Bcb0AXQUYOAekfOvSxJsNegFmf4YvRVvOg68v6X5x5IxX26TtKD K/bC07b+VKlI3giUf9ZcAyC5yHX17inTxhTHDitCQxOJgiwlEkkJ7VmDsOmK49uLtg9S jIv+QiYUEXK2hlWp3vVWvqOw3PHEWQaDae3OFFQuwT/CYor+ah4Uc4PeHASFpJuFl07F 4DoRqycOMfL0c6uWZrWE8MsF2f2EMmyN17C18mbkeIIRoDIOZSQo9zq2MIOz2w/4ppbu UjLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fezUtltp; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a637f03000000b00528b5a668d2si1067357pgd.863.2023.05.09.02.51.05; Tue, 09 May 2023 02:51:21 -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=@ti.com header.s=ti-com-17Q1 header.b=fezUtltp; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233813AbjEIJbY (ORCPT + 99 others); Tue, 9 May 2023 05:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234986AbjEIJbP (ORCPT ); Tue, 9 May 2023 05:31:15 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2A371A4 for ; Tue, 9 May 2023 02:31:12 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3499UfKV022682; Tue, 9 May 2023 04:30:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683624642; bh=vY3Q3GCHsjquVCmMgoZ2yhC4R121K3G0gkk1ot9VvUo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fezUtltp2e4SCP+3uHZIMz5ei4CSeRFHpZHW5FPYcWe22sicUPwtBB6Rs6Z37K+/9 DrFhw0ZOUeyV7fB9+CSjyx11PZbdRY8bOkYLZc+wsT2wfOWeur5nthUPIdxFUOdvh9 AnRSAKP2Ld+NTk2VQOoTHP9CVpWKFDgrBIlud5FM= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3499Ufrh107181 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 May 2023 04:30:41 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 9 May 2023 04:30:41 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE110.ent.ti.com (10.64.6.31) 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; Tue, 9 May 2023 04:30:41 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3499UeXN017870; Tue, 9 May 2023 04:30:41 -0500 From: Aradhya Bhatia To: Tomi Valkeinen , Jyri Sarha , David Airlie , Daniel Vetter , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , 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 , Aradhya Bhatia Subject: [PATCH v6 3/8] drm/bridge: mhdp8546: Add minimal format negotiation Date: Tue, 9 May 2023 15:00:31 +0530 Message-ID: <20230509093036.3303-4-a-bhatia1@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509093036.3303-1-a-bhatia1@ti.com> References: <20230509093036.3303-1-a-bhatia1@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 From: Nikhil Devshatwar With new connector model, mhdp bridge will not create the connector and SoC driver will rely on format negotiation to setup the encoder format. Support minimal format negotiations hooks in the drm_bridge_funcs. Complete format negotiation can be added based on EDID data. This patch adds the minimal required support to avoid failure after moving to new connector model. Signed-off-by: Nikhil Devshatwar Reviewed-by: Tomi Valkeinen --- Notes: changes from v1: * cosmetic fixes, commit message update. changes from v5: * dropped the default_bus_format variable and directly assigned MEDIA_BUS_FMT_RGB121212_1X36 to input_fmts. .../drm/bridge/cadence/cdns-mhdp8546-core.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index f6822dfa3805..623e4235c94f 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2146,6 +2146,30 @@ cdns_mhdp_bridge_atomic_reset(struct drm_bridge *bridge) return &cdns_mhdp_state->base; } +static u32 *cdns_mhdp_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; + + *num_input_fmts = 0; + + if (output_fmt != MEDIA_BUS_FMT_FIXED) + return NULL; + + input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + *num_input_fmts = 1; + input_fmts[0] = MEDIA_BUS_FMT_RGB121212_1X36; + + return input_fmts; +} + static int cdns_mhdp_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -2210,6 +2234,7 @@ static const struct drm_bridge_funcs cdns_mhdp_bridge_funcs = { .atomic_duplicate_state = cdns_mhdp_bridge_atomic_duplicate_state, .atomic_destroy_state = cdns_mhdp_bridge_atomic_destroy_state, .atomic_reset = cdns_mhdp_bridge_atomic_reset, + .atomic_get_input_bus_fmts = cdns_mhdp_get_input_bus_fmts, .detect = cdns_mhdp_bridge_detect, .get_edid = cdns_mhdp_bridge_get_edid, .hpd_enable = cdns_mhdp_bridge_hpd_enable, -- 2.40.1