# How should .fb\_check\_var adjust parameters ?

- From: Laurent Pinchart \<laurent.pinchart@ideasonboard.com\>
- Date: 2011-08-12 11:08:59 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2011/08/13461787
- Thread: https://ratatoskr.run/linux-fbdev/2011/08/13461787/t.md

```text
Hi everybody,

I'm implementing support for fb_set_par() in a driver, and came to think about 
how fb_check_var should behave.

The purpose of that operation is to let drivers verify and adjust a given set 
of fb_var_screeninfo parameters. Looking at various fbdev drivers, the 
function behaviour is clearly left to the author's preferences. Some drivers 
return an error when the parameters don't match the hardware capabilities 
exactly, other drivers adjust them in pretty much non-standardized ways, and 
some other drivers mix both behaviours.

Is anyone aware of guidelines regarding how .fb_char_var should be implemented 
? Under which conditions should it return an error, and under which conditions 
should it adjust parameters ? When adjusting parameters, how should it do so ? 
For instance, if xres > xres_virtual, should xres be lowered or xres_virtual 
raised ?

-- 
Regards,

Laurent Pinchart
```
