Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2966619yba; Tue, 16 Apr 2019 01:36:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/hLz55v2AEksUhHHUXEDSwqJjAFOTTRT4JTYXSjox1Sho39XTCfCgJEsE5TRN+fzguyHL X-Received: by 2002:a62:e50a:: with SMTP id n10mr81100385pff.55.1555403807276; Tue, 16 Apr 2019 01:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555403807; cv=none; d=google.com; s=arc-20160816; b=YnJwGwbeBNmQUxsqKf/r1evd04LtJVNXTHD4duqbBmvVZ5QoY1JB8Xx2lbbpNkwLJP orB2zAJFY65FLLmXz0rYG9IIX16jgdLVlKLVkJiLnJLH0uWbaa7enGL3iua3U0UWCqXH tlcMJ0XR3gxKY15csDqOs48bVI/RHM0S3cnikOq3VWNrEW2kraZl9vUkhad1OwMV9uSU Vr6ns+G3h1tUtilIhKv/dSTlcXD21b6wyA/ur2CBF4bu77d4/SzMTIduD6pd99SjFbFF aKvGnpm8xk2BHqxQ1qUxF7M/bSVDcxVZT15PmJ43KMfIrn84KA1F+rgC1QZEf1vwR8nf RPGw== 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=rMRjVojvNXEI4WDtI84pZSJCa83HhiShNf4lFcsOngU=; b=hshEfzBjBJiWo162bdlxOG26/6XNP3ulpsUAiTnZLnyR+9RceLYPTO/iHLqe9kzjnI VYI0Xz2I/L9HRPYw9cQacFAU5BwGXweR41JyYq6G7UMZ4u65eQ6IloKTDVcXfYSra/dz HYIZMB7sl4K6CoHYfZpmo6APtsUyTkLqvYRbIdoTZnip1iWnCeebSf3tq6kis3qH52uc 0lpzsus+cTu3m/y9aDkRO2+HougmR5OzKbHeBd3rlzPzR886HfOcoZxaZb4+BjiCFTys S0xwJV6ZjfzKPEzqLJb85umhyIjS6Kss41XQ8T0ghLixOrqtaJ2zKI1evqj2pD0syl/7 qRUw== 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 a11si38402571plp.306.2019.04.16.01.36.31; Tue, 16 Apr 2019 01:36:47 -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 S1728776AbfDPIeN (ORCPT + 99 others); Tue, 16 Apr 2019 04:34:13 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:11319 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727828AbfDPIeN (ORCPT ); Tue, 16 Apr 2019 04:34:13 -0400 X-UUID: 55b67e42df5e4227af8934dba0cfd7ff-20190416 X-UUID: 55b67e42df5e4227af8934dba0cfd7ff-20190416 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 943493924; Tue, 16 Apr 2019 16:33:56 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 16:33:54 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 16:33:54 +0800 Message-ID: <1555403634.11519.11.camel@mtksdaap41> Subject: Re: [PATCH v2 24/25] drm/mediatek: respect page offset for PRIME mmap calls From: CK Hu To: CC: , , , , , , , , , , , Date: Tue, 16 Apr 2019 16:33:54 +0800 In-Reply-To: <1553667561-25447-25-git-send-email-yongqiang.niu@mediatek.com> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> <1553667561-25447-25-git-send-email-yongqiang.niu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: 63D5F2FFE5D5D105423AA4BF92CA0A03CB4FA5473FC075292571F951F3F39EF82000:8 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 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 > > 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); > } >