From patchwork Wed Jun 9 11:20:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 12309707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02976C48BCF for ; Wed, 9 Jun 2021 11:22:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C6BDE61108 for ; Wed, 9 Jun 2021 11:22:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6BDE61108 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8grXwuGHBPdQr/aS7VS9//XjBHj1ZFIwWRxj8vVQiqk=; b=yCBvcysd9dNfvg 7xQVx3uswFfMJUII4JDvQDm7azO/7HHQvHbgpJL7QPKp6HB7+WssZUAdU1IioucAUa7Crv4JHPvrY QYiDPozC49+3sHNJI+9gPWQIa3wDxZ0v9qPvP/U01AX5woW7Py3Z6st14BfP7pRWfqRI/tpz5jcUP nk4VaxFatnoVxdPjEKbAf9/cfDjxjkI6gq0MHQ7OWLc7pysUUdGBEEGK2s5L1+ZyUkWrV14z4SRJS KS7cgNKyW03hWrZW6zPcmzKjrhrG47k0rY1uQKuEPisfO958lOrGagHV3FYQXfRDrXSXUErd/Sauu V7Lyh9SVs1wUsCB/+z6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwHS-00DHz7-Ue; Wed, 09 Jun 2021 11:21:54 +0000 Received: from smtp-out2.suse.de ([195.135.220.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqwFt-00DHF4-PY; Wed, 09 Jun 2021 11:20:19 +0000 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 322EA1FD2A; Wed, 9 Jun 2021 11:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623237614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oCiBA5IQR9wf4+Cc+r3nE+xIhszdcMtCPYXz7tk1DUc=; b=fY/lBPn1RzheTsgcxOOcUlu2A6QxXJzVzaZKYGY8dQ/N9dkPZxAh+IzMlWy3Mdw4YcifeB euR+HK45GJ3f0u+/7nmbJqJDLXGEJmIB2cOWMU93FBBin5A1MqrE27Y9jBklc67vNLz8q3 MEB05kirgOr7hJDXocRIMCqdq+d45FY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623237614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oCiBA5IQR9wf4+Cc+r3nE+xIhszdcMtCPYXz7tk1DUc=; b=qtPzutLGd6X37XBCAvAZ4AuMX1bEEdUc0wqN5VeNSoa0OrIM4LVgceME8x2WEfyyR258wQ Jhvg0YtWBnitxsBg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 8991F118DD; Wed, 9 Jun 2021 11:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623237614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oCiBA5IQR9wf4+Cc+r3nE+xIhszdcMtCPYXz7tk1DUc=; b=fY/lBPn1RzheTsgcxOOcUlu2A6QxXJzVzaZKYGY8dQ/N9dkPZxAh+IzMlWy3Mdw4YcifeB euR+HK45GJ3f0u+/7nmbJqJDLXGEJmIB2cOWMU93FBBin5A1MqrE27Y9jBklc67vNLz8q3 MEB05kirgOr7hJDXocRIMCqdq+d45FY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623237614; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oCiBA5IQR9wf4+Cc+r3nE+xIhszdcMtCPYXz7tk1DUc=; b=qtPzutLGd6X37XBCAvAZ4AuMX1bEEdUc0wqN5VeNSoa0OrIM4LVgceME8x2WEfyyR258wQ Jhvg0YtWBnitxsBg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id Pn27IO2jwGBTUgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:20:13 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, mripard@kernel.org, maarten.lankhorst@linux.intel.com, l.stach@pengutronix.de, linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com, inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzysztof.kozlowski@canonical.com, chunkuang.hu@kernel.org, p.zabel@pengutronix.de, matthias.bgg@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@redhat.com, kraxel@redhat.com, hjc@rock-chips.com, heiko@sntech.de, oleksandr_andrushchenko@epam.com, sumit.semwal@linaro.org, christian.koenig@amd.com Cc: dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, xen-devel@lists.xenproject.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Thomas Zimmermann Subject: [PATCH 0/9] drm: Implement gem_prime_mmap with drm_gem_prime_mmap() Date: Wed, 9 Jun 2021 13:20:03 +0200 Message-Id: <20210609112012.10019-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_042018_026278_5EE9FCF2 X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Replace all remaining implementations of struct drm_driver.gem_prime_mmap with use drm_gem_prime_mmap(). For each affected driver, put the mmap code into struct drm_gem_object_funcs.mmap. With the latter change in place, create struct file_operations via DEFINE_DRM_GEM_FOPS(). As next steps, remaining drivers can be converted to use drm_gem_prime_mmap() and drm_gem_mmap() (e.g., Tegra). The default mmap code in drm_gem_prime_mmap() can be pushed into affected drivers or a helper function. The gem_prime_mmap hook can probably be removed at some point. Testing is welcome. I don't have all the necessary hardware. Thomas Zimmermann (9): drm/etnaviv: Implement mmap as GEM object function drm/exynox: Implement mmap as GEM object function drm/mediatek: Implement mmap as GEM object function drm/msm: Implement mmap as GEM object function drm/qxl: Remove empty qxl_gem_prime_mmap() drm/vgem: Implement mmap as GEM object function drm/xen: Implement mmap as GEM object function drm/rockchip: Implement mmap as GEM object function drm: Update documentation and TODO of gem_prime_mmap hook Documentation/gpu/todo.rst | 11 -- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 14 +-- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 3 - drivers/gpu/drm/etnaviv/etnaviv_gem.c | 18 +-- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 13 --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 13 +-- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 20 +--- drivers/gpu/drm/exynos/exynos_drm_gem.c | 43 ++----- drivers/gpu/drm/exynos/exynos_drm_gem.h | 5 - drivers/gpu/drm/mediatek/mtk_drm_drv.c | 13 +-- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 44 ++----- drivers/gpu/drm/mediatek/mtk_drm_gem.h | 3 - drivers/gpu/drm/msm/msm_drv.c | 14 +-- drivers/gpu/drm/msm/msm_drv.h | 1 - drivers/gpu/drm/msm/msm_fbdev.c | 10 +- drivers/gpu/drm/msm/msm_gem.c | 67 +++++------ drivers/gpu/drm/msm/msm_gem.h | 3 - drivers/gpu/drm/msm/msm_gem_prime.c | 11 -- drivers/gpu/drm/qxl/qxl_drv.c | 1 - drivers/gpu/drm/qxl/qxl_drv.h | 2 - drivers/gpu/drm/qxl/qxl_prime.c | 6 - drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 +-- drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 3 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 44 ++----- drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 7 -- drivers/gpu/drm/vgem/vgem_drv.c | 46 +------- drivers/gpu/drm/xen/xen_drm_front.c | 16 +-- drivers/gpu/drm/xen/xen_drm_front_gem.c | 108 +++++++----------- drivers/gpu/drm/xen/xen_drm_front_gem.h | 7 -- include/drm/drm_drv.h | 11 +- 30 files changed, 136 insertions(+), 434 deletions(-) base-commit: 70e4d80795934312a3853a4f4f49445ce6db1271 prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24 --- 2.31.1