Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5000079img; Tue, 26 Mar 2019 23:21:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxirQZ9rRSdytIMyoW7qTcL7aVAzbNUqJaV06R9Png4OtqtoXXXH0ZPKRsZJ3pjkmKV1rLk X-Received: by 2002:a17:902:b210:: with SMTP id t16mr11964197plr.84.1553667707566; Tue, 26 Mar 2019 23:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553667707; cv=none; d=google.com; s=arc-20160816; b=N7jjsCtTP+lGScQ6NVPR8TRTTaobIHX0MheQ+6wtTju5pknvFfSbfrBiQEAkA6Qu+o 7qupCL/OXcDUbdO9I4f0Av3s2vdSEKvLSle1utvUh+37yNUKP48NwJG9w+hqapgjpsZm BecOIKIM9BRZA/+bmXLab/r80RkRji9In9dA8Vd6XdOZmc/Uo/F0UOstspBpd0UlaDi6 5NoxMtVeeaXuZXkgKLoxnYzEPPa8TmWtv+SGjjXU7paIQ8IEO6DHW3UORU0aQWyrs4LW wLjcy5yAqh0Ekg+U3O8twwqkBBkQntveqTHVarkJq7hiPZ5UpO0hkRuQMMUCcMU7vvmg FwAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=mIjsUjQol5ANbYoBlLbIdDYSpZaNTMrx5K7FTVPcVPQ=; b=b6WRaRiI/s594FtIMMvBcFO8CZ2geFMum4KlRBD/SHvIdAHtakAhTFbNmmhvBvWhbm LN/0s/+liaaTgLLWwv7Le0rrwXtk1ZYZFVnbU+NTh15BzK15pr+PSIJMiN3cTnNq4CQR qwd/eQPGa3polN1rHfqEVCC4VqZTfz4+eIKuSpzg6dwrhkhL9lC6fbzph7oQF6pFs5Bk MNmx3bKd66sJQbx+sDFxjOOqL2qT7+Tl9DreXHHJVKcQQ37M+fTtF0RRW5pT1SOPkLxM S7cwsFab+/edJUQBrinphvOY4MSgxk79jLu4J8r7tELq6p6ssyXT9vKVwV3LmeCQR3LR LOaQ== 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 n7si8827930pff.190.2019.03.26.23.21.32; Tue, 26 Mar 2019 23:21: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 S2387627AbfC0GU3 (ORCPT + 99 others); Wed, 27 Mar 2019 02:20:29 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:51982 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2387525AbfC0GUE (ORCPT ); Wed, 27 Mar 2019 02:20:04 -0400 X-UUID: 153891d96a3048a2a0f5fd01535881fd-20190327 X-UUID: 153891d96a3048a2a0f5fd01535881fd-20190327 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 9977578; Wed, 27 Mar 2019 14:19:58 +0800 Received: from MTKMBS01DR.mediatek.inc (172.21.101.111) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 14:19:57 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01dr.mediatek.inc (172.21.101.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 14:19:56 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 27 Mar 2019 14:19:55 +0800 From: To: , , , CC: , , , , , , , , , Yongqiang Niu Subject: [PATCH v2 23/25] drm/mediatek: add vmap support for mediatek drm Date: Wed, 27 Mar 2019 14:19:19 +0800 Message-ID: <1553667561-25447-24-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yongqiang Niu This patch add add vmap support for mediatek drm 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); -- 1.8.1.1.dirty