Message ID | 20200619103636.11974-19-m.szyprowski@samsung.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp400231ilo; Fri, 19 Jun 2020 03:37:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFEEdM++fyBJmYb9RH6m7dbu9bCj7ZUBNLGAxzfldmX7sAdohEYKZTFYMJa6rQVXS48y/I X-Received: by 2002:a17:90a:2104:: with SMTP id a4mr2815539pje.1.1592563061010; Fri, 19 Jun 2020 03:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592563061; cv=none; d=google.com; s=arc-20160816; b=EQQ8UXDkjWeJ/XxsUfw/zpk7l8SH9cDmSonhWCFfPnm4OO7MRW+sej+aAneaam9Fcj /yc+DgZzxGk95JgoUnxAItUPg3callu97O1tsajqLvJsP4nlsXRNS+FXi11ozTBK+7Qp 9DD3yFpnjb4z5QJC/eEp0TEEixGXNu+YwMcd9mgEVxHXohTcgaG39Q7UDSRwSbUQNDfM a1XBUXMco5ZrofIqrxeM9pz0zWApc0eJ4cLGumF+77aAkH+L9DsidhjLKKMvZVybsUTl L49/+vNsAYW39PqnNHjKil3V9kW/c5nAvOZMdlKyOlbLtFhh+Mw6ZebWsmw9S+PywdjE N7Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:cms-type:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-filter:delivered-to; bh=iFAFkCZNbfnJ7Xu284axrmrxOtv55yhMLJSad0LxcRQ=; b=rSEVgzl6Rh2aoUDE5kzsyz4NlrShiUD5fD1xReekKZ69n9hoWSM8+9Spkah+SuskvL XzL1cP6Ps6Vq6wM8/kMfWwuCKFhTQtxwCx6Et9PtBdjsU6yQ4cVSwBwNbA2lgPUFl6d6 peDXVwSFQie9+gCFJ77UqyJlg6dp1DwPEedBYJgfqr8vUyP2WCzATTLF34Vb9R+pgoQX 6JuVkSjazQipH1h/Si+YJpOuhshJFFFN3JVTiJ95RoxPcRKMjzvp9JCIrN5Mps18VUCg Pv3YoyLWe7GG22aj+Nc36e/ls4S0SQDuQymxiQY3zMD7TOB9CZ8Th4s9Y4l4FqNiImpq +yzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=RZWZFZiU; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: <dri-devel-bounces@lists.freedesktop.org> Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 8si2014577pge.521.2020.06.19.03.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 03:37:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=RZWZFZiU; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B7F606EC5F; Fri, 19 Jun 2020 10:37:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DA226EC6B for <dri-devel@lists.freedesktop.org>; Fri, 19 Jun 2020 10:37:07 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200619103706euoutp023b202bcf0fb303c9084b0c39cb97126c~Z66JqzMkQ2242422424euoutp02a for <dri-devel@lists.freedesktop.org>; Fri, 19 Jun 2020 10:37:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200619103706euoutp023b202bcf0fb303c9084b0c39cb97126c~Z66JqzMkQ2242422424euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592563026; bh=Xz5Z61X+A6u/FrMD8ciD40ug8xujs/WBHWVc8ZYxDIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RZWZFZiU9uaK5hCckHSKOUW4U3SYq9HwAyrRqHgCZuTY0ptyEKGO35ufvRT/OuWCE q/s47IGq1Wz9yIKJl/3KbkUV9/xSbO/nqUbphnQC0PrXT+Le6la4WOTgXqDUTN38WO IiyUcbppCmgiKO4IiRbRHHCXes5Zs24xWSfwBwPg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200619103705eucas1p10b8740637e53bc8dde52e03b3c391a35~Z66JbWtwp0705907059eucas1p1H; Fri, 19 Jun 2020 10:37:05 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 01.AC.06456.1559CEE5; Fri, 19 Jun 2020 11:37:05 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200619103705eucas1p2d81a91b989d5aed5c7da6897173905cd~Z66JD4jOp3081530815eucas1p2c; Fri, 19 Jun 2020 10:37:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200619103705eusmtrp168f0ba22988a309be3c4615aa1a9502b~Z66JDKJtI0959609596eusmtrp1H; Fri, 19 Jun 2020 10:37:05 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-56-5eec95513d50 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7C.0B.06017.1559CEE5; Fri, 19 Jun 2020 11:37:05 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200619103704eusmtip21079cff67347dd72f5c34fbc65f764d9~Z66ITSibC0302303023eusmtip2Q; Fri, 19 Jun 2020 10:37:04 +0000 (GMT) From: Marek Szyprowski <m.szyprowski@samsung.com> To: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 18/36] drm: rockchip: use common helper for a scatterlist contiguity check Date: Fri, 19 Jun 2020 12:36:18 +0200 Message-Id: <20200619103636.11974-19-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200619103636.11974-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSeUgUURzHeTszu+Oya9Mq+bBIWOhGzTIZssS0YqIgi0CSXJ10PMhV2VHT IpJSC9NMLa/UREzXK83Eq0PXa8vVrdTMo1IzKI/VPNEgN9dR++/zvr/vl+/vPR6OSBowc9w/ MIRRBNIBUr4QrWpdem957tGEbL/q5z4yXvuORz5PK8NIfVUiQnbPT/HJwuIWHqn/Po6RWUk3 yJx6e3Kue5hHVoz0YGRXXSafnBnSI2Rp81cBqfr9A3M0pkqySwD1eiEHpaoXhjBq8J6aR73I u0kNLI8gVHJvAaB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LCap+LVkkmsDYwruLoYOTkkBEwkJr6+wQxiCwksZZQ4 8qMQIi4jcXJaAyuELSzx51oXWxcjF1DNJ0aJxquTwRrYBAwlut5CJEQEOhklpnV/ZAdxmAXm MUssX3WYCaRKWCBW4l7jTxYQm0VAVeLFuwawbl4BO4m3R6YwQ6yQl1i94QCYzQkUf91ykBXi JFuJ5QveM09g5FvAyLCKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMjMHq2Hfu5ZQdj17vgQ4wC HIxKPLwvQl7HCbEmlhVX5h5ilOBgVhLhdTp7Ok6INyWxsiq1KD++qDQntfgQoynQUROZpUST 84GRnVcSb2hqaG5haWhubG5sZqEkztshcDBGSCA9sSQ1OzW1ILUIpo+Jg1OqgbEhLFbj+5Sm DV8/PPhlzfq3v5L7gpTLRGn/DrvwytOOb2xmtOkFG1g88p778rCq9uX7AaqtW7SmGky0f9oo UfpsZumUv7Xu/5mNY0tnPlSbdPNP6fvrws+nya54VMK2LPH/xb5JB5dHWu1iY7p17pwSq9br s7IhfkwPOl/l1nherVArOPqq6I4SS3FGoqEWc1FxIgDAFerKtAIAAA== X-CMS-MailID: 20200619103705eucas1p2d81a91b989d5aed5c7da6897173905cd X-Msg-Generator: CA X-RootMTR: 20200619103705eucas1p2d81a91b989d5aed5c7da6897173905cd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200619103705eucas1p2d81a91b989d5aed5c7da6897173905cd References: <20200619103636.11974-1-m.szyprowski@samsung.com> <CGME20200619103705eucas1p2d81a91b989d5aed5c7da6897173905cd@eucas1p2.samsung.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, David Airlie <airlied@linux.ie>, Sandy Huang <hjc@rock-chips.com>, linux-rockchip@lists.infradead.org, Robin Murphy <robin.murphy@arm.com>, Christoph Hellwig <hch@lst.de>, linux-arm-kernel@lists.infradead.org, Marek Szyprowski <m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
DRM: fix struct sg_table nents vs. orig_nents misuse
|
expand
|
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b9275ba7c5a5..2970e534e2bb 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -460,23 +460,6 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj) return sgt; } -static unsigned long rockchip_sg_get_contiguous_size(struct sg_table *sgt, - int count) -{ - struct scatterlist *s; - dma_addr_t expected = sg_dma_address(sgt->sgl); - unsigned int i; - unsigned long size = 0; - - for_each_sg(sgt->sgl, s, count, i) { - if (sg_dma_address(s) != expected) - break; - expected = sg_dma_address(s) + sg_dma_len(s); - size += sg_dma_len(s); - } - return size; -} - static int rockchip_gem_iommu_map_sg(struct drm_device *drm, struct dma_buf_attachment *attach, @@ -498,7 +481,7 @@ rockchip_gem_dma_map_sg(struct drm_device *drm, if (!count) return -EINVAL; - if (rockchip_sg_get_contiguous_size(sg, count) < attach->dmabuf->size) { + if (drm_prime_get_contiguous_size(sg) < attach->dmabuf->size) { DRM_ERROR("failed to map sg_table to contiguous linear address.\n"); dma_unmap_sg(drm->dev, sg->sgl, sg->nents, DMA_BIDIRECTIONAL);
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel