Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4608122ybi; Mon, 27 May 2019 22:48:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLirqzexcwZw/bLpVg3GHsqKEr981a83+3XIPWzKP063xvq30evKlQdGp0nUdN2sbugGd6 X-Received: by 2002:a17:902:a613:: with SMTP id u19mr117857128plq.42.1559022505731; Mon, 27 May 2019 22:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559022505; cv=none; d=google.com; s=arc-20160816; b=dkKhH/BR5KKDNugy7OFxs5bXzjm6u4PMgUa++8rqUh5J/pEmW/YVfMcoPX7i6DWWJv suEZKA+TRWx18W6g+aiu9V7AmQfVGKnFCR17YmYckD3LipR+5GGkoYngBS4lhqZnjFMR v1C1b1hX4mJ6zvQo1nLal65hVXmE+VxUXHdeAgKk3+it+GhyrdGk1ulcE+0/Bw/d0/9K IBTg3Sc4ruj0xrfZQ/Hj2FykXUQDXWUKt7qKq5CEo8S1XCTMaZUrp9OMpMI0+IzvgaKQ AL6GrQrAIPc+QNiVGCUA00pNvT51x777QcA9EK5WWm/sW4Ev/WMRmCg1zmbkhgcOBCRn iKAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=7+pOPB/YiUdo8mcY2+hcUMCcBPE01U56ZlObxhJsYZs=; b=kkTzHrCUycUYQvuoeD+69Nxy/MGgEI3j1GfnH5Tdyb7ozM8xMT9TpmVj+nLTDcclxo NiyRva4GfFMYJRTmZhQRwh+Z49l/r5nJHVq9MCiXVjsCU3eP2/1Ny7yGwExz9OggUtqm J9T3WG9dawKPE5qKPx3RanpWepRK5aGkfGjq1tk5WL5fsIBd0dwIy399NSrujUVxKKsP 85QIWAFWnO+MeC/nr0/OhWWiluiZ9b89eDySLVH2MWaWujqakIpKL48Gf33c+LZ4BkGT 7NuYpDgcbyqjcqi0INJyrMwv1/T0+BVU6cbkFxigTyt2zHGBUapf+PjTh/PlZIvxDREw kTrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si19257936pll.64.2019.05.27.22.48.10; Mon, 27 May 2019 22:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbfE1FgM (ORCPT + 99 others); Tue, 28 May 2019 01:36:12 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:2077 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726269AbfE1FgM (ORCPT ); Tue, 28 May 2019 01:36:12 -0400 X-UUID: 431b29fe870c431c9b09dc0979a77c29-20190528 X-UUID: 431b29fe870c431c9b09dc0979a77c29-20190528 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1074673266; Tue, 28 May 2019 13:36:00 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 28 May 2019 13:35:59 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 28 May 2019 13:35:59 +0800 Message-ID: <1559021759.15879.2.camel@mtksdaap41> Subject: Re: [PATCH v2 24/25] drm/mediatek: respect page offset for PRIME mmap calls From: CK Hu To: CC: , , , , , , , , , , , Date: Tue, 28 May 2019 13:35:59 +0800 In-Reply-To: <1555403634.11519.11.camel@mtksdaap41> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> <1553667561-25447-25-git-send-email-yongqiang.niu@mediatek.com> <1555403634.11519.11.camel@mtksdaap41> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: On Tue, 2019-04-16 at 16:33 +0800, CK Hu wrote: > Hi, Yongqiang: > > On Wed, 2019-03-27 at 14:19 +0800, yongqiang.niu@mediatek.com wrote: > > From: Yongqiang Niu > > > > Respect page offset for PRIME mmap calls > > Reviewed-by: CK Hu This patch looks independent, so I've applied it to mediatek-drm-fixes-5.2 [1], thanks. [1] https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-5.2 Regards, CK > > > > > Signed-off-by: Yongqiang Niu > > --- > > drivers/gpu/drm/mediatek/mtk_drm_gem.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > > index c230237..524e494 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c > > +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > > @@ -144,7 +144,6 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, > > * VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap(). > > */ > > vma->vm_flags &= ~VM_PFNMAP; > > - vma->vm_pgoff = 0; > > > > ret = dma_mmap_attrs(priv->dma_dev, vma, mtk_gem->cookie, > > mtk_gem->dma_addr, obj->size, mtk_gem->dma_attrs); > > @@ -183,6 +182,12 @@ int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) > > > > obj = vma->vm_private_data; > > > > + /* > > + * 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; > > + > > return mtk_drm_gem_object_mmap(obj, vma); > > } > > >