From: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
To: linux-renesas-soc@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com,
dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
magnus.damm@gmail.com,
Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Subject: [PATCH v1.5 5/6] v4l: vsp1: Provide display list and VB2 queue with FCP device
Date: Fri, 9 Dec 2016 13:35:11 +0100 [thread overview]
Message-ID: <1481286912-16555-6-git-send-email-ulrich.hecht+renesas@gmail.com> (raw)
In-Reply-To: <1481286912-16555-1-git-send-email-ulrich.hecht+renesas@gmail.com>
Prevents IPMMU trap during boot on r8a7795/6 Salvator-X boards:
ipmmu-vmsa febd0000.mmu: Unhandled faut: status 0x00000101 iova 0x7f09a000
Code by Magnus Damm.
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
---
drivers/media/platform/vsp1/vsp1_dl.c | 12 +++++++++---
drivers/media/platform/vsp1/vsp1_video.c | 6 +++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index ad545af..f610c88 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -17,6 +17,8 @@
#include <linux/slab.h>
#include <linux/workqueue.h>
+#include <media/rcar-fcp.h>
+
#include "vsp1.h"
#include "vsp1_dl.h"
@@ -133,12 +135,13 @@ static int vsp1_dl_body_init(struct vsp1_device *vsp1,
size_t extra_size)
{
size_t size = num_entries * sizeof(*dlb->entries) + extra_size;
+ struct device *fcp = rcar_fcp_get_device(vsp1->fcp);
dlb->vsp1 = vsp1;
dlb->size = size;
- dlb->entries = dma_alloc_wc(vsp1->dev, dlb->size, &dlb->dma,
- GFP_KERNEL);
+ dlb->entries = dma_alloc_wc(fcp ? fcp : vsp1->dev,
+ dlb->size, &dlb->dma, GFP_KERNEL);
if (!dlb->entries)
return -ENOMEM;
@@ -150,7 +153,10 @@ static int vsp1_dl_body_init(struct vsp1_device *vsp1,
*/
static void vsp1_dl_body_cleanup(struct vsp1_dl_body *dlb)
{
- dma_free_wc(dlb->vsp1->dev, dlb->size, dlb->entries, dlb->dma);
+ struct device *fcp = rcar_fcp_get_device(dlb->vsp1->fcp);
+
+ dma_free_wc(fcp ? fcp : dlb->vsp1->dev,
+ dlb->size, dlb->entries, dlb->dma);
}
/**
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index 41e8b09..8f8e57e 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -27,6 +27,8 @@
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
+#include <media/rcar-fcp.h>
+
#include "vsp1.h"
#include "vsp1_bru.h"
#include "vsp1_dl.h"
@@ -1094,6 +1096,7 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
{
struct vsp1_video *video;
const char *direction;
+ struct device *fcp;
int ret;
video = devm_kzalloc(vsp1->dev, sizeof(*video), GFP_KERNEL);
@@ -1151,7 +1154,8 @@ struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
video->queue.ops = &vsp1_video_queue_qops;
video->queue.mem_ops = &vb2_dma_contig_memops;
video->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
- video->queue.dev = video->vsp1->dev;
+ fcp = rcar_fcp_get_device(vsp1->fcp);
+ video->queue.dev = fcp ? fcp : video->vsp1->dev;
ret = vb2_queue_init(&video->queue);
if (ret < 0) {
dev_err(video->vsp1->dev, "failed to initialize vb2 queue\n");
--
2.7.4
next prev parent reply other threads:[~2016-12-09 12:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-09 12:35 [PATCH v1.5 0/6] R-Car DU: Fix IOMMU operation when connected to VSP Ulrich Hecht
2016-12-09 12:35 ` [PATCH v1.5 1/6] v4l: rcar-fcp: Don't get/put module reference Ulrich Hecht
2016-12-09 12:35 ` [PATCH v1.5 2/6] v4l: rcar-fcp: Add an API to retrieve the FCP device Ulrich Hecht
2016-12-09 12:35 ` [PATCH v1.5 3/6] v4l: vsp1: Add API to map and unmap DRM buffers through the VSP Ulrich Hecht
2016-12-09 12:35 ` [PATCH v1.5 4/6] drm: rcar-du: Map memory through the VSP device Ulrich Hecht
2016-12-09 12:35 ` Ulrich Hecht [this message]
2016-12-09 12:35 ` [PATCH v1.5 6/6] arm64: dts: r8a7796: Connect FCP devices to IPMMU Ulrich Hecht
2017-08-30 8:46 ` [PATCH v1.5 0/6] R-Car DU: Fix IOMMU operation when connected to VSP Simon Horman
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=1481286912-16555-6-git-send-email-ulrich.hecht+renesas@gmail.com \
--to=ulrich.hecht+renesas@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
/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).