From patchwork Wed May 4 11:40:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1938 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 993DE3F110 for ; Wed, 4 May 2022 13:41:49 +0200 (CEST) Received: by mail-pj1-f71.google.com with SMTP id s5-20020a17090aa10500b001d9a8e99e3asf542369pjp.2 for ; Wed, 04 May 2022 04:41:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651664508; cv=pass; d=google.com; s=arc-20160816; b=bFz7Se9C/pE9myRxY+hUtTke933R7odYIsXVrYWq1pGmuTcf5r97hvR/Ls8aPr65n2 foUnDb9Id+EQ76+O4wrV22pxfuth1V13DobuZ2iaLMDbC9/VmAW5JRist1Hxsvum8TbM u1mqKWpYlSIdc3GsZ/XovnxPLy2keZ/7fGclXjTFAoaVt2MRSInlnzDZNNS/eye19s6Z TSdVy+cE53QdaG/O9GrSlBdNB+/O++H8DMku0RBOiGgSLVGwhTPbiw6LKKO0IZd6CS3/ Cs4vcAmi4fy/fMiMI7kLRTEAL8EobYQc0uHZgiBXkuWZeAyWGs9kDl9DdL4Jxb4utZ0n AxqA== 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=C42uQn50+Ylt9gzaEEUIWpM8HvOnpMHK/m2VcVXT91Y=; b=jVC21+1Z84CVNvx4PtlMXSt+UR69kil5UP/JQswPxFIyoe//NYHAztBGGvvLBD9ATO zPVp06pBfmNp4cI2ADJxd+U7ywlz1u6nI1IXsJNNk6aUPhHwapx6fTadxQxYsIE5ln3S XTTRWayyiNisJ+kBobDtQCSHgKJjEtB5/rzf5S41sdZ6imcZdUbG3HtpECLGHJozbe7y zVCYPQr5x4Fym63VLrrvYCkk/1UDM/zgVPyS0/z3SpM9LFCaGGJ5PZAcFhvWwyEjerKb w0lFbqT/Y5KbA5Rbqu6zD10Fq/xRE7XwAyfEQv8cZ0QR6bCMWZi0GLU3pM1eEI0kwDH2 4nTg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHL89BZY; 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=C42uQn50+Ylt9gzaEEUIWpM8HvOnpMHK/m2VcVXT91Y=; b=p4q6ceD9gVgkaPw3rqqIo/kbRLcHhOFb2O8Eq50Bzwmgn4PexJtV2ESnaz506Lvs+q 8Ao8xf4cP43Q0a3by6IrLn8h/Z0pT99yCK5EVSbigyYe+P4hKfM9iv8wq0XLbEnYiSw5 EdFv6rN/gFTSndZPdw5ZdynO8wcbueWpewl4E= 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=C42uQn50+Ylt9gzaEEUIWpM8HvOnpMHK/m2VcVXT91Y=; b=hhO8bhahljFp1GGy+4UE3tWQWkjPWMqkj3NA2HzkzwEGrPbNJoCN0CDU1UmkdOVuC4 k2TZpFJgimkEq9b/sR7gJBPlkPM0L6DiHmoTdfM6sMSDwJKMFwAxZP9tDkCKWqIkvCRL Sf8/t4+L1vq9sFdbJrz0H6jH2BywEw++RtiOxb+ti4EE3XY10SdV/rUyEBvdzRFnigX8 kyuiYX4/cwo0US+uoeJPB8HGzJsEuHWycHVdsdQ6xpI1vNpgpw4XUNKQzgf1w89rLCiO BEqwUpzToubas13Bz+Cx22wrpWr3gyA4L3siHRJGXzHj4zY4fYYupqTpvU2sglA3GeDK 18wg== X-Gm-Message-State: AOAM531qo5tfjR8T+lFCqLf6dc/cI6+aIE2BEIxr88l8Y1VHZg0iqn+r Me0Y2pAQKUphN3Nd6QzEoKZainEg X-Google-Smtp-Source: ABdhPJx/mxhZKVjnXaorAe84dNuBGNHbUSYm+jEirSxB+Ht+fyVxvOBFwOz6dBgzCitQp/7PeCL6Gw== X-Received: by 2002:a17:90b:78b:b0:1d9:6cd6:3f4c with SMTP id l11-20020a17090b078b00b001d96cd63f4cmr9692897pjz.240.1651664508449; Wed, 04 May 2022 04:41:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d2ca:b0:15e:bde6:299d with SMTP id n10-20020a170902d2ca00b0015ebde6299dls1197656plc.0.gmail; Wed, 04 May 2022 04:41:48 -0700 (PDT) X-Received: by 2002:a17:903:410b:b0:15c:fd57:aa34 with SMTP id r11-20020a170903410b00b0015cfd57aa34mr20834629pld.82.1651664507803; Wed, 04 May 2022 04:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651664507; cv=none; d=google.com; s=arc-20160816; b=jzAQNPPdKtGuup3b6f0nVPNT4PSXBfKx8ac1mtYFEe6oLPl1q8MxRPp670Bo3h+fCq j1rYtYvvsY8IquJqDoqtwGmJkZjghObimfg/HLQ0fUhrnIIqrgcVeyeGOeqknNOjgAXa XvEQ3ZecoTJKd9U1w24Ajx/+FCp7IxD9ZctP2DmbityOrT+drFDQZ3Lt8EqSvGfAgQBU 5uqQa3cJ8UjJr9wSZhOvTMgzQqW7vKP94LsTLfGuXrIkFKjH0wAr8FvBiexAseiP87p/ t+nsPyPiBM3lqcFSrbwhypeZz2F2s0G787kt8rr0hMhvTlsNz4AfFfrRcnCohgEdJZ5m /9mw== 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=jWSHVu+7IAWvBpqPb+jQsUxTFN1rZcSZyH+a13sKnuI=; b=0FHS/2ciW+k1//u7ev49zJSq72C9wwMiHEnTmstrIayOLYq5zBlk3c/ZT5M1TCrU0l yTHW6t43CyLqVpvfwWLLsaHUmkBZigfN7WrGOQQuANeYKlcqpB4Ans0uyVwOqH5WQJes gWhGMAQ65pumDosqxSsys1/l9P+tMgnji1htOSvW1bNK72vbvn5SjGm27V7SIFpwqaFV NkFgHminfZ2ut1MnfglFrINGXr3oEcnwtvh8uzQS3Nz7CR18GGrvtViDNpZbTEFnlXNC XUpKtghmS1beutxGf8z60G1FM7a5gqjiSuzBfmRDaWFNPe9mBJNatt5txjgQtz6z/NKu 188g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHL89BZY; 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 d2-20020a17090a114200b001cba449d476sor1923693pje.29.2022.05.04.04.41.47 for (Google Transport Security); Wed, 04 May 2022 04:41:47 -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:90a:5d08:b0:1d7:9587:9288 with SMTP id s8-20020a17090a5d0800b001d795879288mr9750437pji.204.1651664507494; Wed, 04 May 2022 04:41:47 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:47 -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 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 v2 09/12] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Wed, 4 May 2022 17:10:18 +0530 Message-Id: <20220504114021.33265-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-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=IHL89BZY; 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. v2: * none 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 bd78cef890e4..407abd488005 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1340,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, @@ -1374,6 +1400,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,