lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5674b73c-3bf3-4ec5-a1a7-44c9ce62ef68@suse.de>
Date: Tue, 2 Jul 2024 09:17:02 +0200
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Asbjørn Sloth Tønnesen <asbjorn@...jorn.st>,
 intel-gfx@...ts.freedesktop.org
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@...el.com>, Tvrtko Ursulin
 <tursulin@...ulin.net>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, Jouni Högander
 <jouni.hogander@...el.com>, Zhao Liu <zhao1.liu@...el.com>,
 dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/i915: implement vmap/vunmap GEM object functions

Hi

Am 29.06.24 um 20:25 schrieb Asbjørn Sloth Tønnesen:
> Implement i915_gem_vmap_object() and i915_gem_vunmap_object(),
> based on i915_gem_dmabuf_vmap() and i915_gem_dmabuf_vunmap().
>
> This enables a drm_client to use drm_client_buffer_vmap() and
> drm_client_buffer_vunmap() on hardware using the i915 driver.
>
> Tested with a currently out of tree pixelflut drm_client[1] on:
> - Lenovo ThinkCentre M720q (CoffeeLake-S GT2 / Intel UHD Graphics 630)
> - Dell Wyse N06D - 3030 LT (ValleyView on Intel Celeron N2807 SOC)
>
> [1] XDP->DRM pixelflut: https://labitat.dk/wiki/Pixelflut-XDR
>
> Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@...jorn.st>

I didn't do a review, but

Ack-by: Thomas Zimmermann <tzimmermann@...e.de>

as it would possible allow to share more code with the fbdev helpers.

Best regards
Thomas

> ---
> This patch applies on top of drm-intel/drm-intel-next (32a120f52a4c)
>
>   drivers/gpu/drm/i915/gem/i915_gem_object.c | 26 ++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> index 58e6c680fe0d..356530b599ce 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
> @@ -873,6 +873,30 @@ bool i915_gem_object_needs_ccs_pages(struct drm_i915_gem_object *obj)
>   	return lmem_placement;
>   }
>   
> +static int i915_gem_vmap_object(struct drm_gem_object *gem_obj,
> +				struct iosys_map *map)
> +{
> +	struct drm_i915_gem_object *obj = to_intel_bo(gem_obj);
> +	void *vaddr;
> +
> +	vaddr = i915_gem_object_pin_map(obj, I915_MAP_WB);
> +	if (IS_ERR(vaddr))
> +		return PTR_ERR(vaddr);
> +
> +	iosys_map_set_vaddr(map, vaddr);
> +
> +	return 0;
> +}
> +
> +static void i915_gem_vunmap_object(struct drm_gem_object *gem_obj,
> +				   struct iosys_map *map)
> +{
> +	struct drm_i915_gem_object *obj = to_intel_bo(gem_obj);
> +
> +	i915_gem_object_flush_map(obj);
> +	i915_gem_object_unpin_map(obj);
> +}
> +
>   void i915_gem_init__objects(struct drm_i915_private *i915)
>   {
>   	INIT_WORK(&i915->mm.free_work, __i915_gem_free_work);
> @@ -896,6 +920,8 @@ static const struct drm_gem_object_funcs i915_gem_object_funcs = {
>   	.free = i915_gem_free_object,
>   	.close = i915_gem_close_object,
>   	.export = i915_gem_prime_export,
> +	.vmap = i915_gem_vmap_object,
> +	.vunmap = i915_gem_vunmap_object,
>   };
>   
>   /**

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ