From patchwork Mon Jan 28 20:55:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10784747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E84D913B5 for ; Mon, 28 Jan 2019 20:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D814E2BF4D for ; Mon, 28 Jan 2019 20:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC5DD29C61; Mon, 28 Jan 2019 20:55:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DB332BF6B for ; Mon, 28 Jan 2019 20:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728016AbfA1UzY (ORCPT ); Mon, 28 Jan 2019 15:55:24 -0500 Received: from mailoutvs60.siol.net ([185.57.226.251]:40933 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727969AbfA1UzX (ORCPT ); Mon, 28 Jan 2019 15:55:23 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 81262521849; Mon, 28 Jan 2019 21:55:20 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hKTnKBSjbJR3; Mon, 28 Jan 2019 21:55:20 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id 22BF2521CC1; Mon, 28 Jan 2019 21:55:20 +0100 (CET) Received: from localhost.localdomain (cpe1-8-82.cable.triera.net [213.161.8.82]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id 716D6521849; Mon, 28 Jan 2019 21:55:17 +0100 (CET) From: Jernej Skrabec To: maxime.ripard@bootlin.com, wens@csie.org Cc: mchehab@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH 2/6] media: cedrus: Add a quirk for not setting DMA offset Date: Mon, 28 Jan 2019 21:55:00 +0100 Message-Id: <20190128205504.11225-3-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128205504.11225-1-jernej.skrabec@siol.net> References: <20190128205504.11225-1-jernej.skrabec@siol.net> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP H6 VPU doesn't work if DMA offset is set. Add a quirk for it. Signed-off-by: Jernej Skrabec Acked-by: Maxime Ripard --- drivers/staging/media/sunxi/cedrus/cedrus.h | 3 +++ drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h index 4aedd24a9848..c57c04b41d2e 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h @@ -28,6 +28,8 @@ #define CEDRUS_CAPABILITY_UNTILED BIT(0) +#define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0) + enum cedrus_codec { CEDRUS_CODEC_MPEG2, @@ -91,6 +93,7 @@ struct cedrus_dec_ops { struct cedrus_variant { unsigned int capabilities; + unsigned int quirks; }; struct cedrus_dev { diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c index 0acf219a8c91..fbfff7c1c771 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c @@ -177,7 +177,8 @@ int cedrus_hw_probe(struct cedrus_dev *dev) */ #ifdef PHYS_PFN_OFFSET - dev->dev->dma_pfn_offset = PHYS_PFN_OFFSET; + if (!(variant->quirks & CEDRUS_QUIRK_NO_DMA_OFFSET)) + dev->dev->dma_pfn_offset = PHYS_PFN_OFFSET; #endif ret = of_reserved_mem_device_init(dev->dev);