Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp22431rdh; Mon, 30 Oct 2023 12:29:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfLicDn4ZE8+gFKlDiwYW7ogDwEugxECY//zIOFGQ3TqHpN3TSKjK0c8jXOr06J7pZaHnq X-Received: by 2002:a05:6a20:2594:b0:15d:8366:65be with SMTP id k20-20020a056a20259400b0015d836665bemr654140pzd.9.1698694192728; Mon, 30 Oct 2023 12:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698694192; cv=none; d=google.com; s=arc-20160816; b=lfQ3PcEjM22hCEul4VrKWHiA27jdEMJ3MiI/l7Fd/IzXwVufAfYOcBiR45/32cVbnl rul/HsQZTmGUDdbJzN9nheI6TcRILsqmYzPP4yG+jcc4OGx9O+BnmKKT+7fRKal8/lS7 G+jHbtQrC648q7w7RTl0NYaR3SL5M/kKqnVfPlh0bKFuyegb+7NTUQb/C9oohzjDI0fy y9KWdnKHZN0si5MCH3OmVvWHLO2powzPdriJHBYPzOGxAu8cQhIxeToIbCJ504JfCzzF QTMCTZLXBbGHrbzRlsxph5veOBvK2dpPSX+K8AhRiDRa39XosnKerOoN5wTswrsPhd5P GLSg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dmgtTJaq9wvJAB+uUOddVab2zm5yVAqq7CEhc68g0vA=; fh=TlS5PpL6elOTttZHu5yzmqNk5MGcxDngd2XOFA+0LpY=; b=xQCHjxT6NXTVRwUOv8cpEspOFrq+1Jxv1cmsjQb1Z85ftaYQQOVwj0Fg7+0fgrznkw MxPAoaq7w8fIO/XXE85zz0bVuNej5MydLQecdMCh1OjXPYwU5iWJs7lzE8jNo8Oxxrp1 zckLlTL1k3mo5CdgBmzW+00+PqqQ2l4OHTEV8vdIrUZPFHQBGDf/NepptVO6qgMhV44F oBPMDClqW7Rc4Jm0BIyxahrn9WB6zsseCRCFRMl577XQNKFrCRw3vigKt/m9aDP4ZYSt E+03v5yOuNeRvBigiUx0hdFNyfG3Cf/qNM1ClWD6hxIkgiMt2PXgzADmC9Owt5uxEJnr woFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yxctoWir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id x36-20020a631724000000b005b88c8a25e4si5406937pgl.491.2023.10.30.12.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 12:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yxctoWir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 57DF280A1A1B; Mon, 30 Oct 2023 12:29:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbjJ3T3i (ORCPT + 99 others); Mon, 30 Oct 2023 15:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjJ3T3h (ORCPT ); Mon, 30 Oct 2023 15:29:37 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73523DB for ; Mon, 30 Oct 2023 12:29:34 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39UJSlsJ052235; Mon, 30 Oct 2023 14:28:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1698694127; bh=dmgtTJaq9wvJAB+uUOddVab2zm5yVAqq7CEhc68g0vA=; h=From:To:CC:Subject:Date; b=yxctoWireIpdlVDftZ8syS/0DiCdAkWsjzIaGp7A0w1uyEIagLw9wtxO/yi/i9UQT 0cqY6t3Iegob92/DXnsEt+VfpNQLRTK9gbiqJ5l/v4U6QaqFNBKe9JFPdyR3Ky9lwt +q3g6ME0C7yV0q7xDiPFRVmTtqpzmdoOXCq8w+t0= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39UJSlR7027257 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Oct 2023 14:28:47 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 30 Oct 2023 14:28:47 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE112.ent.ti.com (157.170.170.23) 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, 30 Oct 2023 14:28:47 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39UJSk5J053179; Mon, 30 Oct 2023 14:28: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 , Maarten Lankhorst , Boris Brezillon , Maxime Ripard , Thomas Zimmermann , Francesco Dolcini , Jan Kiszka , Sam Ravnborg CC: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jayesh Choudhary , Aradhya Bhatia Subject: [PATCH] drm/bridge: tc358767: Support input format negotiation hook Date: Tue, 31 Oct 2023 00:58:46 +0530 Message-ID: <20231030192846.27934-1-a-bhatia1@ti.com> X-Mailer: git-send-email 2.42.0 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=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 30 Oct 2023 12:29:49 -0700 (PDT) With new connector model, tc358767 will not create the connector, when DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and display-controller driver will rely on format negotiation to setup the encoder format. Add the missing input-format negotiation hook in the drm_bridge_funcs to complete DRM_BRIDGE_ATTACH_NO_CONNECTOR support. Input format is selected to MEDIA_BUS_FMT_RGB888_1X24 as default, as is the case with older model. Reported-by: Jan Kiszka Signed-off-by: Aradhya Bhatia --- Notes: * Since I do not have hardware with me, this was just build tested. I would appreciate it if someone could test and review it, especically somebody, who uses the bridge for DPI/DSI to eDP format conversion. * The Toshiba TC358767 bridge is not enabled in arm64 defconfig by default, when it should be. Hence, I sent a quick patch[0] earlier. [0]: https://lore.kernel.org/all/20231030152834.18450-1-a-bhatia1@ti.com/ drivers/gpu/drm/bridge/tc358767.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index ef2e373606ba..0affcefdeb1c 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1751,6 +1751,30 @@ tc_dpi_atomic_get_input_bus_fmts(struct drm_bridge *bridge, return input_fmts; } +static u32 * +tc_edp_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; + + *num_input_fmts = 0; + + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), + GFP_KERNEL); + if (!input_fmts) + return NULL; + + /* This is the DSI/DPI-end bus format */ + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + *num_input_fmts = 1; + + return input_fmts; +} + static const struct drm_bridge_funcs tc_dpi_bridge_funcs = { .attach = tc_dpi_bridge_attach, .mode_valid = tc_dpi_mode_valid, @@ -1777,6 +1801,7 @@ static const struct drm_bridge_funcs tc_edp_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = tc_edp_atomic_get_input_bus_fmts, }; static bool tc_readable_reg(struct device *dev, unsigned int reg) base-commit: c503e3eec382ac708ee7adf874add37b77c5d312 -- 2.42.0