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] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd64206e-4d67-6932-30c2-740237a05bd0@suse.de>
Date:   Tue, 27 Sep 2022 13:18:02 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Javier Martinez Canillas <javierm@...hat.com>,
        linux-kernel@...r.kernel.org
Cc:     David Airlie <airlied@...ux.ie>, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] drm/ssd130x: Synchronize access to dma-buf imported GEM
 BOs

Hi

Am 27.09.22 um 11:52 schrieb Javier Martinez Canillas:
> Synchronize CPU access to GEM BOs with other drivers when updating the
> screen buffer. Imported DMA buffers might otherwise contain stale data.
> 
> Suggested-by: Thomas Zimmermann <tzimmermann@...e.de>
> Signed-off-by: Javier Martinez Canillas <javierm@...hat.com>

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

> ---
> 
>   drivers/gpu/drm/solomon/ssd130x.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index a537692100d1..bc41a5ae810a 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -555,11 +555,18 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb, const struct iosys_m
>   	if (!buf)
>   		return -ENOMEM;
>   
> +	ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
> +	if (ret)
> +		goto out_free;
> +
>   	iosys_map_set_vaddr(&dst, buf);
>   	drm_fb_xrgb8888_to_mono(&dst, &dst_pitch, vmap, fb, rect);
>   
> +	drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
> +
>   	ssd130x_update_rect(ssd130x, buf, rect);
>   
> +out_free:
>   	kfree(buf);
>   
>   	return ret;

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ