Lines Matching +full:v +full:- +full:blanking
2 * Copyright (c) 2006-2009 Red Hat Inc.
3 * Copyright (c) 2006-2008 Intel Corporation
62 fb_helper = sc->fb_helper; in vt_restore_fbdev_mode()
63 sx_xlock(&fb_helper->dev->mode_config.mutex); in vt_restore_fbdev_mode()
65 sx_xunlock(&fb_helper->dev->mode_config.mutex); in vt_restore_fbdev_mode()
76 taskqueue_enqueue(taskqueue_thread, &sc->fb_mode_task); in vt_kms_postswitch()
78 drm_fb_helper_restore_fbdev_mode(sc->fb_helper); in vt_kms_postswitch()
92 TASK_INIT(&sc->fb_mode_task, 0, vt_restore_fbdev_mode, sc); in framebuffer_alloc()
94 info->fb_priv = sc; in framebuffer_alloc()
95 info->enter = &vt_kms_postswitch; in framebuffer_alloc()
104 free(info->fb_priv, DRM_MEM_KMS); in framebuffer_release()
123 * connector-specific mode: in fb_get_options()
129 DRM_INFO(" - %s\n", tunable); in fb_get_options()
130 DRM_INFO(" - kern.vt.fb.default_mode\n"); in fb_get_options()
135 return (*option != NULL ? 0 : -ENOENT); in fb_get_options()
150 struct drm_device *dev = fb_helper->dev; in drm_fb_helper_single_add_all_connectors()
154 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { in drm_fb_helper_single_add_all_connectors()
162 fb_helper_connector->connector = connector; in drm_fb_helper_single_add_all_connectors()
163 fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector; in drm_fb_helper_single_add_all_connectors()
167 for (i = 0; i < fb_helper->connector_count; i++) { in drm_fb_helper_single_add_all_connectors()
168 free(fb_helper->connector_info[i], DRM_MEM_KMS); in drm_fb_helper_single_add_all_connectors()
169 fb_helper->connector_info[i] = NULL; in drm_fb_helper_single_add_all_connectors()
171 fb_helper->connector_count = 0; in drm_fb_helper_single_add_all_connectors()
172 return -ENOMEM; in drm_fb_helper_single_add_all_connectors()
181 for (i = 0; i < fb_helper->connector_count; i++) { in drm_fb_helper_parse_command_line()
186 fb_helper_conn = fb_helper->connector_info[i]; in drm_fb_helper_parse_command_line()
187 connector = fb_helper_conn->connector; in drm_fb_helper_parse_command_line()
188 mode = &fb_helper_conn->cmdline_mode; in drm_fb_helper_parse_command_line()
190 /* do something on return - turn off connector maybe */ in drm_fb_helper_parse_command_line()
197 if (mode->force) { in drm_fb_helper_parse_command_line()
199 switch (mode->force) { in drm_fb_helper_parse_command_line()
204 s = "ON - dig"; in drm_fb_helper_parse_command_line()
214 connector->force = mode->force; in drm_fb_helper_parse_command_line()
219 mode->xres, mode->yres, in drm_fb_helper_parse_command_line()
220 mode->refresh_specified ? mode->refresh : 60, in drm_fb_helper_parse_command_line()
221 mode->rb ? " reduced blanking" : "", in drm_fb_helper_parse_command_line()
222 mode->margins ? " with margins" : "", in drm_fb_helper_parse_command_line()
223 mode->interlace ? " interlaced" : ""); in drm_fb_helper_parse_command_line()
237 r_base = crtc->gamma_store;
238 g_base = r_base + crtc->gamma_size;
239 b_base = g_base + crtc->gamma_size;
241 for (i = 0; i < crtc->gamma_size; i++)
242 helper->funcs->gamma_get(crtc, &r_base[i], &g_base[i], &b_base[i], i);
249 if (crtc->funcs->gamma_set == NULL)
252 r_base = crtc->gamma_store;
253 g_base = r_base + crtc->gamma_size;
254 b_base = g_base + crtc->gamma_size;
256 crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size);
261 struct drm_fb_helper *helper = info->par;
269 for (i = 0; i < helper->crtc_count; i++) {
271 &helper->crtc_info[i].mode_set;
273 if (!mode_set->crtc->enabled)
276 funcs = mode_set->crtc->helper_private;
277 drm_fb_helper_save_lut_atomic(mode_set->crtc, helper);
278 funcs->mode_set_base_atomic(mode_set->crtc,
279 mode_set->fb,
280 mode_set->x,
281 mode_set->y,
293 struct drm_device *dev = crtc->dev;
296 list_for_each_entry(c, &dev->mode_config.crtc_list, head) {
297 if (crtc->base.id == c->base.id)
298 return c->fb;
306 struct drm_fb_helper *helper = info->par;
312 for (i = 0; i < helper->crtc_count; i++) {
313 struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set;
314 crtc = mode_set->crtc;
315 funcs = crtc->helper_private;
318 if (!crtc->enabled)
326 drm_fb_helper_restore_lut_atomic(mode_set->crtc);
327 funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x,
328 crtc->y, LEAVE_ATOMIC_MODE_SET);
341 for (i = 0; i < fb_helper->crtc_count; i++) { in drm_fb_helper_restore_fbdev_mode()
342 struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set; in drm_fb_helper_restore_fbdev_mode()
343 ret = mode_set->crtc->funcs->set_config(mode_set); in drm_fb_helper_restore_fbdev_mode()
360 if (helper->dev->switch_power_state == DRM_SWITCH_POWER_OFF) in drm_fb_helper_force_kernel_mode()
392 * drm_fb_helper_restore - restore the framebuffer console (kernel) config
420 .help_msg = "force-fb(V)",
431 struct drm_fb_helper *fb_helper = info->par;
432 struct drm_device *dev = fb_helper->dev;
440 sx_xlock(&dev->mode_config.mutex);
441 for (i = 0; i < fb_helper->crtc_count; i++) {
442 crtc = fb_helper->crtc_info[i].mode_set.crtc;
444 if (!crtc->enabled)
448 for (j = 0; j < fb_helper->connector_count; j++) {
449 connector = fb_helper->connector_info[j]->connector;
450 connector->funcs->dpms(connector, dpms_mode);
451 drm_object_property_set_value(&connector->base,
452 dev->mode_config.dpms_property, dpms_mode);
455 sx_xunlock(&dev->mode_config.mutex);
491 for (i = 0; i < helper->connector_count; i++) in drm_fb_helper_crtc_free()
492 free(helper->connector_info[i], DRM_MEM_KMS); in drm_fb_helper_crtc_free()
493 free(helper->connector_info, DRM_MEM_KMS); in drm_fb_helper_crtc_free()
494 for (i = 0; i < helper->crtc_count; i++) { in drm_fb_helper_crtc_free()
495 free(helper->crtc_info[i].mode_set.connectors, DRM_MEM_KMS); in drm_fb_helper_crtc_free()
496 if (helper->crtc_info[i].mode_set.mode) in drm_fb_helper_crtc_free()
497 drm_mode_destroy(helper->dev, helper->crtc_info[i].mode_set.mode); in drm_fb_helper_crtc_free()
499 free(helper->crtc_info, DRM_MEM_KMS); in drm_fb_helper_crtc_free()
509 fb_helper->dev = dev; in drm_fb_helper_init()
511 INIT_LIST_HEAD(&fb_helper->kernel_fb_list); in drm_fb_helper_init()
513 fb_helper->crtc_info = malloc(crtc_count * sizeof(struct drm_fb_helper_crtc), in drm_fb_helper_init()
515 if (!fb_helper->crtc_info) in drm_fb_helper_init()
516 return -ENOMEM; in drm_fb_helper_init()
518 fb_helper->crtc_count = crtc_count; in drm_fb_helper_init()
519 …fb_helper->connector_info = malloc(dev->mode_config.num_connector * sizeof(struct drm_fb_helper_co… in drm_fb_helper_init()
521 if (!fb_helper->connector_info) { in drm_fb_helper_init()
522 free(fb_helper->crtc_info, DRM_MEM_KMS); in drm_fb_helper_init()
523 return -ENOMEM; in drm_fb_helper_init()
525 fb_helper->connector_count = 0; in drm_fb_helper_init()
528 fb_helper->crtc_info[i].mode_set.connectors = in drm_fb_helper_init()
533 if (!fb_helper->crtc_info[i].mode_set.connectors) in drm_fb_helper_init()
535 fb_helper->crtc_info[i].mode_set.num_connectors = 0; in drm_fb_helper_init()
539 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { in drm_fb_helper_init()
540 fb_helper->crtc_info[i].mode_set.crtc = crtc; in drm_fb_helper_init()
547 return -ENOMEM; in drm_fb_helper_init()
553 if (!list_empty(&fb_helper->kernel_fb_list)) { in drm_fb_helper_fini()
554 list_del(&fb_helper->kernel_fb_list); in drm_fb_helper_fini()
560 unregister_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); in drm_fb_helper_fini()
574 struct drm_fb_helper *fb_helper = info->par;
575 struct drm_framebuffer *fb = fb_helper->fb;
578 if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
583 return -EINVAL;
584 palette = (u32 *)info->pseudo_palette;
585 red >>= (16 - info->var.red.length);
586 green >>= (16 - info->var.green.length);
587 blue >>= (16 - info->var.blue.length);
588 value = (red << info->var.red.offset) |
589 (green << info->var.green.offset) |
590 (blue << info->var.blue.offset);
591 if (info->var.transp.length > 0) {
592 u32 mask = (1 << info->var.transp.length) - 1;
593 mask <<= info->var.transp.offset;
602 if (fb->bits_per_pixel == 16) {
605 if (fb->depth == 16 && regno > 63)
606 return -EINVAL;
607 if (fb->depth == 15 && regno > 31)
608 return -EINVAL;
610 if (fb->depth == 16) {
615 fb_helper->funcs->gamma_set(crtc, red,
619 fb_helper->funcs->gamma_get(crtc, &r,
624 fb_helper->funcs->gamma_set(crtc, r,
630 if (fb->depth != 16)
631 fb_helper->funcs->gamma_set(crtc, red, green, blue, pindex);
637 struct drm_fb_helper *fb_helper = info->par;
644 for (i = 0; i < fb_helper->crtc_count; i++) {
645 crtc = fb_helper->crtc_info[i].mode_set.crtc;
646 crtc_funcs = crtc->helper_private;
648 red = cmap->red;
649 green = cmap->green;
650 blue = cmap->blue;
651 transp = cmap->transp;
652 start = cmap->start;
654 for (j = 0; j < cmap->len; j++) {
668 crtc_funcs->load_lut(crtc);
677 struct drm_fb_helper *fb_helper = info->par;
678 struct drm_framebuffer *fb = fb_helper->fb;
681 if (var->pixclock != 0 || in_dbg_master())
682 return -EINVAL;
685 if (var->bits_per_pixel > fb->bits_per_pixel ||
686 var->xres > fb->width || var->yres > fb->height ||
687 var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
689 "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
690 var->xres, var->yres, var->bits_per_pixel,
691 var->xres_virtual, var->yres_virtual,
692 fb->width, fb->height, fb->bits_per_pixel);
693 return -EINVAL;
696 switch (var->bits_per_pixel) {
698 depth = (var->green.length == 6) ? 16 : 15;
701 depth = (var->transp.length > 0) ? 32 : 24;
704 depth = var->bits_per_pixel;
710 var->red.offset = 0;
711 var->green.offset = 0;
712 var->blue.offset = 0;
713 var->red.length = 8;
714 var->green.length = 8;
715 var->blue.length = 8;
716 var->transp.length = 0;
717 var->transp.offset = 0;
720 var->red.offset = 10;
721 var->green.offset = 5;
722 var->blue.offset = 0;
723 var->red.length = 5;
724 var->green.length = 5;
725 var->blue.length = 5;
726 var->transp.length = 1;
727 var->transp.offset = 15;
730 var->red.offset = 11;
731 var->green.offset = 5;
732 var->blue.offset = 0;
733 var->red.length = 5;
734 var->green.length = 6;
735 var->blue.length = 5;
736 var->transp.length = 0;
737 var->transp.offset = 0;
740 var->red.offset = 16;
741 var->green.offset = 8;
742 var->blue.offset = 0;
743 var->red.length = 8;
744 var->green.length = 8;
745 var->blue.length = 8;
746 var->transp.length = 0;
747 var->transp.offset = 0;
750 var->red.offset = 16;
751 var->green.offset = 8;
752 var->blue.offset = 0;
753 var->red.length = 8;
754 var->green.length = 8;
755 var->blue.length = 8;
756 var->transp.length = 8;
757 var->transp.offset = 24;
760 return -EINVAL;
769 struct drm_fb_helper *fb_helper = info->par;
770 struct drm_device *dev = fb_helper->dev;
771 struct fb_var_screeninfo *var = &info->var;
776 if (var->pixclock != 0) {
778 return -EINVAL;
781 sx_xlock(&dev->mode_config.mutex);
782 for (i = 0; i < fb_helper->crtc_count; i++) {
783 crtc = fb_helper->crtc_info[i].mode_set.crtc;
784 ret = crtc->funcs->set_config(&fb_helper->crtc_info[i].mode_set);
786 sx_xunlock(&dev->mode_config.mutex);
790 sx_xunlock(&dev->mode_config.mutex);
792 if (fb_helper->delayed_hotplug) {
793 fb_helper->delayed_hotplug = false;
803 struct drm_fb_helper *fb_helper = info->par;
804 struct drm_device *dev = fb_helper->dev;
810 sx_xlock(&dev->mode_config.mutex);
811 for (i = 0; i < fb_helper->crtc_count; i++) {
812 crtc = fb_helper->crtc_info[i].mode_set.crtc;
814 modeset = &fb_helper->crtc_info[i].mode_set;
816 modeset->x = var->xoffset;
817 modeset->y = var->yoffset;
819 if (modeset->num_connectors) {
820 ret = crtc->funcs->set_config(modeset);
822 info->var.xoffset = var->xoffset;
823 info->var.yoffset = var->yoffset;
827 sx_xunlock(&dev->mode_config.mutex);
852 sizes.fb_width = (unsigned)-1; in drm_fb_helper_single_fb_probe()
853 sizes.fb_height = (unsigned)-1; in drm_fb_helper_single_fb_probe()
861 for (i = 0; i < fb_helper->connector_count; i++) { in drm_fb_helper_single_fb_probe()
862 struct drm_fb_helper_connector *fb_helper_conn = fb_helper->connector_info[i]; in drm_fb_helper_single_fb_probe()
865 cmdline_mode = &fb_helper_conn->cmdline_mode; in drm_fb_helper_single_fb_probe()
867 if (cmdline_mode->bpp_specified) { in drm_fb_helper_single_fb_probe()
868 switch (cmdline_mode->bpp) { in drm_fb_helper_single_fb_probe()
892 for (i = 0; i < fb_helper->crtc_count; i++) { in drm_fb_helper_single_fb_probe()
894 desired_mode = fb_helper->crtc_info[i].desired_mode; in drm_fb_helper_single_fb_probe()
898 gamma_size = fb_helper->crtc_info[i].mode_set.crtc->gamma_size; in drm_fb_helper_single_fb_probe()
899 if (desired_mode->hdisplay < sizes.fb_width) in drm_fb_helper_single_fb_probe()
900 sizes.fb_width = desired_mode->hdisplay; in drm_fb_helper_single_fb_probe()
901 if (desired_mode->vdisplay < sizes.fb_height) in drm_fb_helper_single_fb_probe()
902 sizes.fb_height = desired_mode->vdisplay; in drm_fb_helper_single_fb_probe()
903 if (desired_mode->hdisplay > sizes.surface_width) in drm_fb_helper_single_fb_probe()
904 sizes.surface_width = desired_mode->hdisplay; in drm_fb_helper_single_fb_probe()
905 if (desired_mode->vdisplay > sizes.surface_height) in drm_fb_helper_single_fb_probe()
906 sizes.surface_height = desired_mode->vdisplay; in drm_fb_helper_single_fb_probe()
911 if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) { in drm_fb_helper_single_fb_probe()
912 /* hmm everyone went away - assume VGA cable just fell out in drm_fb_helper_single_fb_probe()
914 DRM_INFO("Cannot find any crtc or sizes - going 1024x768\n"); in drm_fb_helper_single_fb_probe()
920 new_fb = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); in drm_fb_helper_single_fb_probe()
924 info = fb_helper->fbdev; in drm_fb_helper_single_fb_probe()
926 kdev = fb_helper->dev->dev; in drm_fb_helper_single_fb_probe()
927 info->fb_video_dev = device_get_parent(kdev); in drm_fb_helper_single_fb_probe()
930 for (i = 0; i < fb_helper->crtc_count; i++) in drm_fb_helper_single_fb_probe()
931 fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; in drm_fb_helper_single_fb_probe()
937 info->fb_fbd_dev = device_add_child(kdev, "fbd", in drm_fb_helper_single_fb_probe()
939 if (info->fb_fbd_dev != NULL) in drm_fb_helper_single_fb_probe()
940 ret = device_probe_and_attach(info->fb_fbd_dev); in drm_fb_helper_single_fb_probe()
949 dev = fb_helper->dev; in drm_fb_helper_single_fb_probe()
950 sx_xlock(&dev->mode_config.mutex); in drm_fb_helper_single_fb_probe()
951 for (i = 0; i < fb_helper->crtc_count; i++) { in drm_fb_helper_single_fb_probe()
952 crtc = fb_helper->crtc_info[i].mode_set.crtc; in drm_fb_helper_single_fb_probe()
953 ret = crtc->funcs->set_config(&fb_helper->crtc_info[i].mode_set); in drm_fb_helper_single_fb_probe()
955 sx_xunlock(&dev->mode_config.mutex); in drm_fb_helper_single_fb_probe()
959 sx_xunlock(&dev->mode_config.mutex); in drm_fb_helper_single_fb_probe()
961 if (fb_helper->delayed_hotplug) { in drm_fb_helper_single_fb_probe()
962 fb_helper->delayed_hotplug = false; in drm_fb_helper_single_fb_probe()
968 info->var.pixclock = 0; in drm_fb_helper_single_fb_probe()
970 return -EINVAL; in drm_fb_helper_single_fb_probe()
972 dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", in drm_fb_helper_single_fb_probe()
973 info->node, info->fix.id); in drm_fb_helper_single_fb_probe()
984 dev_info(fb_helper->dev->dev, "registered panic notifier\n"); in drm_fb_helper_single_fb_probe()
987 register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); in drm_fb_helper_single_fb_probe()
991 list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); in drm_fb_helper_single_fb_probe()
1000 info->fb_stride = pitch; in drm_fb_helper_fill_fix()
1009 struct drm_framebuffer *fb = fb_helper->fb; in drm_fb_helper_fill_var()
1012 info->fb_name = device_get_nameunit(fb_helper->dev->dev); in drm_fb_helper_fill_var()
1013 info->fb_width = fb->width; in drm_fb_helper_fill_var()
1014 info->fb_height = fb->height; in drm_fb_helper_fill_var()
1015 info->fb_depth = fb->bits_per_pixel; in drm_fb_helper_fill_var()
1017 sc = (struct vt_kms_softc *)info->fb_priv; in drm_fb_helper_fill_var()
1018 sc->fb_helper = fb_helper; in drm_fb_helper_fill_var()
1030 for (i = 0; i < fb_helper->connector_count; i++) { in drm_fb_helper_probe_connector_modes()
1031 connector = fb_helper->connector_info[i]->connector; in drm_fb_helper_probe_connector_modes()
1032 count += connector->funcs->fill_modes(connector, maxX, maxY); in drm_fb_helper_probe_connector_modes()
1042 list_for_each_entry(mode, &fb_connector->connector->modes, head) { in drm_has_preferred_mode()
1046 if (mode->type & DRM_MODE_TYPE_PREFERRED) in drm_has_preferred_mode()
1055 cmdline_mode = &fb_connector->cmdline_mode; in drm_has_cmdline_mode()
1056 return cmdline_mode->specified; in drm_has_cmdline_mode()
1065 cmdline_mode = &fb_helper_conn->cmdline_mode; in drm_pick_cmdline_mode()
1066 if (cmdline_mode->specified == false) in drm_pick_cmdline_mode()
1072 if (cmdline_mode->rb || cmdline_mode->margins) in drm_pick_cmdline_mode()
1075 list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { in drm_pick_cmdline_mode()
1077 if (mode->hdisplay != cmdline_mode->xres || in drm_pick_cmdline_mode()
1078 mode->vdisplay != cmdline_mode->yres) in drm_pick_cmdline_mode()
1081 if (cmdline_mode->refresh_specified) { in drm_pick_cmdline_mode()
1082 if (mode->vrefresh != cmdline_mode->refresh) in drm_pick_cmdline_mode()
1086 if (cmdline_mode->interlace) { in drm_pick_cmdline_mode()
1087 if (!(mode->flags & DRM_MODE_FLAG_INTERLACE)) in drm_pick_cmdline_mode()
1094 mode = drm_mode_create_from_cmdline_mode(fb_helper_conn->connector->dev, in drm_pick_cmdline_mode()
1096 list_add(&mode->head, &fb_helper_conn->connector->modes); in drm_pick_cmdline_mode()
1105 enable = connector->status == connector_status_connected; in drm_connector_enabled()
1107 enable = connector->status != connector_status_disconnected; in drm_connector_enabled()
1119 for (i = 0; i < fb_helper->connector_count; i++) { in drm_enable_connectors()
1120 connector = fb_helper->connector_info[i]->connector; in drm_enable_connectors()
1122 DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id, in drm_enable_connectors()
1130 for (i = 0; i < fb_helper->connector_count; i++) { in drm_enable_connectors()
1131 connector = fb_helper->connector_info[i]->connector; in drm_enable_connectors()
1146 if (fb_helper->crtc_count > 1) in drm_target_cloned()
1150 for (i = 0; i < fb_helper->connector_count; i++) { in drm_target_cloned()
1161 for (i = 0; i < fb_helper->connector_count; i++) { in drm_target_cloned()
1164 fb_helper_conn = fb_helper->connector_info[i]; in drm_target_cloned()
1185 dmt_mode = drm_mode_find_dmt(fb_helper->dev, 1024, 768, 60, false); in drm_target_cloned()
1187 for (i = 0; i < fb_helper->connector_count; i++) { in drm_target_cloned()
1192 fb_helper_conn = fb_helper->connector_info[i]; in drm_target_cloned()
1193 list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { in drm_target_cloned()
1216 for (i = 0; i < fb_helper->connector_count; i++) { in drm_target_preferred()
1217 fb_helper_conn = fb_helper->connector_info[i]; in drm_target_preferred()
1223 fb_helper_conn->connector->base.id); in drm_target_preferred()
1229 fb_helper_conn->connector->base.id); in drm_target_preferred()
1233 if (!modes[i] && !list_empty(&fb_helper_conn->connector->modes)) { in drm_target_preferred()
1234 list_for_each_entry(modes[i], &fb_helper_conn->connector->modes, head) in drm_target_preferred()
1237 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name : in drm_target_preferred()
1249 struct drm_device *dev = fb_helper->dev; in drm_pick_crtcs()
1257 if (n == fb_helper->connector_count) in drm_pick_crtcs()
1260 fb_helper_conn = fb_helper->connector_info[n]; in drm_pick_crtcs()
1261 connector = fb_helper_conn->connector; in drm_pick_crtcs()
1268 crtcs = malloc(dev->mode_config.num_connector * in drm_pick_crtcs()
1274 if (connector->status == connector_status_connected) in drm_pick_crtcs()
1281 connector_funcs = connector->helper_private; in drm_pick_crtcs()
1282 encoder = connector_funcs->best_encoder(connector); in drm_pick_crtcs()
1288 for (c = 0; c < fb_helper->crtc_count; c++) { in drm_pick_crtcs()
1289 crtc = &fb_helper->crtc_info[c]; in drm_pick_crtcs()
1291 if ((encoder->possible_crtcs & (1 << c)) == 0) in drm_pick_crtcs()
1300 if (fb_helper->crtc_count > 1) in drm_pick_crtcs()
1314 dev->mode_config.num_connector * in drm_pick_crtcs()
1325 struct drm_device *dev = fb_helper->dev; in drm_setup_crtcs()
1335 width = dev->mode_config.max_width; in drm_setup_crtcs()
1336 height = dev->mode_config.max_height; in drm_setup_crtcs()
1338 crtcs = malloc(dev->mode_config.num_connector * in drm_setup_crtcs()
1340 modes = malloc(dev->mode_config.num_connector * in drm_setup_crtcs()
1342 enabled = malloc(dev->mode_config.num_connector * in drm_setup_crtcs()
1364 /* fill out the connector<->crtc mappings into the modesets */ in drm_setup_crtcs()
1365 for (i = 0; i < fb_helper->crtc_count; i++) { in drm_setup_crtcs()
1366 modeset = &fb_helper->crtc_info[i].mode_set; in drm_setup_crtcs()
1367 modeset->num_connectors = 0; in drm_setup_crtcs()
1370 for (i = 0; i < fb_helper->connector_count; i++) { in drm_setup_crtcs()
1373 modeset = &fb_crtc->mode_set; in drm_setup_crtcs()
1377 mode->name, fb_crtc->mode_set.crtc->base.id); in drm_setup_crtcs()
1378 fb_crtc->desired_mode = mode; in drm_setup_crtcs()
1379 if (modeset->mode) in drm_setup_crtcs()
1380 drm_mode_destroy(dev, modeset->mode); in drm_setup_crtcs()
1381 modeset->mode = drm_mode_duplicate(dev, in drm_setup_crtcs()
1382 fb_crtc->desired_mode); in drm_setup_crtcs()
1383 modeset->connectors[modeset->num_connectors++] = fb_helper->connector_info[i]->connector; in drm_setup_crtcs()
1394 * drm_helper_initial_config - setup a sane initial connector configuration
1411 struct drm_device *dev = fb_helper->dev; in drm_fb_helper_initial_config()
1415 drm_helper_disable_unused_functions(fb_helper->dev); in drm_fb_helper_initial_config()
1420 dev->mode_config.max_width, in drm_fb_helper_initial_config()
1421 dev->mode_config.max_height); in drm_fb_helper_initial_config()
1426 dev_info(fb_helper->dev->dev, "No connectors reported connected with modes\n"); in drm_fb_helper_initial_config()
1435 * drm_fb_helper_hotplug_event - respond to a hotplug notification by
1446 * 0 on success and a non-zero error code otherwise.
1450 struct drm_device *dev = fb_helper->dev; in drm_fb_helper_hotplug_event()
1455 if (!fb_helper->fb) in drm_fb_helper_hotplug_event()
1458 sx_xlock(&dev->mode_config.mutex); in drm_fb_helper_hotplug_event()
1459 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { in drm_fb_helper_hotplug_event()
1460 if (crtc->fb) in drm_fb_helper_hotplug_event()
1462 if (crtc->fb == fb_helper->fb) in drm_fb_helper_hotplug_event()
1467 fb_helper->delayed_hotplug = true; in drm_fb_helper_hotplug_event()
1468 sx_xunlock(&dev->mode_config.mutex); in drm_fb_helper_hotplug_event()
1473 max_width = fb_helper->fb->width; in drm_fb_helper_hotplug_event()
1474 max_height = fb_helper->fb->height; in drm_fb_helper_hotplug_event()
1475 bpp_sel = fb_helper->fb->bits_per_pixel; in drm_fb_helper_hotplug_event()
1480 sx_xunlock(&dev->mode_config.mutex); in drm_fb_helper_hotplug_event()