From patchwork Tue Oct 31 16:28:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 117656 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4120300qgn; Tue, 31 Oct 2017 09:28:30 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QyY6FFpdUkZ5OcJI038U7tIkeEfjdOWt97iU9pc7TezUZ0eip6v1HdbL8KIsY3UEMaZSL3 X-Received: by 10.84.143.162 with SMTP id 31mr2310087plz.254.1509467310516; Tue, 31 Oct 2017 09:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509467310; cv=none; d=google.com; s=arc-20160816; b=CHLMKkVvIel1vX3LZjqwwEJ1b+5Vt8GILlgpmClUuSUL0lAjwr0k5PApUuv8c0rdqZ TXvIDIeO8HJ2lZJra3Dc5CYHB3RCubwp+47Il+Csqg5swrr9MUvpAe0BK3weKq7Qdfsw k+1Z5Ijs+005sD/idLOhlE9J/wvQ94JRt/TjiAXSvw+0FzjLjW9CjxohFU2sDyeS+koS BdjnOp2Eis6dlW54HqLva4Jh2vpDxWQ4BGQdUOOlZ89zTeXNR7DUHGjf8LFeMjBtx3mO mhYBm1lv2E9MORJ9QsQhXh6mqxTIXc4tEVeA9KGHUwo6oWkzcxBuUlw5xv88/uri3vUT iv2Q== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:cms-type:message-id:date:subject :to:from:dkim-signature:dkim-filter:delivered-to :arc-authentication-results; bh=iYg1+xtx2KFLX7s74tgxAGqP8btIerrU/GjRMxlmWo8=; b=kP1uEUzPIZy7Pu3z3JeVl7TIHSwvtqiRfaiqZNbjWPCS/b8QY4Dybt/ShtUg02p2JC Lb257u+LFDf9k2HDVngYmop8ZsRYMvWK5HbeJEsHrIRlT053BHBWyj6CJtDvDpvIziJn w7KZaZAPZXN3+Y4siXxzwI83EMg9E0Q1Jk3ZMziAyQNEQ1wsbqtUBBM77Zrkgy29Sv4p ehw4eLPqkIHpLAUBY3pTO21FYvAP9ZjCwlFtRcdTYKM3fF4iERMVKOXv907zVYajSvfw 2fH+tl0FmXFy0vpFbvX2K0X39czybIYcxkdq+XdICeC6OSvW/30hDHIBXYjFdRTA6UF8 V5pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=ovmpbSE5; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id x11si1827727pgr.439.2017.10.31.09.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 09:28:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=ovmpbSE5; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 9B8E46E065; Tue, 31 Oct 2017 16:28:29 +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 CFC1B6E065 for ; Tue, 31 Oct 2017 16:28:28 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20171031162826euoutp029760ba679dd7b994d5d71dfbdff32b51~ytIRx0GYz0317803178euoutp02h; Tue, 31 Oct 2017 16:28:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171031162826euoutp029760ba679dd7b994d5d71dfbdff32b51~ytIRx0GYz0317803178euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1509467306; bh=g5RQPpabnBnjMwzZ3bKISaf+ZhkAnj+fKjmF2vXJ5k4=; h=From:To:Cc:Subject:Date:References:From; b=ovmpbSE5rJSa6CL7Un3Qv9sLhsORAIIImHM36AVeqoT9eVB07S8B9uMmKe0cPFyPA xF+EWvNPSURiyMNzEP/vg0Jqez7fEOra/UQsF63tfESTGkQhaimtWZHSYjs6aYd/zm kdbDPXhLjYVORZfbvSpAeNzJVh9pcfPFRXVfm9vo= Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171031162825eucas1p2c0b98ce467e5f0ad2a9ea59caa7a3611~ytIREY0ho0478304783eucas1p2N; Tue, 31 Oct 2017 16:28:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 8C.A6.12743.8A4A8F95; Tue, 31 Oct 2017 16:28:25 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20171031162824eucas1p1d15c2ea1d529edd18e16506b26669b91~ytIQU7v7A1633616336eucas1p1n; Tue, 31 Oct 2017 16:28:24 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d0000031c7-77-59f8a4a8b7c5 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 6E.84.20118.8A4A8F95; Tue, 31 Oct 2017 16:28:24 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OYP0039O4F88Y30@eusync1.samsung.com>; Tue, 31 Oct 2017 16:28:24 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] drm/exynos: gem: Drop NONCONTIG flag for buffers allocated without IOMMU Date: Tue, 31 Oct 2017 17:28:13 +0100 Message-id: <20171031162813.1546-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsWy7djPc7orl/yINNh8mNFi44z1rBZXvr5n s5h0fwKLxfnzG9gtZpzfx2Sx9shddov1036yWizY+IjRYsbkl2wOnB47Z91l99i0qpPN4373 cSaPvi2rGD0+b5ILYI3isklJzcksSy3St0vgynj29iZjwS7uihPnbrI1MJ7m7GLk5JAQMJF4 PXEaK4QtJnHh3nq2LkYuDiGBpYwSN5bNYYVwPjNKXD18gA2m49S7FVCJZYwSyw4+Y4FwGpgk Ph1qZAapYhMwlOh62wXWISLgJtF0eCZYB7PAQiaJJ1u+MoIkhAWiJZ6/mgTWwCKgKtH++BQ7 iM0rYCPx4H8X1Dp5ifcL7jOCNEsI9LBJHHr6DirhInH0zU92CFtY4tXxLVC2jMTlyd0sEHY/ o0RTqzaEPYNR4txbXgjbWuLw8YtgXzML8ElM2jYd6AgOoDivREebEESJh8SEGTOhVjlKLHs1 gQ2kREggVmLia88JjFILGBlWMYqklhbnpqcWm+oVJ+YWl+al6yXn525iBEbp6X/Hv+5gXHrM 6hCjAAejEg/vjMTvkUKsiWXFlbmHGCU4mJVEeFMX/4gU4k1JrKxKLcqPLyrNSS0+xCjNwaIk zmsb1RYpJJCeWJKanZpakFoEk2Xi4JRqYAz5NCcr9AXLnxKFAy8DnTKVvt/5sSW3fNqVVV1t 4VO1ts6JSvkRmNrObHB3rYXHShUd5osswqHpi9zydSwSV132e22hJF9qdvrVWgcWYbv/n8V+ 77o3u7Qzb82Xszw75lo+/aHBuTBvxinvjOn2Ibpv7r/8/PDa1o17DG42XdrBeeXW7yNn131W YinOSDTUYi4qTgQAz0+qHc4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjluLIzCtJLcpLzFFi42I5/e/4Zd0VS35EGhybJ2uxccZ6VosrX9+z WUy6P4HF4vz5DewWM87vY7JYe+Quu8X6aT9ZLRZsfMRoMWPySzYHTo+ds+6ye2xa1cnmcb/7 OJNH35ZVjB6fN8kFsEZx2aSk5mSWpRbp2yVwZTx7e5OxYBd3xYlzN9kaGE9zdjFyckgImEic ereCFcIWk7hwbz1bFyMXh5DAEkaJJ5tfskI4TUwSvx/2soBUsQkYSnS97WIDsUUE3CSaDs8E K2IWWMgksezaZyaQhLBAtMTzV5OYQWwWAVWJ9sen2EFsXgEbiQf/IZolBOQl3i+4zziBkXsB I8MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwNDZduznlh2MXe+CDzEKcDAq8fDOSPweKcSa WFZcmXuIUYKDWUmEN3Xxj0gh3pTEyqrUovz4otKc1OJDjNIcLErivL17VkcKCaQnlqRmp6YW pBbBZJk4OKUaGA20Ci6fkMi8+oh967YZvud6avfFzckK2h8Vdy1R5GyE452Dh8/e+3uQ1VVi SsC1Invv6iuxTBPsbz/3kM+XMFm77zh74+fwOyLqwfUrJu+ZH3jq3OlLL/xTjT38L2iuPfNG ckPJac/bodITXnPea554OfjfllWsriJzNjxl2bPV1jhzu3i1nJUSS3FGoqEWc1FxIgBHa8dV GQIAAA== X-CMS-MailID: 20171031162824eucas1p1d15c2ea1d529edd18e16506b26669b91 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171031162824eucas1p1d15c2ea1d529edd18e16506b26669b91 X-RootMTR: 20171031162824eucas1p1d15c2ea1d529edd18e16506b26669b91 References: Cc: Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Krzysztof Kozlowski , stable@vger.kernel.org, Marian Mihailescu , Marek Szyprowski X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When no IOMMU is available, all GEM buffers allocated by Exynos DRM driver are contiguous, because of the underlying dma_alloc_attrs() function provides only such buffers. In such case it makes no sense to keep BO_NONCONTIG flag for the allocated GEM buffers. This allows to avoid failures for buffer contiguity checks in the subsequent operations on GEM objects. Signed-off-by: Marek Szyprowski CC: stable@vger.kernel.org # v4.4+ --- This issue is there since commit 0519f9a12d011 ("drm/exynos: add iommu support for exynos drm framework"), but this patch applies cleanly only to v4.4+ kernel releases due changes in the surrounding code. --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 02f978bb9261..476c00fe1998 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -227,6 +227,13 @@ struct exynos_drm_gem *exynos_drm_gem_create(struct drm_device *dev, if (IS_ERR(exynos_gem)) return exynos_gem; + /* + * when no IOMMU is available, all allocated buffers are contiguous + * anyway, so drop EXYNOS_BO_NONCONTIG flag + */ + if (!is_drm_iommu_supported(dev)) + flags &= ~EXYNOS_BO_NONCONTIG; + /* set memory type and cache attribute from user side. */ exynos_gem->flags = flags;