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]
Date:	Thu, 5 Mar 2015 23:12:04 +0100
From:	Maxime Ripard <maxime.ripard@...e-electrons.com>
To:	Thomas Niederprüm <niederp@...sik.uni-kl.de>
Cc:	plagnioj@...osoft.com, tomi.valkeinen@...com,
	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 07/10] fbdev: ssd1307fb: Add module parameter to set
 refresh rate of the display

On Sun, Mar 01, 2015 at 11:28:00PM +0100, Thomas Niederprüm wrote:
> This patch adds the module parameter "refreshrate" to set delay for the
> deferred io. The refresh rate is given in units of Hertz. The default
> refresh rate is 1 Hz.
> 
> Signed-off-by: Thomas Niederprüm <niederp@...sik.uni-kl.de>
> ---
>  drivers/video/fbdev/ssd1307fb.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index c7ed287..ea58e87 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -43,6 +43,11 @@
>  #define	SSD1307FB_SET_COM_PINS_CONFIG	0xda
>  #define	SSD1307FB_SET_VCOMH		0xdb
>  
> +#define REFRASHRATE 1
> +
> +static u_int refreshrate = REFRASHRATE;
> +module_param(refreshrate, uint, 0);
> +
>  static u_int contrast = 128;
>  module_param(contrast, uint, S_IRUGO);
>  
> @@ -270,11 +275,6 @@ static void ssd1307fb_deferred_io(struct fb_info *info,
>  	ssd1307fb_update_display(info->par);
>  }
>  
> -static struct fb_deferred_io ssd1307fb_defio = {
> -	.delay		= HZ,
> -	.deferred_io	= ssd1307fb_deferred_io,
> -};
> -
>  static int ssd1307fb_init(struct ssd1307fb_par *par)
>  {
>  	int ret;
> @@ -475,6 +475,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
>  {
>  	struct fb_info *info;
>  	struct device_node *node = client->dev.of_node;
> +	struct fb_deferred_io *ssd1307fb_defio;
>  	u32 vmem_size;
>  	struct ssd1307fb_par *par;
>  	u8 *vmem;
> @@ -544,10 +545,20 @@ static int ssd1307fb_probe(struct i2c_client *client,
>  		goto fb_alloc_error;
>  	}
>  
> +	ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(struct fb_deferred_io), GFP_KERNEL);
> +	if (!ssd1307fb_defio) {
> +		dev_err(&client->dev, "Couldn't allocate deferred io.\n");
> +		ret = -ENOMEM;
> +		goto fb_alloc_error;
> +	}
> +
> +	ssd1307fb_defio->delay = HZ/refreshrate;

a space around the operator.

I'm not so sure this is a good solution, since you might perfectly
want to have an SSD1305 with a refreshrate of 1Hz, and an SSD1306 with
a refreshrate of 20Hz.

Unfortunately, beside sysfs, I don't really have a better suggestion.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ