Lines Matching refs:front_info
43 static void dbuf_add_to_list(struct xen_drm_front_info *front_info, in dbuf_add_to_list() argument
47 list_add(&dbuf->list, &front_info->dbuf_list); in dbuf_add_to_list()
126 struct xen_drm_front_info *front_info; in xen_drm_front_mode_set() local
131 front_info = pipeline->drm_info->front_info; in xen_drm_front_mode_set()
132 evtchnl = &front_info->evt_pairs[pipeline->index].req; in xen_drm_front_mode_set()
138 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_mode_set()
148 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_mode_set()
157 int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, in xen_drm_front_dbuf_create() argument
169 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_dbuf_create()
177 dbuf_add_to_list(front_info, dbuf, dbuf_cookie); in xen_drm_front_dbuf_create()
180 buf_cfg.xb_dev = front_info->xb_dev; in xen_drm_front_dbuf_create()
184 buf_cfg.be_alloc = front_info->cfg.be_alloc; in xen_drm_front_dbuf_create()
192 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_dbuf_create()
206 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_dbuf_create()
225 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_create()
229 static int xen_drm_front_dbuf_destroy(struct xen_drm_front_info *front_info, in xen_drm_front_dbuf_destroy() argument
238 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_dbuf_destroy()
242 be_alloc = front_info->cfg.be_alloc; in xen_drm_front_dbuf_destroy()
249 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_destroy()
253 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_dbuf_destroy()
258 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_dbuf_destroy()
268 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_destroy()
274 int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info, in xen_drm_front_fb_attach() argument
284 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_fb_attach()
288 buf = dbuf_get(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_fb_attach()
296 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_fb_attach()
305 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_fb_attach()
314 int xen_drm_front_fb_detach(struct xen_drm_front_info *front_info, in xen_drm_front_fb_detach() argument
322 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_fb_detach()
328 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_fb_detach()
333 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_fb_detach()
342 int xen_drm_front_page_flip(struct xen_drm_front_info *front_info, in xen_drm_front_page_flip() argument
350 if (unlikely(conn_idx >= front_info->num_evt_pairs)) in xen_drm_front_page_flip()
353 evtchnl = &front_info->evt_pairs[conn_idx].req; in xen_drm_front_page_flip()
357 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_page_flip()
362 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_page_flip()
371 void xen_drm_front_on_frame_done(struct xen_drm_front_info *front_info, in xen_drm_front_on_frame_done() argument
374 struct xen_drm_front_drm_info *drm_info = front_info->drm_info; in xen_drm_front_on_frame_done()
376 if (unlikely(conn_idx >= front_info->cfg.num_connectors)) in xen_drm_front_on_frame_done()
389 xen_drm_front_dbuf_destroy(drm_info->front_info, in xen_drm_front_gem_object_free()
393 dbuf_free(&drm_info->front_info->dbuf_list, in xen_drm_front_gem_object_free()
426 ret = xen_drm_front_dbuf_create(drm_info->front_info, in xen_drm_drv_dumb_create()
444 xen_drm_front_dbuf_destroy(drm_info->front_info, in xen_drm_drv_dumb_create()
457 struct xen_drm_front_info *front_info = drm_info->front_info; in xen_drm_drv_release() local
464 if (front_info->cfg.be_alloc) in xen_drm_drv_release()
465 xenbus_switch_state(front_info->xb_dev, in xen_drm_drv_release()
487 static int xen_drm_drv_init(struct xen_drm_front_info *front_info) in xen_drm_drv_init() argument
489 struct device *dev = &front_info->xb_dev->dev; in xen_drm_drv_init()
505 drm_info->front_info = front_info; in xen_drm_drv_init()
506 front_info->drm_info = drm_info; in xen_drm_drv_init()
543 front_info->drm_info = NULL; in xen_drm_drv_init()
548 static void xen_drm_drv_fini(struct xen_drm_front_info *front_info) in xen_drm_drv_fini() argument
550 struct xen_drm_front_drm_info *drm_info = front_info->drm_info; in xen_drm_drv_fini()
568 front_info->drm_info = NULL; in xen_drm_drv_fini()
570 xen_drm_front_evtchnl_free_all(front_info); in xen_drm_drv_fini()
571 dbuf_free_all(&front_info->dbuf_list); in xen_drm_drv_fini()
578 if (!front_info->cfg.be_alloc) in xen_drm_drv_fini()
579 xenbus_switch_state(front_info->xb_dev, in xen_drm_drv_fini()
583 static int displback_initwait(struct xen_drm_front_info *front_info) in displback_initwait() argument
585 struct xen_drm_front_cfg *cfg = &front_info->cfg; in displback_initwait()
588 cfg->front_info = front_info; in displback_initwait()
589 ret = xen_drm_front_cfg_card(front_info, cfg); in displback_initwait()
595 ret = xen_drm_front_evtchnl_create_all(front_info); in displback_initwait()
599 return xen_drm_front_evtchnl_publish_all(front_info); in displback_initwait()
602 static int displback_connect(struct xen_drm_front_info *front_info) in displback_connect() argument
604 xen_drm_front_evtchnl_set_state(front_info, EVTCHNL_STATE_CONNECTED); in displback_connect()
605 return xen_drm_drv_init(front_info); in displback_connect()
608 static void displback_disconnect(struct xen_drm_front_info *front_info) in displback_disconnect() argument
610 if (!front_info->drm_info) in displback_disconnect()
614 xenbus_switch_state(front_info->xb_dev, XenbusStateReconfiguring); in displback_disconnect()
616 xen_drm_drv_fini(front_info); in displback_disconnect()
622 struct xen_drm_front_info *front_info = dev_get_drvdata(&xb_dev->dev); in displback_changed() local
640 displback_disconnect(front_info); in displback_changed()
648 displback_disconnect(front_info); in displback_changed()
652 ret = displback_initwait(front_info); in displback_changed()
663 ret = displback_connect(front_info); in displback_changed()
665 displback_disconnect(front_info); in displback_changed()
685 displback_disconnect(front_info); in displback_changed()
693 struct xen_drm_front_info *front_info; in xen_drv_probe() local
703 front_info = devm_kzalloc(&xb_dev->dev, in xen_drv_probe()
704 sizeof(*front_info), GFP_KERNEL); in xen_drv_probe()
705 if (!front_info) in xen_drv_probe()
708 front_info->xb_dev = xb_dev; in xen_drv_probe()
709 spin_lock_init(&front_info->io_lock); in xen_drv_probe()
710 INIT_LIST_HEAD(&front_info->dbuf_list); in xen_drv_probe()
711 dev_set_drvdata(&xb_dev->dev, front_info); in xen_drv_probe()
718 struct xen_drm_front_info *front_info = dev_get_drvdata(&dev->dev); in xen_drv_remove() local
734 while ((xenbus_read_unsigned(front_info->xb_dev->otherend, "state", in xen_drv_remove()
742 state = xenbus_read_unsigned(front_info->xb_dev->otherend, in xen_drv_remove()
748 xen_drm_drv_fini(front_info); in xen_drv_remove()