linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
Cc: dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-media@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Michal Simek <michal.simek@amd.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH v3 5/9] drm: xlnx: zynqmp_dpsub: Minimize usage of global flag
Date: Fri, 5 Apr 2024 15:42:45 +0300	[thread overview]
Message-ID: <bf489c6e-8b9e-4e60-8874-1498f183a987@ideasonboard.com> (raw)
In-Reply-To: <20240321-dp-live-fmt-v3-5-d5090d796b7e@amd.com>

On 21/03/2024 22:43, Anatoliy Klymenko wrote:
> Avoid usage of global zynqmp_dpsub.dma_enabled flag in DPSUB layer
> context. This flag signals whether the driver runs in DRM CRTC or DRM
> bridge mode, assuming that all display layers share the same live or
> non-live mode of operation. Using per-layer mode instead of global flag
> will simplify future support of the hybrid scenario.
> 
> Remove redundant checks in DMA request/release contexts as
> zynqmp_disp_layer.info is well-defined for all layer types, including the
> correct number of DMA channels required for each particular layer.
> 
> Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
> ---
>   drivers/gpu/drm/xlnx/zynqmp_disp.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> index abdc3971b193..0c2b3f4bffa6 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> @@ -980,7 +980,7 @@ void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer)
>   {
>   	unsigned int i;
>   
> -	if (layer->disp->dpsub->dma_enabled) {
> +	if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) {
>   		for (i = 0; i < layer->drm_fmt->num_planes; i++)
>   			dmaengine_terminate_sync(layer->dmas[i].chan);
>   	}
> @@ -1006,7 +1006,7 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer,
>   
>   	zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt);
>   
> -	if (!layer->disp->dpsub->dma_enabled)
> +	if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE)
>   		return;
>   
>   	/*
> @@ -1044,7 +1044,7 @@ int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer,
>   	const struct drm_format_info *info = layer->drm_fmt;
>   	unsigned int i;
>   
> -	if (!layer->disp->dpsub->dma_enabled)
> +	if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE)
>   		return 0;
>   
>   	for (i = 0; i < info->num_planes; i++) {
> @@ -1094,9 +1094,6 @@ static void zynqmp_disp_layer_release_dma(struct zynqmp_disp *disp,
>   {
>   	unsigned int i;
>   
> -	if (!layer->info || !disp->dpsub->dma_enabled)
> -		return;
> -
>   	for (i = 0; i < layer->info->num_channels; i++) {
>   		struct zynqmp_disp_layer_dma *dma = &layer->dmas[i];
>   
> @@ -1137,9 +1134,6 @@ static int zynqmp_disp_layer_request_dma(struct zynqmp_disp *disp,
>   	unsigned int i;
>   	int ret;
>   
> -	if (!disp->dpsub->dma_enabled)
> -		return 0;
> -
>   	for (i = 0; i < layer->info->num_channels; i++) {
>   		struct zynqmp_disp_layer_dma *dma = &layer->dmas[i];
>   		char dma_channel_name[16];
> 

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

  Tomi


  reply	other threads:[~2024-04-05 12:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 20:43 [PATCH v3 0/9] Setting live video input format for ZynqMP DPSUB Anatoliy Klymenko
2024-03-21 20:43 ` [PATCH v3 1/9] drm: xlnx: zynqmp_dpsub: Set layer mode during creation Anatoliy Klymenko
2024-04-05 12:06   ` Tomi Valkeinen
2024-04-05 12:31   ` Tomi Valkeinen
2024-04-08 18:21     ` Klymenko, Anatoliy
2024-03-21 20:43 ` [PATCH v3 2/9] drm: xlnx: zynqmp_dpsub: Update live format defines Anatoliy Klymenko
2024-04-05 12:10   ` Tomi Valkeinen
2024-04-08 18:17     ` Klymenko, Anatoliy
2024-03-21 20:43 ` [PATCH v3 3/9] drm: xlnx: zynqmp_dpsub: Add connected live layer helper Anatoliy Klymenko
2024-04-05 12:12   ` Tomi Valkeinen
2024-03-21 20:43 ` [PATCH v3 4/9] drm: xlnx: zynqmp_dpsub: Anounce supported input formats Anatoliy Klymenko
2024-04-05 12:39   ` Tomi Valkeinen
2024-03-21 20:43 ` [PATCH v3 5/9] drm: xlnx: zynqmp_dpsub: Minimize usage of global flag Anatoliy Klymenko
2024-04-05 12:42   ` Tomi Valkeinen [this message]
2024-03-21 20:43 ` [PATCH v3 6/9] drm: xlnx: zynqmp_dpsub: Set input live format Anatoliy Klymenko
2024-04-05 12:56   ` Tomi Valkeinen
2024-03-21 20:43 ` [PATCH v3 7/9] drm/atomic-helper: Add select_output_bus_format callback Anatoliy Klymenko
2024-03-22  9:44   ` Maxime Ripard
2024-03-22 19:15     ` Klymenko, Anatoliy
2024-03-21 20:43 ` [PATCH v3 8/9] dt-bindings: xlnx: Add VTC and TPG bindings Anatoliy Klymenko
2024-03-21 22:25   ` Rob Herring
2024-03-22  5:57   ` Krzysztof Kozlowski
2024-03-22  5:59   ` Krzysztof Kozlowski
2024-03-22 18:05     ` Conor Dooley
2024-03-23 10:22       ` Krzysztof Kozlowski
2024-03-23 19:08         ` Conor Dooley
2024-03-22 19:12     ` Klymenko, Anatoliy
2024-03-23 10:20       ` Krzysztof Kozlowski
2024-03-29  0:38         ` Klymenko, Anatoliy
2024-03-29 15:46           ` Conor Dooley
2024-03-30  2:02             ` Klymenko, Anatoliy
2024-03-30  9:27               ` Krzysztof Kozlowski
2024-03-21 20:43 ` [PATCH v3 9/9] drm: xlnx: Intoduce TPG CRTC driver Anatoliy Klymenko
2024-03-23 10:19 ` [PATCH v3 0/9] Setting live video input format for ZynqMP DPSUB Krzysztof Kozlowski

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=bf489c6e-8b9e-4e60-8874-1498f183a987@ideasonboard.com \
    --to=tomi.valkeinen@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=anatoliy.klymenko@amd.com \
    --cc=andrzej.hajda@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mchehab@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tzimmermann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).