Question on struct fb_videomode.name

2 messages, 2 authors, 2011-09-27 · open the first message on its own page

Question on struct fb_videomode.name

From: Timur Tabi <hidden>
Date: 2011-09-26 20:55:45

In my fb driver, I have an array of fb_videomode structs, like this:

static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
	{
		.name		= "1024x768-60",
		.refresh	= 60,
		.xres		= 1024,
		.yres		= 768,
		.pixclock	= 15385,
		.left_margin	= 160,
		.right_margin	= 24,
		.upper_margin	= 29,
		.lower_margin	= 3,
		.hsync_len	= 136,
		.vsync_len	= 6,
		.sync		= FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
		.vmode		= FB_VMODE_NONINTERLACED
	},
	...

Is there any value in specifying the .name field as "<xres>x<yres>-<ref>"?  I
know the .name field is optional, but what happens if I don't specify it?  It
just seems redundant to generate the name based on other data in the same structure.

-- 
Timur Tabi
Linux kernel developer at Freescale

Re: Question on struct fb_videomode.name

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2011-09-27 12:22:53

On Mon, Sep 26, 2011 at 22:55, Timur Tabi [off-list ref] wrote:
In my fb driver, I have an array of fb_videomode structs, like this:

static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
Β  Β  Β  Β {
Β  Β  Β  Β  Β  Β  Β  Β .name Β  Β  Β  Β  Β  = "1024x768-60",
Β  Β  Β  Β  Β  Β  Β  Β .refresh Β  Β  Β  Β = 60,
Β  Β  Β  Β  Β  Β  Β  Β .xres Β  Β  Β  Β  Β  = 1024,
Β  Β  Β  Β  Β  Β  Β  Β .yres Β  Β  Β  Β  Β  = 768,
Β  Β  Β  Β  Β  Β  Β  Β .pixclock Β  Β  Β  = 15385,
Β  Β  Β  Β  Β  Β  Β  Β .left_margin Β  Β = 160,
Β  Β  Β  Β  Β  Β  Β  Β .right_margin Β  = 24,
Β  Β  Β  Β  Β  Β  Β  Β .upper_margin Β  = 29,
Β  Β  Β  Β  Β  Β  Β  Β .lower_margin Β  = 3,
Β  Β  Β  Β  Β  Β  Β  Β .hsync_len Β  Β  Β = 136,
Β  Β  Β  Β  Β  Β  Β  Β .vsync_len Β  Β  Β = 6,
Β  Β  Β  Β  Β  Β  Β  Β .sync Β  Β  Β  Β  Β  = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
Β  Β  Β  Β  Β  Β  Β  Β .vmode Β  Β  Β  Β  Β = FB_VMODE_NONINTERLACED
Β  Β  Β  Β },
Β  Β  Β  Β ...

Is there any value in specifying the .name field as "<xres>x<yres>-<ref>"? Β I
know the .name field is optional, but what happens if I don't specify it? Β It
just seems redundant to generate the name based on other data in the same structure.
If the name is just "<xres>x<yres>-<ref>", you can leave it NULL.
The name only adds value if it's something different, cfr. the modes
in macmodes.c,
amifb.c, or ps3fb.c.

Gr{oetje,eeting}s,

Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β Β  Β Β  -- Linus Torvalds
�τθΊ{.nΗ+‰·�®‰­†+%�Λ�±ιέ¶¥�w�Ί{.nΗ+‰·¥�{±ύφέz�β�Ψ^n‡r΅φ¦zΛ�λh™¨θ­Ϊ&£ϋΰzΏδzΉή—ϊ+€Κ+zf£Ά·h��§~†­†Ϋi��ο�κ�‘κηz_θ®ζj:+v‰¨ώ)ί£ψm
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help