Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2964696yba; Tue, 16 Apr 2019 01:33:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQckgB+/0QiXA0NJupKqEGOJ/H1t6BbhL8BzaEbhCIcwpGDtHhkZiWsV0HNvwZPX8WuJaP X-Received: by 2002:a63:e850:: with SMTP id a16mr71804315pgk.195.1555403620319; Tue, 16 Apr 2019 01:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555403620; cv=none; d=google.com; s=arc-20160816; b=T+1fesEeX4GNMpnUcYez6VvZhkQFF9oF9h/Ty/jSkartaOZ82Xon08S7MVtig52uyR aVtZ+pN+f+OAnvCqeJOfAt7QQhsx1ExNN9DUUHIheILTed9lct3hjPwtbIE5LKJLF9tn aiOW+Xb7KEFLlXt/qnn9K2rcB0jObXK5DuZIDauzkfDoqRo75+MS3W/FLYjUnECBiNlx 6N1myYTDMbhwLChqFqzBCR5qF/gH7h1QKfqlrCs9dh781hXDLEUaJ/j+PyZLNQrf9QBG FHNOS/M7eHEcIbzZD9Rp6efsYW2kdFf65bGfXs2GuKPRsmx/dU4jJXJ6hzBb8lLtlxIH flLQ== 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=amdh8pHjIlg7g1OeHaLx5w1cEYoo3onXincDNVbVpfQ=; b=jy280iE2+RYaDY1Tz0A3QP9MAlDNjJnH6dwqB3W61MU5mFOESihJPl9aIvk37hNg8v KURXGOVclbczCVTo658DZTlahJmVUalOwmAxAzudJr5VV6cV7+D3e64SEGKGtOtgaqmH RQ2OoSNbnhGRzGgAxy+RZuku2Vkk7+0Z/3gdWtkXG7X3MF/0S6DhXYRfnAcMLYWbMuzI XaQ2Ld4OTzkYWtGs3nqjx8cWB4WllkmEWxjOjvKSudNBA3AwZh9PG1ZRBzooNZzSNcxN DhF8CotpZ/J1ku6559HhliGHFzN4QRmvAjM2DZnf8l60HyHQdAA/zyJNCwa8NiLen8kA /u9w== 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 y29si48426459pgk.120.2019.04.16.01.33.24; Tue, 16 Apr 2019 01:33:40 -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 S1728835AbfDPIbT (ORCPT + 99 others); Tue, 16 Apr 2019 04:31:19 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:57456 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728813AbfDPIbM (ORCPT ); Tue, 16 Apr 2019 04:31:12 -0400 X-UUID: 5df338e4de03445c83484615e20fe0b2-20190416 X-UUID: 5df338e4de03445c83484615e20fe0b2-20190416 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 881612881; Tue, 16 Apr 2019 16:30:58 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 16:30:56 +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:30:56 +0800 Message-ID: <1555403456.11519.10.camel@mtksdaap41> Subject: Re: [PATCH v2 23/25] drm/mediatek: add vmap support for mediatek drm From: CK Hu To: CC: , , , , , , , , , , , Date: Tue, 16 Apr 2019 16:30:56 +0800 In-Reply-To: <1553667561-25447-24-git-send-email-yongqiang.niu@mediatek.com> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> <1553667561-25447-24-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-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 > > This patch add add vmap support for mediatek drm I think the upstreamed patch 'drm/mediatek: Implement gem prime vmap/vunmap function' [1] has the same function of this patch. You could cherry-pick that patch to your local and need not to upstream this patch. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/gpu/drm/mediatek?h=v5.1-rc5&id=3df64d7b0a4f70f1797f23cfd4cca5c4d48131fe Regards, CK > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + > drivers/gpu/drm/mediatek/mtk_drm_gem.c | 7 +++++++ > drivers/gpu/drm/mediatek/mtk_drm_gem.h | 1 + > 3 files changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > index 84c6626..942789d 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c > @@ -370,6 +370,7 @@ static void mtk_drm_kms_deinit(struct drm_device *drm) > .gem_prime_get_sg_table = mtk_gem_prime_get_sg_table, > .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table, > .gem_prime_mmap = mtk_drm_gem_mmap_buf, > + .gem_prime_vmap = mtk_drm_gem_vmap_buf, > .fops = &mtk_drm_fops, > > .name = DRIVER_NAME, > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > index 259b7b0..c230237 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c > @@ -165,6 +165,13 @@ int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj, struct vm_area_struct *vma) > return mtk_drm_gem_object_mmap(obj, vma); > } > > +void *mtk_drm_gem_vmap_buf(struct drm_gem_object *obj) > +{ > + struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(obj); > + > + return mtk_gem->cookie; > +} > + > int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) > { > struct drm_gem_object *obj; > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.h b/drivers/gpu/drm/mediatek/mtk_drm_gem.h > index 534639b..3c48af9 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.h > +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.h > @@ -49,6 +49,7 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, > int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); > int mtk_drm_gem_mmap_buf(struct drm_gem_object *obj, > struct vm_area_struct *vma); > +void *mtk_drm_gem_vmap_buf(struct drm_gem_object *obj); > struct sg_table *mtk_gem_prime_get_sg_table(struct drm_gem_object *obj); > struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev, > struct dma_buf_attachment *attach, struct sg_table *sg);