From patchwork Sun May 22 16:28:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72EA4C46467 for ; Sun, 22 May 2022 16:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349163AbiEVQ2d (ORCPT ); Sun, 22 May 2022 12:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348017AbiEVQ22 (ORCPT ); Sun, 22 May 2022 12:28:28 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D4BB14087; Sun, 22 May 2022 09:28:27 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 188C6CCD4E; Sun, 22 May 2022 16:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236900; bh=ZlU+QqaeeUpgg6ydwdW9tHYSbBg1JjP1qdMb8cM8JSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hP3NdJf6PTBiI/nZloaHgFq06IVg0B4nvzxBOzwW1puRDXe7bq3v9VvUKjhtE3ZAn tWEeap2QOohVKt/BdbTAWCpfv23yPfccYqkUeOapjMPbABlc8d9MSEMG/Ru5uF5Zad P7JbsE9Np1pU1STE6hVEcHDsT0xZKNJGpJRN/uZ8= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974 Date: Sun, 22 May 2022 18:28:02 +0200 Message-Id: <20220522162802.208275-15-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Remove IOMMU_DMA dependency from VIDEO_QCOM_CAMSS: We don't have IOMMU on msm8974 yet. DMA_SG -> DMA_CONTIG: Taking a photo without this works but is offset and doing weird stuff. Signed-off-by: Luca Weiss --- drivers/media/platform/qcom/camss/Kconfig | 4 ++-- drivers/media/platform/qcom/camss/camss-video.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/camss/Kconfig b/drivers/media/platform/qcom/camss/Kconfig index 4eda48cb1adf..e382fd77ecc3 100644 --- a/drivers/media/platform/qcom/camss/Kconfig +++ b/drivers/media/platform/qcom/camss/Kconfig @@ -2,8 +2,8 @@ config VIDEO_QCOM_CAMSS tristate "Qualcomm V4L2 Camera Subsystem driver" depends on V4L_PLATFORM_DRIVERS depends on VIDEO_DEV - depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST + depends on ARCH_QCOM || COMPILE_TEST select MEDIA_CONTROLLER select VIDEO_V4L2_SUBDEV_API - select VIDEOBUF2_DMA_SG + select VIDEOBUF2_DMA_CONTIG select V4L2_FWNODE diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index ca955808fd6d..885a809cc941 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "camss-video.h" #include "camss.h" @@ -410,15 +410,15 @@ static int video_buf_init(struct vb2_buffer *vb) vb); const struct v4l2_pix_format_mplane *format = &video->active_fmt.fmt.pix_mp; - struct sg_table *sgt; + //struct sg_table *sgt; unsigned int i; for (i = 0; i < format->num_planes; i++) { - sgt = vb2_dma_sg_plane_desc(vb, i); - if (!sgt) - return -EFAULT; + //sgt = vb2_dma_sg_plane_desc(vb, i); + //if (!sgt) + // return -EFAULT; - buffer->addr[i] = sg_dma_address(sgt->sgl); + buffer->addr[i] = vb2_dma_contig_plane_dma_addr(vb, i); //sg_dma_address(sgt->sgl); } if (format->pixelformat == V4L2_PIX_FMT_NV12 || @@ -966,7 +966,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, q = &video->vb2_q; q->drv_priv = video; - q->mem_ops = &vb2_dma_sg_memops; + q->mem_ops = &vb2_dma_contig_memops; q->ops = &msm_video_vb2_q_ops; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; q->io_modes = VB2_DMABUF | VB2_MMAP | VB2_READ;