All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	<freedreno@lists.freedesktop.org>
Cc: markyacoub@chromium.org, liviu.dudau@arm.com,
	dri-devel@lists.freedesktop.org, swboyd@chromium.org,
	seanpaul@chromium.org, laurent.pinchart@ideasonboard.com,
	quic_jesszhan@quicinc.com, quic_aravindh@quicinc.com
Subject: Re: [PATCH v2 14/17] drm/msm/dpu: add the writeback connector layer
Date: Wed, 20 Apr 2022 12:10:14 -0700	[thread overview]
Message-ID: <0ed00c12-2225-3ed2-1c5e-0005a8c2a8b0@quicinc.com> (raw)
In-Reply-To: <e889b486-4325-2831-9e8b-8bc63e33ac0a@linaro.org>



On 4/20/2022 12:52 AM, Dmitry Baryshkov wrote:
> On 20/04/2022 04:46, Abhinav Kumar wrote:
>> Introduce the dpu_writeback module which serves as the
>> interface between dpu operations and the drm_writeback.
>>
>> This module manages the connector related operations for
>> dpu writeback.
>>
>> changes in v2:
>>     - start using drm_writeback_connector_init_with_encoder()
>>     - drop unnecessary arguments from dpu_writeback_init()
>>     - rebase on msm-next tip and remove usage of priv->connectors
>>
>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>> ---
>>   drivers/gpu/drm/msm/Makefile                  |  1 +
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 68 
>> +++++++++++++++++++++++++++
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h | 25 ++++++++++
>>   3 files changed, 94 insertions(+)
>>   create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
>>   create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h
>>
>> diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile
>> index 0387f22..66395ee 100644
>> --- a/drivers/gpu/drm/msm/Makefile
>> +++ b/drivers/gpu/drm/msm/Makefile
>> @@ -80,6 +80,7 @@ msm-$(CONFIG_DRM_MSM_DPU) += \
>>       disp/dpu1/dpu_plane.o \
>>       disp/dpu1/dpu_rm.o \
>>       disp/dpu1/dpu_vbif.o \
>> +    disp/dpu1/dpu_writeback.o
>>   msm-$(CONFIG_DRM_MSM_MDSS) += \
>>       msm_mdss.o \
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
>> new file mode 100644
>> index 0000000..526d884
>> --- /dev/null
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
>> @@ -0,0 +1,68 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 
>> reserved.
>> + */
>> +
>> +#include "dpu_writeback.h"
>> +
>> +static int dpu_wb_conn_get_modes(struct drm_connector *connector)
>> +{
>> +    struct drm_device *dev = connector->dev;
>> +
>> +    return drm_add_modes_noedid(connector, dev->mode_config.max_width,
>> +            dev->mode_config.max_height);
>> +}
>> +
>> +static const struct drm_connector_funcs dpu_wb_conn_funcs = {
>> +    .reset = drm_atomic_helper_connector_reset,
>> +    .fill_modes = drm_helper_probe_single_connector_modes,
>> +    .destroy = drm_connector_cleanup,
>> +    .atomic_duplicate_state = 
>> drm_atomic_helper_connector_duplicate_state,
>> +    .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
>> +};
>> +
>> +static int dpu_wb_conn_prepare_job(struct drm_writeback_connector 
>> *connector,
>> +        struct drm_writeback_job *job)
>> +{
>> +    if (!job->fb)
>> +        return 0;
>> +
>> +    dpu_encoder_prepare_wb_job(connector->encoder, job);
>> +
>> +    return 0;
>> +}
>> +
>> +static void dpu_wb_conn_cleanup_job(struct drm_writeback_connector 
>> *connector,
>> +        struct drm_writeback_job *job)
>> +{
>> +    if (!job->fb)
>> +        return;
>> +
>> +    dpu_encoder_cleanup_wb_job(connector->encoder, job);
>> +}
>> +
>> +static const struct drm_connector_helper_funcs 
>> dpu_wb_conn_helper_funcs = {
>> +    .get_modes = dpu_wb_conn_get_modes,
>> +    .prepare_writeback_job = dpu_wb_conn_prepare_job,
>> +    .cleanup_writeback_job = dpu_wb_conn_cleanup_job,
>> +};
>> +
>> +int dpu_writeback_init(struct drm_device *dev, struct drm_encoder *enc,
>> +        const u32 *format_list, u32 num_formats)
>> +{
>> +    struct dpu_wb_connector *dpu_wb_conn;
>> +    int rc = 0;
>> +
>> +    dpu_wb_conn = devm_kzalloc(dev->dev, sizeof(*dpu_wb_conn), 
>> GFP_KERNEL);
>> +
>> +    drm_connector_helper_add(&dpu_wb_conn->base.base, 
>> &dpu_wb_conn_helper_funcs);
>> +
>> +    /* DPU initializes the encoder and sets it up completely for 
>> writeback
>> +     * cases and hence should use the new API 
>> drm_writeback_connector_init_with_encoder
>> +     * to initialize the writeback connector
>> +     */
>> +    rc = drm_writeback_connector_init_with_encoder(dev, 
>> &dpu_wb_conn->base, enc,
>> +            &dpu_wb_conn_funcs, format_list, num_formats);
>> +
>> +    return rc;
>> +}
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h
>> new file mode 100644
>> index 0000000..05aff05
>> --- /dev/null
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h
>> @@ -0,0 +1,25 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +/*
>> + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 
>> reserved.
>> + */
>> +
>> +#ifndef _DPU_WRITEBACK_H
>> +#define _DPU_WRITEBACK_H
>> +
>> +#include <drm/drm_crtc.h>
>> +#include <drm/drm_file.h>
>> +#include <drm/drm_probe_helper.h>
>> +#include <drm/drm_writeback.h>
>> +
>> +#include "msm_drv.h"
>> +#include "dpu_kms.h"
>> +#include "dpu_encoder_phys.h"
>> +
>> +struct dpu_wb_connector {
>> +    struct drm_writeback_connector base;
>> +};
> 
> Do you plan to add more fields to this struct? If not, we can probably 
> drop it and use struct drm_writeback_connector directly.

Glad you asked about it. I was expecting this question because it looks 
like a very "light" struct.

Yes, we do plan to expand this as we will keep adding writeback features 
sequentially now to make it ready for this to be absorbed downstream 
completely.

> 
>> +
>> +int dpu_writeback_init(struct drm_device *dev, struct drm_encoder *enc,
>> +        const u32 *format_list, u32 num_formats);
>> +
>> +#endif /*_DPU_WRITEBACK_H */
> 
> 

  reply	other threads:[~2022-04-20 19:10 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  1:45 [PATCH v2 00/17] Add writeback block support for DPU Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 01/17] drm: allow passing possible_crtcs to drm_writeback_connector_init() Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 02/17] drm: introduce drm_writeback_connector_init_with_encoder() API Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 03/17] drm: allow real encoder to be passed for drm_writeback_connector Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 04/17] drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog Abhinav Kumar
2022-04-21 12:16   ` Liviu Dudau
2022-04-22 23:08     ` Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 05/17] drm/msm/dpu: add reset_intf_cfg operation for dpu_hw_ctl Abhinav Kumar
2022-04-20  7:02   ` Dmitry Baryshkov
2022-04-20  1:45 ` [PATCH v2 06/17] drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks Abhinav Kumar
2022-04-20  7:20   ` Dmitry Baryshkov
2022-04-20 17:01     ` Abhinav Kumar
2022-04-20 17:49       ` Dmitry Baryshkov
2022-04-20 18:11         ` Abhinav Kumar
2022-04-20 18:49           ` Dmitry Baryshkov
2022-04-20  1:45 ` [PATCH v2 07/17] drm/msm/dpu: add writeback blocks to DPU RM Abhinav Kumar
2022-04-20  6:47   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 08/17] drm/msm/dpu: add changes to support writeback in hw_ctl Abhinav Kumar
2022-04-20  6:59   ` Dmitry Baryshkov
2022-04-20 17:16     ` Abhinav Kumar
2022-04-20 18:48       ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 09/17] drm/msm/dpu: add an API to reset the encoder related hw blocks Abhinav Kumar
2022-04-20  7:23   ` Dmitry Baryshkov
2022-04-20 21:28     ` Abhinav Kumar
2022-04-20 22:42       ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 10/17] drm/msm/dpu: make changes to dpu_encoder to support virtual encoder Abhinav Kumar
2022-04-20  7:44   ` Dmitry Baryshkov
2022-04-20 17:41     ` Abhinav Kumar
2022-04-20 18:37       ` Dmitry Baryshkov
2022-04-20 18:46         ` [Freedreno] " Abhinav Kumar
2022-04-20 22:06           ` Abhinav Kumar
2022-04-20 22:38             ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 11/17] drm/msm/dpu: add encoder operations to prepare/cleanup wb job Abhinav Kumar
2022-04-20  1:46 ` [PATCH v2 12/17] drm/msm/dpu: move _dpu_plane_get_qos_lut to dpu_hw_util file Abhinav Kumar
2022-04-20  7:26   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 13/17] drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback Abhinav Kumar
2022-04-20  7:49   ` Dmitry Baryshkov
2022-04-20 18:17     ` Abhinav Kumar
2022-04-20 19:26       ` Dmitry Baryshkov
2022-04-20 19:36         ` Abhinav Kumar
2022-04-20 19:37           ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 14/17] drm/msm/dpu: add the writeback connector layer Abhinav Kumar
2022-04-20  7:52   ` Dmitry Baryshkov
2022-04-20 19:10     ` Abhinav Kumar [this message]
2022-04-20 19:26       ` Dmitry Baryshkov
2022-04-20 19:26   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 15/17] drm/msm/dpu: initialize dpu encoder and connector for writeback Abhinav Kumar
2022-04-20  7:54   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 16/17] drm/msm/dpu: gracefully handle null fb commits " Abhinav Kumar
2022-04-20  7:55   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 17/17] drm/msm/dpu: add writeback blocks to the display 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=0ed00c12-2225-3ed2-1c5e-0005a8c2a8b0@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=liviu.dudau@arm.com \
    --cc=markyacoub@chromium.org \
    --cc=quic_aravindh@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=seanpaul@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.