Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>
Cc: <freedreno@lists.freedesktop.org>,
	<linux-arm-msm@vger.kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>
Subject: Re: [Freedreno] [PATCH v2 02/13] drm/msm/hdmi: switch to devm_drm_bridge_add()
Date: Mon, 9 Oct 2023 14:04:51 -0700	[thread overview]
Message-ID: <836a86ea-4a91-c649-fd3d-a9848eb8ecae@quicinc.com> (raw)
In-Reply-To: <8ef34ba0-f30a-45b0-991e-0a7eb573956d@linaro.org>



On 10/9/2023 1:53 PM, Dmitry Baryshkov wrote:
> On 09/10/2023 22:21, Dmitry Baryshkov wrote:
>> On 09/10/2023 22:19, Abhinav Kumar wrote:
>>>
>>>
>>> On 10/9/2023 11:10 AM, Dmitry Baryshkov wrote:
>>>> Make MSM HDMI driver use devm_drm_bridge_add() instead of plain
>>>> drm_bridge_add(). As the driver doesn't require any additional cleanup,
>>>> stop adding created bridge to the priv->bridges array.
>>>>
>>>> Reviewed-by: Rob Clark <robdclark@gmail.com>
>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>> ---
>>>>   drivers/gpu/drm/msm/hdmi/hdmi.c        | 22 +++++--------------
>>>>   drivers/gpu/drm/msm/hdmi/hdmi.h        |  5 ++---
>>>>   drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 30 
>>>> ++++++++------------------
>>>>   drivers/gpu/drm/msm/hdmi/hdmi_hpd.c    |  3 +--
>>>>   4 files changed, 17 insertions(+), 43 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c 
>>>> b/drivers/gpu/drm/msm/hdmi/hdmi.c
>>>> index b6bcb9f675fe..c8ebd75176bb 100644
>>>> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
>>>> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
>>>> @@ -160,24 +160,16 @@ static int msm_hdmi_init(struct hdmi *hdmi)
>>>>   int msm_hdmi_modeset_init(struct hdmi *hdmi,
>>>>           struct drm_device *dev, struct drm_encoder *encoder)
>>>>   {
>>>> -    struct msm_drm_private *priv = dev->dev_private;
>>>>       int ret;
>>>> -    if (priv->num_bridges == ARRAY_SIZE(priv->bridges)) {
>>>> -        DRM_DEV_ERROR(dev->dev, "too many bridges\n");
>>>> -        return -ENOSPC;
>>>> -    }
>>>> -
>>>>       hdmi->dev = dev;
>>>>       hdmi->encoder = encoder;
>>>>       hdmi_audio_infoframe_init(&hdmi->audio.infoframe);
>>>> -    hdmi->bridge = msm_hdmi_bridge_init(hdmi);
>>>> -    if (IS_ERR(hdmi->bridge)) {
>>>> -        ret = PTR_ERR(hdmi->bridge);
>>>> +    ret = msm_hdmi_bridge_init(hdmi);
>>>> +    if (ret) {
>>>>           DRM_DEV_ERROR(dev->dev, "failed to create HDMI bridge: 
>>>> %d\n", ret);
>>>> -        hdmi->bridge = NULL;
>>>>           goto fail;
>>>>       }
>>>> @@ -215,16 +207,9 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
>>>>           goto fail;
>>>>       }
>>>> -    priv->bridges[priv->num_bridges++]       = hdmi->bridge;
>>>> -
>>>>       return 0;
>>>>   fail:
>>>> -    /* bridge is normally destroyed by drm: */
>>>> -    if (hdmi->bridge) {
>>>> -        msm_hdmi_bridge_destroy(hdmi->bridge);
>>>> -        hdmi->bridge = NULL;
>>>> -    }
>>>>       if (hdmi->connector) {
>>>>           hdmi->connector->funcs->destroy(hdmi->connector);
>>>>           hdmi->connector = NULL;
>>>> @@ -395,6 +380,9 @@ static void msm_hdmi_unbind(struct device *dev, 
>>>> struct device *master,
>>>>           if (priv->hdmi->audio_pdev)
>>>>               platform_device_unregister(priv->hdmi->audio_pdev);
>>>> +        if (priv->hdmi->bridge)
>>>> +            msm_hdmi_hpd_disable(priv->hdmi);
>>>> +
>>>
>>> Now is this the only place where hdmi->bridge is used?
>>>
>>> Why cant we just keep msm_hdmi_hpd_disable(priv->hdmi) here since its 
>>> anyway protected by if (priv->hdmi) and drop hdmi->bridge completely?
>>
>> Sure, sounds like a good idea, same followup as for the DSI.
> 
> I was wrong here. hdmi::bridge is used by the driver (e.g. for HPD 
> reporting).
> 

hmmm, I thought HPD module uses hdmi_bridge->hdmi. here we are talking 
about hdmi->bridge?

  reply	other threads:[~2023-10-09 21:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 18:10 [PATCH v2 00/13] drm/msm: move KMS code from msm_drv.c Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 01/13] drm/msm/dsi: switch to devm_drm_bridge_add() Dmitry Baryshkov
2023-10-09 18:39   ` Abhinav Kumar
2023-10-09 18:46     ` Dmitry Baryshkov
2023-10-09 18:51       ` Abhinav Kumar
2023-10-09 19:01         ` Dmitry Baryshkov
2023-10-09 19:11           ` Abhinav Kumar
2023-10-09 18:10 ` [PATCH v2 02/13] drm/msm/hdmi: " Dmitry Baryshkov
2023-10-09 19:19   ` Abhinav Kumar
2023-10-09 19:21     ` Dmitry Baryshkov
2023-10-09 19:50       ` Abhinav Kumar
2023-10-09 20:53       ` Dmitry Baryshkov
2023-10-09 21:04         ` Abhinav Kumar [this message]
2023-10-09 21:05           ` [Freedreno] " Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 03/13] drm/msm/dp: move pdev from struct dp_display_private to struct msm_dp Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 04/13] drm/msm/dp: switch to devm_drm_bridge_add() Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 05/13] drm/msm: remove msm_drm_private::bridges field Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 06/13] drm/msm: drop pm ops from the headless msm driver Dmitry Baryshkov
2023-10-09 19:53   ` Abhinav Kumar
2023-10-09 18:10 ` [PATCH v2 07/13] drm/msm: rename msm_pm_prepare/complete to note the KMS nature Dmitry Baryshkov
2023-10-09 19:57   ` Abhinav Kumar
2023-10-09 18:10 ` [PATCH v2 08/13] drm/msm: remove shutdown callback from msm_platform_driver Dmitry Baryshkov
2023-10-09 19:59   ` Abhinav Kumar
2023-10-09 18:10 ` [PATCH v2 09/13] drm/msm: rename msm_drv_shutdown() to msm_kms_shutdown() Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 10/13] drm/msm: switch to drmm_mode_config_init() Dmitry Baryshkov
2023-10-09 19:58   ` Abhinav Kumar
2023-10-09 18:10 ` [PATCH v2 11/13] drm/msm: only register 'kms' debug file if KMS is used Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 12/13] drm/msm: make fb debugfs file available only in KMS case Dmitry Baryshkov
2023-10-09 18:10 ` [PATCH v2 13/13] drm/msm: carve out KMS code from msm_drv.c 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=836a86ea-4a91-c649-fd3d-a9848eb8ecae@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --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=marijn.suijten@somainline.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --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