From patchwork Thu Oct 20 12:13:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 617739 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 41545C4332F for ; Thu, 20 Oct 2022 12:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbiJTMNZ (ORCPT ); Thu, 20 Oct 2022 08:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiJTMNX (ORCPT ); Thu, 20 Oct 2022 08:13:23 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A44E15B33C for ; Thu, 20 Oct 2022 05:13:22 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id sc25so46847767ejc.12 for ; Thu, 20 Oct 2022 05:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iU7Ami80HgupJejJurFRg6REd9+0fdnmtvN6kf9fvrM=; b=YFmoiqdZUBvC+qFN4kk5CTQPdnf9XhwtohpUYscevmN3jNaa4iFjgNcC2RM4jiQnjB 9QQenxNMrEOb47eteh6gQCK+aTvV9QnUjsLplkE/gnlBn6ZZCmvRMolI7L7lkS8gfDJN XzpHrUX6pWw4JKBoGNh96KK6b9moEebp2+jcLNqnpX8KY/h6kpX11NqOyTWU2Us9cK70 njdXYgopNoZCXEkJZG5ecV5jI3yOTPGDQ9RiNZ3pTkUvACi07cPoLI0BEZu4xdQoiB7v a/DjTDxQFS+Y9jlzSNWjadoUcCyCE//D+fs8NQOdH80OulAh6H5w5F6WKZD3tYpl9k0y 8HUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iU7Ami80HgupJejJurFRg6REd9+0fdnmtvN6kf9fvrM=; b=LUe4PKAqcWpPu1rAQ+ibO91ApkAqoC6niVZL5lvUURf+a81EXkha9yWXczCNDHfOEx agnoBqqp2pFASPFg5s0nVz8LbUhM+oRhjqCymjWh2TW+Z27iMVi7BR9zu2JepXU1HyJP Er7I1HRPcfnMY71Icda9Ur+bfCp9DViNdl5jcAbTDXpeHCfxFyC/4Xsa30Mdklz9dicD pu+iM10JEh/FYTAnP8WA44u/AS61X+8YpwHWExAbs+nJvE+Sbe+dpfmyAqtru9mzoxSx 0IT3FtuxPFH1Uy/4LzNPahp3a3bo+kvVgo/y6JCtqTnLcW7DW1r8C7fkdWPqSXc8zGeq f9wQ== X-Gm-Message-State: ACrzQf1ZBzmyupPOb9I2qzFVCDYABknYOkxpn9QgLZRgqDNfR+ced7MM BglKjpCue8m5sGZF86JmZxE= X-Google-Smtp-Source: AMsMyM4E5G4lZ2GfE7xMWxIcUkc1BGvYjZ6cG1RBPZY7QZErHLQSw1Tvl2XS3C3UC5WoYKpuZXDWUA== X-Received: by 2002:a17:907:2d91:b0:78d:8747:71b4 with SMTP id gt17-20020a1709072d9100b0078d874771b4mr10614819ejc.545.1666268001024; Thu, 20 Oct 2022 05:13:21 -0700 (PDT) Received: from able.fritz.box (p5b0eacfe.dip0.t-ipconnect.de. [91.14.172.254]) by smtp.gmail.com with ESMTPSA id s15-20020a05640217cf00b0045467008dd0sm12091979edy.35.2022.10.20.05.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:13:20 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: l.stach@pengutronix.de, nicolas@ndufresne.ca, ppaalanen@gmail.com, sumit.semwal@linaro.org, daniel@ffwll.ch, robdclark@gmail.com, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org Cc: =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 1/3] dma-buf: add dma_coherent flag Date: Thu, 20 Oct 2022 14:13:14 +0200 Message-Id: <20221020121316.3946-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020121316.3946-1-christian.koenig@amd.com> References: <20221020121316.3946-1-christian.koenig@amd.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Start to fix the coherency issues for non PCI devices by adding a dma_coherent flag to the DMA-buf. The flag should be set by the exporter if only devices which can do coherent DMA-access with respect to the CPU cache are allowed to access the buffer. Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 5 +++++ include/linux/dma-buf.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index c40d72d318fd..7509807bf485 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -635,6 +636,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) dmabuf->priv = exp_info->priv; dmabuf->ops = exp_info->ops; + dmabuf->dma_coherent = exp_info->coherent; dmabuf->size = exp_info->size; dmabuf->exp_name = exp_info->exp_name; dmabuf->owner = exp_info->owner; @@ -894,6 +896,9 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev, if (WARN_ON(importer_ops && !importer_ops->move_notify)) return ERR_PTR(-EINVAL); + if (dmabuf->dma_coherent && !dev_is_dma_coherent(dev)) + return ERR_PTR(-EINVAL); + attach = kzalloc(sizeof(*attach), GFP_KERNEL); if (!attach) return ERR_PTR(-ENOMEM); diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 6fa8d4e29719..f2083b94b116 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -326,6 +326,20 @@ struct dma_buf { /** @ops: dma_buf_ops associated with this buffer object. */ const struct dma_buf_ops *ops; + /** + * @dma_coherent: + * + * True if the buffer is backed by DMA coherent memory with respect to + * the CPU cache even if the architecture can support incoherent + * devices. + * + * Usually mirrors the result of dev_is_dma_coherent() of the exporter, + * but can be cleared by the exporter to allow incoherent devices + * access to the buffer if the exporter takes care of coherency for CPU + * accesses. + */ + bool dma_coherent; + /** * @vmapping_counter: * @@ -524,6 +538,7 @@ struct dma_buf_attachment { * @ops: Attach allocator-defined dma buf ops to the new buffer * @size: Size of the buffer - invariant over the lifetime of the buffer * @flags: mode flags for the file + * @coherent: If DMA accesses must be coherent to the CPU cache. * @resv: reservation-object, NULL to allocate default one * @priv: Attach private data of allocator to this buffer * @@ -536,6 +551,7 @@ struct dma_buf_export_info { const struct dma_buf_ops *ops; size_t size; int flags; + bool coherent; struct dma_resv *resv; void *priv; }; From patchwork Thu Oct 20 12:13:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 616996 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 36CCBC4332F for ; Thu, 20 Oct 2022 12:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbiJTMNb (ORCPT ); Thu, 20 Oct 2022 08:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiJTMNa (ORCPT ); Thu, 20 Oct 2022 08:13:30 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FDF5187DD2 for ; Thu, 20 Oct 2022 05:13:27 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id w18so46883792ejq.11 for ; Thu, 20 Oct 2022 05:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6+v29EKFl+eJvb82q1HKwVTg2HY11/VB4Svx4P9W+lo=; b=YqFUB2RVnHN5EsUo3VW1I9AsNIcJJQLV4S+D44r9T9b6ym2gHsJKjzGJimsfO6xmbU A/+REzVhwdsNLSGCWIlcXJnVzRV5XGbNg2/RaaZKNEi53jQhLaFGPH8liVB+C996ROnc E1C7cbICnMASBOMmLMtdY6huElsnoE+NKhqTKQuA/qOlUY6R49cmAb/38cLDHTGowhY4 yUOGRnuAFJ5PnrBCfk8n9kco9tJZxEyyQWN+mfjRog96QiZ7rsio7eYITjKsjVmyrG7q jZwXCk33x8Jwjap9Zfv/JsVGZhluG1rEZaKxg0vX/31a+Q3b8L3mtUsmk97ho1lIr3Iy 5Q3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6+v29EKFl+eJvb82q1HKwVTg2HY11/VB4Svx4P9W+lo=; b=KAvAY6GbztHic6HS4B//5q/LZi6eTyZRMb2YAqeaurTcYuTnIGDR+Rm+Omx2bknc5w fW23rmR2ykYfGJmV8WX0Vt0m/vi1kWSGMQrt1KCHDF17x7aFjpIlfKMWMQiKQJnFUjNJ wCG2eyewkkfdoZ4T8E/vFhZii1+iUTyQJ4XdAlAXJqKSkUFHtH6mL1A0Hv25nJ9L223t LxxiEUg7NbxYWRgfm1L/reAuk+v1ZWNgi8Q64vkR0Fhs2FRD7jbisMlAUs7QXURjcuDT 0NLnBCB1kZfvkSLwMvBBHINUz5V3MF9dRxwVF9vv//zzwuoQxpRa4RRAo75MtlVTA/ci 0fAA== X-Gm-Message-State: ACrzQf1B8Fgz8faRxHVPTqL/cA6PI5K3+46k8bbjJC550aFhylNbXcG2 UnaNoVIS/LRq+Ju/W3v6nhw= X-Google-Smtp-Source: AMsMyM6BChwqh4PIcxBaoBdOLcOjBF6P/9MGAQWN+q+1y6+Muz30Cs5s0ZOBk0hSI0JvdUfHbEu7gA== X-Received: by 2002:a17:907:31c4:b0:78d:9b2f:4e1a with SMTP id xf4-20020a17090731c400b0078d9b2f4e1amr10731462ejb.306.1666268006079; Thu, 20 Oct 2022 05:13:26 -0700 (PDT) Received: from able.fritz.box (p5b0eacfe.dip0.t-ipconnect.de. [91.14.172.254]) by smtp.gmail.com with ESMTPSA id s15-20020a05640217cf00b0045467008dd0sm12091979edy.35.2022.10.20.05.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:13:25 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: l.stach@pengutronix.de, nicolas@ndufresne.ca, ppaalanen@gmail.com, sumit.semwal@linaro.org, daniel@ffwll.ch, robdclark@gmail.com, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org Cc: =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 2/3] drm/prime: set the dma_coherent flag for export Date: Thu, 20 Oct 2022 14:13:15 +0200 Message-Id: <20221020121316.3946-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020121316.3946-1-christian.koenig@amd.com> References: <20221020121316.3946-1-christian.koenig@amd.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When a device driver is snooping the CPU cache during access we assume that all importers need to be able to snoop the CPU cache as well. Signed-off-by: Christian König --- drivers/gpu/drm/drm_prime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 20e109a802ae..d5c70b6fe8a4 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -889,6 +890,7 @@ struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj, .size = obj->size, .flags = flags, .priv = obj, + .coherent = dev_is_dma_coherent(dev->dev), .resv = obj->resv, }; From patchwork Thu Oct 20 12:13:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 617738 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 EB3E0C433FE for ; Thu, 20 Oct 2022 12:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbiJTMNd (ORCPT ); Thu, 20 Oct 2022 08:13:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiJTMNb (ORCPT ); Thu, 20 Oct 2022 08:13:31 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A244015B126 for ; Thu, 20 Oct 2022 05:13:29 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id a67so29557788edf.12 for ; Thu, 20 Oct 2022 05:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KzSxYsG4b4l+I9q2QIs0U4YnHUtpdMnLVfBoeSrQrAc=; b=jIYrU7+t6O0+MOllWK+5mFCQMiOi/kRWuMhz3cY4alWWXmJLWcFMrHIqgYpApPm7rV w5gnQSyraFv6vlSxkrFxE/z6BH2AriwBL0nqbkLvB92duSwkVfBWFH6JxUAu1g5ugSV4 SEkz6WhzGTTTKG82PHYo5d64WY6PyQU9xaUdmVqi45fnr5pqXYxvQN/m5uzUoTh8gQHB 4e16i8/MIxm5Mcq/qeSjTxc2dXHtuDaB/PNaL7GYEQOBJp0E9Vb2xrpra+tWs5fqWogd yWC+B8e+1kIQYwycccp+zWvZRXO14+Gjwej51Ggu5qqmALXlRZZuU5D2zETpzsOR1R5S IS2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KzSxYsG4b4l+I9q2QIs0U4YnHUtpdMnLVfBoeSrQrAc=; b=FwfPNi5g2kisbwooOPaK88tqdd7i2JUcAMlp15o91Q+XC3unyVrCq5gTB14PjOn0zo Q/i7puz0mHy5tAXpyXYJCi+lvcHlhWm0nqThuEAxiErEv+2/GuPX+kDymLiTBqFPOots xgvTxVMUHGcyUqS3b+nQrQpwxotk7fv0qKwaKf7lWe03d6oAKYhU/1p09iwlY7tR6nZc mdRM2b2Geb5lMcfJ+6TA0w1wAPs882r02SBu7P/kV9o7vmFLV3fzCnSgsk9UsOapxc2t xVkPZGxM/oYmVE417voAh7zRSLZ/YP0p2V3+ZyEs4LOegnTOfd9HdYPqcq/iYAV/oNr8 Vjng== X-Gm-Message-State: ACrzQf1LmBKiKvHo4fpBdE8MZJBToPhhpLPaTU/FGxdWG99+W7JESuIo tmQ5OZwt7/nZmPBjyF6RvqE= X-Google-Smtp-Source: AMsMyM7Tr0exJWZIHe2hajABmGUD0VYCZ5U27TZBF0a1r7poeOtlWKVajuBZT4re8KtHczrCmIgQ8Q== X-Received: by 2002:aa7:de9a:0:b0:44d:8191:44c5 with SMTP id j26-20020aa7de9a000000b0044d819144c5mr11711686edv.232.1666268007265; Thu, 20 Oct 2022 05:13:27 -0700 (PDT) Received: from able.fritz.box (p5b0eacfe.dip0.t-ipconnect.de. [91.14.172.254]) by smtp.gmail.com with ESMTPSA id s15-20020a05640217cf00b0045467008dd0sm12091979edy.35.2022.10.20.05.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 05:13:26 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: l.stach@pengutronix.de, nicolas@ndufresne.ca, ppaalanen@gmail.com, sumit.semwal@linaro.org, daniel@ffwll.ch, robdclark@gmail.com, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org Cc: =?utf-8?q?Christian_K=C3=B6nig?= Subject: [PATCH 3/3] media: videobuf2: set dma_coherent flag for DMA-buf Date: Thu, 20 Oct 2022 14:13:16 +0200 Message-Id: <20221020121316.3946-4-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020121316.3946-1-christian.koenig@amd.com> References: <20221020121316.3946-1-christian.koenig@amd.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When a device is snooping the CPU cache we assume that all importers must snoop the CPU cache as well. Execpt for vmalloc allocations since those implement mmap() imports must always snoop the cache or we will run into coherency problems. Signed-off-by: Christian König Acked-by: Hans Verkuil --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 2 ++ drivers/media/common/videobuf2/videobuf2-dma-sg.c | 2 ++ drivers/media/common/videobuf2/videobuf2-vmalloc.c | 1 + 3 files changed, 5 insertions(+) diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index 555bd40fa472..57433310c55c 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -507,6 +508,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(struct vb2_buffer *vb, exp_info.size = buf->size; exp_info.flags = flags; exp_info.priv = buf; + exp_info.coherent = dev_is_dma_coherent(vb->vb2_queue->dev); if (!buf->sgt_base) buf->sgt_base = vb2_dc_get_base_sgt(buf); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index 36981a5b5c53..dbdd753e4a39 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -10,6 +10,7 @@ * the Free Software Foundation. */ +#include #include #include #include @@ -522,6 +523,7 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(struct vb2_buffer *vb, exp_info.size = buf->size; exp_info.flags = flags; exp_info.priv = buf; + exp_info.coherent = dev_is_dma_coherent(vb->vb2_queue->dev); if (WARN_ON(!buf->dma_sgt)) return NULL; diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index 41db707e43a4..0b6874733e86 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c @@ -341,6 +341,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(struct vb2_buffer *vb, exp_info.size = buf->size; exp_info.flags = flags; exp_info.priv = buf; + exp_info.coherent = true; if (WARN_ON(!buf->vaddr)) return NULL;