From patchwork Wed Mar 1 22:29:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13156563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EA7DC678D4 for ; Wed, 1 Mar 2023 22:29:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE8CF10E279; Wed, 1 Mar 2023 22:29:33 +0000 (UTC) Received: from mail-4018.proton.ch (mail-4018.proton.ch [185.70.40.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3705510E279 for ; Wed, 1 Mar 2023 22:29:31 +0000 (UTC) Date: Wed, 01 Mar 2023 22:29:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1677709769; x=1677968969; bh=Pcwm2+1dIZ/mUTMXqf+ozl5YE2RZ57DIMKTJVrmcGis=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=LrZamqpmHHM5N054EnYqwVySpL9n7Lk79cm7/BhGNCjGEnL7CtDdlfTNTp0Z7n+CD zRed1CBiFvs32wTTjLiWAjnAzAkbd9V/w5L4kIVNTaXp+rUMdne0mJ3gT17oIjtDbq PmtPBGTSieaTk/I8H90+NiWrfE8J6O/4kTdPecUSo0lHUMtEYVXFIDFiTlz9jphtNO EED0oy3K2mGpGqTm9uffwPyNXZeWMoUYn5LIb+Bq0+/qqTmGSFv5vHn6sFHumKJb3b mXAvCw2N9kCfspWMtWTjRuKGHXfxFTR7dSLeARoIlz1ItFNYRitVMvTIFiSfHju9KT I24AIz0WZodqg== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH] drm/vram-helper: turn on PRIME import/export Message-ID: <20230301222903.458692-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Hans de Goede , Maxime Ripard , Thomas Zimmermann , Tian Tao , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We don't populate gem_prime_import_sg_table so only DMA-BUFs exported from our own device can be imported. Still, this is useful to user-space. Signed-off-by: Simon Ser Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Tian Tao Cc: Maxime Ripard Cc: Christian König Cc: Hans de Goede --- include/drm/drm_gem_vram_helper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index d3e8920c0b64..f4aab64411d8 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -160,7 +160,9 @@ void drm_gem_vram_simple_display_pipe_cleanup_fb( .debugfs_init = drm_vram_mm_debugfs_init, \ .dumb_create = drm_gem_vram_driver_dumb_create, \ .dumb_map_offset = drm_gem_ttm_dumb_map_offset, \ - .gem_prime_mmap = drm_gem_prime_mmap + .gem_prime_mmap = drm_gem_prime_mmap, \ + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, \ + .prime_fd_to_handle = drm_gem_prime_fd_to_handle /* * VRAM memory manager