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 13/14] drm/msm/dp: drop struct msm_dp_panel_in
Date: Thu, 12 Dec 2024 10:56:06 -0800	[thread overview]
Message-ID: <3d7a82d5-3c7f-40dc-a896-daf1e564bdb0@quicinc.com> (raw)
In-Reply-To: <CAA8EJppthF3aVq0T2FmjLRNySP2pW36QnEXoWt5fFAKh+Nmz5A@mail.gmail.com>



On 12/12/2024 12:53 AM, Dmitry Baryshkov wrote:
> On Thu, 12 Dec 2024 at 05:26, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 12/11/2024 3:41 PM, Dmitry Baryshkov wrote:
>>> All other submodules pass arguments directly. Drop struct
>>> msm_dp_panel_in that is used to wrap dp_panel's submodule args and pass
>>> all data to msm_dp_panel_get() directly.
>>>
>>> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>>>    drivers/gpu/drm/msm/dp/dp_display.c |  9 +--------
>>>    drivers/gpu/drm/msm/dp/dp_panel.c   | 15 ++++++++-------
>>>    drivers/gpu/drm/msm/dp/dp_panel.h   | 10 ++--------
>>>    3 files changed, 11 insertions(+), 23 deletions(-)
>>>
>>
>> Change not necessarily tied to catalog cleanup, and can be sent
>> independently IMO.
>>
>>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
>>> index cb02d5d5b404925707c737ed75e9e83fbec34f83..a2cdcdac042d63a59ff71aefcecb7f8b22f01167 100644
>>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>>> @@ -722,9 +722,6 @@ static int msm_dp_init_sub_modules(struct msm_dp_display_private *dp)
>>>    {
>>>        int rc = 0;
>>>        struct device *dev = &dp->msm_dp_display.pdev->dev;
>>> -     struct msm_dp_panel_in panel_in = {
>>> -             .dev = dev,
>>> -     };
>>>        struct phy *phy;
>>>
>>>        phy = devm_phy_get(dev, "dp");
>>> @@ -765,11 +762,7 @@ static int msm_dp_init_sub_modules(struct msm_dp_display_private *dp)
>>>                goto error_link;
>>>        }
>>>
>>> -     panel_in.aux = dp->aux;
>>> -     panel_in.catalog = dp->catalog;
>>> -     panel_in.link = dp->link;
>>> -
>>> -     dp->panel = msm_dp_panel_get(&panel_in);
>>> +     dp->panel = msm_dp_panel_get(dev, dp->aux, dp->link, dp->catalog);
>>>        if (IS_ERR(dp->panel)) {
>>>                rc = PTR_ERR(dp->panel);
>>>                DRM_ERROR("failed to initialize panel, rc = %d\n", rc);
>>> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
>>> index 25869e2ac93aba0bffeddae9f95917d81870d8cb..49bbcde8cf60ac1b297310a50191135d79b092fb 100644
>>> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
>>> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
>>> @@ -659,25 +659,26 @@ static int msm_dp_panel_parse_dt(struct msm_dp_panel *msm_dp_panel)
>>>        return 0;
>>>    }
>>>
>>> -struct msm_dp_panel *msm_dp_panel_get(struct msm_dp_panel_in *in)
>>> +struct msm_dp_panel *msm_dp_panel_get(struct device *dev, struct drm_dp_aux *aux,
>>> +                           struct msm_dp_link *link, struct msm_dp_catalog *catalog)
>>>    {
>>
>> so this API, takes a filled input panel, makes a msm_dp_panel out of it
>> by filling out more information on top of what was already passed in and
>> returns a msm_dp_panel.
>>
>> So IOW, converts a msm_dp_panel_in to msm_dp_panel.
>>
>> What is the gain by passing individual params rather than passing them
>> as a struct instead? Isnt it better to have it within that struct to
>> show the conversion and moreover we dont have to pass in 4 arguments
>> instead of 1.
> 
> We gain uniformity. All other modules use params. And, as pointed out
> by Maxime during HDMI Codec reviews, it's easier to handle function
> params - it makes it more obvious that one of the params got missing.
> 

Point noted but a very long param list also makes it harder to manage. 
So we should really evaluate on a case-by-case basis and not generalize 
here.

Here its only 4, so i would say its kindof okay. If it goes beyond it, 
then msm_dp_panel_in is probably going to come back.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

  reply	other threads:[~2024-12-12 18:56 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
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 [this message]
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=3d7a82d5-3c7f-40dc-a896-daf1e564bdb0@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®