From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>,
dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
robdclark@gmail.com, seanpaul@chromium.org, swboyd@chromium.org,
nganji@codeaurora.org, aravindh@codeaurora.org, daniel@ffwll.ch,
markyacoub@chromium.org, quic_jesszhan@quicinc.com
Subject: Re: [PATCH 09/12] drm/msm/dpu: add the writeback connector layer
Date: Sat, 5 Feb 2022 02:24:07 +0300 [thread overview]
Message-ID: <f13e4fda-1dbb-5e48-35fc-ce0e87cde861@linaro.org> (raw)
In-Reply-To: <1644009445-17320-10-git-send-email-quic_abhinavk@quicinc.com>
On 05/02/2022 00:17, 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.
>
> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> ---
> drivers/gpu/drm/msm/Makefile | 1 +
> drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 71 +++++++++++++++++++++++++++
> drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h | 27 ++++++++++
> 3 files changed, 99 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 3abaf84..05a8515 100644
> --- a/drivers/gpu/drm/msm/Makefile
> +++ b/drivers/gpu/drm/msm/Makefile
> @@ -74,6 +74,7 @@ msm-y := \
> disp/dpu1/dpu_plane.o \
> disp/dpu1/dpu_rm.o \
> disp/dpu1/dpu_vbif.o \
> + disp/dpu1/dpu_writeback.o \
> disp/msm_disp_snapshot.o \
> disp/msm_disp_snapshot_util.o \
> msm_atomic.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..7b61fad
> --- /dev/null
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
> @@ -0,0 +1,71 @@
> +// 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 struct drm_encoder_helper_funcs *enc_helper_funcs, const u32 *format_list,
> + u32 num_formats)
the enc_helper_funcs is always dpu_encoder_helper_funcs here. And
enc->helper_private is already initalized. You can drop the argument.
> +{
> + struct msm_drm_private *priv = dev->dev_private;
> + struct dpu_wb_connector *dpu_wb_conn;
> + int rc = 0;
> +
> + dpu_wb_conn = devm_kzalloc(dev->dev, sizeof(*dpu_wb_conn), GFP_KERNEL);
> + dpu_wb_conn->base.base = &dpu_wb_conn->connector;
> + dpu_wb_conn->base.encoder = enc;
> +
> + drm_connector_helper_add(dpu_wb_conn->base.base, &dpu_wb_conn_helper_funcs);
> +
> + rc = drm_writeback_connector_init(dev, &dpu_wb_conn->base,
> + &dpu_wb_conn_funcs, enc_helper_funcs,
> + format_list, num_formats);
> +
> + priv->connectors[priv->num_connectors++] = dpu_wb_conn->base.base;
> +
> + 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..206ce5e
> --- /dev/null
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.h
> @@ -0,0 +1,27 @@
> +/* 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_connector connector;
> + struct drm_writeback_connector base;
> +};
> +
> +int dpu_writeback_init(struct drm_device *dev, struct drm_encoder *enc,
> + const struct drm_encoder_helper_funcs *enc_helper_funcs,
> + const u32 *format_list, u32 num_formats);
> +
> +#endif /*_DPU_WRITEBACK_H */
--
With best wishes
Dmitry
next prev parent reply other threads:[~2022-02-04 23:24 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 21:17 [PATCH 00/12] Add writeback block support for DPU Abhinav Kumar
2022-02-04 21:17 ` [PATCH 01/12] drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog Abhinav Kumar
2022-02-04 22:48 ` Dmitry Baryshkov
2022-02-04 21:17 ` [PATCH 02/12] drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks Abhinav Kumar
2022-02-04 22:56 ` Dmitry Baryshkov
2022-04-14 21:28 ` Abhinav Kumar
2022-04-14 21:41 ` Dmitry Baryshkov
2022-02-04 21:17 ` [PATCH 03/12] drm/msm/dpu: add writeback blocks to DPU RM Abhinav Kumar
2022-02-04 23:43 ` Dmitry Baryshkov
2022-04-14 21:30 ` Abhinav Kumar
2022-02-04 21:17 ` [PATCH 04/12] drm/msm/dpu: add changes to support writeback in hw_ctl Abhinav Kumar
2022-02-04 22:19 ` Dmitry Baryshkov
2022-04-14 21:50 ` Abhinav Kumar
2022-04-14 23:25 ` Dmitry Baryshkov
2022-04-15 0:01 ` Abhinav Kumar
2022-04-15 0:19 ` Dmitry Baryshkov
2022-04-15 0:27 ` [Freedreno] " Abhinav Kumar
2022-04-15 0:30 ` Abhinav Kumar
2022-02-04 21:17 ` [PATCH 05/12] drm/msm/dpu: add an API to reset the encoder related hw blocks Abhinav Kumar
2022-02-04 23:46 ` Dmitry Baryshkov
2022-04-14 21:53 ` Abhinav Kumar
2022-02-04 21:17 ` [PATCH 06/12] drm/msm/dpu: make changes to dpu_encoder to support virtual encoder Abhinav Kumar
2022-02-04 23:36 ` Dmitry Baryshkov
2022-04-14 21:54 ` Abhinav Kumar
2022-04-14 22:26 ` Marijn Suijten
2022-04-14 22:30 ` [Freedreno] " Abhinav Kumar
2022-04-15 19:25 ` Abhinav Kumar
2022-04-15 23:14 ` Marijn Suijten
2022-02-04 21:17 ` [PATCH 07/12] drm/msm/dpu: add encoder operations to prepare/cleanup wb job Abhinav Kumar
2022-02-04 23:42 ` Dmitry Baryshkov
2022-02-04 21:17 ` [PATCH 08/12] drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback Abhinav Kumar
2022-02-04 23:19 ` Dmitry Baryshkov
2022-04-14 22:16 ` [Freedreno] " Abhinav Kumar
2022-04-15 0:24 ` Dmitry Baryshkov
2022-04-19 20:19 ` Abhinav Kumar
2022-02-04 21:17 ` [PATCH 09/12] drm/msm/dpu: add the writeback connector layer Abhinav Kumar
2022-02-04 23:24 ` Dmitry Baryshkov [this message]
2022-02-04 21:17 ` [PATCH 10/12] drm/msm/dpu: initialize dpu encoder and connector for writeback Abhinav Kumar
2022-02-04 22:34 ` Dmitry Baryshkov
2022-04-14 22:21 ` [Freedreno] " Abhinav Kumar
2022-02-04 21:17 ` [PATCH 11/12] drm/msm/dpu: gracefully handle null fb commits " Abhinav Kumar
2022-02-04 22:43 ` Dmitry Baryshkov
2022-04-14 23:17 ` Abhinav Kumar
2022-04-15 0:36 ` Dmitry Baryshkov
2022-04-15 1:50 ` Abhinav Kumar
2022-02-04 21:17 ` [PATCH 12/12] drm/msm/dpu: add writeback blocks to the display snapshot Abhinav Kumar
2022-02-04 22:36 ` Dmitry Baryshkov
2022-03-03 22:46 ` [PATCH 00/12] Add writeback block support for DPU Stephen Boyd
2022-03-03 23:40 ` 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=f13e4fda-1dbb-5e48-35fc-ce0e87cde861@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=aravindh@codeaurora.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=markyacoub@chromium.org \
--cc=nganji@codeaurora.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_jesszhan@quicinc.com \
--cc=robdclark@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox