From: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
To: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 07/14] drm/msm/dpu: iterate for assigned hw ctl in virtual encoder
Date: Thu, 30 Aug 2018 12:28:29 -0400 [thread overview]
Message-ID: <20180830162829.GJ188300@art_vandelay> (raw)
In-Reply-To: <1535503203-22054-8-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On Tue, Aug 28, 2018 at 05:39:56PM -0700, Jeykumar Sankaran wrote:
> Instead of iterating for hw ctrl per physical encoder, this
> patch moves the iterations and assignment to the virtual encoder.
>
Missing "Changes in" section as well as _why_ you're doing this in your
description.
> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 22 +++++++++++++++++++---
> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 19 -------------------
> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 19 -------------------
> 3 files changed, 19 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index b223bd2..dbf669e 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1011,9 +1011,10 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
> struct dpu_kms *dpu_kms;
> struct list_head *connector_list;
> struct drm_connector *conn = NULL, *conn_iter;
> - struct dpu_rm_hw_iter pp_iter;
> + struct dpu_rm_hw_iter pp_iter, ctl_iter;
> struct msm_display_topology topology;
> enum dpu_rm_topology_name topology_name;
> + struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
> int i = 0, ret;
>
> if (!drm_enc) {
> @@ -1061,17 +1062,32 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
> dpu_enc->hw_pp[i] = (struct dpu_hw_pingpong *) pp_iter.hw;
> }
>
> + dpu_rm_init_hw_iter(&ctl_iter, drm_enc->base.id, DPU_HW_BLK_CTL);
> + for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) {
> + if (!dpu_rm_get_hw(&dpu_kms->rm, &ctl_iter))
> + break;
> + hw_ctl[i] = (struct dpu_hw_ctl *)ctl_iter.hw;
> + }
> +
> topology_name = dpu_rm_get_topology_name(topology);
> for (i = 0; i < dpu_enc->num_phys_encs; i++) {
> struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
>
> if (phys) {
> if (!dpu_enc->hw_pp[i]) {
> - DPU_ERROR_ENC(dpu_enc,
> - "invalid pingpong block for the encoder\n");
> + DPU_ERROR_ENC(dpu_enc, "no pp block assigned"
> + "at idx: %d\n", i);
> return;
> }
> phys->hw_pp = dpu_enc->hw_pp[i];
> +
> + if (!hw_ctl[i]) {
Should you check this before you assign hw_pp?
> + DPU_ERROR_ENC(dpu_enc, "no ctl block assigned"
> + "at idx: %d\n", i);
> + return;
> + }
> + phys->hw_ctl = hw_ctl[i];
> +
> phys->connector = conn->state->connector;
> phys->topology_name = topology_name;
> if (phys->ops.mode_set)
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> index c8c4612..5c89868 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
> @@ -196,9 +196,6 @@ static void dpu_encoder_phys_cmd_mode_set(
> {
> struct dpu_encoder_phys_cmd *cmd_enc =
> to_dpu_encoder_phys_cmd(phys_enc);
> - struct dpu_rm *rm = &phys_enc->dpu_kms->rm;
> - struct dpu_rm_hw_iter iter;
> - int i, instance;
>
> if (!phys_enc || !mode || !adj_mode) {
> DPU_ERROR("invalid args\n");
> @@ -208,22 +205,6 @@ static void dpu_encoder_phys_cmd_mode_set(
> DPU_DEBUG_CMDENC(cmd_enc, "caching mode:\n");
> drm_mode_debug_printmodeline(adj_mode);
>
> - instance = phys_enc->split_role == ENC_ROLE_SLAVE ? 1 : 0;
> -
> - /* Retrieve previously allocated HW Resources. Shouldn't fail */
> - dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_CTL);
> - for (i = 0; i <= instance; i++) {
> - if (dpu_rm_get_hw(rm, &iter))
> - phys_enc->hw_ctl = (struct dpu_hw_ctl *)iter.hw;
> - }
> -
> - if (IS_ERR_OR_NULL(phys_enc->hw_ctl)) {
> - DPU_ERROR_CMDENC(cmd_enc, "failed to init ctl: %ld\n",
> - PTR_ERR(phys_enc->hw_ctl));
> - phys_enc->hw_ctl = NULL;
> - return;
> - }
> -
> _dpu_encoder_phys_cmd_setup_irq_hw_idx(phys_enc);
> }
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index ecb8c65..ca0963c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -395,9 +395,6 @@ static void dpu_encoder_phys_vid_mode_set(
> struct drm_display_mode *mode,
> struct drm_display_mode *adj_mode)
> {
> - struct dpu_rm *rm;
> - struct dpu_rm_hw_iter iter;
> - int i, instance;
> struct dpu_encoder_phys_vid *vid_enc;
>
> if (!phys_enc || !phys_enc->dpu_kms) {
> @@ -405,7 +402,6 @@ static void dpu_encoder_phys_vid_mode_set(
> return;
> }
>
> - rm = &phys_enc->dpu_kms->rm;
> vid_enc = to_dpu_encoder_phys_vid(phys_enc);
>
> if (adj_mode) {
> @@ -414,21 +410,6 @@ static void dpu_encoder_phys_vid_mode_set(
> DPU_DEBUG_VIDENC(vid_enc, "caching mode:\n");
> }
>
> - instance = phys_enc->split_role == ENC_ROLE_SLAVE ? 1 : 0;
> -
> - /* Retrieve previously allocated HW Resources. Shouldn't fail */
> - dpu_rm_init_hw_iter(&iter, phys_enc->parent->base.id, DPU_HW_BLK_CTL);
> - for (i = 0; i <= instance; i++) {
> - if (dpu_rm_get_hw(rm, &iter))
> - phys_enc->hw_ctl = (struct dpu_hw_ctl *)iter.hw;
> - }
> - if (IS_ERR_OR_NULL(phys_enc->hw_ctl)) {
> - DPU_ERROR_VIDENC(vid_enc, "failed to init ctl, %ld\n",
> - PTR_ERR(phys_enc->hw_ctl));
> - phys_enc->hw_ctl = NULL;
> - return;
> - }
> -
> _dpu_encoder_phys_vid_setup_irq_hw_idx(phys_enc);
> }
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-08-30 16:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 0:39 [PATCH 00/14] clean up DPU for RM refactor Jeykumar Sankaran
2018-08-29 0:39 ` [PATCH 01/14] drm/msm/dpu: remove debugfs support for misr Jeykumar Sankaran
[not found] ` <1535503203-22054-2-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:15 ` Sean Paul
[not found] ` <1535503203-22054-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-29 0:39 ` [PATCH 02/14] drm/msm/dpu: remove scalar config definitions Jeykumar Sankaran
2018-08-29 0:39 ` [PATCH 03/14] drm/msm/dpu: remove resource pool manager Jeykumar Sankaran
2018-08-29 0:39 ` [PATCH 04/14] drm/msm/dpu: remove ping pong split topology variables Jeykumar Sankaran
2018-08-29 0:39 ` [PATCH 05/14] drm/msm/dpu: enable master-slave encoders explicitly Jeykumar Sankaran
2018-08-30 16:24 ` Sean Paul
2018-08-31 19:16 ` Jeykumar Sankaran
[not found] ` <3c3232c852b8f3a17955322c8ec3fbd8-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 20:12 ` Sean Paul
2018-08-29 0:39 ` [PATCH 06/14] drm/msm/dpu: use kms stored hw mdp block Jeykumar Sankaran
2018-08-29 0:39 ` [PATCH 07/14] drm/msm/dpu: iterate for assigned hw ctl in virtual encoder Jeykumar Sankaran
[not found] ` <1535503203-22054-8-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:28 ` Sean Paul [this message]
2018-08-29 0:39 ` [PATCH 08/14] drm/msm/dpu: avoid querying for hw intf before assignment Jeykumar Sankaran
[not found] ` <1535503203-22054-9-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:39 ` Sean Paul
2018-08-29 0:39 ` [PATCH 09/14] drm/msm/dpu: make crtc get_mixer_width helper static Jeykumar Sankaran
2018-08-31 14:40 ` Sean Paul
2018-08-29 0:39 ` [PATCH 10/14] drm/msm/dpu: move hw resource tracking to crtc state Jeykumar Sankaran
2018-08-31 14:56 ` Sean Paul
2018-08-31 19:22 ` Jeykumar Sankaran
[not found] ` <b09b0a69d6b72ae170c0b02f6acfb9d5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 20:13 ` Sean Paul
2018-09-04 22:36 ` Jeykumar Sankaran
2018-08-29 0:40 ` [PATCH 11/14] drm/msm/dpu: rename hw_ctl to lm_ctl Jeykumar Sankaran
2018-08-31 15:54 ` Sean Paul
2018-08-29 0:40 ` [PATCH 12/14] drm/msm/dpu: remove topology name Jeykumar Sankaran
[not found] ` <1535503203-22054-13-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 16:08 ` Sean Paul
2018-09-04 23:03 ` Jeykumar Sankaran
[not found] ` <6e6b8dd4bbc3343c82b3e093db23b6f5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-09-05 13:33 ` Sean Paul
2018-08-29 0:40 ` [PATCH 13/14] drm/msm/dpu: remove display H_TILE from encoder Jeykumar Sankaran
2018-08-31 16:10 ` Sean Paul
2018-08-29 0:40 ` [PATCH 14/14] drm/msm/dpu: remove cdm block support from resource manager Jeykumar Sankaran
[not found] ` <1535503203-22054-15-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 16:12 ` Sean Paul
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=20180830162829.GJ188300@art_vandelay \
--to=sean-p7ytbzm4h96eqtr555yldq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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