dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: [PATCH v2 02/14] v4l: vsp1: Don't recycle active list at display start
Date: Mon, 26 Jun 2017 21:12:14 +0300	[thread overview]
Message-ID: <20170626181226.29575-3-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <20170626181226.29575-1-laurent.pinchart+renesas@ideasonboard.com>

When the display start interrupt occurs, we know that the hardware has
finished loading the active display list. The driver then proceeds to
recycle the list, assuming it won't be needed anymore.

This assumption holds true for headerless display lists, as the VSP
doesn't reload the list for the next frame if it hasn't changed.
However, this isn't true anymore for header display lists, as they are
loaded at every frame start regardless of whether they have been
updated.

To prepare for header display lists usage in display pipelines, we need
to postpone recycling the list until it gets replaced by a new one
through a page flip. The driver already does so in the frame end
interrupt handler, so all we need is to skip list recycling in the
display start interrupt handler.

While the active list can be recycled at display start for headerless
display lists, there's no real harm in postponing that to the frame end
interrupt handler in all cases. This simplifies interrupt handling as we
don't need to process the display start interrupt anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_dl.c  | 16 ----------------
 drivers/media/platform/vsp1/vsp1_dl.h  |  1 -
 drivers/media/platform/vsp1/vsp1_drm.c | 12 ++++--------
 drivers/media/platform/vsp1/vsp1_drm.h |  2 --
 drivers/media/platform/vsp1/vsp1_drv.c |  8 --------
 5 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index dc47e236c780..bb92be4fe0f0 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -547,22 +547,6 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl)
  * Display List Manager
  */
 
-/* Interrupt Handling */
-void vsp1_dlm_irq_display_start(struct vsp1_dl_manager *dlm)
-{
-	spin_lock(&dlm->lock);
-
-	/*
-	 * The display start interrupt signals the end of the display list
-	 * processing by the device. The active display list, if any, won't be
-	 * accessed anymore and can be reused.
-	 */
-	__vsp1_dl_list_put(dlm->active);
-	dlm->active = NULL;
-
-	spin_unlock(&dlm->lock);
-}
-
 /**
  * vsp1_dlm_irq_frame_end - Display list handler for the frame end interrupt
  * @dlm: the display list manager
diff --git a/drivers/media/platform/vsp1/vsp1_dl.h b/drivers/media/platform/vsp1/vsp1_dl.h
index 6ec1380a10af..ee3508172f0a 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.h
+++ b/drivers/media/platform/vsp1/vsp1_dl.h
@@ -27,7 +27,6 @@ struct vsp1_dl_manager *vsp1_dlm_create(struct vsp1_device *vsp1,
 					unsigned int prealloc);
 void vsp1_dlm_destroy(struct vsp1_dl_manager *dlm);
 void vsp1_dlm_reset(struct vsp1_dl_manager *dlm);
-void vsp1_dlm_irq_display_start(struct vsp1_dl_manager *dlm);
 bool vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm);
 
 struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm);
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
index 9377aafa8996..bc3fd9bc7126 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -32,11 +32,6 @@
  * Interrupt Handling
  */
 
-void vsp1_drm_display_start(struct vsp1_device *vsp1)
-{
-	vsp1_dlm_irq_display_start(vsp1->drm->pipe.output->dlm);
-}
-
 static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe)
 {
 	struct vsp1_drm *drm = to_vsp1_drm(pipe);
@@ -224,6 +219,10 @@ int vsp1_du_setup_lif(struct device *dev, const struct vsp1_du_lif_config *cfg)
 		return ret;
 	}
 
+	/* Disable the display interrupts. */
+	vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0);
+	vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0);
+
 	dev_dbg(vsp1->dev, "%s: pipeline enabled\n", __func__);
 
 	return 0;
@@ -529,13 +528,10 @@ void vsp1_du_atomic_flush(struct device *dev)
 
 	/* Start or stop the pipeline if needed. */
 	if (!vsp1->drm->num_inputs && pipe->num_inputs) {
-		vsp1_write(vsp1, VI6_DISP_IRQ_STA, 0);
-		vsp1_write(vsp1, VI6_DISP_IRQ_ENB, VI6_DISP_IRQ_ENB_DSTE);
 		spin_lock_irqsave(&pipe->irqlock, flags);
 		vsp1_pipeline_run(pipe);
 		spin_unlock_irqrestore(&pipe->irqlock, flags);
 	} else if (vsp1->drm->num_inputs && !pipe->num_inputs) {
-		vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0);
 		vsp1_pipeline_stop(pipe);
 	}
 }
diff --git a/drivers/media/platform/vsp1/vsp1_drm.h b/drivers/media/platform/vsp1/vsp1_drm.h
index e9f80727ff92..cbdbb8a39883 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.h
+++ b/drivers/media/platform/vsp1/vsp1_drm.h
@@ -50,6 +50,4 @@ int vsp1_drm_init(struct vsp1_device *vsp1);
 void vsp1_drm_cleanup(struct vsp1_device *vsp1);
 int vsp1_drm_create_links(struct vsp1_device *vsp1);
 
-void vsp1_drm_display_start(struct vsp1_device *vsp1);
-
 #endif /* __VSP1_DRM_H__ */
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index 95c26edead85..6b35e043b554 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -68,14 +68,6 @@ static irqreturn_t vsp1_irq_handler(int irq, void *data)
 		}
 	}
 
-	status = vsp1_read(vsp1, VI6_DISP_IRQ_STA);
-	vsp1_write(vsp1, VI6_DISP_IRQ_STA, ~status & VI6_DISP_IRQ_STA_DST);
-
-	if (status & VI6_DISP_IRQ_STA_DST) {
-		vsp1_drm_display_start(vsp1);
-		ret = IRQ_HANDLED;
-	}
-
 	return ret;
 }
 
-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2017-06-26 18:12 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 18:12 [PATCH v2 00/14] Renesas R-Car VSP: Add H3 ES2.0 support Laurent Pinchart
2017-06-26 18:12 ` [PATCH v2 01/14] v4l: vsp1: Fill display list headers without holding dlm spinlock Laurent Pinchart
2017-07-13 12:48   ` Kieran Bingham
2017-07-20 13:50     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` Laurent Pinchart [this message]
2017-07-13 17:02   ` [PATCH v2 02/14] v4l: vsp1: Don't recycle active list at display start Kieran Bingham
2017-07-20 13:51     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 03/14] v4l: vsp1: Don't set WPF sink pointer Laurent Pinchart
2017-07-13 12:50   ` Kieran Bingham
2017-07-20 13:52     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 04/14] v4l: vsp1: Store source and sink pointers as vsp1_entity Laurent Pinchart
2017-07-13 13:00   ` Kieran Bingham
2017-07-20 13:53     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 05/14] v4l: vsp1: Don't create links for DRM pipeline Laurent Pinchart
2017-07-13 13:06   ` Kieran Bingham
2017-07-20 13:54     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 06/14] v4l: vsp1: Add pipe index argument to the VSP-DU API Laurent Pinchart
2017-07-13 13:16   ` Kieran Bingham
2017-07-13 23:04     ` Laurent Pinchart
2017-07-20 13:56       ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 07/14] v4l: vsp1: Add support for the BRS entity Laurent Pinchart
2017-07-13 13:38   ` Kieran Bingham
2017-07-20 13:58     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 08/14] v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances Laurent Pinchart
2017-07-13 17:49   ` Kieran Bingham
2017-07-13 23:31     ` Laurent Pinchart
2017-07-14  7:36       ` Kieran Bingham
2017-07-14  0:35   ` [PATCH v2.1 " Laurent Pinchart
2017-07-20 13:59     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 09/14] v4l: vsp1: Add support for multiple LIF instances Laurent Pinchart
2017-07-13 17:57   ` Kieran Bingham
2017-07-20 14:00     ` Mauro Carvalho Chehab
2017-06-26 18:12 ` [PATCH v2 10/14] v4l: vsp1: Add support for multiple DRM pipelines Laurent Pinchart
2017-07-20 14:02   ` Mauro Carvalho Chehab
2017-08-01 18:39   ` Kieran Bingham
2017-06-26 18:12 ` [PATCH v2 11/14] v4l: vsp1: Add support for header display lists in continuous mode Laurent Pinchart
2017-07-20 14:03   ` Mauro Carvalho Chehab
2017-08-01 17:35   ` Kieran Bingham
2017-08-01 18:47     ` Laurent Pinchart
2017-08-02 11:06       ` Kieran Bingham
2017-06-26 18:12 ` [PATCH v2 12/14] drm: rcar-du: Support multiple sources from the same VSP Laurent Pinchart
2017-08-01 18:10   ` Kieran Bingham
2017-08-01 19:01     ` Laurent Pinchart
2017-06-26 18:12 ` [PATCH v2 13/14] drm: rcar-du: Restrict DPLL duty cycle workaround to H3 ES1.x Laurent Pinchart
2017-08-01 14:06   ` Kieran Bingham
2017-08-01 18:39     ` Laurent Pinchart
2017-12-11 20:58     ` Laurent Pinchart
2017-06-26 18:12 ` [PATCH v2 14/14] drm: rcar-du: Configure DPAD0 routing through last group on Gen3 Laurent Pinchart
2017-08-01 13:46   ` Kieran Bingham
2017-08-01 13:51     ` Laurent Pinchart
2017-08-01 17:20   ` [PATCH v2.1 " Laurent Pinchart
2017-08-01 17:23     ` Kieran Bingham
2017-07-13 12:25 ` [PATCH v2 00/14] Renesas R-Car VSP: Add H3 ES2.0 support Kieran Bingham
2017-07-14  0:54   ` Laurent Pinchart
2017-07-18 13:03 ` Hans Verkuil

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=20170626181226.29575-3-laurent.pinchart+renesas@ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).