Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Arnaud Vrac <rawoul@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	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 2/2] drm/msm/dpu: add HDMI output support
Date: Sun, 16 Apr 2023 19:39:46 +0200	[thread overview]
Message-ID: <ZDwy4n12G8unCgM0@speedcore> (raw)
In-Reply-To: <20230415171926.85774-3-dmitry.baryshkov@linaro.org>

On Apr 15 20:19, Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:

>MSM8998 and the older Qualcomm platforms support HDMI outputs. Now as
>DPU encoder is ready, add support for using INTF_HDMI.
>
>Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>---
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 45 +++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
>diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>index e85e3721d2c7..65cce59163a4 100644
>--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>@@ -617,6 +617,45 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev,
> 	return 0;
> }
>
>+static int _dpu_kms_initialize_hdmi(struct drm_device *dev,
>+				    struct msm_drm_private *priv,
>+				    struct dpu_kms *dpu_kms)
>+{
>+	struct drm_encoder *encoder = NULL;
>+	struct msm_display_info info;
>+	int rc;
>+	int i;
>+
>+	if (!priv->hdmi)
>+		return 0;
>+
>+	encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS);
>+	if (IS_ERR(encoder)) {
>+		DPU_ERROR("encoder init failed for HDMI display\n");
>+		return PTR_ERR(encoder);
>+	}
>+
>+	memset(&info, 0, sizeof(info));

Move this where fields are initialized ?

>+	rc = msm_hdmi_modeset_init(priv->hdmi, dev, encoder);
>+	if (rc) {
>+		DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc);
>+		drm_encoder_cleanup(encoder);
>+		return rc;
>+	}
>+
>+	info.num_of_h_tiles = 1;
>+	info.h_tile_instance[0] = i;

i is uninitialized here, the line can be removed.

With the above changes:

Reviewed-by: Arnaud Vrac <rawoul@gmail.com>
Tested-by: Arnaud Vrac <rawoul@gmail.com> # on msm8998

-Arnaud

>+	info.intf_type = INTF_HDMI;
>+	rc = dpu_encoder_setup(dev, encoder, &info);
>+	if (rc) {
>+		DPU_ERROR("failed to setup DPU encoder %d: rc:%d\n",
>+			  encoder->base.id, rc);
>+		return rc;
>+	}
>+
>+	return 0;
>+}
>+
> static int _dpu_kms_initialize_writeback(struct drm_device *dev,
> 		struct msm_drm_private *priv, struct dpu_kms *dpu_kms,
> 		const u32 *wb_formats, int n_formats)
>@@ -683,6 +722,12 @@ static int _dpu_kms_setup_displays(struct drm_device *dev,
> 		return rc;
> 	}
>
>+	rc = _dpu_kms_initialize_hdmi(dev, priv, dpu_kms);
>+	if (rc) {
>+		DPU_ERROR("initialize HDMI failed, rc = %d\n", rc);
>+		return rc;
>+	}
>+
> 	/* Since WB isn't a driver check the catalog before initializing */
> 	if (dpu_kms->catalog->wb_count) {
> 		for (i = 0; i < dpu_kms->catalog->wb_count; i++) {
>-- 
>2.30.2
>

  reply	other threads:[~2023-04-16 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 17:19 [PATCH 0/2] drm/msm/dpu: enable INTF_HDMI support Dmitry Baryshkov
2023-04-15 17:19 ` [PATCH 1/2] drm/msm/dpu: simplify intf allocation code Dmitry Baryshkov
2023-04-16 17:36   ` [Freedreno] " Arnaud Vrac
2023-04-17 19:25   ` Abhinav Kumar
2023-04-15 17:19 ` [PATCH 2/2] drm/msm/dpu: add HDMI output support Dmitry Baryshkov
2023-04-16 17:39   ` Arnaud Vrac [this message]
2023-04-17 21:36   ` Abhinav Kumar

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=ZDwy4n12G8unCgM0@speedcore \
    --to=rawoul@gmail.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=quic_abhinavk@quicinc.com \
    --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