Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1008274rdb; Fri, 9 Feb 2024 07:42:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwQrExZgosDrggYf0II/XAN2vT57+koxHP1BgGOf8Qcy2mLkIEwdDGzqHtH8ZYP+OznCji X-Received: by 2002:a17:902:eccc:b0:1da:e86:3d9e with SMTP id a12-20020a170902eccc00b001da0e863d9emr1841173plh.43.1707493323665; Fri, 09 Feb 2024 07:42:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707493323; cv=pass; d=google.com; s=arc-20160816; b=mAzXRHneyJ8eXU8j72F+/bF9zDi5NjUYidJYCCBHBb5K84ndR6NVSg1qyFAzIlTB0m iwPKqiVTOJiiyzBi65njO579i64BabPbFZ6CVoI0wqnHh43GvXoVgyHoYnLc7ttW4wLG r82MtzIvgjj4BLcRQqOvvmmBxPFtvMgZNMSIDiUUVLzgcUixRrqSYYQ1yuXkH8J5lLPG DZQmIs49gQKNR58rm7HqwtOj3DUsNphRRf6OpYowAWS6tfs20moDt/7IAHEzS5alrHT3 /JsOvWbv8N4vtSSf635Nt1Cr8Z7TBFcHTQR3pRFIFi1LbVrL9gs2Km0RJRXcjMwW39em Tqhg== 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=BYQAgrM0iCoWkiPwDJhO3sbjPQzqGgLvX5Ho5qTAbYE=; fh=lqrTjt5DK3ZUU0MeU7jLq+pZ7nq8HrP1UDMQjwNoiFU=; b=D+Y1FO/00Vr7ggduHudUNux6Lo0bDClmo2qlKEhxg6oadlB5fwGhq/dTctBVWXJcH4 lrRxwgEKjIaIMoyaBEBTdljlM1DLi4DdRysmIeGbb60p9jXHIKgniurdhym3v/G/chBJ scxR8Ne2YMbzvxQEGg3OCL1tJUMZtHyL1b5ldFsJDljGG7a0Fha41vaLu4tSC0V/ftHo QEjGihIjWuvDXhh21K2yFhYnwTV4X4qlUos1IjiKJjTu4aEb2e58/PCM6TWRuHxbXOr8 49Evcj8PuJnfi3KW7gWyf+kmFQ6vW7S7tBOQqq6jZalD8ATvBbTWPjt08i22yuoVwja9 xTSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VsIgGSvh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCW8YwRvUbF5+jScEf6nxFHTlo1hkXkJFZOOPlPOy4ishyfdjeMtniXsV34+1CqbMysq4yYtoldbKS7EaCcYnlACiSy2dHdolKUPKrZW5g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u12-20020a170902e80c00b001d94665e9d5si1907537plg.458.2024.02.09.07.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 07:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VsIgGSvh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59546-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5432F288D06 for ; Fri, 9 Feb 2024 15:42:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7786674E1E; Fri, 9 Feb 2024 15:41:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VsIgGSvh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B17169971 for ; Fri, 9 Feb 2024 15:41:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707493317; cv=none; b=OnXQMRSWo+jHEp4GC1TW4ZSWLrotN0YdtmDkEAYaEU9CQ9eMHixLiQo86bgfG7XGDhCjWmr7rz+Ffu99Fnqn54nrRkztj4xlzut+NGDfD1VEEe4iO9ejiQQm13S4vpEu/wOL5cQM73uDwRA+gl7ZyfR44XphYAnMf4WiJamtvRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707493317; c=relaxed/simple; bh=BYQAgrM0iCoWkiPwDJhO3sbjPQzqGgLvX5Ho5qTAbYE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rrrx1R8cMlVkY4ub7h1xoKRtOKcie+aQiRLEVT4ngprYJbqMFUbIRbED0gM2vR3KqotIzNb+wmAvVUuWd2OlFfinreYcBfStaQROzXAev6iXuPhoMf5TQAPuBdcimBIj/IWRG3H8iW5pKYwWNab+R6A2PCkx0nclVUlp7Au9ArM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VsIgGSvh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B72EAC433C7; Fri, 9 Feb 2024 15:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707493317; bh=BYQAgrM0iCoWkiPwDJhO3sbjPQzqGgLvX5Ho5qTAbYE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VsIgGSvhtfchQukDvq4H3WhSTrq7UyqASJZ9pVsLHoPtd2T+vyRlwbP33lWXVmt5+ iOkAny1mSRsmzVzfPfCnILsSG0E5SZiXgEz8SJx5RkRCy/Q88kLhOezAl4YpsKSRhn x8pls9kKl3kDWafXSrSJhIP+alK94F+qoAVx/u7jaVriV1B5VlFrMRrL7orK7aVQMr 3rotfhTB0Ztty+mi1VNypLZYFkMoF8/bPi7Q5gthONJtCJJth/N+fcq3d7yMgZx7Ys TJ77P1XNTj/0lelVDgaXfWbBdfiVnsvFPtVOlADeglEZpdXYTuu0u8KcUB4yu6boUj 492zsufl2215A== Date: Fri, 9 Feb 2024 16:41:54 +0100 From: Maxime Ripard To: Laurent Pinchart Cc: "Klymenko, Anatoliy" , "maarten.lankhorst@linux.intel.com" , "tzimmermann@suse.de" , "airlied@gmail.com" , "daniel@ffwll.ch" , "Simek, Michal" , "dri-devel@lists.freedesktop.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: Re: RE: Re: [PATCH 0/4] Fixing live video input in ZynqMP DPSUB Message-ID: References: <20240112234222.913138-1-anatoliy.klymenko@amd.com> <6jhwss2wego6yoo5mwmphwawhsj5bbj62gwrzcpapoixwkrkli@g4fbxdooopby> <20240117142343.GD17920@pendragon.ideasonboard.com> <2ytxhpti53e743b5pca3oa5jmscffi4vpsyeh727bcoh4v6cuw@zkz5pqkcv7v2> <20240204095618.GJ3094@pendragon.ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aaihxypctcsxwq6q" Content-Disposition: inline In-Reply-To: <20240204095618.GJ3094@pendragon.ideasonboard.com> --aaihxypctcsxwq6q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 04, 2024 at 11:56:18AM +0200, Laurent Pinchart wrote: > On Thu, Feb 01, 2024 at 06:01:01PM +0100, Maxime Ripard wrote: > > On Fri, Jan 26, 2024 at 11:18:30PM +0000, Klymenko, Anatoliy wrote: > > > On Friday, January 26, 2024 4:26 AM, Maxime Ripard wrote: > > > > On Wed, Jan 17, 2024 at 04:23:43PM +0200, Laurent Pinchart wrote: > > > > > On Mon, Jan 15, 2024 at 09:28:39AM +0100, Maxime Ripard wrote: > > > > > > On Fri, Jan 12, 2024 at 03:42:18PM -0800, Anatoliy Klymenko wro= te: > > > > > > > Patches 1/4,2/4,3/4 are minor fixes. > > > > > > > > > > > > > > DPSUB requires input live video format to be configured. > > > > > > > Patch 4/4: The DP Subsystem requires the input live video for= mat to be > > > > > > > configured. In this patch we are assuming that the CRTC's bus= format is fixed > > > > > > > and comes from the device tree. This is a proposed solution, = as there are no api > > > > > > > to query CRTC output bus format. > > > > > > > > > > > > > > Is this a good approach to go with? > > > > > > > > > > > > I guess you would need to expand a bit on what "live video inpu= t" is? Is > > > > > > it some kind of mechanism to bypass memory and take your pixels= straight > > > > > > from a FIFO from another device, or something else? > > > > > > > > > > Yes and no. > > > > > > > > > > The DPSUB integrates DMA engines, a blending engine (two planes),= and a > > > > > DP encoder. The dpsub driver supports all of this, and creates a = DRM > > > > > device. The DP encoder hardware always takes its input data from = the > > > > > output of the blending engine. > > > > > > > > > > The blending engine can optionally take input data from a bus con= nected > > > > > to the FPGA fabric, instead of taking it from the DPSUB internal = DMA > > > > > engines. When operating in that mode, the dpsub driver exposes th= e DP > > > > > encoder as a bridge, and internally programs the blending engine = to > > > > > disable blending. Typically, the FPGA fabric will then contain a = CRTC of > > > > > some sort, with a driver that will acquire the DP encoder bridge = as > > > > > usually done. > > > > > > > > > > In this mode of operation, it is typical for the IP cores in FPGA= fabric > > > > > to be synthesized with a fixed format (as that saves resources), = while > > > > > the DPSUB supports multiple input formats. > > > >=20 > > > > Where is that CRTC driver? It's not clear to me why the format would > > > > need to be in the device tree at all. Format negociation between the > > > > CRTC and whatever comes next is already done in a number of drivers= so > > > > it would be useful to have that kind of API outside of the bridge > > > > support. > > > > > > One example of such CRTC driver: > > > https://github.com/Xilinx/linux-xlnx/blob/master/drivers/gpu/drm/xlnx= /xlnx_mixer.c It's not > > > upstreamed yet. Bus format negotiations here are handled by utilizing= Xilinx-specific bridge > > > framework. Ideally, it would be nice to rework this to comply with th= e upstream DRM bridge > > > framework. > > > > > > > > Bridge drivers in the upstream kernel work the other way around, = with > > > > > the bridge hardware supporting a limited set of formats, and the = CRTC > > > > > then being programmed with whatever the bridges chain needs. Here= , the > > > > > negotiation needs to go the other way around, as the CRTC is the > > > > > limiting factor, not the bridge. > > > >=20 > > > > Sounds like there's something to rework in the API then? > > > >=20 > > > Adding an optional CRTC callback imposing CRTC specific bus format re= strictions, which may be > > > called from here https://github.com/torvalds/linux/blob/master/driver= s/gpu/drm/drm_bridge.c#L935 > > > would solve the problem. > >=20 > > CRTCs and bridges are orthogonal. If anything, I'd expect that callback > > to be set at the CRTC, encoder and connector levels and filled by the > > drm_bridge code if relevant. >=20 > I'm thinking about a new CRTC operation that would be called by the > bridge chain format negotiation helper > drm_atomic_bridge_chain_select_bus_fmts() (or one of the functions it > calls), to filter the list of formats supported by the chain based on > what the CRTC supports, or possibly to pick a format in that list. This > needs to be prototyped As long as we come up with something that works for regular encoders, I'm fine with that. Maxime --aaihxypctcsxwq6q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZcZHwgAKCRDj7w1vZxhR xR4xAQCnQ6B6KaRCdTBxvteV+SMevGOo6sSoUF43CpxDsbz/sgEA63pm3o5vZJBw Gkm3OaFel/wkTknuEVjJc+X59sDpagA= =H5zw -----END PGP SIGNATURE----- --aaihxypctcsxwq6q--