linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Do set var even if no fb_check_var() provided.
@ 2008-08-27  5:09 Takashi Yoshii
  2008-08-27  7:08 ` Geert Uytterhoeven
  0 siblings, 1 reply; 33+ messages in thread
From: Takashi Yoshii @ 2008-08-27  5:09 UTC (permalink / raw)
  To: linux-fbdev-devel

Hi,

The behavior of FBIOSET_VSCREENINFO seems to be weired on FB which does not
 provides fbops->fb_check_var.
It doesn't set anything, but gets info->var instead, and returns no error.
It is just same as FBIOGET_VSCREENINFO does.

IMHO, this should be one of the following candidates,
 1. set var without check.
 2. do nothing but return error (setting var is not supported).
or
 3. it's a bug (fb_check_var should always be provided).

The patch at the bottom implements "1".

Because I don't know API specification, nor the history of the code, 
I would like people who knows well to discuss this.

Regards,
/yoshii
---
drivers/video/fbmem.c:fb_set_var()
 Do set_var even if fbops->fb_check_var == NULL.
 Possible API change of ioctl(FBIOSET_VSCREENINFO).

Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com>

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 776f7fc..6fc2ba6 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -939,16 +939,12 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
 	    memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) {
 		u32 activate = var->activate;
 
-		if (!info->fbops->fb_check_var) {
-			*var = info->var;
-			goto done;
+		if (info->fbops->fb_check_var) {
+			ret = info->fbops->fb_check_var(var, info);
+			if (ret)
+				goto done;
 		}
 
-		ret = info->fbops->fb_check_var(var, info);
-
-		if (ret)
-			goto done;
-
 		if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
 			struct fb_videomode mode;
 
-- 
1.5.4.5


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2008-09-04  7:38 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27  5:09 [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-27  7:08 ` Geert Uytterhoeven
2008-08-27 21:49   ` Helge Deller
2008-08-28  6:53     ` Michel Dänzer
2008-08-28 21:43       ` Helge Deller
2008-08-28 22:08         ` Michel Dänzer
2008-08-28 22:16           ` Helge Deller
2008-08-28 22:18             ` Michel Dänzer
2008-08-28 22:23               ` Helge Deller
2008-08-28 22:30                 ` Michel Dänzer
2008-08-28 22:35                   ` Helge Deller
2008-08-28 22:47                     ` Michel Dänzer
2008-08-28  7:45     ` Ville Syrjälä
2008-08-28 21:45       ` Helge Deller
2008-08-29  5:15       ` [PATCH] Add fb_check_var() for fixed mode device Takashi Yoshii
2008-08-29  7:07         ` Michel Dänzer
2008-08-29  7:48           ` Takashi Yoshii
2008-08-29  7:10         ` Geert Uytterhoeven
2008-09-04  1:56           ` Takashi Yoshii
2008-08-29  8:49         ` Michel Dänzer
2008-08-29 12:16           ` Geert Uytterhoeven
2008-08-29 13:51             ` Michel Dänzer
2008-08-29 14:14               ` Geert Uytterhoeven
2008-08-29 14:23                 ` Michel Dänzer
2008-08-30  8:58                   ` Helge Deller
2008-09-02 19:11                     ` Helge Deller
2008-09-03 10:11                       ` Michel Dänzer
2008-09-03 19:24                         ` Helge Deller
2008-09-04  7:21                       ` Takashi Yoshii
2008-08-29 17:38             ` Ville Syrjälä
2008-08-29  2:06   ` [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-29  7:03     ` Geert Uytterhoeven
2008-09-04  7:38       ` Takashi Yoshii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).