From patchwork Wed Jul 20 15:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2197 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 968973F03E for ; Wed, 20 Jul 2022 17:53:43 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id c15-20020a170902d48f00b0016c01db365csf10740682plg.20 for ; Wed, 20 Jul 2022 08:53:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658332422; cv=pass; d=google.com; s=arc-20160816; b=HYiTtO/rbMPPtPOFdbZqQvtVxfoOTm0xU6ikT6eL88vaPcjk34ennFlCprS91unabM KtTEZDpluPCRmip+ZxyFVB1mbSQ9UI9K8I58HvJ2aseIHSBKKIFflI0Y2ktu5Qpzzo5G pkfYkwzHnk7dFYy+eI1Q/cozcKsYNN7bE8htvEdJVr/GoMa5iHLagPepbhdcG6nyUWXl GPkzhN1fHQm/rcdhqTilrXZliQ3or5xQAlKasoPLLO3dAUvuAgrJaYgFPX20gOcIsZqv Jhw7e/XFmbW6BzwNjNt3YfXAzs2SSicvb+OcrxzxmO6oHnkFz0/45IybOgFLBtIcUKbm bb0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yL8MTyYhcbFkxo9/kpIr7d280uBAQpR+/eqdvN/geyM=; b=m5BEtfoD6og7o4Lm6XScXhVnKlXz3mTP4/FBicGk4oAUo5wQ4BT+Bodarkq3YHG+Og XezATXFQL/RmDO6DWeAIr+2c6HZSmsPXXO8q6kG9WK2t0bFGyMZRNJqsXshuSKzuko53 ue8bVKPFHLOuZvnAVrNFUjuAyIdKiCejFmQObIhRcw8vGt4PSZRxB/C4XIZRN60hBQjl UJYWSOZTwYkf2ATiMmhCc0E1KbNAPI4nzRu9ADagdARgdRaGSd0CDV1q/pm47tNZ+uwQ 8hpJgz2MBG+2V1Qg3iQhhlECmqkbPKih8TIROUgCbwJrE57iA63TwIqK+uhLjvM48d9U dJGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XAWPI9yh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=yL8MTyYhcbFkxo9/kpIr7d280uBAQpR+/eqdvN/geyM=; b=l+6MscUDf6oP3yLkGqK4zyuKJdcNp1Y1pQbULEpqjx4s+ROuMIiibufG0rTL5npVb9 FALEYSo+y8z3Y3aMzVxAe41AthO73n63uDL+ma3Sku60VlalPtkCZLXBI0OT+SivXBg0 ipt+AbRsN7hWWJ7k/daILAqO/wZ1OLYKT1JS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=yL8MTyYhcbFkxo9/kpIr7d280uBAQpR+/eqdvN/geyM=; b=UUPq4r4ma+g9iw/E496tiR0cIpSV1tC/aAJHxtlM/CzsYsxWeSkcdZ7OCCI2t0JQEE BlMHryLtq8XYENJZ59inyOkHbMwZ/1GyNUKtn0jAmi2PB1cJaz6nHWceYBkva1t1NLbR YPw7KP/7ssLT23och8afOeRWbF75/2Tmu5UTERuwh2yqxFicYBdiedGOHQNw95LuXNXI 6oDxF1epmK7uZwYCu/1Jx0MwVySbXOlbwTaP1glp+j6ItE7obJiZSHo7U1+Vt9lzL9iT J9JjD3x3QktAKU2eRDHaYawL+3yhPrH63fnnmtJPM8yR70vNOCWXxsk6ndoUq/jugUSl gywQ== X-Gm-Message-State: AJIora8whtAx/EStb40FLeJSLxscS/bgn/VqLqbOZn2XwkOfLTsR5DD5 KONdeb+O4XAGz4/8ta4k2itmW/bh X-Google-Smtp-Source: AGRyM1v/erVdVvtcWva3DQR/HAlu1dqIHm4f+g25Z4W2sGpTmNR4b7l6GXou1ZuPROjq9mQ6dUW4Pw== X-Received: by 2002:a17:90b:3d84:b0:1ef:9049:9f43 with SMTP id pq4-20020a17090b3d8400b001ef90499f43mr6240679pjb.45.1658332422449; Wed, 20 Jul 2022 08:53:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:197:0:b0:41a:1c22:f9e9 with SMTP id 145-20020a630197000000b0041a1c22f9e9ls179566pgb.6.-pod-prod-gmail; Wed, 20 Jul 2022 08:53:41 -0700 (PDT) X-Received: by 2002:a62:1754:0:b0:529:8f40:8d4b with SMTP id 81-20020a621754000000b005298f408d4bmr39644161pfx.24.1658332421623; Wed, 20 Jul 2022 08:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658332421; cv=none; d=google.com; s=arc-20160816; b=QEwJiKOz0gFnb3QpxlvYyFeaAIsjCCUjxWj6jgpW31loGVzVbu05R0r5FtuVAU6ZlV EI1JktChcKsivxzL/QdJW0bVkgkhP96mW1S39UYolV9dqhlh4qqwd4suYY8AIsgeacFf YcK56csXO9Y5pwD8zipxr6wJO1Qe1yzzn3Dod99Zz9uyAL6D5/L5gAx8xQNDIZ3tTrZ0 1XddJ+1W/5vwrutvRUua41U/uxRHP/xUpaHj579M3HNDsy3e61crEp7122Kt/LxoaP0f /7yloDT5oxzRl+lHnuLLoZroN1t46o3/TmCQd0yNHAPXIRrDtUJD8jpgEWMZ9j/Or41T /XSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3PaVrZ0eRNjr+pr3ZZXawjElGckp5XUV6/rIxT+wqok=; b=RPMT8Zfn5Gul6Yi8HJq/eC/uD652MwEgIo5KLZL9mqZaAWwVUfCiAxcTI/w1yC7RJg ds9Q97srcKqWBrQrOqxyKCzvd5V3Ae+DO6BVymLLSQPr21VtDlYEDm/bqeFAAwOzaah4 h0wEAw4q09ob47uC9IkWFR9GiO6rVajsh4wPst1hWq12GmLwBxpQ/QQRKREadoWt9Ybw nlWEEocSGe7Iv6MJl8oE59J//OobYKnivRWwMzU0GdKB1G45TI3hi76kz2v3txo2dED0 fKVvEDznZX0l8PXgCxXH9tT886XPRx6uHH0jCHfVueiaegLU55l+w5C0Lb25NEKpnsvb Em/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XAWPI9yh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h5-20020a170902f70500b0016a1df314bbsor8092497plo.111.2022.07.20.08.53.41 for (Google Transport Security); Wed, 20 Jul 2022 08:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:903:191:b0:16c:3d49:b0c8 with SMTP id z17-20020a170903019100b0016c3d49b0c8mr39502922plg.95.1658332421306; Wed, 20 Jul 2022 08:53:41 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:40 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v3 10/13] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Wed, 20 Jul 2022 21:22:07 +0530 Message-Id: <20220720155210.365977-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XAWPI9yh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the default RGB888_1X24 bus format on DSI-end. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. v3: * include media-bus-format.h v2: * none v1: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 376e9682e130..2584343b767a 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -1339,6 +1340,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +#define MAX_INPUT_SEL_FORMATS 1 + +static u32 * +samsung_dsim_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-end bus format */ + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + *num_input_fmts = 1; + + return input_fmts; +} + static int samsung_dsim_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1378,6 +1405,7 @@ static const struct drm_bridge_funcs samsung_dsim_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 = samsung_dsim_atomic_get_input_bus_fmts, .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable,