* Re: [PATCH] video: Add a callback 'notify_after' for backlight
From: Robert Morell @ 2011-08-09 2:34 UTC (permalink / raw)
To: Dilan Lee
Cc: rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
Jordan Nien, Stephen Warren,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1312856996-22452-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On Mon, Aug 08, 2011 at 07:29:56PM -0700, Dilan Lee wrote:
> From: Dilan Lee <dilee@nvidia.com>
>
> We need a callback to do some things after pwm_enable, pwm_disable
> and pwm_config.
>
> Signed-off-by: Dilan Lee <dilee@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Thanks,
Robert
^ permalink raw reply
* [PATCH] video: Add a callback 'notify_after' for backlight control
From: dilee @ 2011-08-09 2:29 UTC (permalink / raw)
To: rpurdie-Fm38FmjxZ/leoWH0uzbU5w, lethal-M7jkjyW5wf5g9hUCZPvPmw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw,
rmorell-DDmLM1+adcrQT0dZR+AlfA,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dilan Lee
In-Reply-To: <1312855525-21464-1-git-send-email-dilee@nvidia.com>
From: Dilan Lee <dilee@nvidia.com>
We need a callback to do some things after pwm_enable, pwm_disable
and pwm_config.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
---
drivers/video/backlight/pwm_bl.c | 9 +++++++++
include/linux/pwm_backlight.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b8f38ec..8b5b2a4 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -28,6 +28,8 @@ struct pwm_bl_data {
unsigned int lth_brightness;
int (*notify)(struct device *,
int brightness);
+ void (*notify_after)(struct device *,
+ int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
+
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, brightness);
+
return 0;
}
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, 0);
return 0;
}
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a..63d2df4 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
+ void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
--
1.7.6
^ permalink raw reply related
* Re: [PATCH] video: Add a callback 'notify_after' for backlight
From: Robert Morell @ 2011-08-09 2:12 UTC (permalink / raw)
To: Dilan Lee
Cc: rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
Jordan Nien, Stephen Warren,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1312855525-21464-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
On Mon, Aug 08, 2011 at 07:05:25PM -0700, Dilan Lee wrote:
[...]
> For example, GPIO backlight_en has to be risen after pwm has been enabled
> to meet panel power on sequence defined in panel specification.
I still think this information is irrelevant/nonsensical here, and
should be omitted entirely..
[...]
> unsigned int lth_brightness;
> int (*notify)(struct device *,
> - int brightness);
> + int brightness);
Please don't change the line above; unlike the one you added after, it
was already lined up properly with its argument list.
Otherwise,
Reviewed-by: Robert Morell <rmorell@nvidia.com>
^ permalink raw reply
* [PATCH] video: Add a callback 'notify_after' for backlight control
From: dilee @ 2011-08-09 2:05 UTC (permalink / raw)
To: rpurdie-Fm38FmjxZ/leoWH0uzbU5w, lethal-M7jkjyW5wf5g9hUCZPvPmw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw,
rmorell-DDmLM1+adcrQT0dZR+AlfA,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dilan Lee
From: Dilan Lee <dilee@nvidia.com>
We need a callback to do some things after pwm_enable, pwm_disable
and pwm_config.
This may be necessary to properly sequence timing on
certain devices.
For example, GPIO backlight_en has to be risen after pwm has been enabled
to meet panel power on sequence defined in panel specification.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
---
drivers/video/backlight/pwm_bl.c | 11 ++++++++++-
include/linux/pwm_backlight.h | 1 +
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b8f38ec..e92e6e0 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -27,7 +27,9 @@ struct pwm_bl_data {
unsigned int period;
unsigned int lth_brightness;
int (*notify)(struct device *,
- int brightness);
+ int brightness);
+ void (*notify_after)(struct device *,
+ int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
+
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, brightness);
+
return 0;
}
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, 0);
return 0;
}
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a..63d2df4 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
+ void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
--
1.7.6
^ permalink raw reply related
* Re: [PATCH] video: Added a callback 'notify_after' for backlight
From: Robert Morell @ 2011-08-08 16:13 UTC (permalink / raw)
To: Dilan Lee
Cc: rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
Jordan Nien, Stephen Warren,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1312799875-18629-1-git-send-email-dilee-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Looks fine to me in principle, but a few nitpicks.
First, the short commit message should be in imperative form, i.e., "Add
a callback..."
On Mon, Aug 08, 2011 at 03:37:55AM -0700, Dilan Lee wrote:
> From: Dilan Lee <dilee@nvidia.com>
>
> We need a callback to do some things after pwm_enable,pwm_disable
> and pwm_config.
Add a space between "pwm_enable,pwm_disable"
> For example, GPIO backlight_en has to be rised after pwm has been enabled
> to meet panel power on sequence defined in panel specification.
There's a typo in "raised" above, but really, this paragraph should be
omitted entirely. Without context, it doesn't make any sense. If
more motivation that the previous paragraph is necessary, maybe add
something like "This may be necessary to properly sequence timing on
certain devices."
> unsigned int lth_brightness;
> int (*notify)(struct device *,
> int brightness);
> + void (*notify_after)(struct device *,
> + int brightness);
The indentation here looks a bit off; notify_after should be lined up
with notify and check_fb, and int brightness doesn't need the extra
spaces since the notify_after argument list starts on a tab boundary.
Otherwise,
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Thanks,
Robert
^ permalink raw reply
* Re: [PATCH] viafb: replace strict_strtoul to kstrto* and check return
From: Florian Tobias Schandinat @ 2011-08-08 10:40 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1312723884-21790-1-git-send-email-wangshaoyan.pt@taobao.com>
Hello Wang,
On 08/08/2011 02:18 AM, stufever@gmail.com wrote:
> From: Wang Shaoyan<wangshaoyan.pt@taobao.com>
>
> This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
>
> drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
>
> Signed-off-by: Wang Shaoyan<wangshaoyan.pt@taobao.com>
Thank you, this looks good, I will apply it.
Best regards,
Florian Tobias Schandinat
> ---
> drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
> 1 files changed, 68 insertions(+), 58 deletions(-)
>
> diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
> index 53aa443..ddf4a9a 100644
> --- a/drivers/video/via/viafbdev.c
> +++ b/drivers/video/via/viafbdev.c
> @@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
> for (i = 0; i< 3; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0, (unsigned long *)®_val);
> + if (kstrtou8(value, 0,®_val)< 0)
> + return -EINVAL;
> DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
> reg_val);
> switch (i) {
> @@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
> for (i = 0; i< 3; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0, (unsigned long *)®_val);
> + if (kstrtou8(value, 0,®_val)< 0)
> + return -EINVAL;
> switch (i) {
> case 0:
> viafb_write_reg_mask(CR9B, VIACR,
> @@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtou8(buf, 0,®_val)< 0)
> + return -EINVAL;
> viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
> return count;
> }
> @@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtou8(buf, 0,®_val)< 0)
> + return -EINVAL;
> viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
> return count;
> }
> @@ -1394,8 +1398,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
> for (i = 0; i< 2; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0,
> - (unsigned long *)®_val.Data);
> + if (kstrtou8(value, 0,®_val.Data)< 0)
> + return -EINVAL;
> switch (i) {
> case 0:
> reg_val.Index = 0x08;
> @@ -1431,8 +1435,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
> for (i = 0; i< 2; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0,
> - (unsigned long *)®_val.Data);
> + if (kstrtou8(value, 0,®_val.Data)< 0)
> + return -EINVAL;
> switch (i) {
> case 0:
> reg_val.Index = 0x08;
> @@ -1950,61 +1954,67 @@ static int __init viafb_setup(void)
> if (!*this_opt)
> continue;
>
> - if (!strncmp(this_opt, "viafb_mode1=", 12))
> + if (!strncmp(this_opt, "viafb_mode1=", 12)) {
> viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_mode=", 11))
> + } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
> viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_bpp1=", 11))
> - strict_strtoul(this_opt + 11, 0,
> - (unsigned long *)&viafb_bpp1);
> - else if (!strncmp(this_opt, "viafb_bpp=", 10))
> - strict_strtoul(this_opt + 10, 0,
> - (unsigned long *)&viafb_bpp);
> - else if (!strncmp(this_opt, "viafb_refresh1=", 15))
> - strict_strtoul(this_opt + 15, 0,
> - (unsigned long *)&viafb_refresh1);
> - else if (!strncmp(this_opt, "viafb_refresh=", 14))
> - strict_strtoul(this_opt + 14, 0,
> - (unsigned long *)&viafb_refresh);
> - else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
> - strict_strtoul(this_opt + 21, 0,
> - (unsigned long *)&viafb_lcd_dsp_method);
> - else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
> - strict_strtoul(this_opt + 19, 0,
> - (unsigned long *)&viafb_lcd_panel_id);
> - else if (!strncmp(this_opt, "viafb_accel=", 12))
> - strict_strtoul(this_opt + 12, 0,
> - (unsigned long *)&viafb_accel);
> - else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
> - strict_strtoul(this_opt + 14, 0,
> - (unsigned long *)&viafb_SAMM_ON);
> - else if (!strncmp(this_opt, "viafb_active_dev=", 17))
> + } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
> + if (kstrtouint(this_opt + 11, 0,&viafb_bpp1)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
> + if (kstrtouint(this_opt + 10, 0,&viafb_bpp)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
> + if (kstrtoint(this_opt + 15, 0,&viafb_refresh1)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
> + if (kstrtoint(this_opt + 14, 0,&viafb_refresh)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
> + if (kstrtoint(this_opt + 21, 0,
> + &viafb_lcd_dsp_method)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
> + if (kstrtoint(this_opt + 19, 0,
> + &viafb_lcd_panel_id)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
> + if (kstrtoint(this_opt + 12, 0,&viafb_accel)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
> + if (kstrtoint(this_opt + 14, 0,&viafb_SAMM_ON)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
> viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
> - else if (!strncmp(this_opt,
> - "viafb_display_hardware_layout=", 30))
> - strict_strtoul(this_opt + 30, 0,
> - (unsigned long *)&viafb_display_hardware_layout);
> - else if (!strncmp(this_opt, "viafb_second_size=", 18))
> - strict_strtoul(this_opt + 18, 0,
> - (unsigned long *)&viafb_second_size);
> - else if (!strncmp(this_opt,
> - "viafb_platform_epia_dvi=", 24))
> - strict_strtoul(this_opt + 24, 0,
> - (unsigned long *)&viafb_platform_epia_dvi);
> - else if (!strncmp(this_opt,
> - "viafb_device_lcd_dualedge=", 26))
> - strict_strtoul(this_opt + 26, 0,
> - (unsigned long *)&viafb_device_lcd_dualedge);
> - else if (!strncmp(this_opt, "viafb_bus_width=", 16))
> - strict_strtoul(this_opt + 16, 0,
> - (unsigned long *)&viafb_bus_width);
> - else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
> - strict_strtoul(this_opt + 15, 0,
> - (unsigned long *)&viafb_lcd_mode);
> - else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
> + } else if (!strncmp(this_opt,
> + "viafb_display_hardware_layout=", 30)) {
> + if (kstrtoint(this_opt + 30, 0,
> + &viafb_display_hardware_layout)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
> + if (kstrtoint(this_opt + 18, 0,&viafb_second_size)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt,
> + "viafb_platform_epia_dvi=", 24)) {
> + if (kstrtoint(this_opt + 24, 0,
> + &viafb_platform_epia_dvi)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt,
> + "viafb_device_lcd_dualedge=", 26)) {
> + if (kstrtoint(this_opt + 26, 0,
> + &viafb_device_lcd_dualedge)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
> + if (kstrtoint(this_opt + 16, 0,&viafb_bus_width)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
> + if (kstrtoint(this_opt + 15, 0,&viafb_lcd_mode)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
> viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
> + } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
> viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
> + }
> }
> return 0;
> }
^ permalink raw reply
* [PATCH] video: Added a callback 'notify_after' for backlight control
From: dilee @ 2011-08-08 10:37 UTC (permalink / raw)
To: rpurdie-Fm38FmjxZ/leoWH0uzbU5w, lethal-M7jkjyW5wf5g9hUCZPvPmw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
arun.murthy-0IS4wlFg1OjSUeElwK9/Pw,
rmorell-DDmLM1+adcrQT0dZR+AlfA,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw
Cc: jnien-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Dilan Lee
From: Dilan Lee <dilee@nvidia.com>
We need a callback to do some things after pwm_enable,pwm_disable
and pwm_config.
For example, GPIO backlight_en has to be rised after pwm has been enabled
to meet panel power on sequence defined in panel specification.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
---
drivers/video/backlight/pwm_bl.c | 9 +++++++++
include/linux/pwm_backlight.h | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index b8f38ec..d9a16e5 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -28,6 +28,8 @@ struct pwm_bl_data {
unsigned int lth_brightness;
int (*notify)(struct device *,
int brightness);
+ void (*notify_after)(struct device *,
+ int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}
+
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, brightness);
+
return 0;
}
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->period = data->pwm_period_ns;
pb->notify = data->notify;
+ pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
+ if (pb->notify_after)
+ pb->notify_after(pb->dev, 0);
return 0;
}
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a..63d2df4 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
+ void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
--
1.7.5.4
^ permalink raw reply related
* [RFC] fbdev: allow multiple concurrent visible consoles
From: Florian Tobias Schandinat @ 2011-08-08 10:37 UTC (permalink / raw)
To: linux-fbdev
Cc: linux-kernel, Florian Tobias Schandinat, Geert Uytterhoeven,
Paul Mundt, Andrew Morton, Dave Airlie
This patch allows having multiple visible consoles that receive
display updates. For example one can have running "top" to monitor
the system on fb0 and at the same time work on a shell on fb1.
At the moment that works only with consoles, not with console and
graphical application nor with two graphical applications.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/console/fbcon.c | 13 ++++++++++++-
drivers/video/console/fbcon.h | 1 +
2 files changed, 13 insertions(+), 1 deletions(-)
There are probably still some bugs in this and it requires a lot of
review and testing before it ready for inclusion. I just want to
know whether it looks good and whether the approach taken
(it's my 3rd) is acceptable. I think the feature is desirable
and I hope that we can avoid the limitation to consoles only one day.
The problem that causes it is that the vt.c has a global blanking
variable it sets as soon as any graphical application starts and
hence no console updates go through anymore.
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 8745637..5246a15 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -710,8 +710,11 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
if (!err) {
info->fbcon_par = ops;
- if (vc)
+ if (vc) {
+ ops->vc_fg = vc;
+ vc->vc_display_fg = &ops->vc_fg;
set_blitting_type(vc, info);
+ }
}
if (err) {
@@ -814,6 +817,7 @@ static int set_con2fb_map(int unit, int newidx, int user)
{
struct vc_data *vc = vc_cons[unit].d;
int oldidx = con2fb_map[unit];
+ struct fbcon_ops *ops;
struct fb_info *info = registered_fb[newidx];
struct fb_info *oldinfo = NULL;
int found, err = 0;
@@ -839,6 +843,11 @@ static int set_con2fb_map(int unit, int newidx, int user)
if (!err && !found)
err = con2fb_acquire_newinfo(vc, info, unit, oldidx);
+ if (!err && oldinfo) {
+ ops = oldinfo->fbcon_par;
+ if (vc = ops->vc_fg)
+ ops->vc_fg = NULL;
+ }
/*
* If old fb is not mapped to any of the consoles,
@@ -849,6 +858,8 @@ static int set_con2fb_map(int unit, int newidx, int user)
found);
if (!err) {
+ ops = info->fbcon_par;
+ vc->vc_display_fg = &ops->vc_fg;
int show_logo = (fg_console = 0 && !user &&
logo_shown != FBCON_LOGO_DONTSHOW);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..adc7316 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -69,6 +69,7 @@ struct fbcon_ops {
struct timer_list cursor_timer; /* Cursor timer */
struct fb_cursor cursor_state;
struct display *p;
+ struct vc_data *vc_fg;
int currcon; /* Current VC. */
int cursor_flash;
int cursor_reset;
--
1.6.3.2
^ permalink raw reply related
* [PATCH] viafb: replace strict_strtoul to kstrto* and check return value
From: stufever @ 2011-08-08 2:18 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1312723884-21790-1-git-send-email-wangshaoyan.pt@taobao.com>
From: Wang Shaoyan <wangshaoyan.pt@taobao.com>
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
1 files changed, 68 insertions(+), 58 deletions(-)
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 53aa443..ddf4a9a 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
reg_val);
switch (i) {
@@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
switch (i) {
case 0:
viafb_write_reg_mask(CR9B, VIACR,
@@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, 0, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
return count;
}
@@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, 0, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
return count;
}
@@ -1394,8 +1398,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1431,8 +1435,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1950,61 +1954,67 @@ static int __init viafb_setup(void)
if (!*this_opt)
continue;
- if (!strncmp(this_opt, "viafb_mode1=", 12))
+ if (!strncmp(this_opt, "viafb_mode1=", 12)) {
viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_mode=", 11))
+ } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_bpp1=", 11))
- strict_strtoul(this_opt + 11, 0,
- (unsigned long *)&viafb_bpp1);
- else if (!strncmp(this_opt, "viafb_bpp=", 10))
- strict_strtoul(this_opt + 10, 0,
- (unsigned long *)&viafb_bpp);
- else if (!strncmp(this_opt, "viafb_refresh1=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_refresh1);
- else if (!strncmp(this_opt, "viafb_refresh=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_refresh);
- else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
- strict_strtoul(this_opt + 21, 0,
- (unsigned long *)&viafb_lcd_dsp_method);
- else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
- strict_strtoul(this_opt + 19, 0,
- (unsigned long *)&viafb_lcd_panel_id);
- else if (!strncmp(this_opt, "viafb_accel=", 12))
- strict_strtoul(this_opt + 12, 0,
- (unsigned long *)&viafb_accel);
- else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_SAMM_ON);
- else if (!strncmp(this_opt, "viafb_active_dev=", 17))
+ } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
+ if (kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
+ if (kstrtouint(this_opt + 10, 0, &viafb_bpp) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_refresh1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_refresh) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
+ if (kstrtoint(this_opt + 21, 0,
+ &viafb_lcd_dsp_method) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
+ if (kstrtoint(this_opt + 19, 0,
+ &viafb_lcd_panel_id) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
+ if (kstrtoint(this_opt + 12, 0, &viafb_accel) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_SAMM_ON) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
- else if (!strncmp(this_opt,
- "viafb_display_hardware_layout=", 30))
- strict_strtoul(this_opt + 30, 0,
- (unsigned long *)&viafb_display_hardware_layout);
- else if (!strncmp(this_opt, "viafb_second_size=", 18))
- strict_strtoul(this_opt + 18, 0,
- (unsigned long *)&viafb_second_size);
- else if (!strncmp(this_opt,
- "viafb_platform_epia_dvi=", 24))
- strict_strtoul(this_opt + 24, 0,
- (unsigned long *)&viafb_platform_epia_dvi);
- else if (!strncmp(this_opt,
- "viafb_device_lcd_dualedge=", 26))
- strict_strtoul(this_opt + 26, 0,
- (unsigned long *)&viafb_device_lcd_dualedge);
- else if (!strncmp(this_opt, "viafb_bus_width=", 16))
- strict_strtoul(this_opt + 16, 0,
- (unsigned long *)&viafb_bus_width);
- else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_lcd_mode);
- else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
+ } else if (!strncmp(this_opt,
+ "viafb_display_hardware_layout=", 30)) {
+ if (kstrtoint(this_opt + 30, 0,
+ &viafb_display_hardware_layout) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
+ if (kstrtoint(this_opt + 18, 0, &viafb_second_size) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_platform_epia_dvi=", 24)) {
+ if (kstrtoint(this_opt + 24, 0,
+ &viafb_platform_epia_dvi) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_device_lcd_dualedge=", 26)) {
+ if (kstrtoint(this_opt + 26, 0,
+ &viafb_device_lcd_dualedge) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
+ if (kstrtoint(this_opt + 16, 0, &viafb_bus_width) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_lcd_mode) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
+ } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
+ }
}
return 0;
}
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH V2] viafb: replace strict_strtoul to kstrto* and check
From: Florian Tobias Schandinat @ 2011-08-08 0:10 UTC (permalink / raw)
To: stufever; +Cc: linux-kernel, linux-fbdev, lethal, Wang Shaoyan
In-Reply-To: <1312760553-2143-1-git-send-email-wangshaoyan.pt@taobao.com>
On 08/07/2011 11:42 PM, stufever@gmail.com wrote:
> diff --git drivers/video/via/viafbdev.c drivers/video/via/viafbdev.c
Um, you did something different this time, causing another (not critical)
checkpatch warning
WARNING: patch prefix 'drivers' exists, appears to be a -p0 patch
> @@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtou8(buf, -1,®_val)< 0)
Did you miss my comment about the -1 above last time? Why it is there?
> + return -EINVAL;
> viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
> return count;
> }
Thanks,
Florian Tobias Schandinat
^ permalink raw reply
* [PATCH V2] viafb: replace strict_strtoul to kstrto* and check return value
From: stufever @ 2011-08-07 23:42 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-fbdev, FlorianSchandinat, lethal, Wang Shaoyan
From: Wang Shaoyan <wangshaoyan.pt@taobao.com>
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
1 files changed, 68 insertions(+), 58 deletions(-)
Change since V1:
1.use kstrto*, not kstrtoul
2.replace &buf[0] to buf
diff --git drivers/video/via/viafbdev.c drivers/video/via/viafbdev.c
index 53aa443..0186cd7 100644
--- drivers/video/via/viafbdev.c
+++ drivers/video/via/viafbdev.c
@@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
reg_val);
switch (i) {
@@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
switch (i) {
case 0:
viafb_write_reg_mask(CR9B, VIACR,
@@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, 0, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
return count;
}
@@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, -1, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
return count;
}
@@ -1394,8 +1398,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1431,8 +1435,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1950,61 +1954,67 @@ static int __init viafb_setup(void)
if (!*this_opt)
continue;
- if (!strncmp(this_opt, "viafb_mode1=", 12))
+ if (!strncmp(this_opt, "viafb_mode1=", 12)) {
viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_mode=", 11))
+ } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_bpp1=", 11))
- strict_strtoul(this_opt + 11, 0,
- (unsigned long *)&viafb_bpp1);
- else if (!strncmp(this_opt, "viafb_bpp=", 10))
- strict_strtoul(this_opt + 10, 0,
- (unsigned long *)&viafb_bpp);
- else if (!strncmp(this_opt, "viafb_refresh1=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_refresh1);
- else if (!strncmp(this_opt, "viafb_refresh=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_refresh);
- else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
- strict_strtoul(this_opt + 21, 0,
- (unsigned long *)&viafb_lcd_dsp_method);
- else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
- strict_strtoul(this_opt + 19, 0,
- (unsigned long *)&viafb_lcd_panel_id);
- else if (!strncmp(this_opt, "viafb_accel=", 12))
- strict_strtoul(this_opt + 12, 0,
- (unsigned long *)&viafb_accel);
- else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_SAMM_ON);
- else if (!strncmp(this_opt, "viafb_active_dev=", 17))
+ } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
+ if (kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
+ if (kstrtouint(this_opt + 10, 0, &viafb_bpp) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_refresh1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_refresh) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
+ if (kstrtoint(this_opt + 21, 0,
+ &viafb_lcd_dsp_method) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
+ if (kstrtoint(this_opt + 19, 0,
+ &viafb_lcd_panel_id) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
+ if (kstrtoint(this_opt + 12, 0, &viafb_accel) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_SAMM_ON) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
- else if (!strncmp(this_opt,
- "viafb_display_hardware_layout=", 30))
- strict_strtoul(this_opt + 30, 0,
- (unsigned long *)&viafb_display_hardware_layout);
- else if (!strncmp(this_opt, "viafb_second_size=", 18))
- strict_strtoul(this_opt + 18, 0,
- (unsigned long *)&viafb_second_size);
- else if (!strncmp(this_opt,
- "viafb_platform_epia_dvi=", 24))
- strict_strtoul(this_opt + 24, 0,
- (unsigned long *)&viafb_platform_epia_dvi);
- else if (!strncmp(this_opt,
- "viafb_device_lcd_dualedge=", 26))
- strict_strtoul(this_opt + 26, 0,
- (unsigned long *)&viafb_device_lcd_dualedge);
- else if (!strncmp(this_opt, "viafb_bus_width=", 16))
- strict_strtoul(this_opt + 16, 0,
- (unsigned long *)&viafb_bus_width);
- else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_lcd_mode);
- else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
+ } else if (!strncmp(this_opt,
+ "viafb_display_hardware_layout=", 30)) {
+ if (kstrtoint(this_opt + 30, 0,
+ &viafb_display_hardware_layout) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
+ if (kstrtoint(this_opt + 18, 0, &viafb_second_size) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_platform_epia_dvi=", 24)) {
+ if (kstrtoint(this_opt + 24, 0,
+ &viafb_platform_epia_dvi) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_device_lcd_dualedge=", 26)) {
+ if (kstrtoint(this_opt + 26, 0,
+ &viafb_device_lcd_dualedge) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
+ if (kstrtoint(this_opt + 16, 0, &viafb_bus_width) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_lcd_mode) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
+ } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
+ }
}
return 0;
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH V2] replace strict_strtoul to kstrto[*] and check return
From: Florian Tobias Schandinat @ 2011-08-07 17:36 UTC (permalink / raw)
To: stufever; +Cc: linux-kernel, linux-fbdev, lethal, Wang Shaoyan
In-Reply-To: <1312730922-1211-1-git-send-email-wangshaoyan.pt@taobao.com>
Hi Wang,
On 08/07/2011 03:28 PM, stufever@gmail.com wrote:
> From: Wang Shaoyan<wangshaoyan.pt@taobao.com>
>
> Change since V1:
> 1.use kstrto*, not kstrtoul
> 2.replace&buf[0] to buf
it is good that you wrote what you changed. But it would be better if you write
it below the commit message like this
<commit message>
Signed-off-by:
---
drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
1 files changed, 68 insertions(+), 58 deletions(-)
Change since V1:
as nobody really cares what changed in different patch versions once the final
version is applied in git. And if you do it this way I could just do "git am -s
<patch>" and would get the commit message without the history.
> This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
>
> drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
Thanks this looks much saner. Just 2 little issues before it is good enough, I
think.
./scripts/checkpatch.pl ./\[PATCH\ V2\]\ replace\ strict_strtoul\ to\
kstrto\[\*\]\ and\ check\ return\ value.eml
ERROR: trailing whitespace
#173: FILE: drivers/video/via/viafbdev.c:1974:
+^I^I^Iif (kstrtoint(this_opt + 21, 0, $
ERROR: trailing whitespace
#177: FILE: drivers/video/via/viafbdev.c:1978:
+^I^I^Iif (kstrtoint(this_opt + 19, 0, $
ERROR: trailing whitespace
#212: FILE: drivers/video/via/viafbdev.c:1991:
+^I^I^Iif (kstrtoint(this_opt + 30, 0, $
ERROR: trailing whitespace
#220: FILE: drivers/video/via/viafbdev.c:1999:
+^I^I^Iif (kstrtoint(this_opt + 24, 0, $
total: 4 errors, 0 warnings, 173 lines checked
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
scripts/cleanfile
./[PATCH V2] replace strict_strtoul to kstrto[*] and check return value.eml has
style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Can you please fix those?
> Signed-off-by: Wang Shaoyan<wangshaoyan.pt@taobao.com>
> ---
> drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
> 1 files changed, 68 insertions(+), 58 deletions(-)
>
> diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
> index 53aa443..7074fc7 100644
> --- a/drivers/video/via/viafbdev.c
> +++ b/drivers/video/via/viafbdev.c
[snip]
> @@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtou8(buf, -1,®_val)< 0)
> + return -EINVAL;
> viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
> return count;
> }
Using -1 instead 0 as base here? Why? What does this cause?
I assume that it should be 0.
Thanks,
Florian Tobias Schandinat
^ permalink raw reply
* [PATCH 6/6] viafb: get rid of the remaining modetable structure assumptions
From: Florian Tobias Schandinat @ 2011-08-07 15:52 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
This patch removes the remaining places where assumptions about the
structure of the modetable were made. Aside from some places where
assumptions are made that certain modes are in the modetable the
only code dealing with the modetable and not just a single mode is
in viamode. This will allow chaniging the modetable and use other
sources for videomodes like the subsystem or EDID.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/global.c | 2 ++
drivers/video/via/global.h | 2 ++
drivers/video/via/hw.c | 23 +++++++----------------
drivers/video/via/hw.h | 3 +--
drivers/video/via/viafbdev.c | 14 +++-----------
drivers/video/via/viamode.c | 4 ++--
drivers/video/via/viamode.h | 2 --
7 files changed, 17 insertions(+), 33 deletions(-)
diff --git a/drivers/video/via/global.c b/drivers/video/via/global.c
index e10d824..3102171 100644
--- a/drivers/video/via/global.c
+++ b/drivers/video/via/global.c
@@ -35,6 +35,8 @@ int viafb_LCD_ON ;
int viafb_LCD2_ON;
int viafb_SAMM_ON;
int viafb_dual_fb;
+unsigned int viafb_second_xres = 640;
+unsigned int viafb_second_yres = 480;
int viafb_hotplug_Xres = 640;
int viafb_hotplug_Yres = 480;
int viafb_hotplug_bpp = 32;
diff --git a/drivers/video/via/global.h b/drivers/video/via/global.h
index ff969dc..275dbbb 100644
--- a/drivers/video/via/global.h
+++ b/drivers/video/via/global.h
@@ -67,6 +67,8 @@ extern int viafb_lcd_dsp_method;
extern int viafb_lcd_mode;
extern int viafb_CRT_ON;
+extern unsigned int viafb_second_xres;
+extern unsigned int viafb_second_yres;
extern int viafb_hotplug_Xres;
extern int viafb_hotplug_Yres;
extern int viafb_hotplug_bpp;
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 30668bd..d5aaca9 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1840,23 +1840,16 @@ static void hw_init(void)
load_fix_bit_crtc_reg();
}
-int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
- struct VideoModeTable *vmode_tbl1, int video_bpp1)
+int viafb_setmode(int video_bpp, int video_bpp1)
{
int j;
int port;
u32 devices = viaparinfo->shared->iga1_devices
| viaparinfo->shared->iga2_devices;
u8 value, index, mask;
- struct crt_mode_table *crt_timing;
- struct crt_mode_table *crt_timing1 = NULL;
struct fb_var_screeninfo var2;
device_screen_off();
- crt_timing = vmode_tbl->crtc;
- if (viafb_SAMM_ON = 1)
- crt_timing1 = vmode_tbl1->crtc;
-
device_off();
via_set_state(devices, VIA_STATE_OFF);
@@ -1865,9 +1858,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
/* Update Patch Register */
if ((viaparinfo->chip_info->gfx_chip_name = UNICHROME_CLE266
- || viaparinfo->chip_info->gfx_chip_name = UNICHROME_K400)
- && vmode_tbl->crtc[0].crtc.hor_addr = 1024
- && vmode_tbl->crtc[0].crtc.ver_addr = 768) {
+ || viaparinfo->chip_info->gfx_chip_name = UNICHROME_K400)
+ && viafbinfo->var.xres = 1024 && viafbinfo->var.yres = 768) {
for (j = 0; j < res_patch_table[0].table_length; j++) {
index = res_patch_table[0].io_reg_table[j].index;
port = res_patch_table[0].io_reg_table[j].port;
@@ -1898,8 +1890,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
var2 = viafbinfo1->var;
} else if (viafb_SAMM_ON) {
viafb_fill_var_timing_info(&var2, viafb_get_best_mode(
- vmode_tbl1->crtc->crtc.hor_addr,
- vmode_tbl1->crtc->crtc.ver_addr, viafb_refresh1));
+ viafb_second_xres, viafb_second_yres, viafb_refresh1));
var2.bits_per_pixel = viafbinfo->var.bits_per_pixel;
}
@@ -1916,7 +1907,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
/* Patch if set_hres is not 8 alignment (1366) to viafb_setmode
to 8 alignment (1368),there is several pixels (2 pixels)
on right side of screen. */
- if (vmode_tbl->crtc[0].crtc.hor_addr % 8) {
+ if (viafbinfo->var.xres % 8) {
viafb_unlock_crt();
viafb_write_reg(CR02, VIACR,
viafb_read_reg(VIACR, CR02) - 1);
@@ -1974,8 +1965,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
/* If set mode normally, save resolution information for hot-plug . */
if (!viafb_hotplug) {
- viafb_hotplug_Xres = vmode_tbl->crtc[0].crtc.hor_addr;
- viafb_hotplug_Yres = vmode_tbl->crtc[0].crtc.ver_addr;
+ viafb_hotplug_Xres = viafbinfo->var.xres;
+ viafb_hotplug_Yres = viafbinfo->var.yres;
viafb_hotplug_bpp = video_bpp;
viafb_hotplug_refresh = viafb_refresh;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 46f65da..4db5b6e 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -657,8 +657,7 @@ void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active);
void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
*p_gfx_dpa_setting);
-int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
- struct VideoModeTable *vmode_tbl1, int video_bpp1);
+int viafb_setmode(int video_bpp, int video_bpp1);
void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
struct crt_mode_table *mode);
void __devinit viafb_init_chip_info(int chip_type);
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 0c0ef95..3856784 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -38,8 +38,6 @@ static char *viafb_mode1;
static int viafb_bpp = 32;
static int viafb_bpp1 = 32;
-static unsigned int viafb_second_xres = 640;
-static unsigned int viafb_second_yres = 480;
static unsigned int viafb_second_offset;
static int viafb_second_size;
@@ -267,7 +265,6 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
static int viafb_set_par(struct fb_info *info)
{
struct viafb_par *viapar = info->par;
- struct VideoModeTable *vmode_entry, *vmode_entry1 = NULL;
int refresh;
DEBUG_MSG(KERN_INFO "viafb_set_par!\n");
@@ -276,10 +273,7 @@ static int viafb_set_par(struct fb_info *info)
viafb_update_device_setting(viafbinfo->var.xres, viafbinfo->var.yres,
viafbinfo->var.bits_per_pixel, 0);
- vmode_entry = viafb_get_mode(viafbinfo->var.xres, viafbinfo->var.yres);
if (viafb_dual_fb) {
- vmode_entry1 = viafb_get_mode(viafbinfo1->var.xres,
- viafbinfo1->var.yres);
viafb_update_device_setting(viafbinfo1->var.xres,
viafbinfo1->var.yres, viafbinfo1->var.bits_per_pixel,
1);
@@ -287,8 +281,6 @@ static int viafb_set_par(struct fb_info *info)
DEBUG_MSG(KERN_INFO
"viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
viafb_second_xres, viafb_second_yres, viafb_bpp1);
- vmode_entry1 = viafb_get_mode(viafb_second_xres,
- viafb_second_yres);
viafb_update_device_setting(viafb_second_xres,
viafb_second_yres, viafb_bpp1, 1);
@@ -296,7 +288,8 @@ static int viafb_set_par(struct fb_info *info)
refresh = viafb_get_refresh(info->var.xres, info->var.yres,
get_var_refresh(&info->var));
- if (vmode_entry) {
+ if (viafb_get_best_mode(viafbinfo->var.xres, viafbinfo->var.yres,
+ refresh)) {
if (viafb_dual_fb && viapar->iga_path = IGA2) {
viafb_bpp1 = info->var.bits_per_pixel;
viafb_refresh1 = refresh;
@@ -309,8 +302,7 @@ static int viafb_set_par(struct fb_info *info)
info->flags &= ~FBINFO_HWACCEL_DISABLED;
else
info->flags |= FBINFO_HWACCEL_DISABLED;
- viafb_setmode(vmode_entry, info->var.bits_per_pixel,
- vmode_entry1, viafb_bpp1);
+ viafb_setmode(info->var.bits_per_pixel, viafb_bpp1);
viafb_pan_display(&info->var, info);
}
diff --git a/drivers/video/via/viamode.c b/drivers/video/via/viamode.c
index 88096e5..0911cac 100644
--- a/drivers/video/via/viamode.c
+++ b/drivers/video/via/viamode.c
@@ -896,7 +896,7 @@ static struct crt_mode_table *get_best_mode(struct VideoModeTable *vmt,
return best;
}
-struct VideoModeTable *viafb_get_mode(int hres, int vres)
+static struct VideoModeTable *viafb_get_mode(int hres, int vres)
{
return get_modes(viafb_modes, ARRAY_SIZE(viafb_modes), hres, vres);
}
@@ -906,7 +906,7 @@ struct crt_mode_table *viafb_get_best_mode(int hres, int vres, int refresh)
return get_best_mode(viafb_get_mode(hres, vres), refresh);
}
-struct VideoModeTable *viafb_get_rb_mode(int hres, int vres)
+static struct VideoModeTable *viafb_get_rb_mode(int hres, int vres)
{
return get_modes(viafb_rb_modes, ARRAY_SIZE(viafb_rb_modes), hres,
vres);
diff --git a/drivers/video/via/viamode.h b/drivers/video/via/viamode.h
index 0396581..5917a2b 100644
--- a/drivers/video/via/viamode.h
+++ b/drivers/video/via/viamode.h
@@ -60,9 +60,7 @@ extern struct io_reg PM1024x768[];
extern struct patch_table res_patch_table[];
extern struct VPITTable VPIT;
-struct VideoModeTable *viafb_get_mode(int hres, int vres);
struct crt_mode_table *viafb_get_best_mode(int hres, int vres, int refresh);
-struct VideoModeTable *viafb_get_rb_mode(int hres, int vres);
struct crt_mode_table *viafb_get_best_rb_mode(int hres, int vres, int refresh);
#endif /* __VIAMODE_H__ */
--
1.6.3.2
^ permalink raw reply related
* [PATCH 5/6] viafb: eliminate modetable dependancy of LCD modesetting
From: Florian Tobias Schandinat @ 2011-08-07 15:52 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
This patch removes the need for knowing the modetable structure
within the LCD modesetting function. The magic 60Hz refresh rate was
already there as always the first entry for a resolution was choosen
based on the ascending refresh rate ordering in the modetable.
For all but one this is at least 60Hz, if only higher frequencies
available we choose those like the code before did. The exception is
OLPC but that resolution has only one frequency so we get the same
behaviour there as well.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/hw.c | 20 ++++++++------------
drivers/video/via/lcd.c | 12 +++++-------
drivers/video/via/lcd.h | 5 ++---
3 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 76fad92..30668bd 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1937,9 +1937,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
if (viafb_SAMM_ON &&
(viaparinfo->lvds_setting_info->iga_path = IGA2)) {
viaparinfo->lvds_setting_info->bpp = video_bpp1;
- viafb_lcd_set_mode(crt_timing1, viaparinfo->
- lvds_setting_info,
- &viaparinfo->chip_info->lvds_chip_info);
+ viafb_lcd_set_mode(viaparinfo->lvds_setting_info,
+ &viaparinfo->chip_info->lvds_chip_info);
} else {
/* IGA1 doesn't have LCD scaling, so set it center. */
if (viaparinfo->lvds_setting_info->iga_path = IGA1) {
@@ -1947,18 +1946,16 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
LCD_CENTERING;
}
viaparinfo->lvds_setting_info->bpp = video_bpp;
- viafb_lcd_set_mode(crt_timing, viaparinfo->
- lvds_setting_info,
- &viaparinfo->chip_info->lvds_chip_info);
+ viafb_lcd_set_mode(viaparinfo->lvds_setting_info,
+ &viaparinfo->chip_info->lvds_chip_info);
}
}
if (viafb_LCD2_ON) {
if (viafb_SAMM_ON &&
(viaparinfo->lvds_setting_info2->iga_path = IGA2)) {
viaparinfo->lvds_setting_info2->bpp = video_bpp1;
- viafb_lcd_set_mode(crt_timing1, viaparinfo->
- lvds_setting_info2,
- &viaparinfo->chip_info->lvds_chip_info2);
+ viafb_lcd_set_mode(viaparinfo->lvds_setting_info2,
+ &viaparinfo->chip_info->lvds_chip_info2);
} else {
/* IGA1 doesn't have LCD scaling, so set it center. */
if (viaparinfo->lvds_setting_info2->iga_path = IGA1) {
@@ -1966,9 +1963,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
LCD_CENTERING;
}
viaparinfo->lvds_setting_info2->bpp = video_bpp;
- viafb_lcd_set_mode(crt_timing, viaparinfo->
- lvds_setting_info2,
- &viaparinfo->chip_info->lvds_chip_info2);
+ viafb_lcd_set_mode(viaparinfo->lvds_setting_info2,
+ &viaparinfo->chip_info->lvds_chip_info2);
}
}
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 0a38e4d..5f3b4e3 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -548,9 +548,8 @@ static void lcd_patch_skew(struct lvds_setting_information
}
/* LCD Set Mode */
-void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
- struct lvds_setting_information *plvds_setting_info,
- struct lvds_chip_information *plvds_chip_info)
+void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info,
+ struct lvds_chip_information *plvds_chip_info)
{
int set_iga = plvds_setting_info->iga_path;
int mode_bpp = plvds_setting_info->bpp;
@@ -560,15 +559,14 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
int panel_vres = plvds_setting_info->lcd_panel_vres;
u32 clock;
struct display_timing mode_crt_reg, panel_crt_reg, timing;
- struct crt_mode_table *panel_crt_table = NULL;
- struct VideoModeTable *vmode_tbl = viafb_get_mode(panel_hres,
- panel_vres);
+ struct crt_mode_table *mode_crt_table, *panel_crt_table;
DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
/* Get mode table */
+ mode_crt_table = viafb_get_best_mode(set_hres, set_vres, 60);
mode_crt_reg = mode_crt_table->crtc;
/* Get panel table Pointer */
- panel_crt_table = vmode_tbl->crtc;
+ panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
panel_crt_reg = panel_crt_table->crtc;
DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n");
if (VT1636_LVDS = plvds_chip_info->lvds_chip_name)
diff --git a/drivers/video/via/lcd.h b/drivers/video/via/lcd.h
index 3b9e539..77ca7b8 100644
--- a/drivers/video/via/lcd.h
+++ b/drivers/video/via/lcd.h
@@ -76,9 +76,8 @@ void __devinit viafb_init_lvds_output_interface(struct lvds_chip_information
*plvds_chip_info,
struct lvds_setting_information
*plvds_setting_info);
-void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
- struct lvds_setting_information *plvds_setting_info,
- struct lvds_chip_information *plvds_chip_info);
+void viafb_lcd_set_mode(struct lvds_setting_information *plvds_setting_info,
+ struct lvds_chip_information *plvds_chip_info);
bool __devinit viafb_lvds_trasmitter_identify(void);
void viafb_init_lvds_output_interface(struct lvds_chip_information
*plvds_chip_info,
--
1.6.3.2
^ permalink raw reply related
* [PATCH 4/6] viafb: seperate hardware initialization
From: Florian Tobias Schandinat @ 2011-08-07 15:51 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
This patch splits the hardware initialization out of the modesetting
function which will make it easier to make it conditional and not
require starting from scratch for every mode change, which is
especially annoying in dual framebuffer mode.
This required some minor reordering but it should not influence its
functionality.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/hw.c | 48 ++++++++++++++++++++++++++++--------------------
1 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 6845c82..76fad92 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1769,24 +1769,9 @@ static u8 get_sync(struct fb_info *info)
return polarity;
}
-int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
- struct VideoModeTable *vmode_tbl1, int video_bpp1)
+static void hw_init(void)
{
- int i, j;
- int port;
- u32 devices = viaparinfo->shared->iga1_devices
- | viaparinfo->shared->iga2_devices;
- u8 value, index, mask;
- struct crt_mode_table *crt_timing;
- struct crt_mode_table *crt_timing1 = NULL;
- struct fb_var_screeninfo var2;
-
- device_screen_off();
- crt_timing = vmode_tbl->crtc;
-
- if (viafb_SAMM_ON = 1) {
- crt_timing1 = vmode_tbl1->crtc;
- }
+ int i;
inb(VIAStatus);
outb(0x00, VIAAR);
@@ -1825,9 +1810,8 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
break;
}
+ /* probably this should go to the scaling code one day */
viafb_write_regx(scaling_parameters, ARRAY_SIZE(scaling_parameters));
- device_off();
- via_set_state(devices, VIA_STATE_OFF);
/* Fill VPIT Parameters */
/* Write Misc Register */
@@ -1853,6 +1837,31 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
inb(VIAStatus);
outb(0x20, VIAAR);
+ load_fix_bit_crtc_reg();
+}
+
+int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
+ struct VideoModeTable *vmode_tbl1, int video_bpp1)
+{
+ int j;
+ int port;
+ u32 devices = viaparinfo->shared->iga1_devices
+ | viaparinfo->shared->iga2_devices;
+ u8 value, index, mask;
+ struct crt_mode_table *crt_timing;
+ struct crt_mode_table *crt_timing1 = NULL;
+ struct fb_var_screeninfo var2;
+
+ device_screen_off();
+ crt_timing = vmode_tbl->crtc;
+ if (viafb_SAMM_ON = 1)
+ crt_timing1 = vmode_tbl1->crtc;
+
+ device_off();
+ via_set_state(devices, VIA_STATE_OFF);
+
+ hw_init();
+
/* Update Patch Register */
if ((viaparinfo->chip_info->gfx_chip_name = UNICHROME_CLE266
@@ -1868,7 +1877,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
}
}
- load_fix_bit_crtc_reg();
via_set_primary_pitch(viafbinfo->fix.line_length);
via_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length
: viafbinfo->fix.line_length);
--
1.6.3.2
^ permalink raw reply related
* [PATCH 3/6] viafb: use information in var for modesetting
From: Florian Tobias Schandinat @ 2011-08-07 15:51 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
This patch starts to use the information in var for modesetting for
CRT and DVI devices. This is the right thing as it allows us to use
more generic modes than the ones predefined by VIA. We do not yet
allow more generic modes as check_var still limits them to the
predefined ones but with this patch applied it would be really easy
to do so. A problem was VIAs SAMM mode as it has 2 different modes
but just one frame buffer device. This is solved by creating a
pseudo var which contains enough information to use it for
modesetting. Hopefully one day we can use information in var for all
modes that do not involve hardware scaling.
Well I'd like to say that the chance of regressions is low but it is
quite likely that the behaviour in some cases changed especially
when SAMM is involved. I hope we made it better than before in
particular the DVI frequency check was probably broken before and
hopefully works better now.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/dvi.c | 30 +++++--------
drivers/video/via/dvi.h | 3 +-
drivers/video/via/hw.c | 107 +++++++++++++++++++++--------------------------
drivers/video/via/hw.h | 4 +-
4 files changed, 61 insertions(+), 83 deletions(-)
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index c7ff5c0..9138e51 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -172,28 +172,20 @@ static int tmds_register_read_bytes(int index, u8 *buff, int buff_len)
}
/* DVI Set Mode */
-void viafb_dvi_set_mode(struct VideoModeTable *mode, int mode_bpp,
- int set_iga)
+void viafb_dvi_set_mode(const struct fb_var_screeninfo *var, int iga)
{
- struct VideoModeTable *rb_mode;
- struct crt_mode_table *pDviTiming;
- unsigned long desirePixelClock, maxPixelClock;
- pDviTiming = mode->crtc;
- desirePixelClock = pDviTiming->refresh_rate
- * pDviTiming->crtc.hor_total * pDviTiming->crtc.ver_total
- / 1000000;
- maxPixelClock = (unsigned long)viaparinfo->
- tmds_setting_info->max_pixel_clock;
-
- DEBUG_MSG(KERN_INFO "\nDVI_set_mode!!\n");
-
- if ((maxPixelClock != 0) && (desirePixelClock > maxPixelClock)) {
- rb_mode = viafb_get_rb_mode(mode->crtc[0].crtc.hor_addr,
- mode->crtc[0].crtc.ver_addr);
+ struct fb_var_screeninfo dvi_var = *var;
+ struct crt_mode_table *rb_mode;
+ int maxPixelClock;
+
+ maxPixelClock = viaparinfo->shared->tmds_setting_info.max_pixel_clock;
+ if (maxPixelClock && PICOS2KHZ(var->pixclock) / 1000 > maxPixelClock) {
+ rb_mode = viafb_get_best_rb_mode(var->xres, var->yres, 60);
if (rb_mode)
- mode = rb_mode;
+ viafb_fill_var_timing_info(&dvi_var, rb_mode);
}
- viafb_fill_crtc_timing(mode, mode_bpp / 8, set_iga);
+
+ viafb_fill_crtc_timing(&dvi_var, iga);
}
/* Sense DVI Connector */
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index f473dd0..e2116aa 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -59,7 +59,6 @@ void viafb_dvi_enable(void);
bool __devinit viafb_tmds_trasmitter_identify(void);
void __devinit viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
struct tmds_setting_information *tmds_setting);
-void viafb_dvi_set_mode(struct VideoModeTable *videoMode, int mode_bpp,
- int set_iga);
+void viafb_dvi_set_mode(const struct fb_var_screeninfo *var, int iga);
#endif /* __DVI_H__ */
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index d7b9a9f..6845c82 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -1467,49 +1467,40 @@ void viafb_set_vclock(u32 clk, int set_iga)
via_write_misc_reg_mask(0x0C, 0x0C); /* select external clock */
}
-void viafb_fill_crtc_timing(struct VideoModeTable *video_mode, int bpp_byte,
- int set_iga)
+static struct display_timing var_to_timing(const struct fb_var_screeninfo *var)
{
- struct crt_mode_table *crt_table = video_mode->crtc;
- struct display_timing crt_reg;
- int i;
- int index = 0;
- int h_addr, v_addr;
- u32 clock, refresh = viafb_refresh;
-
- if (viafb_SAMM_ON && set_iga = IGA2)
- refresh = viafb_refresh1;
-
- for (i = 0; i < video_mode->mode_array; i++) {
- index = i;
+ struct display_timing timing;
+
+ timing.hor_addr = var->xres;
+ timing.hor_sync_start = timing.hor_addr + var->right_margin;
+ timing.hor_sync_end = timing.hor_sync_start + var->hsync_len;
+ timing.hor_total = timing.hor_sync_end + var->left_margin;
+ timing.hor_blank_start = timing.hor_addr;
+ timing.hor_blank_end = timing.hor_total;
+ timing.ver_addr = var->yres;
+ timing.ver_sync_start = timing.ver_addr + var->lower_margin;
+ timing.ver_sync_end = timing.ver_sync_start + var->vsync_len;
+ timing.ver_total = timing.ver_sync_end + var->upper_margin;
+ timing.ver_blank_start = timing.ver_addr;
+ timing.ver_blank_end = timing.ver_total;
+ return timing;
+}
- if (crt_table[i].refresh_rate = refresh)
- break;
- }
+void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var, int iga)
+{
+ struct display_timing crt_reg = var_to_timing(var);
- crt_reg = crt_table[index].crtc;
- crt_reg.hor_blank_end += crt_reg.hor_blank_start;
- crt_reg.hor_sync_end += crt_reg.hor_sync_start;
- crt_reg.ver_blank_end += crt_reg.ver_blank_start;
- crt_reg.ver_sync_end += crt_reg.ver_sync_start;
- h_addr = crt_reg.hor_addr;
- v_addr = crt_reg.ver_addr;
- if (set_iga = IGA1)
+ if (iga = IGA1)
via_set_primary_timing(&crt_reg);
- else if (set_iga = IGA2)
+ else if (iga = IGA2)
via_set_secondary_timing(&crt_reg);
- viafb_load_fetch_count_reg(h_addr, bpp_byte, set_iga);
-
- /* load FIFO */
- if ((viaparinfo->chip_info->gfx_chip_name != UNICHROME_CLE266)
- && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400))
- viafb_load_FIFO_reg(set_iga, h_addr, v_addr);
-
- clock = crt_reg.hor_total * crt_reg.ver_total
- * crt_table[index].refresh_rate;
- viafb_set_vclock(clock, set_iga);
+ viafb_load_fetch_count_reg(var->xres, var->bits_per_pixel / 8, iga);
+ if (viaparinfo->chip_info->gfx_chip_name != UNICHROME_CLE266
+ && viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400)
+ viafb_load_FIFO_reg(iga, var->xres, var->yres);
+ viafb_set_vclock(PICOS2KHZ(var->pixclock) * 1000, iga);
}
void __devinit viafb_init_chip_info(int chip_type)
@@ -1788,6 +1779,7 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
u8 value, index, mask;
struct crt_mode_table *crt_timing;
struct crt_mode_table *crt_timing1 = NULL;
+ struct fb_var_screeninfo var2;
device_screen_off();
crt_timing = vmode_tbl->crtc;
@@ -1894,17 +1886,24 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
/* Clear On Screen */
+ if (viafb_dual_fb) {
+ var2 = viafbinfo1->var;
+ } else if (viafb_SAMM_ON) {
+ viafb_fill_var_timing_info(&var2, viafb_get_best_mode(
+ vmode_tbl1->crtc->crtc.hor_addr,
+ vmode_tbl1->crtc->crtc.ver_addr, viafb_refresh1));
+ var2.bits_per_pixel = viafbinfo->var.bits_per_pixel;
+ }
+
/* CRT set mode */
if (viafb_CRT_ON) {
- if (viafb_SAMM_ON &&
- viaparinfo->shared->iga2_devices & VIA_CRT) {
- viafb_fill_crtc_timing(vmode_tbl1, video_bpp1 / 8,
- IGA2);
- } else {
- viafb_fill_crtc_timing(vmode_tbl, video_bpp / 8,
+ if (viaparinfo->shared->iga2_devices & VIA_CRT
+ && viafb_SAMM_ON)
+ viafb_fill_crtc_timing(&var2, IGA2);
+ else
+ viafb_fill_crtc_timing(&viafbinfo->var,
(viaparinfo->shared->iga1_devices & VIA_CRT)
? IGA1 : IGA2);
- }
/* Patch if set_hres is not 8 alignment (1366) to viafb_setmode
to 8 alignment (1368),there is several pixels (2 pixels)
@@ -1918,22 +1917,12 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
}
if (viafb_DVI_ON) {
- if (viafb_SAMM_ON &&
- (viaparinfo->tmds_setting_info->iga_path = IGA2)) {
- viafb_dvi_set_mode(viafb_get_mode
- (viaparinfo->tmds_setting_info->h_active,
- viaparinfo->tmds_setting_info->
- v_active),
- video_bpp1, viaparinfo->
- tmds_setting_info->iga_path);
- } else {
- viafb_dvi_set_mode(viafb_get_mode
- (viaparinfo->tmds_setting_info->h_active,
- viaparinfo->
- tmds_setting_info->v_active),
- video_bpp, viaparinfo->
- tmds_setting_info->iga_path);
- }
+ if (viaparinfo->shared->tmds_setting_info.iga_path = IGA2
+ && viafb_SAMM_ON)
+ viafb_dvi_set_mode(&var2, IGA2);
+ else
+ viafb_dvi_set_mode(&viafbinfo->var,
+ viaparinfo->tmds_setting_info->iga_path);
}
if (viafb_LCD_ON) {
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 5516b02..46f65da 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -637,9 +637,7 @@ extern int viafb_LCD_ON;
extern int viafb_DVI_ON;
extern int viafb_hotplug;
-void viafb_fill_crtc_timing(struct VideoModeTable *video_mode, int bpp_byte,
- int set_iga);
-
+void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var, int iga);
void viafb_set_vclock(u32 CLK, int set_iga);
void viafb_load_reg(int timing_value, int viafb_load_reg_num,
struct io_register *reg,
--
1.6.3.2
^ permalink raw reply related
* [PATCH 2/6] viafb: eliminate viafb_get_pixclock
From: Florian Tobias Schandinat @ 2011-08-07 15:50 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
As there is only one user we can just insert the formula where
needed. Avoids one lookup in the modetable and
viafb_fill_var_timing_info does no longer depend on the modetable.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/hw.c | 16 ++--------------
drivers/video/via/hw.h | 1 -
drivers/video/via/share.h | 4 ----
3 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 5e69c20..d7b9a9f 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2033,18 +2033,6 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
return 1;
}
-int viafb_get_pixclock(int hres, int vres, int vmode_refresh)
-{
- struct crt_mode_table *best;
-
- best = viafb_get_best_mode(hres, vres, vmode_refresh);
- if (!best)
- return RES_640X480_60HZ_PIXCLOCK;
-
- return 1000000000 / (best->crtc.hor_total * best->crtc.ver_total)
- * 1000 / best->refresh_rate;
-}
-
int viafb_get_refresh(int hres, int vres, u32 long_refresh)
{
struct crt_mode_table *best;
@@ -2160,8 +2148,8 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
struct display_timing crt_reg;
crt_reg = mode->crtc;
- var->pixclock = viafb_get_pixclock(var->xres, var->yres,
- mode->refresh_rate);
+ var->pixclock = 1000000000 / (crt_reg.hor_total * crt_reg.ver_total)
+ * 1000 / mode->refresh_rate;
var->left_margin crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end);
var->right_margin = crt_reg.hor_sync_start - crt_reg.hor_addr;
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 3b7e149..5516b02 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -665,7 +665,6 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
struct crt_mode_table *mode);
void __devinit viafb_init_chip_info(int chip_type);
void __devinit viafb_init_dac(int set_iga);
-int viafb_get_pixclock(int hres, int vres, int vmode_refresh);
int viafb_get_refresh(int hres, int vres, u32 float_refresh);
void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h
index 2906b2d..69d882c 100644
--- a/drivers/video/via/share.h
+++ b/drivers/video/via/share.h
@@ -636,10 +636,6 @@
#define V_SYNC_SATRT_SHADOW_INDEX 18
#define V_SYNC_END_SHADOW_INDEX 19
-/* Definition Video Mode Pixel Clock (picoseconds)
-*/
-#define RES_640X480_60HZ_PIXCLOCK 39722
-
/* LCD display method
*/
#define LCD_EXPANDSION 0x00
--
1.6.3.2
^ permalink raw reply related
* [PATCH 1/6] viafb: add new funcions to select a single mode
From: Florian Tobias Schandinat @ 2011-08-07 15:49 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
In-Reply-To: <cover.1312730859.git.FlorianSchandinat@gmx.de>
This patch introduces 2 new functions for selecting a single mode
based on hres, vres and refresh rate and changes some uses to use
those. The advantage is that it is less error prone than doing the
selection based on refresh rate everywhere and allows replacing the
modetable structure. This includes a little change that users may
notice: If a refresh rate was given as module parameters but does
not exist in the modetable prior to this patch a refresh rate of 60
was assumed and after this patch the closest supported refresh rate
to the one provided by the user is used.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
drivers/video/via/hw.c | 45 ++++++++-------------------------
drivers/video/via/hw.h | 4 +-
drivers/video/via/viafbdev.c | 24 +++++++++---------
drivers/video/via/viamode.c | 56 ++++++++++++++++++++++++++++++++---------
drivers/video/via/viamode.h | 2 +
5 files changed, 70 insertions(+), 61 deletions(-)
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index c5e7833..5e69c20 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -2035,40 +2035,24 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
int viafb_get_pixclock(int hres, int vres, int vmode_refresh)
{
- int i;
struct crt_mode_table *best;
- struct VideoModeTable *vmode = viafb_get_mode(hres, vres);
- if (!vmode)
+ best = viafb_get_best_mode(hres, vres, vmode_refresh);
+ if (!best)
return RES_640X480_60HZ_PIXCLOCK;
- best = &vmode->crtc[0];
- for (i = 1; i < vmode->mode_array; i++) {
- if (abs(vmode->crtc[i].refresh_rate - vmode_refresh)
- < abs(best->refresh_rate - vmode_refresh))
- best = &vmode->crtc[i];
- }
-
return 1000000000 / (best->crtc.hor_total * best->crtc.ver_total)
* 1000 / best->refresh_rate;
}
int viafb_get_refresh(int hres, int vres, u32 long_refresh)
{
- int i;
struct crt_mode_table *best;
- struct VideoModeTable *vmode = viafb_get_mode(hres, vres);
- if (!vmode)
+ best = viafb_get_best_mode(hres, vres, long_refresh);
+ if (!best)
return 60;
- best = &vmode->crtc[0];
- for (i = 1; i < vmode->mode_array; i++) {
- if (abs(vmode->crtc[i].refresh_rate - long_refresh)
- < abs(best->refresh_rate - long_refresh))
- best = &vmode->crtc[i];
- }
-
if (abs(best->refresh_rate - long_refresh) > 3) {
if (hres = 1200 && vres = 900)
return 49; /* OLPC DCON only supports 50 Hz */
@@ -2170,21 +2154,14 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
}
/*According var's xres, yres fill var's other timing information*/
-void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
- struct VideoModeTable *vmode_tbl)
+void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
+ struct crt_mode_table *mode)
{
- struct crt_mode_table *crt_timing = NULL;
struct display_timing crt_reg;
- int i = 0, index = 0;
- crt_timing = vmode_tbl->crtc;
- for (i = 0; i < vmode_tbl->mode_array; i++) {
- index = i;
- if (crt_timing[i].refresh_rate = refresh)
- break;
- }
- crt_reg = crt_timing[index].crtc;
- var->pixclock = viafb_get_pixclock(var->xres, var->yres, refresh);
+ crt_reg = mode->crtc;
+ var->pixclock = viafb_get_pixclock(var->xres, var->yres,
+ mode->refresh_rate);
var->left_margin crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end);
var->right_margin = crt_reg.hor_sync_start - crt_reg.hor_addr;
@@ -2194,8 +2171,8 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
var->lower_margin = crt_reg.ver_sync_start - crt_reg.ver_addr;
var->vsync_len = crt_reg.ver_sync_end;
var->sync = 0;
- if (crt_timing[index].h_sync_polarity = POSITIVE)
+ if (mode->h_sync_polarity = POSITIVE)
var->sync |= FB_SYNC_HOR_HIGH_ACT;
- if (crt_timing[index].v_sync_polarity = POSITIVE)
+ if (mode->v_sync_polarity = POSITIVE)
var->sync |= FB_SYNC_VERT_HIGH_ACT;
}
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index 1fd8d98..3b7e149 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -661,8 +661,8 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
struct VideoModeTable *vmode_tbl1, int video_bpp1);
-void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
- struct VideoModeTable *vmode_tbl);
+void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
+ struct crt_mode_table *mode);
void __devinit viafb_init_chip_info(int chip_type);
void __devinit viafb_init_dac(int set_iga);
int viafb_get_pixclock(int hres, int vres, int vmode_refresh);
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 3eaf607..0c0ef95 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -201,7 +201,6 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{
int depth, refresh;
- struct VideoModeTable *vmode_entry;
struct viafb_par *ppar = info->par;
u32 line;
@@ -211,8 +210,10 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
if (var->vmode & FB_VMODE_INTERLACED || var->vmode & FB_VMODE_DOUBLE)
return -EINVAL;
- vmode_entry = viafb_get_mode(var->xres, var->yres);
- if (!vmode_entry) {
+ /* the refresh rate is not important here, as we only want to know
+ * whether the resolution exists
+ */
+ if (!viafb_get_best_mode(var->xres, var->yres, 60)) {
DEBUG_MSG(KERN_INFO
"viafb: Mode %dx%dx%d not supported!!\n",
var->xres, var->yres, var->bits_per_pixel);
@@ -254,7 +255,8 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
get_var_refresh(var));
/* Adjust var according to our driver's own table */
- viafb_fill_var_timing_info(var, refresh, vmode_entry);
+ viafb_fill_var_timing_info(var,
+ viafb_get_best_mode(var->xres, var->yres, refresh));
if (var->accel_flags & FB_ACCELF_TEXT &&
!ppar->shared->vdev->engine_mmio)
var->accel_flags = 0;
@@ -1816,9 +1818,8 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
default_var.xres_virtual = default_xres;
default_var.yres_virtual = default_yres;
default_var.bits_per_pixel = viafb_bpp;
- viafb_fill_var_timing_info(&default_var, viafb_get_refresh(
- default_var.xres, default_var.yres, viafb_refresh),
- viafb_get_mode(default_var.xres, default_var.yres));
+ viafb_fill_var_timing_info(&default_var, viafb_get_best_mode(
+ default_var.xres, default_var.yres, viafb_refresh));
viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo);
viafbinfo->var = default_var;
@@ -1857,9 +1858,8 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
default_var.xres_virtual = viafb_second_xres;
default_var.yres_virtual = viafb_second_yres;
default_var.bits_per_pixel = viafb_bpp1;
- viafb_fill_var_timing_info(&default_var, viafb_get_refresh(
- default_var.xres, default_var.yres, viafb_refresh1),
- viafb_get_mode(default_var.xres, default_var.yres));
+ viafb_fill_var_timing_info(&default_var, viafb_get_best_mode(
+ default_var.xres, default_var.yres, viafb_refresh1));
viafb_setup_fixinfo(&viafbinfo1->fix, viaparinfo1);
viafb_check_var(&default_var, viafbinfo1);
@@ -2032,9 +2032,9 @@ int __init viafb_init(void)
return r;
#endif
if (parse_mode(viafb_mode, &dummy_x, &dummy_y)
- || !viafb_get_mode(dummy_x, dummy_y)
+ || !viafb_get_best_mode(dummy_x, dummy_y, viafb_refresh)
|| parse_mode(viafb_mode1, &dummy_x, &dummy_y)
- || !viafb_get_mode(dummy_x, dummy_y)
+ || !viafb_get_best_mode(dummy_x, dummy_y, viafb_refresh1)
|| viafb_bpp < 0 || viafb_bpp > 32
|| viafb_bpp1 < 0 || viafb_bpp1 > 32
|| parse_active_dev())
diff --git a/drivers/video/via/viamode.c b/drivers/video/via/viamode.c
index 8a9f4fc..88096e5 100644
--- a/drivers/video/via/viamode.c
+++ b/drivers/video/via/viamode.c
@@ -863,26 +863,56 @@ int NUM_TOTAL_CLE266_ModeXregs = ARRAY_SIZE(CLE266_ModeXregs);
int NUM_TOTAL_PATCH_MODE = ARRAY_SIZE(res_patch_table);
-struct VideoModeTable *viafb_get_mode(int hres, int vres)
+static struct VideoModeTable *get_modes(struct VideoModeTable *vmt, int n,
+ int hres, int vres)
{
- u32 i;
- for (i = 0; i < ARRAY_SIZE(viafb_modes); i++)
- if (viafb_modes[i].mode_array &&
- viafb_modes[i].crtc[0].crtc.hor_addr = hres &&
- viafb_modes[i].crtc[0].crtc.ver_addr = vres)
+ int i;
+
+ for (i = 0; i < n; i++)
+ if (vmt[i].mode_array &&
+ vmt[i].crtc[0].crtc.hor_addr = hres &&
+ vmt[i].crtc[0].crtc.ver_addr = vres)
return &viafb_modes[i];
return NULL;
}
+static struct crt_mode_table *get_best_mode(struct VideoModeTable *vmt,
+ int refresh)
+{
+ struct crt_mode_table *best;
+ int i;
+
+ if (!vmt)
+ return NULL;
+
+ best = &vmt->crtc[0];
+ for (i = 1; i < vmt->mode_array; i++) {
+ if (abs(vmt->crtc[i].refresh_rate - refresh)
+ < abs(best->refresh_rate - refresh))
+ best = &vmt->crtc[i];
+ }
+
+ return best;
+}
+
+struct VideoModeTable *viafb_get_mode(int hres, int vres)
+{
+ return get_modes(viafb_modes, ARRAY_SIZE(viafb_modes), hres, vres);
+}
+
+struct crt_mode_table *viafb_get_best_mode(int hres, int vres, int refresh)
+{
+ return get_best_mode(viafb_get_mode(hres, vres), refresh);
+}
+
struct VideoModeTable *viafb_get_rb_mode(int hres, int vres)
{
- u32 i;
- for (i = 0; i < ARRAY_SIZE(viafb_rb_modes); i++)
- if (viafb_rb_modes[i].mode_array &&
- viafb_rb_modes[i].crtc[0].crtc.hor_addr = hres &&
- viafb_rb_modes[i].crtc[0].crtc.ver_addr = vres)
- return &viafb_rb_modes[i];
+ return get_modes(viafb_rb_modes, ARRAY_SIZE(viafb_rb_modes), hres,
+ vres);
+}
- return NULL;
+struct crt_mode_table *viafb_get_best_rb_mode(int hres, int vres, int refresh)
+{
+ return get_best_mode(viafb_get_rb_mode(hres, vres), refresh);
}
diff --git a/drivers/video/via/viamode.h b/drivers/video/via/viamode.h
index 3751289..0396581 100644
--- a/drivers/video/via/viamode.h
+++ b/drivers/video/via/viamode.h
@@ -61,6 +61,8 @@ extern struct patch_table res_patch_table[];
extern struct VPITTable VPIT;
struct VideoModeTable *viafb_get_mode(int hres, int vres);
+struct crt_mode_table *viafb_get_best_mode(int hres, int vres, int refresh);
struct VideoModeTable *viafb_get_rb_mode(int hres, int vres);
+struct crt_mode_table *viafb_get_best_rb_mode(int hres, int vres, int refresh);
#endif /* __VIAMODE_H__ */
--
1.6.3.2
^ permalink raw reply related
* [PATCH 0/6] viafb modesetting update 2
From: Florian Tobias Schandinat @ 2011-08-07 15:46 UTC (permalink / raw)
To: linux-fbdev; +Cc: linux-kernel, Florian Tobias Schandinat
Hi all,
this is the second patch series. It's a little less stable than the
previous one but it contains some great internal improvements.
We do no longer rely on the modetable structure across all sections
and we use the values in var directly for CRT and DVI when possible.
Basically this enables us to allow arbitary modes passed in var.
That's not implemented yet and probably will never be the default as
we want to do some sanity checking in check_var for the devices
connected but would allow overriding buggy information.
Anyway with these patches it will be very simple to avoid the buggy
modetable we use at the moment.
Best regards,
Florian Tobias Schandinat
Florian Tobias Schandinat (6):
viafb: add new funcions to select a single mode
viafb: eliminate viafb_get_pixclock
viafb: use information in var for modesetting
viafb: seperate hardware initialization
viafb: eliminate modetable dependancy of LCD modesetting
viafb: get rid of the remaining modetable structure assumptions
drivers/video/via/dvi.c | 30 ++----
drivers/video/via/dvi.h | 3 +-
drivers/video/via/global.c | 2 +
drivers/video/via/global.h | 2 +
drivers/video/via/hw.c | 229 ++++++++++++++++-------------------------
drivers/video/via/hw.h | 12 +--
drivers/video/via/lcd.c | 12 +--
drivers/video/via/lcd.h | 5 +-
drivers/video/via/share.h | 4 -
drivers/video/via/viafbdev.c | 38 +++----
drivers/video/via/viamode.c | 58 ++++++++---
drivers/video/via/viamode.h | 4 +-
12 files changed, 177 insertions(+), 222 deletions(-)
^ permalink raw reply
* [PATCH V2] replace strict_strtoul to kstrto[*] and check return value
From: stufever @ 2011-08-07 15:28 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-fbdev, FlorianSchandinat, lethal, Wang Shaoyan
From: Wang Shaoyan <wangshaoyan.pt@taobao.com>
Change since V1:
1.use kstrto*, not kstrtoul
2.replace &buf[0] to buf
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
drivers/video/via/viafbdev.c | 126 ++++++++++++++++++++++-------------------
1 files changed, 68 insertions(+), 58 deletions(-)
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 53aa443..7074fc7 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
reg_val);
switch (i) {
@@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtou8(value, 0, ®_val) < 0)
+ return -EINVAL;
switch (i) {
case 0:
viafb_write_reg_mask(CR9B, VIACR,
@@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, 0, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
return count;
}
@@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtou8(buf, -1, ®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
return count;
}
@@ -1394,8 +1398,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1431,8 +1435,8 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtou8(value, 0, ®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1950,61 +1954,67 @@ static int __init viafb_setup(void)
if (!*this_opt)
continue;
- if (!strncmp(this_opt, "viafb_mode1=", 12))
+ if (!strncmp(this_opt, "viafb_mode1=", 12)) {
viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_mode=", 11))
+ } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_bpp1=", 11))
- strict_strtoul(this_opt + 11, 0,
- (unsigned long *)&viafb_bpp1);
- else if (!strncmp(this_opt, "viafb_bpp=", 10))
- strict_strtoul(this_opt + 10, 0,
- (unsigned long *)&viafb_bpp);
- else if (!strncmp(this_opt, "viafb_refresh1=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_refresh1);
- else if (!strncmp(this_opt, "viafb_refresh=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_refresh);
- else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
- strict_strtoul(this_opt + 21, 0,
- (unsigned long *)&viafb_lcd_dsp_method);
- else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
- strict_strtoul(this_opt + 19, 0,
- (unsigned long *)&viafb_lcd_panel_id);
- else if (!strncmp(this_opt, "viafb_accel=", 12))
- strict_strtoul(this_opt + 12, 0,
- (unsigned long *)&viafb_accel);
- else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_SAMM_ON);
- else if (!strncmp(this_opt, "viafb_active_dev=", 17))
+ } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
+ if (kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
+ if (kstrtouint(this_opt + 10, 0, &viafb_bpp) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_refresh1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_refresh) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
+ if (kstrtoint(this_opt + 21, 0,
+ &viafb_lcd_dsp_method) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
+ if (kstrtoint(this_opt + 19, 0,
+ &viafb_lcd_panel_id) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
+ if (kstrtoint(this_opt + 12, 0, &viafb_accel) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
+ if (kstrtoint(this_opt + 14, 0, &viafb_SAMM_ON) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
- else if (!strncmp(this_opt,
- "viafb_display_hardware_layout=", 30))
- strict_strtoul(this_opt + 30, 0,
- (unsigned long *)&viafb_display_hardware_layout);
- else if (!strncmp(this_opt, "viafb_second_size=", 18))
- strict_strtoul(this_opt + 18, 0,
- (unsigned long *)&viafb_second_size);
- else if (!strncmp(this_opt,
- "viafb_platform_epia_dvi=", 24))
- strict_strtoul(this_opt + 24, 0,
- (unsigned long *)&viafb_platform_epia_dvi);
- else if (!strncmp(this_opt,
- "viafb_device_lcd_dualedge=", 26))
- strict_strtoul(this_opt + 26, 0,
- (unsigned long *)&viafb_device_lcd_dualedge);
- else if (!strncmp(this_opt, "viafb_bus_width=", 16))
- strict_strtoul(this_opt + 16, 0,
- (unsigned long *)&viafb_bus_width);
- else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_lcd_mode);
- else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
+ } else if (!strncmp(this_opt,
+ "viafb_display_hardware_layout=", 30)) {
+ if (kstrtoint(this_opt + 30, 0,
+ &viafb_display_hardware_layout) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
+ if (kstrtoint(this_opt + 18, 0, &viafb_second_size) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_platform_epia_dvi=", 24)) {
+ if (kstrtoint(this_opt + 24, 0,
+ &viafb_platform_epia_dvi) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_device_lcd_dualedge=", 26)) {
+ if (kstrtoint(this_opt + 26, 0,
+ &viafb_device_lcd_dualedge) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
+ if (kstrtoint(this_opt + 16, 0, &viafb_bus_width) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
+ if (kstrtoint(this_opt + 15, 0, &viafb_lcd_mode) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
+ } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
+ }
}
return 0;
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] viafb: replace strict_strtoul to kstrtoul and check return
From: Florian Tobias Schandinat @ 2011-08-07 14:20 UTC (permalink / raw)
To: stufever; +Cc: linux-kernel, linux-fbdev, lethal, Wang Shaoyan
In-Reply-To: <1312723884-21790-1-git-send-email-wangshaoyan.pt@taobao.com>
Hi Wang,
On 08/07/2011 01:31 PM, stufever@gmail.com wrote:
> From: Wang Shaoyan<wangshaoyan.pt@taobao.com>
>
> This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
>
> drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
well I'm not against using the new functions but if you do this change please
try to have a look why those were introduced.
> Signed-off-by: Wang Shaoyan<wangshaoyan.pt@taobao.com>
> ---
> drivers/video/via/viafbdev.c | 137 ++++++++++++++++++++++++------------------
> 1 files changed, 79 insertions(+), 58 deletions(-)
>
> diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
> index 53aa443..5f638d6 100644
> --- a/drivers/video/via/viafbdev.c
> +++ b/drivers/video/via/viafbdev.c
> @@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
> for (i = 0; i< 3; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0, (unsigned long *)®_val);
> + if (kstrtoul(value, 0, (unsigned long *)®_val)< 0)
> + return -EINVAL;
Ugh, the old code was ugly (casting u8* to unsigned long*) but you did not
really improve it although the new functions were introduced for cases like
this. You should use kstrtou8() here, I think.
It would also be nice if you could add range checks for the value entered as the
behavior to -EINVAL on values > 255 but accepting too big values that are <= 255
is not very consistent. Okay, as I know that doing this right would be difficult
I'll accept this patch without them or without them being 100% accurate.
> DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
> reg_val);
> switch (i) {
> @@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
> for (i = 0; i< 3; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0, (unsigned long *)®_val);
> + if (kstrtoul(value, 0, (unsigned long *)®_val)< 0)
> + return -EINVAL;
Same here.
> switch (i) {
> case 0:
> viafb_write_reg_mask(CR9B, VIACR,
> @@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtoul(&buf[0], 0, (unsigned long *)®_val)< 0)
> + return -EINVAL;
Same here. And the &buf[0] is somewhat misleading, can you please correct it to
be just buf?
> viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
> return count;
> }
> @@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
> if (copy_from_user(&buf[0], buffer, length))
> return -EFAULT;
> buf[length - 1] = '\0'; /*Ensure end string */
> - strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
> + if (kstrtoul(&buf[0], 0, (unsigned long *)®_val)< 0)
> + return -EINVAL;
Same as above.
> viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
> return count;
> }
> @@ -1394,8 +1398,9 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
> for (i = 0; i< 2; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0,
> - (unsigned long *)®_val.Data);
> + if (kstrtoul(value, 0,
> + (unsigned long *)®_val.Data)< 0)
> + return -EINVAL;
Again this u8 thing.
> switch (i) {
> case 0:
> reg_val.Index = 0x08;
> @@ -1431,8 +1436,9 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
> for (i = 0; i< 2; i++) {
> value = strsep(&pbuf, " ");
> if (value != NULL) {
> - strict_strtoul(value, 0,
> - (unsigned long *)®_val.Data);
> + if (kstrtoul(value, 0,
> + (unsigned long *)®_val.Data)< 0)
> + return -EINVAL;
And again.
> switch (i) {
> case 0:
> reg_val.Index = 0x08;
> @@ -1950,61 +1956,76 @@ static int __init viafb_setup(void)
> if (!*this_opt)
> continue;
>
> - if (!strncmp(this_opt, "viafb_mode1=", 12))
> + if (!strncmp(this_opt, "viafb_mode1=", 12)) {
> viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_mode=", 11))
> + } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
> viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_bpp1=", 11))
> - strict_strtoul(this_opt + 11, 0,
> - (unsigned long *)&viafb_bpp1);
> - else if (!strncmp(this_opt, "viafb_bpp=", 10))
> - strict_strtoul(this_opt + 10, 0,
> - (unsigned long *)&viafb_bpp);
> - else if (!strncmp(this_opt, "viafb_refresh1=", 15))
> - strict_strtoul(this_opt + 15, 0,
> - (unsigned long *)&viafb_refresh1);
> - else if (!strncmp(this_opt, "viafb_refresh=", 14))
> - strict_strtoul(this_opt + 14, 0,
> - (unsigned long *)&viafb_refresh);
> - else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
> - strict_strtoul(this_opt + 21, 0,
> - (unsigned long *)&viafb_lcd_dsp_method);
> - else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
> - strict_strtoul(this_opt + 19, 0,
> - (unsigned long *)&viafb_lcd_panel_id);
> - else if (!strncmp(this_opt, "viafb_accel=", 12))
> - strict_strtoul(this_opt + 12, 0,
> - (unsigned long *)&viafb_accel);
> - else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
> - strict_strtoul(this_opt + 14, 0,
> - (unsigned long *)&viafb_SAMM_ON);
> - else if (!strncmp(this_opt, "viafb_active_dev=", 17))
> + } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
> + if (kstrtoul(this_opt + 11, 0,
> + (unsigned long *)&viafb_bpp1)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
> + if (kstrtoul(this_opt + 10, 0,
> + (unsigned long *)&viafb_bpp)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
> + if (kstrtoul(this_opt + 15, 0,
> + (unsigned long *)&viafb_refresh1)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
> + if (kstrtoul(this_opt + 14, 0,
> + (unsigned long *)&viafb_refresh)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
> + if (kstrtoul(this_opt + 21, 0,
> + (unsigned long *)&viafb_lcd_dsp_method)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
> + if (kstrtoul(this_opt + 19, 0,
> + (unsigned long *)&viafb_lcd_panel_id)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
> + if (kstrtoul(this_opt + 12, 0,
> + (unsigned long *)&viafb_accel)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
> + if (kstrtoul(this_opt + 14, 0,
> + (unsigned long *)&viafb_SAMM_ON)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
> viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
> - else if (!strncmp(this_opt,
> - "viafb_display_hardware_layout=", 30))
> - strict_strtoul(this_opt + 30, 0,
> - (unsigned long *)&viafb_display_hardware_layout);
> - else if (!strncmp(this_opt, "viafb_second_size=", 18))
> - strict_strtoul(this_opt + 18, 0,
> - (unsigned long *)&viafb_second_size);
> - else if (!strncmp(this_opt,
> - "viafb_platform_epia_dvi=", 24))
> - strict_strtoul(this_opt + 24, 0,
> - (unsigned long *)&viafb_platform_epia_dvi);
> - else if (!strncmp(this_opt,
> - "viafb_device_lcd_dualedge=", 26))
> - strict_strtoul(this_opt + 26, 0,
> - (unsigned long *)&viafb_device_lcd_dualedge);
> - else if (!strncmp(this_opt, "viafb_bus_width=", 16))
> - strict_strtoul(this_opt + 16, 0,
> - (unsigned long *)&viafb_bus_width);
> - else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
> - strict_strtoul(this_opt + 15, 0,
> - (unsigned long *)&viafb_lcd_mode);
> - else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
> + } else if (!strncmp(this_opt,
> + "viafb_display_hardware_layout=", 30)) {
> + if (kstrtoul(this_opt + 30, 0,
> + (unsigned long *)&viafb_display_hardware_layout)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
> + if (kstrtoul(this_opt + 18, 0,
> + (unsigned long *)&viafb_second_size)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt,
> + "viafb_platform_epia_dvi=", 24)) {
> + if ( kstrtoul(this_opt + 24, 0,
> + (unsigned long *)&viafb_platform_epia_dvi)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt,
> + "viafb_device_lcd_dualedge=", 26)) {
> + if (kstrtoul(this_opt + 26, 0,
> + (unsigned long *)&viafb_device_lcd_dualedge)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
> + if (kstrtoul(this_opt + 16, 0,
> + (unsigned long *)&viafb_bus_width)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
> + if (kstrtoul(this_opt + 15, 0,
> + (unsigned long *)&viafb_lcd_mode)< 0)
> + return -EINVAL;
> + } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
> viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
> - else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
> + } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
> viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
> + }
> }
> return 0;
> }
Please try to use the correct functions (kstrtoint, ...) here too, basically you
should no longer have any need for casting pointers.
Thanks,
Florian Tobias Schandinat
^ permalink raw reply
* [PATCH] viafb: replace strict_strtoul to kstrtoul and check return value
From: stufever @ 2011-08-07 13:31 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-fbdev, FlorianSchandinat, lethal, Wang Shaoyan
From: Wang Shaoyan <wangshaoyan.pt@taobao.com>
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning:
drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result
Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
drivers/video/via/viafbdev.c | 137 ++++++++++++++++++++++++------------------
1 files changed, 79 insertions(+), 58 deletions(-)
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 53aa443..5f638d6 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1158,7 +1158,8 @@ static ssize_t viafb_dvp0_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtoul(value, 0, (unsigned long *)®_val) < 0)
+ return -EINVAL;
DEBUG_MSG(KERN_INFO "DVP0:reg_val[%l]=:%x\n", i,
reg_val);
switch (i) {
@@ -1228,7 +1229,8 @@ static ssize_t viafb_dvp1_proc_write(struct file *file,
for (i = 0; i < 3; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0, (unsigned long *)®_val);
+ if (kstrtoul(value, 0, (unsigned long *)®_val) < 0)
+ return -EINVAL;
switch (i) {
case 0:
viafb_write_reg_mask(CR9B, VIACR,
@@ -1286,7 +1288,8 @@ static ssize_t viafb_dfph_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtoul(&buf[0], 0, (unsigned long *)®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f);
return count;
}
@@ -1325,7 +1328,8 @@ static ssize_t viafb_dfpl_proc_write(struct file *file,
if (copy_from_user(&buf[0], buffer, length))
return -EFAULT;
buf[length - 1] = '\0'; /*Ensure end string */
- strict_strtoul(&buf[0], 0, (unsigned long *)®_val);
+ if (kstrtoul(&buf[0], 0, (unsigned long *)®_val) < 0)
+ return -EINVAL;
viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f);
return count;
}
@@ -1394,8 +1398,9 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtoul(value, 0,
+ (unsigned long *)®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1431,8 +1436,9 @@ static ssize_t viafb_vt1636_proc_write(struct file *file,
for (i = 0; i < 2; i++) {
value = strsep(&pbuf, " ");
if (value != NULL) {
- strict_strtoul(value, 0,
- (unsigned long *)®_val.Data);
+ if (kstrtoul(value, 0,
+ (unsigned long *)®_val.Data) < 0)
+ return -EINVAL;
switch (i) {
case 0:
reg_val.Index = 0x08;
@@ -1950,61 +1956,76 @@ static int __init viafb_setup(void)
if (!*this_opt)
continue;
- if (!strncmp(this_opt, "viafb_mode1=", 12))
+ if (!strncmp(this_opt, "viafb_mode1=", 12)) {
viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_mode=", 11))
+ } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_bpp1=", 11))
- strict_strtoul(this_opt + 11, 0,
- (unsigned long *)&viafb_bpp1);
- else if (!strncmp(this_opt, "viafb_bpp=", 10))
- strict_strtoul(this_opt + 10, 0,
- (unsigned long *)&viafb_bpp);
- else if (!strncmp(this_opt, "viafb_refresh1=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_refresh1);
- else if (!strncmp(this_opt, "viafb_refresh=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_refresh);
- else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21))
- strict_strtoul(this_opt + 21, 0,
- (unsigned long *)&viafb_lcd_dsp_method);
- else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19))
- strict_strtoul(this_opt + 19, 0,
- (unsigned long *)&viafb_lcd_panel_id);
- else if (!strncmp(this_opt, "viafb_accel=", 12))
- strict_strtoul(this_opt + 12, 0,
- (unsigned long *)&viafb_accel);
- else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14))
- strict_strtoul(this_opt + 14, 0,
- (unsigned long *)&viafb_SAMM_ON);
- else if (!strncmp(this_opt, "viafb_active_dev=", 17))
+ } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
+ if (kstrtoul(this_opt + 11, 0,
+ (unsigned long *)&viafb_bpp1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bpp=", 10)) {
+ if (kstrtoul(this_opt + 10, 0,
+ (unsigned long *)&viafb_bpp) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh1=", 15)) {
+ if (kstrtoul(this_opt + 15, 0,
+ (unsigned long *)&viafb_refresh1) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_refresh=", 14)) {
+ if (kstrtoul(this_opt + 14, 0,
+ (unsigned long *)&viafb_refresh) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_dsp_method=", 21)) {
+ if (kstrtoul(this_opt + 21, 0,
+ (unsigned long *)&viafb_lcd_dsp_method) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_panel_id=", 19)) {
+ if (kstrtoul(this_opt + 19, 0,
+ (unsigned long *)&viafb_lcd_panel_id) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_accel=", 12)) {
+ if (kstrtoul(this_opt + 12, 0,
+ (unsigned long *)&viafb_accel) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_SAMM_ON=", 14)) {
+ if (kstrtoul(this_opt + 14, 0,
+ (unsigned long *)&viafb_SAMM_ON) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
- else if (!strncmp(this_opt,
- "viafb_display_hardware_layout=", 30))
- strict_strtoul(this_opt + 30, 0,
- (unsigned long *)&viafb_display_hardware_layout);
- else if (!strncmp(this_opt, "viafb_second_size=", 18))
- strict_strtoul(this_opt + 18, 0,
- (unsigned long *)&viafb_second_size);
- else if (!strncmp(this_opt,
- "viafb_platform_epia_dvi=", 24))
- strict_strtoul(this_opt + 24, 0,
- (unsigned long *)&viafb_platform_epia_dvi);
- else if (!strncmp(this_opt,
- "viafb_device_lcd_dualedge=", 26))
- strict_strtoul(this_opt + 26, 0,
- (unsigned long *)&viafb_device_lcd_dualedge);
- else if (!strncmp(this_opt, "viafb_bus_width=", 16))
- strict_strtoul(this_opt + 16, 0,
- (unsigned long *)&viafb_bus_width);
- else if (!strncmp(this_opt, "viafb_lcd_mode=", 15))
- strict_strtoul(this_opt + 15, 0,
- (unsigned long *)&viafb_lcd_mode);
- else if (!strncmp(this_opt, "viafb_lcd_port=", 15))
+ } else if (!strncmp(this_opt,
+ "viafb_display_hardware_layout=", 30)) {
+ if (kstrtoul(this_opt + 30, 0,
+ (unsigned long *)&viafb_display_hardware_layout) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_second_size=", 18)) {
+ if (kstrtoul(this_opt + 18, 0,
+ (unsigned long *)&viafb_second_size) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_platform_epia_dvi=", 24)) {
+ if ( kstrtoul(this_opt + 24, 0,
+ (unsigned long *)&viafb_platform_epia_dvi) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt,
+ "viafb_device_lcd_dualedge=", 26)) {
+ if (kstrtoul(this_opt + 26, 0,
+ (unsigned long *)&viafb_device_lcd_dualedge) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_bus_width=", 16)) {
+ if (kstrtoul(this_opt + 16, 0,
+ (unsigned long *)&viafb_bus_width) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_mode=", 15)) {
+ if (kstrtoul(this_opt + 15, 0,
+ (unsigned long *)&viafb_lcd_mode) < 0)
+ return -EINVAL;
+ } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
- else if (!strncmp(this_opt, "viafb_dvi_port=", 15))
+ } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
+ }
}
return 0;
}
--
1.7.0.4
^ permalink raw reply related
* Subject: [PATCH] savagefb: Fix savage4 series video chip detection
From: John Stanley @ 2011-08-06 22:27 UTC (permalink / raw)
To: linux-fbdev
From: John Stanley <jpsinthemix@verizon.net>
savagefb: Fix typo causing regression in savage4 series video chip detection
Two additional savage4 variants were added, but the S3_SAVAGE4_SERIES
macro was
incompletely modified, resulting in a false positive detection of a
savage4 card
regardless of which savage card is actually present. For non-savage4 series
cards, such as a Savage/IX-MV card, this results in garbled video and/or a
hard-hang at boot time. Fix this by changing an '||' to an '&&' in the
S3_SAVAGE4_SERIES macro.
Signed-off-by: John P. Stanley <jpsinthemix@verizon.net>
Reviewed-by: Tormod Volden <debian.tormod@gmail.com>
Cc: stable@kernel.org
---
Specifically, prior to linux-3.0, there were two savage4 variants
(S3_SAVAGE4
and S3_PROSAVAGE). Hence, S3_SAVAGE4_SERIES was defined as
S3_SAVAGE4 or S3_PROSAVAGE
In linux-3.0, two additional savage4 variants (S3_TWISTER and
S3_PROSAVAGEDDR)
have been added. Hence S3_SAVAGE4_SERIES should be defined as
S3_SAVAGE4, S3_PROSAVAGE, S3_TWISTER, or S3_PROSAVAGEDDR
However, the #define macro for S3_SAVAGE4_SERIES was incompletely
updated: the
'||' should have been changed to an '&&'.
--- linux-3.0.0/drivers/video/savage/savagefb.h.orig 2011-07-21
22:17:23.000000000 -0400
+++ linux-3.0.0/drivers/video/savage/savagefb.h 2011-07-31
05:27:47.314798215 -0400
@@ -55,7 +55,7 @@
#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) &&
(chip<=S3_SAVAGE_MX))
-#define S3_SAVAGE4_SERIES(chip) ((chip>=S3_SAVAGE4) ||
(chip<=S3_PROSAVAGEDDR))
+#define S3_SAVAGE4_SERIES(chip) ((chip>=S3_SAVAGE4) &&
(chip<=S3_PROSAVAGEDDR))
#define S3_SAVAGE_MOBILE_SERIES(chip) ((chip=S3_SAVAGE_MX) ||
(chip=S3_SUPERSAVAGE))
^ permalink raw reply
* Re: [PATCH] viafb: fix pointer type missmatch
From: Florian Tobias Schandinat @ 2011-08-06 15:18 UTC (permalink / raw)
To: Wang Shaoyan; +Cc: linux-kernel, linux-fbdev, lethal, Wang Shaoyan
In-Reply-To: <CANxBZFpxO40BE6iTGw3ad9+685_sAZettg+H6VQfB-X7cFbvhw@mail.gmail.com>
Hi,
okay, it was not obvious that "stufever@gmail.com" is the same person as "Wang
Shaoyan". Now that I know it it's okay. Maybe you want to adjust your config
(maybe user.name in git) to give others a hint that they are the same.
I will apply your patch to my tree when linux-next is reopened for new material
(when -rc1 is released).
Thanks,
Florian Tobias Schandinat
On 08/06/2011 03:03 PM, Wang Shaoyan wrote:
> hi, the gmail is just to send patch, I have to use it, because my work
> mail server will append some spam information. So my signed-off-by is
> right author, that's why I add an obvious "From:". Sorry to trobule
> you.
>
>> But as I assume you, who sent this email, are not the original author,
>> please resent it with your Signed-off-by added. (as keeping track who
>> received the patch from whom is one reasons for having those)
>
>
^ permalink raw reply
* Re: [PATCH] viafb: fix pointer type missmatch
From: Wang Shaoyan @ 2011-08-06 15:03 UTC (permalink / raw)
To: Florian Tobias Schandinat; +Cc: linux-kernel, linux-fbdev, lethal, Wang Shaoyan
In-Reply-To: <4E3D5154.2040808@gmx.de>
hi, the gmail is just to send patch, I have to use it, because my work
mail server will append some spam information. So my signed-off-by is
right author, that's why I add an obvious "From:". Sorry to trobule
you.
> But as I assume you, who sent this email, are not the original author,
> please resent it with your Signed-off-by added. (as keeping track who
> received the patch from whom is one reasons for having those)
--
Wang Shaoyan
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox