32c32
< __FBSDID("$FreeBSD: head/sys/dev/drm2/drm_fb_helper.c 248061 2013-03-08 18:15:07Z dumbbell $");
---
> __FBSDID("$FreeBSD: head/sys/dev/drm2/drm_fb_helper.c 259016 2013-12-05 22:38:53Z ray $");
38a39,73
> #if defined(__FreeBSD__)
> struct vt_kms_softc {
> struct drm_fb_helper *fb_helper;
> struct task fb_mode_task;
> };
>
> static fb_enter_t vt_kms_postswitch;
> static void vt_restore_fbdev_mode(void *, int);
>
> /* Call restore out of vt(9) locks. */
> static void
> vt_restore_fbdev_mode(void *arg, int pending)
> {
> struct drm_fb_helper *fb_helper;
> struct vt_kms_softc *sc;
>
> sc = (struct vt_kms_softc *)arg;
> fb_helper = sc->fb_helper;
> sx_xlock(&fb_helper->dev->mode_config.mutex);
> drm_fb_helper_restore_fbdev_mode(fb_helper);
> sx_xunlock(&fb_helper->dev->mode_config.mutex);
> }
>
> static int
> vt_kms_postswitch(void *arg)
> {
> struct vt_kms_softc *sc;
>
> sc = (struct vt_kms_softc *)arg;
> taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task);
>
> return (0);
> }
> #endif
>
218a254,257
> /*
> * TODO: store mode options pointer in ${option} for connector with
> * name ${connector_name}
> */
895d933
< #if 0
897d934
< #endif
899a937,940
> #if defined(__FreeBSD__)
> struct vt_kms_softc *sc;
> device_t kdev;
> #endif
976c1017,1022
< #if 0
---
> #if defined(__FreeBSD__)
> sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS,
> M_WAITOK | M_ZERO);
> sc->fb_helper = fb_helper;
> TASK_INIT(&sc->fb_mode_task, 0, vt_restore_fbdev_mode, sc);
>
977a1024,1031
>
> info->fb_name = device_get_nameunit(fb_helper->dev->device);
> info->fb_depth = fb_helper->fb->bits_per_pixel;
> info->fb_height = fb_helper->fb->height;
> info->fb_width = fb_helper->fb->width;
> info->fb_stride = fb_helper->fb->pitches[0];
> info->fb_priv = sc;
> info->enter = &vt_kms_postswitch;
985c1039
< #if 0
---
> #if defined(__FreeBSD__)
986a1041,1051
> device_t fbd;
> int ret;
>
> kdev = fb_helper->dev->device;
> fbd = device_add_child(kdev, "fbd", device_get_unit(kdev));
> ret = device_probe_and_attach(fbd);
> if (ret != 0)
> DRM_ERROR("Failed to attach fbd device: %d\n", ret);
> }
> #else
> if (new_fb) {
1009d1073
<
< __FBSDID("$FreeBSD: head/sys/dev/drm2/drm_fb_helper.c 248061 2013-03-08 18:15:07Z dumbbell $");
---
> __FBSDID("$FreeBSD: head/sys/dev/drm2/drm_fb_helper.c 259016 2013-12-05 22:38:53Z ray $");
38a39,73
> #if defined(__FreeBSD__)
> struct vt_kms_softc {
> struct drm_fb_helper *fb_helper;
> struct task fb_mode_task;
> };
>
> static fb_enter_t vt_kms_postswitch;
> static void vt_restore_fbdev_mode(void *, int);
>
> /* Call restore out of vt(9) locks. */
> static void
> vt_restore_fbdev_mode(void *arg, int pending)
> {
> struct drm_fb_helper *fb_helper;
> struct vt_kms_softc *sc;
>
> sc = (struct vt_kms_softc *)arg;
> fb_helper = sc->fb_helper;
> sx_xlock(&fb_helper->dev->mode_config.mutex);
> drm_fb_helper_restore_fbdev_mode(fb_helper);
> sx_xunlock(&fb_helper->dev->mode_config.mutex);
> }
>
> static int
> vt_kms_postswitch(void *arg)
> {
> struct vt_kms_softc *sc;
>
> sc = (struct vt_kms_softc *)arg;
> taskqueue_enqueue_fast(taskqueue_thread, &sc->fb_mode_task);
>
> return (0);
> }
> #endif
>
218a254,257
> /*
> * TODO: store mode options pointer in ${option} for connector with
> * name ${connector_name}
> */
895d933
< #if 0
897d934
< #endif
899a937,940
> #if defined(__FreeBSD__)
> struct vt_kms_softc *sc;
> device_t kdev;
> #endif
976c1017,1022
< #if 0
---
> #if defined(__FreeBSD__)
> sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS,
> M_WAITOK | M_ZERO);
> sc->fb_helper = fb_helper;
> TASK_INIT(&sc->fb_mode_task, 0, vt_restore_fbdev_mode, sc);
>
977a1024,1031
>
> info->fb_name = device_get_nameunit(fb_helper->dev->device);
> info->fb_depth = fb_helper->fb->bits_per_pixel;
> info->fb_height = fb_helper->fb->height;
> info->fb_width = fb_helper->fb->width;
> info->fb_stride = fb_helper->fb->pitches[0];
> info->fb_priv = sc;
> info->enter = &vt_kms_postswitch;
985c1039
< #if 0
---
> #if defined(__FreeBSD__)
986a1041,1051
> device_t fbd;
> int ret;
>
> kdev = fb_helper->dev->device;
> fbd = device_add_child(kdev, "fbd", device_get_unit(kdev));
> ret = device_probe_and_attach(fbd);
> if (ret != 0)
> DRM_ERROR("Failed to attach fbd device: %d\n", ret);
> }
> #else
> if (new_fb) {
1009d1073
<