mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>
Cc: Sean Paul <sean@poorly.run>, <linux-kernel@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	Rob Clark <robdclark@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	<linux-arm-msm@vger.kernel.org>, David Airlie <airlied@gmail.com>,
	<freedreno@lists.freedesktop.org>
Subject: Re: [Freedreno] [PATCH 2/3] drm/msm/dpu: Set DATABUS_WIDEN on command mode encoders
Date: Thu, 29 Jun 2023 10:37:52 -0700	[thread overview]
Message-ID: <829ef35b-b074-81db-0aa2-7cb3dd276322@quicinc.com> (raw)
In-Reply-To: <53df7008-0a72-dfa7-27d9-96c07e410ac3@quicinc.com>



On 6/29/2023 10:26 AM, Abhinav Kumar wrote:
> 
> 
> On 6/22/2023 4:37 PM, Abhinav Kumar wrote:
>>
>>
>> On 6/22/2023 4:14 PM, Dmitry Baryshkov wrote:
>>> On 23/06/2023 01:37, Abhinav Kumar wrote:
>>>>
>>>>
>>>> On 6/21/2023 4:46 PM, Dmitry Baryshkov wrote:
>>>>> On 22/06/2023 02:01, Abhinav Kumar wrote:
>>>>>>
>>>>>>
>>>>>> On 6/21/2023 9:36 AM, Dmitry Baryshkov wrote:
>>>>>>> On 21/06/2023 18:17, Marijn Suijten wrote:
>>>>>>>> On 2023-06-20 14:38:34, Jessica Zhang wrote:
>>>>>>>> <snip>
>>>>>>>>>>>>>> +    if (phys_enc->hw_intf->ops.enable_widebus)
>>>>>>>>>>>>>> + phys_enc->hw_intf->ops.enable_widebus(phys_enc->hw_intf);
>>>>>>>>>>>>>
>>>>>>>>>>>>> No. Please provide a single function which takes necessary
>>>>>>>>>>>>> configuration, including compression and wide_bus_enable.
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> There are two ways to look at this. Your point is coming 
>>>>>>>>>>>> from the
>>>>>>>>>>>> perspective that its programming the same register but just 
>>>>>>>>>>>> a different
>>>>>>>>>>>> bit. But that will also make it a bit confusing.
>>>>>>>>>>
>>>>>>>>>> My point is to have a high-level function that configures the 
>>>>>>>>>> INTF for
>>>>>>>>>> the CMD mode. This way it can take a structure with necessary
>>>>>>>>>> configuration bits.
>>>>>>>>>
>>>>>>>>> Hi Dmitry,
>>>>>>>>>
>>>>>>>>> After discussing this approach with Abhinav, we still have a few
>>>>>>>>> questions about it:
>>>>>>>>>
>>>>>>>>> Currently, only 3 of the 32 bits for INTF_CONFIG2 are being 
>>>>>>>>> used (the
>>>>>>>>> rest are reserved with no plans of being programmed in the 
>>>>>>>>> future). Does
>>>>>>>>> this still justify the use of a struct to pass in the necessary
>>>>>>>>> configuration?
>>>>>>>>
>>>>>>>> No.  The point Dmitry is making is **not** about this concidentally
>>>>>>>> using the same register, but about adding a common codepath to 
>>>>>>>> enable
>>>>>>>> compression on this hw_intf (regardless of the registers it 
>>>>>>>> needs to
>>>>>>>> touch).
>>>>>>>
>>>>>>> Actually to setup INTF for CMD stream (which is equal to setting 
>>>>>>> up compression at this point).
>>>>>>>
>>>>>>
>>>>>> Yes it should be setup intf for cmd and not enable compression.
>>>>>>
>>>>>> Widebus and compression are different features and we should be 
>>>>>> able to control them independently.
>>>>>>
>>>>>> We just enable them together for DSI. So a separation is necessary.
>>>>>>
>>>>>> But I am still not totally convinced we even need to go down the 
>>>>>> path for having an op called setup_intf_cmd() which takes in a 
>>>>>> struct like
>>>>>>
>>>>>> struct dpu_cmd_intf_cfg {
>>>>>>      bool data_compress;
>>>>>>      bool widebus_en;
>>>>>> };
>>>>>>
>>>>>> As we have agreed that we will not touch the video mode timing 
>>>>>> engine path, it leaves us with only two bits.
>>>>>>
>>>>>> And like I said, its not that these two bits always go together. 
>>>>>> We want to be able to control them independently which means that 
>>>>>> its not necessary both bits program the same register one by one. 
>>>>>> We might just end up programming one of them if we just use widebus.
>>>>>>
>>>>>> Thats why I am still leaning on keeping this approach.
>>>>>
>>>>> I do not like the idea of having small functions being called 
>>>>> between modules. So, yes there will a config of two booleans, but 
>>>>> it is preferable (and more scalable) compared to separate callbacks.
>>>>>
>>>>
>>>> I definitely agree with the scalable part and I even cross checked 
>>>> that the number of usable bitfields of this register is going up 
>>>> from one chipset to the other although once again that depends on 
>>>> whether we will use those features.
>>>>
>>>> For that reason I am not opposed to the struct idea.
>>>>
>>>> But there is also another pattern i am seeing which worries me. 
>>>> Usable bitfields sometimes even reduce. For those cases, if we go 
>>>> with a pre-defined struct it ends up with redundant members as those 
>>>> bitfields go away.
>>>>
>>>> With the function op based approach, we just call the op if the 
>>>> feature bit / core revision.
>>>>
>>>> So I wanted to check once more about the fact that we should 
>>>> consider not just expansion but also reduction.
>>>
>>> As we have to support all generations, there is no actual reduction. 
>>> Newer SoCs do not have particular feature/bit, but older ones do. By 
>>> having multiple optional ops we just move this knowledge from 
>>> ops->complex_callback() to _setup_block_ops(). But more importantly 
>>> the caller gets more complicated. Instead of just calling 
>>> ops->set_me_up(), it has to check all the optional callbacks and call 
>>> the one by one.
>>>
>>
>> Alright, I am thinking that perhaps because this register is kind of 
>> unique that its actually controlling a specific setting in the 
>> datapath, downstream also has separate ops for this.
>>
>> But thats fine, we can go ahead with the struct based approach.
>>
> 
> As data_compress has already landed, let me introduced the struct along 
> with the core_revision based approach in the core_revision series and 
> this series will expand that struct to include widebus too.

Acked. Will rebase on top of the core_revision series and add widebus to 
the config struct.

Thanks,

Jessica Zhang


  reply	other threads:[~2023-06-29 17:38 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  1:57 [PATCH 0/3] Add support for databus widen mode Jessica Zhang
2023-06-14  1:57 ` [PATCH 1/3] drm/msm/dpu: Add DPU_INTF_DATABUS_WIDEN feature flag for DPU >= 5.0 Jessica Zhang
2023-06-14  7:50   ` Dmitry Baryshkov
2023-06-14 11:42   ` Marijn Suijten
2023-06-14 12:01     ` Dmitry Baryshkov
2023-06-14 12:23       ` Marijn Suijten
2023-06-14 19:35         ` Abhinav Kumar
2023-06-14 19:54           ` Abhinav Kumar
2023-06-14 20:39             ` [Freedreno] " Abhinav Kumar
2023-06-14 20:43               ` Dmitry Baryshkov
2023-06-16 21:10                 ` Abhinav Kumar
2023-06-17  0:37                   ` Dmitry Baryshkov
2023-06-20 21:37                     ` Jessica Zhang
2023-06-20 22:11                       ` Dmitry Baryshkov
2023-06-20 23:37                         ` Jessica Zhang
2023-06-14 21:41               ` Marijn Suijten
2023-06-16 21:13                 ` Abhinav Kumar
2023-06-16 21:58                   ` Marijn Suijten
2023-06-14 22:49         ` Marijn Suijten
2023-06-16 21:06           ` Abhinav Kumar
2023-06-16 22:00             ` Marijn Suijten
2023-06-14  1:57 ` [PATCH 2/3] drm/msm/dpu: Set DATABUS_WIDEN on command mode encoders Jessica Zhang
2023-06-14  7:56   ` Dmitry Baryshkov
2023-06-16 21:18     ` Abhinav Kumar
2023-06-16 21:54       ` Marijn Suijten
2023-06-17  0:35         ` Dmitry Baryshkov
2023-06-20 21:38           ` Jessica Zhang
2023-06-20 22:10             ` Dmitry Baryshkov
2023-06-21 15:17             ` Marijn Suijten
2023-06-21 16:36               ` Dmitry Baryshkov
2023-06-21 19:00                 ` Marijn Suijten
2023-06-21 23:01                 ` Abhinav Kumar
2023-06-21 23:46                   ` Dmitry Baryshkov
2023-06-22 22:37                     ` Abhinav Kumar
2023-06-22 23:14                       ` Dmitry Baryshkov
2023-06-22 23:37                         ` [Freedreno] " Abhinav Kumar
2023-06-29 17:26                           ` Abhinav Kumar
2023-06-29 17:37                             ` Jessica Zhang [this message]
2023-06-14  1:57 ` [PATCH 3/3] drm/msm/dsi: Enable DATABUS_WIDEN for DSI command mode Jessica Zhang
2023-06-14  7:49   ` Dmitry Baryshkov
2023-06-14 10:03     ` Marijn Suijten
2023-06-22 23:04       ` Abhinav Kumar
2023-06-23  7:02         ` Marijn Suijten
2023-06-16 21:23     ` Abhinav Kumar
2023-06-14  9:56   ` Marijn Suijten
2023-06-23  0:01     ` [Freedreno] " Abhinav Kumar
2023-06-23  0:41       ` Dmitry Baryshkov
2023-06-23  7:19       ` Marijn Suijten
2023-06-23 17:29         ` Abhinav Kumar
2023-06-23 20:14           ` Marijn Suijten
2023-06-23 20:34             ` Abhinav Kumar
2023-06-23 21:33               ` Marijn Suijten
2023-06-23 21:47                 ` Abhinav Kumar
2023-06-14 10:09 ` [PATCH 0/3] Add support for databus widen mode Marijn Suijten
2023-06-16 11:30 ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=829ef35b-b074-81db-0aa2-7cb3dd276322@quicinc.com \
    --to=quic_jesszhan@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®