From patchwork Fri Apr 8 16:21:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1909 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EB59F3F0D5 for ; Fri, 8 Apr 2022 18:23:15 +0200 (CEST) Received: by mail-pj1-f72.google.com with SMTP id d10-20020a17090a3b0a00b001ca93b34e3csf5700063pjc.7 for ; Fri, 08 Apr 2022 09:23:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649434994; cv=pass; d=google.com; s=arc-20160816; b=s/eXxdzkeHgEUOkJbhNrWXWZmdcScRXqF9IIM0YFcj3ohF6h8BKIZEH+WNxWWSgPCr MgDJLh2hCFqkJZsnJAs69GnJ8K3Mw9WulrVPkJA57NLa4vmt/mP+fyy+ihlPv0V6ckb/ UP9cL7lX4fNRO4BEHvxQ14ljF/GQCHmK7J76RIhiaijhWC2OKfhda5mOTp9OyfcFFxN6 GMsRGloAwOULmEBF/7/3KwhaXCYXMnMNxefoWDWxfGzXCkGKL1rZcJbnlfIxE17BFg+o 6qyQLFUPcB4KFvD/7jZ/cFaHggd/5Dv/KQ11pvFGXmU/D61fN5eDldkGMRJuUMvjdWEc 6gKw== 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=1jh0Z17DnObZ/lkmzyuHgs/7q5ufAf5U3vIE+BGQtJc=; b=XEWmZp70PRppuZ7DM4ee0wwSEGztqzHwFQKIQ3l2cCacF/y8BoLSTQkproAn2MXE6p frdgmqdZj5VIP/NdlAwFifY9VcswHZBlyoXVET5FqPNnsOcInmiT2vVgJrEvuU3uCBQf jwyhPx/ncgUdlkDVkuKpxdnWgD2sXQwK7ncgefCru07vngkgtjNB4uQ+ePg0gp4pFqnA hKmlvFOyjLUV9esPRFO/jS8LfYEMfeDmo5lQhN8LNBxFeyivPG+dhYtpLg+NdzjBTAYl 7SqWHanYsF6o4/otukNBQJF7S1BHZi7TNDRG8UdJHjR4QqAPZkTJA4n37MZNUHCu/oO3 fViQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="AUwD0c/H"; 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=1jh0Z17DnObZ/lkmzyuHgs/7q5ufAf5U3vIE+BGQtJc=; b=pxr9vzUrJ8VnrHyKxfKsxmg82cYQV9CuiC85Ka3som4Dcv8TdeZqV7ElCWiOodcFpk cbyQYetBBKitv46YY1t7TWg2J6uzCK1es1jppk9oMklPZcDKjPwoFyy3MS7ypp0/ETfd Y/M97M9iQj91H1E/eMpTmwTasG3P86Vh84TMA= 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=1jh0Z17DnObZ/lkmzyuHgs/7q5ufAf5U3vIE+BGQtJc=; b=smq2u7i/IW0N8XFolBsr9E3OT+9tbztY/+TMWssrupdRvbC60iaIOElyevuyyIdPLt rN4mnrd2pG1IqUNeayzCXtY8E9ofqGrpJIhMYX7Wvy7RfbWRgaI8ZOYvXo9sjP5Ig4MP K+OyrjBWelmcHxJunE0dOfdscKRz0BhZYkxQ0lFTWOOG37BcrrJ2Y5UAB+pzz5kb8Jf+ 9eqb5HooHTyi+jPTtWPbR4lCPBl5HGRAvx5VjnlQtWfh2ifUpKRZHK0HVCozqN7nKpVe 7WumQGRRzrdQfIyGmWHCUTePSM/Hyo0iqu/TLn5XlIht+VWKuvN0NufrYZbsHnvOLZLF IrZw== X-Gm-Message-State: AOAM532MiFlZBcnilGW5HeaJYdY4JxEWT7DXKczfXU1U8iVzvfOTSTN3 Nkeafw08cJb5kp9D4Iw6nHIx3vYQ X-Google-Smtp-Source: ABdhPJwHeErQthdXNjN9vx4wltM4CdHlp8fjKAOXJa+iEDwv54RBcuAx+wckNDQIh1v9XOjK/aUmAQ== X-Received: by 2002:a17:902:cec1:b0:158:2ced:1e1b with SMTP id d1-20020a170902cec100b001582ced1e1bmr1984586plg.145.1649434994800; Fri, 08 Apr 2022 09:23:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:179d:b0:505:9501:adc5 with SMTP id s29-20020a056a00179d00b005059501adc5ls285728pfg.2.gmail; Fri, 08 Apr 2022 09:23:14 -0700 (PDT) X-Received: by 2002:a63:fa56:0:b0:399:3452:ffa8 with SMTP id g22-20020a63fa56000000b003993452ffa8mr16140898pgk.255.1649434994063; Fri, 08 Apr 2022 09:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649434994; cv=none; d=google.com; s=arc-20160816; b=JG7pcR0A4vyn2iIwgkz6OuBImpX4VD3OHlh+ypbQsZqDC4h9I3BqFpG6ptCPOyRYzQ T/SjayS8p9bvjq2ykJm7fie5oGBfa63ZOZ3hJmu+VmNDd1ozKp0hjLVm+IJjxeo3dVnU rJREayvpc3w7xjJp7okcuw2/BfoaSRcmTB5RyKtuaHxc96ZUDtDim5nUIUVsrMY+v/UV vQ188/hB/xJ5UaHmhWM9IBsTOVXRrzGy5WjJgqyWdq/PL+Ds3RH9CYKXQgA8/JGFejnV YJ1EYxxF8Zgz/d1Hs1MzP8tivJrbGIax8khcRnCBWqXCKVjnRiaZXalu5Es9n8CbYChy iKiQ== 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=JGCB1sW6LyijUbLjQ0T8cjIYHkAIPaRA2Df2SDrEzx4=; b=XGX74qQUwjlIQSd8903E+b/VAwwjWFMS37gtbje2LhI2s3bZN9cpkTT70kZpFBLUuP jr9noSsXckFeJBdRgf9617H8wA3epl5TsbiOH+Mo43aEaSjVg50n2IX7FUmkRWfhTBjD DDtzSkmvCP21ym3nee/eNeAQdVgApW6T1QpT75clveDU+obMIP90J6li71QmLFQ8rdNu zX8UFxpPgzKhNh9gRUfpFlMgrPf2WKzO60uu6+iVWXVZwkib9VlPeiW8XfVyA5d396c0 hwdCvBuAjoDSuef4xr1EAXN910OA+AxIunf2NZRRNmRY/xtCng2zHNrLu6dQWbIRWZXX 6DEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="AUwD0c/H"; 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 x189-20020a6386c6000000b003994e333c4esor996446pgd.8.2022.04.08.09.23.14 for (Google Transport Security); Fri, 08 Apr 2022 09:23:14 -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:a63:9d07:0:b0:398:9594:a48f with SMTP id i7-20020a639d07000000b003989594a48fmr16365061pgd.51.1649434993731; Fri, 08 Apr 2022 09:23:13 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:13 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 08/11] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Fri, 8 Apr 2022 21:51:05 +0530 Message-Id: <20220408162108.184583-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-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="AUwD0c/H"; 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. v1: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 38db1f93ed51..02802526f82f 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1338,6 +1338,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, @@ -1372,6 +1398,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,