Lines Matching refs:front_info

44 static void dbuf_add_to_list(struct xen_drm_front_info *front_info,  in dbuf_add_to_list()  argument
48 list_add(&dbuf->list, &front_info->dbuf_list); in dbuf_add_to_list()
127 struct xen_drm_front_info *front_info; in xen_drm_front_mode_set() local
132 front_info = pipeline->drm_info->front_info; in xen_drm_front_mode_set()
133 evtchnl = &front_info->evt_pairs[pipeline->index].req; in xen_drm_front_mode_set()
139 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_mode_set()
149 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_mode_set()
158 int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, in xen_drm_front_dbuf_create() argument
170 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_dbuf_create()
178 dbuf_add_to_list(front_info, dbuf, dbuf_cookie); in xen_drm_front_dbuf_create()
181 buf_cfg.xb_dev = front_info->xb_dev; in xen_drm_front_dbuf_create()
185 buf_cfg.be_alloc = front_info->cfg.be_alloc; in xen_drm_front_dbuf_create()
193 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_dbuf_create()
207 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_dbuf_create()
226 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_create()
230 static int xen_drm_front_dbuf_destroy(struct xen_drm_front_info *front_info, in xen_drm_front_dbuf_destroy() argument
239 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_dbuf_destroy()
243 be_alloc = front_info->cfg.be_alloc; in xen_drm_front_dbuf_destroy()
250 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_destroy()
254 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_dbuf_destroy()
259 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_dbuf_destroy()
269 dbuf_free(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_dbuf_destroy()
275 int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info, in xen_drm_front_fb_attach() argument
285 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_fb_attach()
289 buf = dbuf_get(&front_info->dbuf_list, dbuf_cookie); in xen_drm_front_fb_attach()
297 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_fb_attach()
306 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_fb_attach()
315 int xen_drm_front_fb_detach(struct xen_drm_front_info *front_info, in xen_drm_front_fb_detach() argument
323 evtchnl = &front_info->evt_pairs[GENERIC_OP_EVT_CHNL].req; in xen_drm_front_fb_detach()
329 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_fb_detach()
334 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_fb_detach()
343 int xen_drm_front_page_flip(struct xen_drm_front_info *front_info, in xen_drm_front_page_flip() argument
351 if (unlikely(conn_idx >= front_info->num_evt_pairs)) in xen_drm_front_page_flip()
354 evtchnl = &front_info->evt_pairs[conn_idx].req; in xen_drm_front_page_flip()
358 spin_lock_irqsave(&front_info->io_lock, flags); in xen_drm_front_page_flip()
363 spin_unlock_irqrestore(&front_info->io_lock, flags); in xen_drm_front_page_flip()
372 void xen_drm_front_on_frame_done(struct xen_drm_front_info *front_info, in xen_drm_front_on_frame_done() argument
375 struct xen_drm_front_drm_info *drm_info = front_info->drm_info; in xen_drm_front_on_frame_done()
377 if (unlikely(conn_idx >= front_info->cfg.num_connectors)) in xen_drm_front_on_frame_done()
390 xen_drm_front_dbuf_destroy(drm_info->front_info, in xen_drm_front_gem_object_free()
394 dbuf_free(&drm_info->front_info->dbuf_list, in xen_drm_front_gem_object_free()
427 ret = xen_drm_front_dbuf_create(drm_info->front_info, in xen_drm_drv_dumb_create()
445 xen_drm_front_dbuf_destroy(drm_info->front_info, in xen_drm_drv_dumb_create()
458 struct xen_drm_front_info *front_info = drm_info->front_info; in xen_drm_drv_release() local
465 if (front_info->cfg.be_alloc) in xen_drm_drv_release()
466 xenbus_switch_state(front_info->xb_dev, in xen_drm_drv_release()
491 static int xen_drm_drv_init(struct xen_drm_front_info *front_info) in xen_drm_drv_init() argument
493 struct device *dev = &front_info->xb_dev->dev; in xen_drm_drv_init()
509 drm_info->front_info = front_info; in xen_drm_drv_init()
510 front_info->drm_info = drm_info; in xen_drm_drv_init()
547 front_info->drm_info = NULL; in xen_drm_drv_init()
552 static void xen_drm_drv_fini(struct xen_drm_front_info *front_info) in xen_drm_drv_fini() argument
554 struct xen_drm_front_drm_info *drm_info = front_info->drm_info; in xen_drm_drv_fini()
572 front_info->drm_info = NULL; in xen_drm_drv_fini()
574 xen_drm_front_evtchnl_free_all(front_info); in xen_drm_drv_fini()
575 dbuf_free_all(&front_info->dbuf_list); in xen_drm_drv_fini()
582 if (!front_info->cfg.be_alloc) in xen_drm_drv_fini()
583 xenbus_switch_state(front_info->xb_dev, in xen_drm_drv_fini()
587 static int displback_initwait(struct xen_drm_front_info *front_info) in displback_initwait() argument
589 struct xen_drm_front_cfg *cfg = &front_info->cfg; in displback_initwait()
592 cfg->front_info = front_info; in displback_initwait()
593 ret = xen_drm_front_cfg_card(front_info, cfg); in displback_initwait()
599 ret = xen_drm_front_evtchnl_create_all(front_info); in displback_initwait()
603 return xen_drm_front_evtchnl_publish_all(front_info); in displback_initwait()
606 static int displback_connect(struct xen_drm_front_info *front_info) in displback_connect() argument
608 xen_drm_front_evtchnl_set_state(front_info, EVTCHNL_STATE_CONNECTED); in displback_connect()
609 return xen_drm_drv_init(front_info); in displback_connect()
612 static void displback_disconnect(struct xen_drm_front_info *front_info) in displback_disconnect() argument
614 if (!front_info->drm_info) in displback_disconnect()
618 xenbus_switch_state(front_info->xb_dev, XenbusStateReconfiguring); in displback_disconnect()
620 xen_drm_drv_fini(front_info); in displback_disconnect()
626 struct xen_drm_front_info *front_info = dev_get_drvdata(&xb_dev->dev); in displback_changed() local
644 displback_disconnect(front_info); in displback_changed()
652 displback_disconnect(front_info); in displback_changed()
656 ret = displback_initwait(front_info); in displback_changed()
667 ret = displback_connect(front_info); in displback_changed()
669 displback_disconnect(front_info); in displback_changed()
689 displback_disconnect(front_info); in displback_changed()
697 struct xen_drm_front_info *front_info; in xen_drv_probe() local
707 front_info = devm_kzalloc(&xb_dev->dev, in xen_drv_probe()
708 sizeof(*front_info), GFP_KERNEL); in xen_drv_probe()
709 if (!front_info) in xen_drv_probe()
712 front_info->xb_dev = xb_dev; in xen_drv_probe()
713 spin_lock_init(&front_info->io_lock); in xen_drv_probe()
714 INIT_LIST_HEAD(&front_info->dbuf_list); in xen_drv_probe()
715 dev_set_drvdata(&xb_dev->dev, front_info); in xen_drv_probe()
722 struct xen_drm_front_info *front_info = dev_get_drvdata(&dev->dev); in xen_drv_remove() local
738 while ((xenbus_read_unsigned(front_info->xb_dev->otherend, "state", in xen_drv_remove()
746 state = xenbus_read_unsigned(front_info->xb_dev->otherend, in xen_drv_remove()
752 xen_drm_drv_fini(front_info); in xen_drv_remove()