Re: framebuffer_{alloc,release}
flat view
From: James Simmons <hidden>
Date: 2003-09-22 21:24:09
framebuffer_alloc doesn't assume anything. It allocates fb_info->par iff
it's told to. For dual head you can allocate par yourself (and do
whatever you want with it) or do something like this (matrox fb is doing
something similar):
if (seconday) {
fb_info = framebuffer_alloc(0, NULL);
fb_info->par = primary->par;
} else
fb_info = framebuffer_alloc(sizeof(struct foo_par), NULL);
release_fb_info won't touch fb_info->par unless it was created by
framebuffer_alloc. If secondary driver can work even when primary is
unloaded then you can use class_device_get (or a wrapper) to keep
primary fb data around:
if (secondary) {
if (!primary_fb_info)
secondary_fb_info = framebuffer_alloc(sizeof(struct foo_par), NULL);
else {
if (!class_device_get(&primary_fb_info->class_dev))
/* primary is going away */
else {
secondary_fb_info = framebuffer_alloc(0, NULL);
secondary_fb_info->par = primary_fb_info->par;
}
}
}This is acceptable. I applied your changes. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf