Received: by 2002:a05:7412:a986:b0:f9:90c9:de9f with SMTP id o6csp29963rdh; Wed, 20 Dec 2023 13:25:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQBpoNsDgJ10VuLHELVeJXN04yW6c3ABwiOZgC7ZiFa/JIwQt4BSHS8CRSoo07giVL8RoY X-Received: by 2002:a50:cd5e:0:b0:553:a9bd:19e8 with SMTP id d30-20020a50cd5e000000b00553a9bd19e8mr1831871edj.5.1703107518988; Wed, 20 Dec 2023 13:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703107518; cv=none; d=google.com; s=arc-20160816; b=gwEor+6/fUxS/eZsMlgqStHsPH9EjYINNwC7UyxjdrobM8wzlKH1yF1efwKXpbhFAB wlR+27lOB0ZOrw6SRN5MdQRPtFZYIEMXj8EwpLwbUkiE68VZ1P/uDPKdzjVB6Yk+th7q hiPF1TBb5iJXeMIdiOmLnb2godbSaDxK5Ami2xRXeJ4hTTwRQs1Im+rNlvZkH5G8ak1C pskTYOxT0GbiIYrIJM4FcGcEQaKaCT+luL+nSeGKKtQ57tu+D3QYWApKrVDMVFIhLMW8 D4wT0lgUXowlVms6j/S9SW7Wje6tV5+7Ec9Jkax5ITAgJrpzgWkEvX7/xiO1SFTz7jta xe0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=SthL2gAMsR+mHPBG1JCkY0mqpm5FBToJ0tzjEFRNHcc=; fh=MAOaO6S5GXjxRtYVuAoqnz2yz++LoW3yuyx4DeAgmhM=; b=IPd7bMYQFXMZW32PWyxZ5ZsX+GYLym089G4uHs7Tuh7iaz1LegZGuGJjbR3aX/jKLE CBzhHZRnly9U1/vQJx4fBde0iYArtG/BiiKbnLiqJD6wUhR91bGhv/CGKZsvKMvbYy6+ rULvaU9RLcAU06vYn09aviNSfnwv/QLYPi5/SDfL0C39/msf01+W2xsYhB1CfuCl7abj KVTeVoyWrfkbgY6HNJNN4JZJB/4gTpRX7ozkmra83kGkDByL0MNFhaj5mnvPzTGPH45G h+RqU2bd7++77v3OHK0pIpWYiUR3/SLIGjQ1cnRYH+x9Msv8SSuAq+JoJl5le67BapWZ Emww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wyRJ2EnQ; spf=pass (google.com: domain of linux-kernel+bounces-7450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7450-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m22-20020a50d7d6000000b0054c90d54da4si189779edj.180.2023.12.20.13.25.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 13:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wyRJ2EnQ; spf=pass (google.com: domain of linux-kernel+bounces-7450-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7450-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 89D831F2401F for ; Wed, 20 Dec 2023 21:25:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 581EA48CF6; Wed, 20 Dec 2023 21:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wyRJ2EnQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (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 E49B7495C2 for ; Wed, 20 Dec 2023 21:25:00 +0000 (UTC) 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-yb1-f181.google.com with SMTP id 3f1490d57ef6-db4364ecd6aso110766276.2 for ; Wed, 20 Dec 2023 13:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703107500; x=1703712300; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SthL2gAMsR+mHPBG1JCkY0mqpm5FBToJ0tzjEFRNHcc=; b=wyRJ2EnQ9EILyke63DVwLzUHKo0u/iLIfiV5P2SeSbjf0HPELqe+zAB5xn/pR42JsU 3VYjXVIgU/QZ5u9DHPyfNyW2qRrb3RCaaZdxXvUnNe3hYuORFbOMhgl5aCCs6IIutIOZ E87liu3bD6V/+aCuNpY2xBnySs1QF9WSTOZYijkAo/czWMfX5BNX8kC8XNZNZP8v7vU/ Vo05a5/faIRWYmA8ay9vhLKTIEy6UWH2hFaUTyEePLK6qCdvlWmU/N8eJ/GjY4f2torP 1TBYgCY5TJoic22xEmwlUot/jtdy5VogzAv/sFgjO1y3UU6AAdO+32wNz8MEJzpYqd/3 E0wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703107500; x=1703712300; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SthL2gAMsR+mHPBG1JCkY0mqpm5FBToJ0tzjEFRNHcc=; b=WZktsOZulvmA7U1UdPLgosxg2jJzxcZc1FaNbJBpCVlUbdvd0eKs1z1dVjMzhh14/n MbgPRgNjUGJIOMXSp0sK1INPDNwAOsPLVpTjG7JsInQDhJcLfzZxNiPEP6wytzPvIURs 6eSCIO5BxFtljsaba+8FD7v+ICNbHiaGnHk907mHX0l8vTDRwDKdB7mJZ3PKPIj3H+Pt i9iGszP2AIKcV9hipokpGcTCXP48IsD4ZODL4yQPAojQq+P9cGHDBT/hIA5u4tkn7IB7 1uLXXSWKDsFazEcxmR8qZV3y5NMFsRrG3NMXyLbtL/BsHV9Ecc708zJxsO/MOFP87QDX dxiw== X-Gm-Message-State: AOJu0Ywig1Equ49izGziHoge5lFOxJvkWe8R9FScnAlNtWIepOmooqjg 8C9LMqJVLO5N8zOS63b5/YB9y2QGU1JfuUs9BKuZoQ== X-Received: by 2002:a25:690e:0:b0:dbd:7177:6531 with SMTP id e14-20020a25690e000000b00dbd71776531mr348556ybc.37.1703107499779; Wed, 20 Dec 2023 13:24:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1702899149-21321-1-git-send-email-quic_dikshita@quicinc.com> <9d94317c-5da9-5494-26a2-12007761a1e5@quicinc.com> In-Reply-To: From: Dmitry Baryshkov Date: Wed, 20 Dec 2023 23:24:48 +0200 Message-ID: Subject: Re: [PATCH v2 00/34] Qualcomm video encoder and decoder driver To: Abhinav Kumar Cc: Vikash Garodia , Dikshita Agarwal , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, stanimir.k.varbanov@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, bryan.odonoghue@linaro.org, linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Abhinav, On Wed, 20 Dec 2023 at 20:55, Abhinav Kumar wrote: > > Hi Dmitry and Krzysztof > > On 12/20/2023 1:52 AM, Dmitry Baryshkov wrote: > > On Wed, 20 Dec 2023 at 10:53, Vikash Garodia wrote: > >> > >> On 12/20/2023 2:09 PM, Dmitry Baryshkov wrote: > >>> On Wed, 20 Dec 2023 at 10:14, Vikash Garodia wrote: > >>>> > >>>> Hi, > >>>> > >>>> On 12/20/2023 1:07 PM, Dmitry Baryshkov wrote: > >>>>> On Wed, 20 Dec 2023 at 08:32, Vikash Garodia wrote: > >>>>>> > >>>>>> Hi Dmitry, > >>>>>> > >>>>>> On 12/19/2023 12:08 AM, Dmitry Baryshkov wrote: > >>>>>>> On 18/12/2023 13:31, Dikshita Agarwal wrote: > >>>>>>>> This patch series introduces support for Qualcomm new video acceleration > >>>>>>>> hardware architecture, used for video stream decoding/encoding. This driver > >>>>>>>> is based on new communication protocol between video hardware and application > >>>>>>>> processor. > >>>>>>> > >>>>>>> This doesn't answer one important point, you have been asked for v1. What is the > >>>>>>> actual change point between Venus and Iris? What has been changed so much that > >>>>>>> it demands a separate driver. This is the main question for the cover letter, > >>>>>>> which has not been answered so far. > >>>>>>> > >>>>>>> From what I see from you bindings, the hardware is pretty close to what we see > >>>>>>> in the latest venus generations. I asssme that there was a change in the vcodec > >>>>>>> inteface to the firmware and other similar changes. Could you please point out, > >>>>>>> which parts of Venus driver do no longer work or are not applicable for sm8550 > >>>>>> > >>>>>> The motivation behind having a separate IRIS driver was discussed earlier in [1] > >>>>>> In the same discussion, it was ellaborated on how the impact would be with > >>>>>> change in the new firmware interface and other video layers in the driver. I can > >>>>>> add this in cover letter in the next revision. > >>>>> > >>>>> Ok. So the changes cover the HFI interface. Is that correct? > >>>> Change wise, yes. > >>>> > >>>>>> We see some duplication of code and to handle the same, the series brings in a > >>>>>> common code reusability between iris and venus. Aligning the common peices of > >>>>>> venus and iris will be a work in progress, once we land the base driver for iris. > >>>>> > >>>>> This is not how it usually works. Especially not with the patches you > >>>>> have posted. > >>>>> > >>>>> I have the following suggestion how this story can continue: > >>>>> You can _start_ by reworking venus driver, separating the HFI / > >>>>> firmware / etc interface to an internal interface in the driver. Then > >>>>> implement Iris as a plug in for that interface. I might be mistaken > >>>>> here, but I think this is the way how this can be beneficial for both > >>>>> the video en/decoding on both old and new platforms. > >>>> > >>>> HFI/firmware interface is already confined to HFI layer in the existing venus > >>>> driver. We explained in the previous discussion [1], on how the HFI change > >>>> impacts the other layers by taking example of a DRC usecase. Please have a look > >>>> considering the usecase and the impact it brings to other layers in the driver. > >>> > >>> I have looked at it. And I still see huge change in the interface > >>> side, but it doesn't tell me about the hardware changes. > >> > >> I hope you noticed how the common layers like decoder, response, state layers > >> are impacted in handling one of usecase. Now add that to all the different > >> scenarios like seek, drain, DRC during seek, DRC during drain, etc. > > > > Yes, for sure. > > > >> > >>> Have you evaluated the other opportunity? > >>> > >>> To have a common platform interface and firmware-specific backend? > >>> > >>> You have already done a part of it, but from a different perspective. > >>> You have tried to move common code out of the driver. Instead we are > >>> asking you to do a different thing. Move non-common code within the > >>> driver. Then add your code on top of that. > >> > >> For common platform - yes, we are bringing in common stuff like PIL. > >> Other than that, abstraction to firmware interface is not that confined to one > >> layer. It spreads over decoder/encoder/common layers. Now when majority of the > >> layers/code is different, we planned to make it in parallel to venus and have a > >> common layer having common things to both iris and venus. > > > > My suggestion still holds. Start with this common platform code. > > Rather than arguing back and forth, could you please perform an > > experiment on the current venus driver and move firmware interface to > > subdirs, leaving just the platform / PIL / formats / etc in place? > > This will at least allow us to determine whether it is a feasible > > concept or not. > > > > Your comments are valid. The platform driver piece and some other pieces > still are common between venus and iris despite this initial effort of > moving common pieces out. I have also seen this from whatever I have > reviewed. > > Video team also acknowledges this part and internally I think they did > evaluate this option and their feedback was, the more and more they > changed, they were touching pretty much every file of venus. This is fine from my POV. Splitting the the common functionality also touched a significant part of the venus driver in a pretty bad way. > The missing piece i think in all this discussion is that in addition to > the forward channel, the reverse channel of HFI, based on which the rest > of the video state machine changes should also be considered. > > So even with respect to the code layout, its not just the forward > communication but the backwards communication of fw--->hfi--->codec is > becoming a challenge as the venus layers seem to only work with the hfi > of venus. Again, this is a question of the platform backend part. Nobody questions that newer platforms have their own driver interface. We are not asking your team to add if(new) { foo; } else { bar; } conditions all over the code. Instead we have been asking to split all platform specifics to the 'backend'. Compare this with mdp4, mdp5 and dpu backends of the single drm/msm frontend. Or with a similar approach found in other DRM drivers. Adding new driver is frequently unjustified, instead the existing driver gets extended to support different generations. > For adding support for the new HFI events/communication, it was getting > harder to extend venus. > > What I certainly acknowledge is now with iris whether this can be dealt > with better for future chipsets to avoid another re-write for another > HFI as that will be too much of maintenance cost. Another approach, which might also be fine, if that looks better from your point of view. The current venus driver might have issues with the internal interfaces. Or it might be not suitable for the backends. In this case, can we please get older platforms also supported by the iris driver? This will be a very simple case then: the old deprecated driver, being phased out and removed, and a new one, which is being phased in. The problem is very simple from my side. I do not want to end up in a situation where we have to change platform code for both drivers if there is any common issue. Neither would I like for venus and iris bindings to diverge more than necessary. And as you have seen from my comments, the iris bindings already do not follow the venus example. > I will let the video team comment on this part. > > Thanks > > Abhinav > > > > > > >> > >>>> > >>>> [1] https://lore.kernel.org/lkml/8c97d866-1cab-0106-4ab3-3ca070945ef7@quicinc.com/ > >>>>> Short rationale: > >>>>> The venus driver has a history of supported platforms. There is > >>>>> already some kind of buffer management in place. Both developers and > >>>>> testers have spent their effort on finding issues there. Sending new > >>>>> driver means that we have to spend the same amount of efforts on this. > >>>>> Moreover, even from the porter point of view. You are creating new > >>>>> bindings for the new hardware. Which do not follow the > >>>>> venus-common.yaml. And they do not follow the defined bindings for the > >>>>> recent venus platforms. Which means that as a developer I have to care > >>>>> about two different ways to describe nearly the same hardware.>> Again qualcomm video team does not have a plan to support sm8550/x1e80100 on > >>>>>> venus as the changes are too interleaved to absorb in venus driver. And there is > >>>>>> significant interest in community to start validating video driver on sm8550 or > >>>>>> x1e80100. > >>>>>> > >>>>>> [1] https://lore.kernel.org/lkml/8c97d866-1cab-0106-4ab3-3ca070945ef7@quicinc.com/ > >>>>>> > >>>>>> Regards, > >>>>>> Vikash -- With best wishes Dmitry