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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6eca431-7464-09da-333d-a40318422077@suse.de>
Date:   Fri, 1 Sep 2023 12:59:05 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Javier Martinez Canillas <javierm@...hat.com>,
        linux-kernel@...r.kernel.org
Cc:     Geert Uytterhoeven <geert@...ux-m68k.org>,
        dri-devel@...ts.freedesktop.org, Maxime Ripard <mripard@...nel.org>
Subject: Re: [RFC PATCH] drm/ssd130x: Allocate buffer in the CRTC's
 .atomic_check() callback

Hi

Am 01.09.23 um 09:48 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann@...e.de> writes:
> 
>> Hi Javier,
>>
>> another idea about this patch: why not just keep the allocation in the
>> plane's atomic check, but store the temporary buffers in a plane struct.
>> You'd only grow the arrays length in atomic_check and later fetch the
>> pointers in atomic_update. It needs some locking, but nothing complicated.
>>
> 
> Yes, that would work too. Another option is to just move the buffers to
> struct ssd130x_device as it was before commit 45b58669e532 ("drm/ssd130x:

Adding something like a struct ssd130x_plane that holds the temporary 
memory has the advantage of making a clear connection between the memory 
and the plane. If nothing else, to the next programmer reading the code.

> Allocate buffer in the plane's .atomic_check() callback") but just make
> them fixed arrays with the size of the biggest format.

What is the size of the biggest format? I haven't read the driver code, 
but a shadow plane can be up to 4096 pixels wide. It's 16 KiB for 
XRGB888. Not too much, but not nothing either.

To reduce allocation and/or locking overhead, you could try to update 
the pointers in the plane struct with RCU semantics. Plane updates would 
use whatever pointer they saw, while the plane's atomic_check could grow 
the memory buffers as necessary.

Best regards
Thomas

> 
> That will be some memory wasted but will prevent the problem of trying to
> allocate buffers after drm_atomic_helper_swap_state() has been called.
> 
>> Best regards
>> Thomas
>>
>> Am 30.08.23 um 08:25 schrieb Javier Martinez Canillas:
> 

-- 
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)

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