Lines Matching +full:activate +full:- +full:to +full:- +full:activate

2  * fbsysfs.c - framebuffer device class and attributes
15 * are converted to use it a sysfsification will open OOPSable races.
27 * framebuffer_alloc - creates a new frame buffer info structure
30 * @dev: pointer to the device for this fb, this can be NULL
33 * for driver private data (info->par). info->par (if any) will be
34 * aligned to sizeof(long).
42 #define PADDING (BYTES_PER_LONG - (sizeof(struct fb_info) % BYTES_PER_LONG)) in framebuffer_alloc()
58 info->par = p + fb_info_size; in framebuffer_alloc()
60 info->device = dev; in framebuffer_alloc()
63 mutex_init(&info->bl_curve_mutex); in framebuffer_alloc()
73 * framebuffer_release - marks the structure available for freeing
83 kfree(info->apertures); in framebuffer_release()
88 static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) in activate() function
92 var->activate |= FB_ACTIVATE_FORCE; in activate()
94 fb_info->flags |= FBINFO_MISC_USEREVENT; in activate()
96 fb_info->flags &= ~FBINFO_MISC_USEREVENT; in activate()
109 if (mode->flag & FB_MODE_IS_DETAILED) in mode_string()
111 if (mode->flag & FB_MODE_IS_VESA) in mode_string()
113 if (mode->flag & FB_MODE_IS_STANDARD) in mode_string()
116 if (mode->vmode & FB_VMODE_INTERLACED) in mode_string()
118 if (mode->vmode & FB_VMODE_DOUBLE) in mode_string()
121 return snprintf(&buf[offset], PAGE_SIZE - offset, "%c:%dx%d%c-%d\n", in mode_string()
122 m, mode->xres, mode->yres, v, mode->refresh); in mode_string()
139 list_for_each(pos, &fb_info->modelist) { in store_mode()
141 mode = &modelist->mode; in store_mode()
145 var = fb_info->var; in store_mode()
147 if ((err = activate(fb_info, &var))) in store_mode()
149 fb_info->mode = mode; in store_mode()
153 return -EINVAL; in store_mode()
161 if (!fb_info->mode) in show_mode()
164 return mode_string(buf, 0, fb_info->mode); in show_mode()
176 return -EINVAL; in store_modes()
179 list_splice(&fb_info->modelist, &old_list); in store_modes()
181 &fb_info->modelist); in store_modes()
183 fb_destroy_modelist(&fb_info->modelist); in store_modes()
184 list_splice(&old_list, &fb_info->modelist); in store_modes()
203 list_for_each(pos, &fb_info->modelist) { in show_modes()
205 mode = &modelist->mode; in show_modes()
219 var = fb_info->var; in store_bpp()
221 if ((err = activate(fb_info, &var))) in store_bpp()
230 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel); in show_bpp()
242 var = fb_info->var; in store_rotate()
245 if ((err = activate(fb_info, &var))) in store_rotate()
257 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.rotate); in show_rotate()
269 var = fb_info->var; in store_virtual()
272 if (last - buf >= count) in store_virtual()
273 return -EINVAL; in store_virtual()
276 if ((err = activate(fb_info, &var))) in store_virtual()
285 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, in show_virtual()
286 fb_info->var.yres_virtual); in show_virtual()
293 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length); in show_stride()
305 fb_info->flags |= FBINFO_MISC_USEREVENT; in store_blank()
307 fb_info->flags &= ~FBINFO_MISC_USEREVENT; in store_blank()
360 var = fb_info->var; in store_pan()
363 if (last - buf >= count) in store_pan()
364 return -EINVAL; in store_pan()
380 return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset, in show_pan()
381 fb_info->var.yoffset); in show_pan()
389 return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); in show_name()
403 return -ENODEV; in store_fbstate()
416 return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->state); in show_fbstate()
431 if (!fb_info || !fb_info->bl_dev) in store_bl_curve()
432 return -ENODEV; in store_bl_curve()
435 return -EINVAL; in store_bl_curve()
448 return -EINVAL; in store_bl_curve()
453 mutex_lock(&fb_info->bl_curve_mutex); in store_bl_curve()
455 fb_info->bl_curve[i] = tmp_curve[i]; in store_bl_curve()
456 mutex_unlock(&fb_info->bl_curve_mutex); in store_bl_curve()
471 if (!fb_info || !fb_info->bl_dev) in show_bl_curve()
472 return -ENODEV; in show_bl_curve()
474 mutex_lock(&fb_info->bl_curve_mutex); in show_bl_curve()
478 fb_info->bl_curve[i + 0], in show_bl_curve()
479 fb_info->bl_curve[i + 1], in show_bl_curve()
480 fb_info->bl_curve[i + 2], in show_bl_curve()
481 fb_info->bl_curve[i + 3], in show_bl_curve()
482 fb_info->bl_curve[i + 4], in show_bl_curve()
483 fb_info->bl_curve[i + 5], in show_bl_curve()
484 fb_info->bl_curve[i + 6], in show_bl_curve()
485 fb_info->bl_curve[i + 7]); in show_bl_curve()
486 mutex_unlock(&fb_info->bl_curve_mutex); in show_bl_curve()
493 * not a text one. Consideration should also be given to converting
494 * fbdev to use configfs instead of sysfs */
517 dev_set_drvdata(fb_info->dev, fb_info); in fb_init_device()
519 fb_info->class_flag |= FB_SYSFS_FLAG_ATTR; in fb_init_device()
522 error = device_create_file(fb_info->dev, &device_attrs[i]); in fb_init_device()
529 while (--i >= 0) in fb_init_device()
530 device_remove_file(fb_info->dev, &device_attrs[i]); in fb_init_device()
531 fb_info->class_flag &= ~FB_SYSFS_FLAG_ATTR; in fb_init_device()
541 if (fb_info->class_flag & FB_SYSFS_FLAG_ATTR) { in fb_cleanup_device()
543 device_remove_file(fb_info->dev, &device_attrs[i]); in fb_cleanup_device()
545 fb_info->class_flag &= ~FB_SYSFS_FLAG_ATTR; in fb_cleanup_device()
553 * 1-7: min
554 * 8-127: linear from min to max
558 unsigned int i, flat, count, range = (max - min); in fb_bl_default_curve()
560 mutex_lock(&fb_info->bl_curve_mutex); in fb_bl_default_curve()
562 fb_info->bl_curve[0] = off; in fb_bl_default_curve()
565 fb_info->bl_curve[flat] = min; in fb_bl_default_curve()
569 fb_info->bl_curve[flat + i] = min + (range * (i + 1) / count); in fb_bl_default_curve()
571 mutex_unlock(&fb_info->bl_curve_mutex); in fb_bl_default_curve()