Received: by 2002:a05:7208:2202:b0:86:316c:7444 with SMTP id s2csp97749rbb; Thu, 30 May 2024 16:21:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKQ7vrquvlv36EbZcGXpvw44KdpwNoTHBxZGpWXGIsCcIF1BMsykaxgkIfqGCEdWFRpY/wooa0L/QBXCjYJSL9gX2aojIhkgaKe91D4Q== X-Google-Smtp-Source: AGHT+IFoXIKdoqKLcEdLzLl00qMioTUQatSUPAkb/tHIy42gUQao84Dv/rFL7YyQEH6Z2J2PWyxb X-Received: by 2002:a17:906:3084:b0:a67:a2e0:9dcc with SMTP id a640c23a62f3a-a681fc5c75cmr16555566b.5.1717111285815; Thu, 30 May 2024 16:21:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717111285; cv=pass; d=google.com; s=arc-20160816; b=pzw8brZPuE6kMyDo5PdyaxR8T1cyDx29ZbMoKi4vHXEtk7qi2TgnEtZl2Rz5Hg4vEY /gudHrtucHZAUSLwNORThvcCxz95qhzUV1jFSf5JhQ65EvJnhNby/NST+Xusg3vJSNxG hSULl6NLHh84132z6N9t5VhAs88kuSMnWy2ewB8ydCAm5K01FYOm+RIPhlM5YR97g5uT 71QWWUqXa4/l6PQFMwSrm3au9b+tZ/yZhMTLP86vPEujf1OON0PBF8A6OnZcrqoKBWyq SinonOXHfFJJ6NTyv9cITwMDjVnMfYWwuE41HKkbdA+8SAHhtUfqIKnuPXVDDYWBPdbF W/5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YE7nBWRP2r6qptkkjnhfqlN+45c+PRv7G0Q2JOIxAzQ=; fh=r5TW94K8NnSmpMhWxaLEsDG5pPkWiA6uP+HJIddB1Vs=; b=XPx1yEbnN/lMl3HLpQTyBbHGJ7Kbq5dDBfyxVmEb6PwyY1qCGRUO25QIGwlaJvKZ78 tWJ6bfWgV4GlvySKy5xgqQtCylhJOAuVOcAJ5CW80c17hCMXSb4RitCbh/FH19cr9S7+ 57qHXbK4fra+gcCo8z0Vn1PnzgOygV8uxdEXS+HioPJAvWxBL5yTa3diZgRyXbfFZIR7 15XtsLkMQocnVNB147oMb67tNqYbMGOlYiX+KGgRZBs//tYXP/hYH4V3pml3AspQPsRk scCEZJNlRc2KDCc8R+W2UP421mEApCXiBPNLB/VmuigTXsfPJ3slVURKf9+j1oXYA6SY q0xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BPD+sFml; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-196025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a67e73fa4a9si24163366b.246.2024.05.30.16.21.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 16:21:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BPD+sFml; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-196025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 636371F26CF0 for ; Thu, 30 May 2024 23:21:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C5D017F4E0; Thu, 30 May 2024 23:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BPD+sFml" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 647F34D8C3 for ; Thu, 30 May 2024 23:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717111274; cv=none; b=c6VE/4JPLXq3CGS4Zv9YseaSo+S2KF9JGKK0Jkw6pt0JMMcMaQL+v8cPUkETghpOKR/x/NygSmrNHrOdS/8cCKdvv7bhBgIPHffJTI/nW2cjJpFCeaPcM7li18/0aFEEu5ya9qaxk51uowzC7PDg4d73ecNHGmFzNw5hG6F8GO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717111274; c=relaxed/simple; bh=0DuLBq2hPeHv+UcOyW3LvpkU0d5LnKtIu6WxqV1OaLA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iuujuNSgh1OA1045aZhy/swu838heY9fpFud3MyNjr1lxsaawMrOe2BQchc3UKPZ3ABqUhpMjWxLhELMqiKIQFMd72KByQ6vEofQeia0G70k2LcrYAh31RW2AtT2TADDwHLqPSzaEcJpFD2NwoJtimYyl32le4a+yoahAeJ6TTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BPD+sFml; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-52b7ffd9f6eso627532e87.3 for ; Thu, 30 May 2024 16:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717111270; x=1717716070; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YE7nBWRP2r6qptkkjnhfqlN+45c+PRv7G0Q2JOIxAzQ=; b=BPD+sFml7NkcYg3bh5W+vOWkTNXhCFrsF3F26sSLBhvuH4NQT88wEy4g/JMbtCoAoT FO9jBFT5WhRNQb1g/bKTbqzf4ZX9QjnG5Of7nBVRjeXRbeisvOsPhABIZ0+h2eP0BKCv J1IME0mITZVaC5xmEnafcxfgA4R0lL+/9UsTzS1zfvIkS8btyzAIcN7iG81mWf58YLYD kwk6X9IB6f5wa22azkYAPwcLbql4WMDNPh+OfZZmdhQ3wiABdrnd6vOJbXBUkOuuEu3a H80F76J0W7UZ3qW4jdtKK2EF12NJWgxqFXItzYThVrES8iVW9Pl8ifblPBVZuQu2S3Lv zU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717111270; x=1717716070; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YE7nBWRP2r6qptkkjnhfqlN+45c+PRv7G0Q2JOIxAzQ=; b=QFMqevZSmCKV/TL4AX2m/caRAVXqiVnELPgr5ZRIguxoaXgz8XDZ+0LW5VUWxaGi2g 4NJTYA6umwHTio6GyLVlBu1BgVqc1/TKBhwokUdSIZEP0/zIhhInfpnwrTExipaK4U0V gDdgq5uGBbZCuSpPUJOylShQv4QjQ1CPNGCl9sX3T7BETM3P+W/2fUlYXqBEB8/FocpW 1UvCq26H9d11WilTj6wpCoZrSaLlDd7ke73CbAMpGQqBCBQt5zMa2g961ZHovl9GmPeb lat8ioNi6mEreXfjgIGFqLCOsB3OFSmD2HhX4t/EkJG1iYagfmhiSIQZWoH0/v8TKbyD UsdQ== X-Forwarded-Encrypted: i=1; AJvYcCWIpOIl03EpRyFLETdDRLinZQ1EsOe2aLlTfQr++oW0hW0kgzfFhWdMIoPESYH0tinRZttE/6+mYYytCnajBMfYPo0zCvDfflsReBcc X-Gm-Message-State: AOJu0Yy6rzRoSw3UyyyFpYYtWxNFv73af6ZYEPEOU9m6zPcGzwZsk6p6 T+BFKaAapW9ZRNzj78e8y9sommr/KFNOOr9Z4E1Eetve/yGDgTXK4r6+Qsy5ejQ= X-Received: by 2002:a19:6a09:0:b0:523:8a14:9149 with SMTP id 2adb3069b0e04-52b8956b5c9mr47305e87.21.1717111270420; Thu, 30 May 2024 16:21:10 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d89c2dsm121896e87.258.2024.05.30.16.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 16:21:10 -0700 (PDT) Date: Fri, 31 May 2024 02:21:08 +0300 From: Dmitry Baryshkov To: Aradhya Bhatia Cc: Tomi Valkeinen , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Jyri Sarha , Thomas Zimmermann , David Airlie , Daniel Vetter , DRI Development List , Linux Kernel List , Sam Ravnborg , Thierry Reding , Kieran Bingham , Nishanth Menon , Vignesh Raghavendra , Praneeth Bajjuri , Udit Kumar , Devarsh Thakkar , Jayesh Choudhary , Jai Luthra Subject: Re: [PATCH v2 7/9] drm/bridge: cdns-dsi: Support atomic bridge APIs Message-ID: <4fsu5fa5zbrqgc5bepxscoenrax5c6p5b4eyomavioy3bhwuq3@rjjbur3v52e3> References: <20240530093621.1925863-1-a-bhatia1@ti.com> <20240530093621.1925863-8-a-bhatia1@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240530093621.1925863-8-a-bhatia1@ti.com> On Thu, May 30, 2024 at 03:06:19PM +0530, Aradhya Bhatia wrote: > Change the existing (and deprecated) bridge hooks, to the bridge > atomic APIs. > > Add drm helpers for duplicate_state, destroy_state, and bridge_reset > bridge hooks. > > Further add support for the input format negotiation hook. > > Signed-off-by: Aradhya Bhatia > --- > .../gpu/drm/bridge/cadence/cdns-dsi-core.c | 70 ++++++++++++++++--- > 1 file changed, 62 insertions(+), 8 deletions(-) Reviewed-by: Dmitry Baryshkov Minor nit below. > > @@ -915,13 +920,62 @@ static void cdns_dsi_bridge_pre_enable(struct drm_bridge *bridge) > cdns_dsi_hs_init(dsi); > } > > +static u32 *cdns_dsi_bridge_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) > +{ This code below looks pretty generic. Would be logical to extract it to a helper and allow it to be used by other DSI host bridges? > + struct cdns_dsi_input *input = bridge_to_cdns_dsi_input(bridge); > + struct cdns_dsi *dsi = input_to_dsi(input); > + struct cdns_dsi_output *output = &dsi->output; > + u32 *input_fmts; > + > + *num_input_fmts = 0; > + > + input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); > + if (!input_fmts) > + return NULL; > + > + switch (output->dev->format) { > + case MIPI_DSI_FMT_RGB888: > + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; > + break; > + > + case MIPI_DSI_FMT_RGB666: > + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; > + break; > + > + case MIPI_DSI_FMT_RGB666_PACKED: > + input_fmts[0] = MEDIA_BUS_FMT_RGB666_1X18; > + break; > + > + case MIPI_DSI_FMT_RGB565: > + input_fmts[0] = MEDIA_BUS_FMT_RGB565_1X16; > + break; > + > + default: > + /* Unsupported DSI Format */ > + return NULL; > + } > + > + *num_input_fmts = 1; > + > + return input_fmts; > +} > + -- With best wishes Dmitry