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: <freedreno@lists.freedesktop.org>,
	Rob Clark <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	"David Airlie" <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	<dri-devel@lists.freedesktop.org>, <quic_jesszhan@quicinc.com>,
	<quic_parellan@quicinc.com>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 14/16] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output
Date: Fri, 8 Dec 2023 08:50:15 -0800	[thread overview]
Message-ID: <0484fef8-872d-a5cd-cafa-307b93487d2c@quicinc.com> (raw)
In-Reply-To: <CAA8EJpoVfuybVPddKy2Sn-YsovkbiWmoNa48jKjdpKg4HiJaAg@mail.gmail.com>



On 12/8/2023 8:38 AM, Dmitry Baryshkov wrote:
> On Fri, 8 Dec 2023 at 18:34, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>>
>>
>> On 12/8/2023 3:54 AM, Dmitry Baryshkov wrote:
>>> On Fri, 8 Dec 2023 at 07:07, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>>>
>>>> Reserve CDM blocks for writeback if the format of the output fb
>>>> is YUV. At the moment, the reservation is done only for writeback
>>>> but can easily be extended by relaxing the checks once other
>>>> interfaces are ready to output YUV.
>>>>
>>>> changes in v2:
>>>>           - use needs_cdm from topology struct
>>>>           - drop fb related checks from atomic_mode_set()
>>>
>>> It looks like this should be squashed with the patch 11. The 'unbind
>>> CDM' doesn't really make sense without this patch. We need to allocate
>>> it first,  before touching it.
>>>
>>
>> The way I was thinking was that patch just completes the
>> dpu_encoder_phys_cleanup() and yes it was intentionally kept ahead
>> because that will not kick in till hw_cdm is assigned.
>>
>> Then, this patch only handles reserving/assignment of hw_cdm when needed.
>>
>> That was the motivation behind this split.
> 
> It leaves a leaf code that is not used at all. There is no need to
> cleanup anything if it was not allocated. Please remove the split and
> squash it with allocation.
> 

Ack. No concerns with squashing them.

>>
>>>>
>>>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>>>> ---
>>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 27 +++++++++++++++++++++
>>>>    1 file changed, 27 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>>> index 862912727925..a576e3e62429 100644
>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>>>> @@ -16,6 +16,7 @@
>>>>    #include <drm/drm_crtc.h>
>>>>    #include <drm/drm_file.h>
>>>>    #include <drm/drm_probe_helper.h>
>>>> +#include <drm/drm_framebuffer.h>
>>>>
>>>>    #include "msm_drv.h"
>>>>    #include "dpu_kms.h"
>>>> @@ -583,6 +584,7 @@ static int dpu_encoder_virt_atomic_check(
>>>>           struct drm_display_mode *adj_mode;
>>>>           struct msm_display_topology topology;
>>>>           struct dpu_global_state *global_state;
>>>> +       struct drm_framebuffer *fb;
>>>>           struct drm_dsc_config *dsc;
>>>>           int i = 0;
>>>>           int ret = 0;
>>>> @@ -623,6 +625,22 @@ static int dpu_encoder_virt_atomic_check(
>>>>
>>>>           topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state, dsc);
>>>>
>>>> +       /*
>>>> +        * Use CDM only for writeback at the moment as other interfaces cannot handle it.
>>>> +        * if writeback itself cannot handle cdm for some reason it will fail in its atomic_check()
>>>> +        * earlier.
>>>> +        */
>>>> +       if (dpu_enc->disp_info.intf_type == INTF_WB && conn_state->writeback_job) {
>>>> +               fb = conn_state->writeback_job->fb;
>>>> +
>>>> +               if (fb && DPU_FORMAT_IS_YUV(to_dpu_format(msm_framebuffer_format(fb))))
>>>> +                       topology.needs_cdm = true;
>>>> +               if (topology.needs_cdm && !dpu_enc->cur_master->hw_cdm)
>>>> +                       crtc_state->mode_changed = true;
>>>> +               else if (!topology.needs_cdm && dpu_enc->cur_master->hw_cdm)
>>>> +                       crtc_state->mode_changed = true;
>>>> +       }
>>>> +
>>>>           /*
>>>>            * Release and Allocate resources on every modeset
>>>>            * Dont allocate when active is false.
>>>> @@ -1063,6 +1081,15 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc,
>>>>
>>>>           dpu_enc->dsc_mask = dsc_mask;
>>>>
>>>> +       if (dpu_enc->disp_info.intf_type == INTF_WB && conn_state->writeback_job) {
>>>> +               struct dpu_hw_blk *hw_cdm = NULL;
>>>> +
>>>> +               dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state,
>>>> +                                             drm_enc->base.id, DPU_HW_BLK_CDM,
>>>> +                                             &hw_cdm, 1);
>>>> +               dpu_enc->cur_master->hw_cdm = hw_cdm ? to_dpu_hw_cdm(hw_cdm) : NULL;
>>>> +       }
>>>> +
>>>>           cstate = to_dpu_crtc_state(crtc_state);
>>>>
>>>>           for (i = 0; i < num_lm; i++) {
>>>> --
>>>> 2.40.1
>>>>
>>>
>>>
>>> --
>>> With best wishes
>>>
>>> Dmitry
> 
> 
> 

  reply	other threads:[~2023-12-08 16:50 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231208050641.32582-1-quic_abhinavk@quicinc.com>
2023-12-08  5:06 ` [PATCH v2 01/16] drm/msm/dpu: add formats check for writeback encoder Abhinav Kumar
2023-12-08  5:06 ` [PATCH v2 02/16] drm/msm/dpu: rename dpu_encoder_phys_wb_setup_cdp to match its functionality Abhinav Kumar
2023-12-08  5:06 ` [PATCH v2 03/16] drm/msm/dpu: fix writeback programming for YUV cases Abhinav Kumar
2023-12-08 11:11   ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 04/16] drm/msm/dpu: move csc matrices to dpu_hw_util Abhinav Kumar
2023-12-08 11:12   ` Dmitry Baryshkov
2023-12-08 16:24     ` Abhinav Kumar
2023-12-08 16:27       ` Dmitry Baryshkov
2023-12-08 16:35         ` Abhinav Kumar
2023-12-08 16:40           ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 05/16] drm/msm/dpu: add cdm blocks to sc7280 dpu_hw_catalog Abhinav Kumar
2023-12-08 11:13   ` Dmitry Baryshkov
2023-12-08 11:19   ` Dmitry Baryshkov
2023-12-11 21:16     ` Abhinav Kumar
2023-12-11 21:31       ` Dmitry Baryshkov
2023-12-11 21:32         ` Abhinav Kumar
2023-12-11 21:42           ` Dmitry Baryshkov
2023-12-11 21:48             ` Abhinav Kumar
2023-12-12  6:49               ` Dmitry Baryshkov
2023-12-12 17:12                 ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 06/16] drm/msm/dpu: add cdm blocks to sm8250 dpu_hw_catalog Abhinav Kumar
2023-12-08 11:20   ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 07/16] drm/msm/dpu: add dpu_hw_cdm abstraction for CDM block Abhinav Kumar
2023-12-08 12:06   ` Dmitry Baryshkov
2023-12-08 17:08     ` Abhinav Kumar
2023-12-08 18:17       ` Dmitry Baryshkov
2023-12-10 10:53   ` kernel test robot
2023-12-08  5:06 ` [PATCH v2 08/16] drm/msm/dpu: add cdm blocks to RM Abhinav Kumar
2023-12-08 11:26   ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 09/16] drm/msm/dpu: add support to allocate CDM from RM Abhinav Kumar
2023-12-08 11:33   ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 10/16] drm/msm/dpu: add CDM related logic to dpu_hw_ctl layer Abhinav Kumar
2023-12-08 11:34   ` Dmitry Baryshkov
2023-12-10 12:29   ` kernel test robot
2023-12-08  5:06 ` [PATCH v2 11/16] drm/msm/dpu: add support to disable CDM block during encoder cleanup Abhinav Kumar
2023-12-08 11:36   ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 12/16] drm/msm/dpu: add an API to setup the CDM block for writeback Abhinav Kumar
2023-12-08 11:52   ` Dmitry Baryshkov
2023-12-08 17:27     ` Abhinav Kumar
2023-12-08 20:55       ` Dmitry Baryshkov
2023-12-08 22:48         ` Abhinav Kumar
2023-12-10 14:06   ` kernel test robot
2023-12-08  5:06 ` [PATCH v2 13/16] drm/msm/dpu: plug-in the cdm related bits to writeback setup Abhinav Kumar
2023-12-08  5:06 ` [PATCH v2 14/16] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output Abhinav Kumar
2023-12-08 11:54   ` Dmitry Baryshkov
2023-12-08 16:33     ` Abhinav Kumar
2023-12-08 16:38       ` Dmitry Baryshkov
2023-12-08 16:50         ` Abhinav Kumar [this message]
2023-12-08  5:06 ` [PATCH v2 15/16] drm/msm/dpu: introduce separate wb2_format arrays for rgb and yuv Abhinav Kumar
2023-12-08 11:44   ` Dmitry Baryshkov
2023-12-08 17:53     ` Abhinav Kumar
2023-12-08 20:45       ` Dmitry Baryshkov
2023-12-08 23:09         ` Abhinav Kumar
2023-12-09  1:10           ` Dmitry Baryshkov
2023-12-08  5:06 ` [PATCH v2 16/16] drm/msm/dpu: add cdm blocks to dpu snapshot 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=0484fef8-872d-a5cd-cafa-307b93487d2c@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=airlied@gmail.com \
    --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=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=quic_parellan@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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®