* How should .fb_check_var adjust parameters ?
@ 2011-08-12 11:08 Laurent Pinchart
2011-08-12 12:06 ` Florian Tobias Schandinat
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2011-08-12 11:08 UTC (permalink / raw)
To: linux-fbdev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How should .fb_check_var adjust parameters ?
2011-08-12 11:08 How should .fb_check_var adjust parameters ? Laurent Pinchart
@ 2011-08-12 12:06 ` Florian Tobias Schandinat
0 siblings, 0 replies; 2+ messages in thread
From: Florian Tobias Schandinat @ 2011-08-12 12:06 UTC (permalink / raw)
To: linux-fbdev
Hi Laurent,
On 08/12/2011 11:08 AM, Laurent Pinchart wrote:
> 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 ?
I try to stick to
drivers/video/skeletonfb.c
* If the var passed in is slightly
* off by what the hardware can support then we alter the var PASSED in
* to what we can do.
*
* For values that are off, this function must round them _up_ to the
* next value that is supported by the hardware. If the value is
* greater than the highest value supported by the hardware, then this
* function must return -EINVAL.
Sure that still allows a lot of differences in implementation.
Best regards,
Florian Tobias Schandinat
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-12 12:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 11:08 How should .fb_check_var adjust parameters ? Laurent Pinchart
2011-08-12 12:06 ` Florian Tobias Schandinat
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.