Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757502AbbDPOmP (ORCPT ); Thu, 16 Apr 2015 10:42:15 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:48691 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757248AbbDPOmC convert rfc822-to-8bit (ORCPT ); Thu, 16 Apr 2015 10:42:02 -0400 From: =?UTF-8?q?=C3=98rjan=20Eide?= To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Cc: djkurtz@chromium.org Subject: [PATCH 1/2] drm: rockchip: Don't pass DRM fake offset to dma-api Date: Thu, 16 Apr 2015 16:41:51 +0200 Message-Id: <1429195312-25898-1-git-send-email-orjan.eide@arm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-OriginalArrivalTime: 16 Apr 2015 14:41:53.0246 (UTC) FILETIME=[7AD9D7E0:01D07853] X-MC-Unique: 3sc6C6XHQd-WQhZ7e-5KjQ-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 37 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 --- 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); -- 1.9.1 -- 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/