Lines Matching full:drm
40 #include <drm/drm_crtc.h>
41 #include <drm/drm_crtc_helper.h>
42 #include <drm/drm_probe_helper.h>
43 #include <drm/drm_fb_helper.h>
44 #include <drm/drm_fourcc.h>
45 #include <drm/drm_atomic.h>
68 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_fillrect() local
69 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_fillrect()
77 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_fillrect()
85 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_fillrect()
100 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_copyarea() local
101 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_copyarea()
109 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_copyarea()
117 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_copyarea()
132 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_imageblit() local
133 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_imageblit()
141 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_imageblit()
149 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_imageblit()
164 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_sync() local
165 struct nouveau_channel *chan = drm->channel; in nouveau_fbcon_sync()
173 if (!mutex_trylock(&drm->client.mutex)) in nouveau_fbcon_sync()
177 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_sync()
191 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_open() local
192 int ret = pm_runtime_get_sync(drm->dev->dev); in nouveau_fbcon_open()
194 pm_runtime_put(drm->dev->dev); in nouveau_fbcon_open()
204 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_release() local
205 pm_runtime_put(drm->dev->dev); in nouveau_fbcon_release()
233 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_save_disable() local
234 if (drm->fbcon && drm->fbcon->helper.fbdev) { in nouveau_fbcon_accel_save_disable()
235 drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags; in nouveau_fbcon_accel_save_disable()
236 drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; in nouveau_fbcon_accel_save_disable()
243 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_restore() local
244 if (drm->fbcon && drm->fbcon->helper.fbdev) { in nouveau_fbcon_accel_restore()
245 drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags; in nouveau_fbcon_accel_restore()
252 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_fini() local
253 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_accel_fini()
254 if (fbcon && drm->channel) { in nouveau_fbcon_accel_fini()
259 nouveau_channel_idle(drm->channel); in nouveau_fbcon_accel_fini()
273 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_init() local
274 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_accel_init()
278 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) in nouveau_fbcon_accel_init()
281 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_FERMI) in nouveau_fbcon_accel_init()
296 /* Clear the entire fbcon. The drm will program every connector in nouveau_fbcon_zfill()
315 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_create() local
316 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_create()
333 ret = nouveau_gem_new(&drm->client, mode_cmd.pitches[0] * in nouveau_fbcon_create()
337 NV_ERROR(drm, "failed to allocate framebuffer\n"); in nouveau_fbcon_create()
347 NV_ERROR(drm, "failed to pin fb: %d\n", ret); in nouveau_fbcon_create()
353 NV_ERROR(drm, "failed to map fb: %d\n", ret); in nouveau_fbcon_create()
357 chan = nouveau_nofbaccel ? NULL : drm->channel; in nouveau_fbcon_create()
361 NV_ERROR(drm, "failed to map fb into chan: %d\n", ret); in nouveau_fbcon_create()
397 NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n", in nouveau_fbcon_create()
440 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_gpu_lockup() local
442 NV_ERROR(drm, "GPU lockup - switching to software fbcon\n"); in nouveau_fbcon_gpu_lockup()
453 struct nouveau_drm *drm = container_of(work, typeof(*drm), fbcon_work); in nouveau_fbcon_set_suspend_work() local
454 int state = READ_ONCE(drm->fbcon_new_state); in nouveau_fbcon_set_suspend_work()
457 pm_runtime_get_sync(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
461 nouveau_fbcon_accel_restore(drm->dev); in nouveau_fbcon_set_suspend_work()
462 drm_fb_helper_set_suspend(&drm->fbcon->helper, state); in nouveau_fbcon_set_suspend_work()
464 nouveau_fbcon_accel_save_disable(drm->dev); in nouveau_fbcon_set_suspend_work()
468 nouveau_fbcon_hotplug_resume(drm->fbcon); in nouveau_fbcon_set_suspend_work()
469 pm_runtime_mark_last_busy(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
470 pm_runtime_put_autosuspend(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
477 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_set_suspend() local
479 if (!drm->fbcon) in nouveau_fbcon_set_suspend()
482 drm->fbcon_new_state = state; in nouveau_fbcon_set_suspend()
487 schedule_work(&drm->fbcon_work); in nouveau_fbcon_set_suspend()
493 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_output_poll_changed() local
494 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_output_poll_changed()
515 NV_DEBUG(drm, "fbcon HPD event deferred until runtime resume\n"); in nouveau_fbcon_output_poll_changed()
517 pm_runtime_put_noidle(drm->dev->dev); in nouveau_fbcon_output_poll_changed()
529 struct nouveau_drm *drm; in nouveau_fbcon_hotplug_resume() local
533 drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_hotplug_resume()
539 NV_DEBUG(drm, "Handling deferred fbcon HPD events\n"); in nouveau_fbcon_hotplug_resume()
548 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_init() local
561 drm->fbcon = fbcon; in nouveau_fbcon_init()
562 INIT_WORK(&drm->fbcon_work, nouveau_fbcon_set_suspend_work); in nouveau_fbcon_init()
572 if (drm->client.device.info.ram_size <= 32 * 1024 * 1024) in nouveau_fbcon_init()
575 if (drm->client.device.info.ram_size <= 64 * 1024 * 1024) in nouveau_fbcon_init()
597 drm->fbcon = NULL; in nouveau_fbcon_init()
604 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_fini() local
606 if (!drm->fbcon) in nouveau_fbcon_fini()
611 nouveau_fbcon_destroy(dev, drm->fbcon); in nouveau_fbcon_fini()
612 kfree(drm->fbcon); in nouveau_fbcon_fini()
613 drm->fbcon = NULL; in nouveau_fbcon_fini()