From patchwork Mon Aug 29 18:40:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2327 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B697F40F47 for ; Mon, 29 Aug 2022 20:41:59 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id x25-20020aa79199000000b005358eeebf49sf3445910pfa.17 for ; Mon, 29 Aug 2022 11:41:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661798518; cv=pass; d=google.com; s=arc-20160816; b=BGvnycNykHou75cyHcvobyyDrOA21lAMI3G6M2QTQtkfsuy/PLwlsaDjqrytasosX1 MYAmZL5KAHe1H0OWK2Rrf5kevdKa0f+kWPX860fmkfzq8aE8LWnrb5p2QcXX7+qMW6RM 27JrnZtbAI+hHVW15LQFhkkiJxVyiGZz3IoySiC4iUJ3pbGHq5E8Zp5m3CW+evbE4Siq 0zfqeu/OoFewdm1BSAdI2MO8oLKzr5rfUclxAtjdsInQx8smzSQ1ZzVi49H1gUXkGCwG nS84WciuZjsYuy7EhvgylPJPV8OBR58wAuvJ0EpC9pYnSF4i4Rro4rZ5nzSLpQdbkZGL VKRQ== 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=Id6oO5cJwqTYE4/k2Vn0vmYg+rNZJSdaAkaFs4d7KAE=; b=ItkA3DP6pRqZdVm5NjsgXk/4ahMcubRX1+Dx8OvQtTur1d6yl8Xne6HJajf2ULgsKC F7dAc1Hq3GEaF457MpVeVa5Ml0yMYAY9r+WJN010FBfrCAJasOaNQTTutcOmpGMafrjM xiE5oKX1p6fB3riBcJe2CBhHsRocDv44iXnClo01gU7TI0v77DnhS5QvM2hTC8vLgaXV R78eZ1mfeXCPIXdPmYvZqJmaRtwXRLjOBeVDxHMUscJRFZMsyuldw2Qq5zOliedDNLXV jUrkGcF78IbgyESzwa3RqCPQdL/4ZgVTr/Kc/fs4ARS7hBS7dJCwsLNdzMTZ+aeeARqp gv/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZpgS7uft; 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=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc; bh=Id6oO5cJwqTYE4/k2Vn0vmYg+rNZJSdaAkaFs4d7KAE=; b=O4mKYBOVJeSBKhZTv7dIaj4p11KqHaPfgswlE/ALJYhfN6gzVn/Q01/TllQh2vkhkn w432VEYPhC9Fq1Vi4CiPYO14VGp1EGjQ3mnPsKEOV9dAysCCV+K6nPjWJXcGRA61r5mE YkU2umZ+4hrhz0yMMNYOGoMIyMcb4T8x9VIXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=Id6oO5cJwqTYE4/k2Vn0vmYg+rNZJSdaAkaFs4d7KAE=; b=7122epS3RpKivZRJZIsDWZf/Cl2V/X9xIip+KjJVrBgEFi3cdFmjV/3hEWFooABs5U m8n3JnfxpT2pilFh8j6CqaZAEqdIEgDTwJttQG4gOBxl6+wjqE8xViFPTTcPSfoSA+iX fbXGrpBwkBCS1gKtxJnQTJma9ID5GCj8WYLvvV86RVBpvvPBQruEQZJpAE7BsHXnquog k/FOHB5Xz3+y6PtHizfoyA+cSSDUe0CsxYoM1yzAPdLIQvKp112Q+xPhFiy8KRNW6+nR Nb+U/6p2Gz2jzyMs4X+OPk1ujr3kdAktWRtAEzHOjAtJkBtADO3KfcYaicIichPKg+qT 3Vtg== X-Gm-Message-State: ACgBeo1wcdQ7ekvaTuFTBq/H+GyBfGJpwYXr6d/cVBJOBgIdTol+VFm4 mYJ+svDoP8GsjbKVjQc5VIcLP+js X-Google-Smtp-Source: AA6agR6Y68w8vv2e/M70YAYO6Z8MfE8S+nSRyDy/y1bpxc/dtwKYBfMZ+vVfFegNFaWQpvwfsBl1OQ== X-Received: by 2002:a63:5264:0:b0:427:e7f2:a43 with SMTP id s36-20020a635264000000b00427e7f20a43mr15233622pgl.159.1661798518587; Mon, 29 Aug 2022 11:41:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:5a01:0:b0:536:5777:1f90 with SMTP id o1-20020a625a01000000b0053657771f90ls4517648pfb.2.-pod-prod-gmail; Mon, 29 Aug 2022 11:41:58 -0700 (PDT) X-Received: by 2002:a63:8a44:0:b0:42b:351d:e309 with SMTP id y65-20020a638a44000000b0042b351de309mr14633773pgd.426.1661798517727; Mon, 29 Aug 2022 11:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661798517; cv=none; d=google.com; s=arc-20160816; b=Khl2BX3j6JvRD0MCQt0pJkjA6+NI78lt5eC2tOcjb42s34wr3jmig42HiEd71Nxptn fqmJSEcRwjILIzn8H9S5fupAWYEMmIztXi+/Dw8K3DE6sFiHquUu9kC6uO/ztWgidYpy t8wXBLC5XMXv8sfRndIf7i+tZ4lMEsUh08faQL/dLus5k960r4q5K5F0iyOIwWwrxqMC ibzUjIfYSEGecMdbHaz6r0/P8Y0k4rw/ox/kZUkCy18mxp4H6HIIakNx1euJ6J44R5Ir 0bEUtt03DyfKQBMUokPpnYZxgPRT9w/m4iAXE8ASim7kOnhR1UKtu+kSyGBUpvVDJbmD ddJQ== 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=qMo2BeLrtj91nopBHoVSTvJhtNl7A+ypG14iH2k8FGY=; b=ixwjDxd9XiGooCMxeCskRWJNfueZt0VgHnrp6ELZA61V9/ysBDYucIJaVKMt39nhPy o2t1nqXy59cpVUFTrdMpPZog8ycuJWmfiUCRlbGL0aiv3FT03JFTtQ7meuTtRrTWvBuT WTuYMgd4BT5H4AFZ8j0HwiMM0bgE0sYpUVDME9s68gfa8csoZ//cFwEu7teHHeD4/sdH SFiW+2BDoPh7dCxn6OVHRhiSj6RUx6u8aWXYC2ill6cLZSl65hlGrIAfzrKiilFKCMsb e9PKVdy8Vyk+sI6d/fhk+obBHJ4+4dfMLcuQdxrzxjIJiJ+ZMUlekRcIHixGkO8vE9XN vMVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZpgS7uft; 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 n6-20020a170902d2c600b00174e624ed86sor1116351plc.62.2022.08.29.11.41.57 for (Google Transport Security); Mon, 29 Aug 2022 11:41:57 -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:902:c611:b0:174:7f4c:3b4d with SMTP id r17-20020a170902c61100b001747f4c3b4dmr10823339plr.130.1661798517134; Mon, 29 Aug 2022 11:41:57 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:56 -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 v4 09/12] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Tue, 30 Aug 2022 00:10:28 +0530 Message-Id: <20220829184031.1863663-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-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=ZpgS7uft; 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. v4: * none 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 724fd76435c6..871cc8cc5352 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 @@ -1341,6 +1342,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, @@ -1380,6 +1407,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,