mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	"Marijn Suijten" <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Paloma Arellano <quic_parellan@quicinc.com>,
	Douglas Anderson <dianders@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	<linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 04/14] drm/msm/dp: pull I/O data out of msm_dp_catalog_private()
Date: Thu, 12 Dec 2024 11:15:48 -0800	[thread overview]
Message-ID: <5cb7b1b1-5596-4704-bd01-beaadf8bba51@quicinc.com> (raw)
In-Reply-To: <CAA8EJppOjAjFVUFSEXJMbJ4aV_MvzpeTuKDkL7P+t_Mw47YECw@mail.gmail.com>



On 12/12/2024 12:52 AM, Dmitry Baryshkov wrote:
> On Thu, 12 Dec 2024 at 04:59, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 12/11/2024 3:41 PM, Dmitry Baryshkov wrote:
>>> Having I/O regions inside a msm_dp_catalog_private() results in extra
>>> layers of one-line wrappers for accessing the data. Move I/O region base
>>> and size to the globally visible struct msm_dp_catalog.
>>>
>>> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>>    drivers/gpu/drm/msm/dp/dp_catalog.c | 457 +++++++++++++++---------------------
>>>    drivers/gpu/drm/msm/dp/dp_catalog.h |  12 +
>>>    2 files changed, 197 insertions(+), 272 deletions(-)
>>>
>>
>>
>> Fundamentally, the whole point of catalog was that it needs to be the
>> only place where we want to access the registers. Thats how this really
>> started.
>>
>> This pre-dates my time with the DP driver but as I understand thats what
>> it was for.
>>
>> Basically separating out the logical abstraction vs actual register writes .
>>
>> If there are hardware sequence differences within the controller reset
>> OR any other register offsets which moved around, catalog should have
>> been able to absorb it without that spilling over to all the layers.
>>
>> So for example, if we call dp_ctrl_reset() --> ctrl->catalog->reset_ctrl()
>>
>> Then the reset_ctrl op of the catalog should manage any controller
>> version differences within the reset sequence.
> 
> The problem is that the register-level writes are usually not the best
> abstraction. So, instead of designing the code around dp_catalog I'd
> prefer to see actual hw / programming changes first.
> 

So thats the issue here. If we did end up with registers and sequences 
different for controller versions, the ctrl layer was expected to just 
call a reset() op for example similar to the DPU example you gave. And 
as you rightly noted, the dpu_hw_xxx files only expose the ops based on 
version and the upper layers were supposed to just call into the ops 
without knowing the register level details. Thats pretty much what 
dp_ctrl tried to do here. We did not want to expose all the register 
defines in those layers. This series is doing exactly opposite of that.

>>
>> We do not use or have catalog ops today so it looks redundant as we just
>> call the dp_catalog APIs directly but that was really the intention.
>>
>> Another reason which was behind this split but not applicable to current
>> upstream driver is that the AUX is part of the PHY driver in upstream
>> but in downstream, that remains a part of catalog and as we know the AUX
>> component keeps changing with chipsets especially the settings. That was
>> the reason of keeping catalog separate and the only place which should
>> deal with registers and not the entire DP driver.
>>
>> The second point seems not applicable to this driver but first point
>> still is. I do admit there is re-direction like ctrl->catalog
>> instead of just writing it within dp_ctrl itself but the redirection was
>> only because ctrl layers were not really meant to deal with the register
>> programming. So for example, now with patch 7 of this series every
>> register being written to i exposed in dp_ctrl.c and likewise for other
>> files. That seems unnecessary. Because if we do end up with some
>> variants which need separate registers written, then we will now have to
>> end up touching every file as opposed to only touching dp_catalog.
> 
> Yes. I think that it's a bonus, not a problem. We end up touching the
> files that are actually changed, so we see what is happening. Quite
> frequently register changes are paired with the functionality changes.
> 

Not exactly. Why should dp_ctrl really know that some register offset or 
some block shift happened for example. It only needs to know when to 
reset the hardware and not how. Thats the separation getting broken with 
this.

> For example (a very simple and dumb one), when designing code around
> dp_catalog you ended up adding separate _p1 handlers.
> Doing that from the data source point of view demands adding a stream_id param.
> 

I have not checked your comment on that series here but if your concern 
is stream_id should not be stored in the catalog but just passed, thats 
fine, we can change it. stream_id as a param is needed anyway because 
the register programming layer needs to know which offset to use. This 
series is not mitigating that fact.

> In the DPU driver we also have version-related conditionals in the HW
> modules rather than pushing all data access to dpu_hw_catalog.c &
> counterparts.

The dpu_hw_catalog.c and the dp_catalog.c are not the right files to 
compare with each other. dp_catalog.c should be compared with 
dpu_hw_xxx.c and as you noted, DPU version dependencies are handled in 
those files only and not all over the files like what this series is doing.

> I think it's better to make DP driver reflect DPU rather than keeping
> a separate wrapper for no particular reason (note, DPU has hardware
> abstractions, but on a block level, not on a register level).
> 

Thats the issue here. DPU hardware blocks are arranged according to the 
sub-blocks both in the software interface document and hence the code 
matches it file-by-file. DP registers are grouped by clock domains and 
the file separation we have today does not match that anyway. Hence 
grouping link registers writes or pixel clock register writes into 
dp_ctrl is also not correct that way. Let catalog handle that separation 
internally which it already does.

  reply	other threads:[~2024-12-12 19:15 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 23:41 [PATCH v3 00/14] drm/msm/dp: perform misc cleanups Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 01/14] drm/msm/dp: set safe_to_exit_level before printing it Dmitry Baryshkov
2024-12-12  1:14   ` Abhinav Kumar
2024-12-12  8:58     ` Dmitry Baryshkov
2024-12-12 18:31       ` Abhinav Kumar
2024-12-12 18:52         ` Abhinav Kumar
2024-12-12 23:09           ` Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 02/14] drm/msm/dp: fix msm_dp_utils_pack_sdp_header interface Dmitry Baryshkov
2024-12-12  1:23   ` Abhinav Kumar
2024-12-11 23:41 ` [PATCH v3 03/14] drm/msm/dp: drop msm_dp_panel_dump_regs() and msm_dp_catalog_dump_regs() Dmitry Baryshkov
2024-12-12  1:13   ` Abhinav Kumar
2024-12-11 23:41 ` [PATCH v3 04/14] drm/msm/dp: pull I/O data out of msm_dp_catalog_private() Dmitry Baryshkov
2024-12-12  2:59   ` Abhinav Kumar
2024-12-12  8:52     ` Dmitry Baryshkov
2024-12-12 19:15       ` Abhinav Kumar [this message]
2024-12-12 23:09         ` Dmitry Baryshkov
2024-12-14 20:53           ` Abhinav Kumar
2024-12-14 22:05             ` Dmitry Baryshkov
2024-12-16 20:45               ` Abhinav Kumar
2024-12-16 23:24                 ` Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 05/14] drm/msm/dp: move I/O functions to global header Dmitry Baryshkov
2024-12-12 20:26   ` Stephen Boyd
2024-12-11 23:41 ` [PATCH v3 06/14] drm/msm/dp: move/inline AUX register functions Dmitry Baryshkov
2024-12-12 20:26   ` Stephen Boyd
2024-12-11 23:41 ` [PATCH v3 07/14] drm/msm/dp: move/inline ctrl " Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 08/14] drm/msm/dp: move/inline panel related functions Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 09/14] drm/msm/dp: use msm_dp_utils_pack_sdp_header() for audio packets Dmitry Baryshkov
2024-12-12  3:12   ` Abhinav Kumar
2024-12-12  8:53     ` Dmitry Baryshkov
2024-12-12 21:41   ` Abhinav Kumar
2024-12-12 22:28     ` Dmitry Baryshkov
2024-12-12 23:53       ` Abhinav Kumar
2024-12-13  0:28         ` Dmitry Baryshkov
2024-12-14 18:02           ` Abhinav Kumar
2024-12-11 23:41 ` [PATCH v3 10/14] drm/msm/dp: drop obsolete audio headers access through catalog Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 11/14] drm/msm/dp: move/inline audio related functions Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 12/14] drm/msm/dp: move more AUX functions to dp_aux.c Dmitry Baryshkov
2024-12-11 23:41 ` [PATCH v3 13/14] drm/msm/dp: drop struct msm_dp_panel_in Dmitry Baryshkov
2024-12-12  3:26   ` Abhinav Kumar
2024-12-12  8:53     ` Dmitry Baryshkov
2024-12-12 18:56       ` Abhinav Kumar
2024-12-11 23:41 ` [PATCH v3 14/14] drm/msm/dp: move interrupt handling to dp_ctrl Dmitry Baryshkov
2024-12-12 20:27 ` [PATCH v3 00/14] drm/msm/dp: perform misc cleanups Stephen Boyd

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=5cb7b1b1-5596-4704-bd01-beaadf8bba51@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=dianders@chromium.org \
    --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_parellan@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=swboyd@chromium.org \
    /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®