From patchwork Tue Jun 6 08:21:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aradhya Bhatia X-Patchwork-Id: 103638 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3239307vqr; Tue, 6 Jun 2023 01:39:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6i887Ewah+Oq9sQS/jv260erG9c64FTfTKv/pETKpx/vDEIli9konntq5NK6lwYnOvCwxG X-Received: by 2002:a9d:6387:0:b0:6b2:9bdb:a84a with SMTP id w7-20020a9d6387000000b006b29bdba84amr600549otk.32.1686040750872; Tue, 06 Jun 2023 01:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686040750; cv=none; d=google.com; s=arc-20160816; b=esR2KcfqmfCJxedJJOd+4udjtXER90reLFrg79p8lWHiGlECym389zapHjcQSY3eCu vSaLZi3r7EvGY7gfumQfIpii4vMQsqrInbrv8LHdrk0YJz35hRU2h6lK+ZHPvb0XJe1M ZdggKCl/gY/2vh8exWPLdtEwi813lxnMGYdaYGqJBs+gLYAc0pzCatw3v4zfX7QfaxzR 0lnERPXAjKlUaoAGGO1ifD+T93CjVFIpg9WKa3N1yJ59E2byzyazscadkTvznHFfFBKW 6+6TCXyuPPB2a3eCZs1nOnAAVSkerskUBIi1jiR5RJL2VUEXAxHHsuFQ/FnWUOvoBcHz gWmQ== 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=rlcycElYspBBCBwIoOXKjxDNDpCcwf8wJnBjzKivxps=; b=sHJylA0YdFrcDoRqRblKnlJUCOm2GC5fTcPGoHy3VKbLBrSoQ/Z2VOjQ/d3vnmCG2S GG8DUk5SgKWH5iUrZ7V2wbi7Gx7SOsFCwKmBKsXrIInWZ1B6tQkctHd5AeFlnhs7UZCb HUflfKHWYHu3C9S1/9mcJPrbZy+xsTG1kah//O9fIytKzxUt0QwCvSXOaHmRrGTQLJ4D 71zXn3iBYRJAhNYmT5DDty7NgxfJrc585WAxefDt6LiJP4zz4Bm0Zmm5nuuvp7zYo0fw Fue8RUqd5+iEHfNte0p6fqOavdeaY1MQvvK9wY2iUPDJNL2L51/AqrLjVw2uQrVwog61 M8qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=e6Ba3L3x; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020aa78e92000000b0064d2d6b6b87si6900943pfr.268.2023.06.06.01.38.58; Tue, 06 Jun 2023 01:39:10 -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=e6Ba3L3x; 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 S236597AbjFFIWe (ORCPT + 99 others); Tue, 6 Jun 2023 04:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236361AbjFFIWT (ORCPT ); Tue, 6 Jun 2023 04:22:19 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C80E6A for ; Tue, 6 Jun 2023 01:22:14 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3568LmD8038638; Tue, 6 Jun 2023 03:21:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1686039708; bh=rlcycElYspBBCBwIoOXKjxDNDpCcwf8wJnBjzKivxps=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=e6Ba3L3xN8aTgby39c2YceFYEp/JCiiN7ZCgYAnc+lPbjYwgCOqCo5eFiVSSpKEJk 3JtsJ/fRBgxfKiinqfWqk4Uf2MDIP4lRYqX0PtWhyL0Rl/eEz3OZB90kiZv2LGDijw R0IIlx/GMYR8PYeRIu/AH1h9uDUY0VI3EIn2+eGo= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3568LmF5012332 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Jun 2023 03:21:48 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6 Jun 2023 03:21:48 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) 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, 6 Jun 2023 03:21:48 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3568LkxE019588; Tue, 6 Jun 2023 03:21:47 -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 , Swapnil Jakhade , Boris Brezillon , Francesco Dolcini CC: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Rahul T R , Devarsh Thakkar , Jayesh Choudhary , Aradhya Bhatia Subject: [PATCH v7 3/8] drm/bridge: mhdp8546: Add minimal format negotiation Date: Tue, 6 Jun 2023 13:51:37 +0530 Message-ID: <20230606082142.23760-4-a-bhatia1@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606082142.23760-1-a-bhatia1@ti.com> References: <20230606082142.23760-1-a-bhatia1@ti.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767941866316869975?= X-GMAIL-MSGID: =?utf-8?q?1767941866316869975?= 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 [a-bhatia1: Drop the output_fmt check condition] Signed-off-by: Aradhya Bhatia Reviewed-by: Neil Armstrong --- Notes: changes from v1: * cosmetic fixes, commit message update. changes from v5: * drop the default_bus_format variable and directly assigned MEDIA_BUS_FMT_RGB121212_1X36 to input_fmts. changes from v6: * Drop the output_fmt check condition and hence drop Tomi Valkeinen's R-b tag. .../drm/bridge/cadence/cdns-mhdp8546-core.c | 22 +++++++++++++++++++ 1 file changed, 22 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..afd4e353f37a 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2146,6 +2146,27 @@ 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; + + 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 +2231,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,