Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888AbbDTFoh (ORCPT ); Mon, 20 Apr 2015 01:44:37 -0400 Received: from va-smtp01.263.net ([54.88.144.211]:43755 "EHLO va-smtp01.263.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751297AbbDTFoe (ORCPT ); Mon, 20 Apr 2015 01:44:34 -0400 X-RL-SENDER: mark.yao@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: mark.yao@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <55349237.3050901@rock-chips.com> Date: Mon, 20 Apr 2015 13:44:23 +0800 From: Mark yao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: =?UTF-8?B?SGVpa28gU3TDvGJuZXI=?= , linux-rockchip@lists.infradead.org CC: =?UTF-8?B?w5hyamFuIEVpZGU=?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, djkurtz@chromium.org Subject: Re: [PATCH 1/2] drm: rockchip: Don't pass DRM fake offset to dma-api References: <1429195312-25898-1-git-send-email-orjan.eide@arm.com> <1743547.3D2D8THGkI@diego> <55349001.80304@rock-chips.com> In-Reply-To: <55349001.80304@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2137 Lines: 65 On 2015年04月20日 13:34, Mark yao wrote: > On 2015年04月19日 00:55, Heiko Stübner wrote: >> Am Donnerstag, 16. April 2015, 16:41:51 schrieb Ørjan Eide: >>> Set vm_pgoff to 0 after using it to look up the GEM node, before >>> passing >>> it on rockchip_gem_mmap_buf() where the offset must be from the >>> start of >>> the buffer. >>> >>> Passing in the fake offset currently works because the >>> dma_mmap_attrs implementation that is used for this device, >>> arm_iommu_mmap_attrs, ignores the offset completely. >>> >>> Signed-off-by: Ørjan Eide >> both patches on a rk3288-veyron-pinky >> >> Tested-by: Heiko Stuebner >> >> Through which tree do you want to take these patches? I guess the >> rockchip-drm >> related patch should go through the tree that will take the >> dma-mapping patch, >> so you'll probably need an "Ack" from Mark Yao (Cc'ed). >> >> >> Heiko >> >>> --- >>> drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c >>> b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 7ca8799e..69f01c3 >>> 100644 >>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c >>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c >>> @@ -94,6 +94,11 @@ int rockchip_gem_mmap(struct file *filp, struct >>> vm_area_struct *vma) return -EACCES; >>> } >>> >>> + /* Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and >>> map the >>> + * whole buffer from the start. >>> + */ >>> + vma->vm_pgoff = 0; >>> + >>> obj = container_of(node, struct drm_gem_object, vma_node); >>> ret = rockchip_gem_mmap_buf(obj, vma); >> >> >> > Thanks for this fix, > Acked-by: Mark Yao > I met this problem when work with gem non-iommu path, set vma->vm_pgoff = 0 solved it. :-) -- Mark -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/