Lines Matching full:drm

40 #include <drm/drm_crtc.h>
41 #include <drm/drm_crtc_helper.h>
42 #include <drm/drm_fb_helper.h>
43 #include <drm/drm_fourcc.h>
44 #include <drm/drm_atomic.h>
67 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_fillrect() local
68 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_fillrect()
76 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_fillrect()
84 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_fillrect()
99 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_copyarea() local
100 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_copyarea()
108 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_copyarea()
116 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_copyarea()
131 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_imageblit() local
132 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_imageblit()
140 mutex_trylock(&drm->client.mutex)) { in nouveau_fbcon_imageblit()
148 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_imageblit()
163 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_sync() local
164 struct nouveau_channel *chan = drm->channel; in nouveau_fbcon_sync()
172 if (!mutex_trylock(&drm->client.mutex)) in nouveau_fbcon_sync()
176 mutex_unlock(&drm->client.mutex); in nouveau_fbcon_sync()
190 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_open() local
191 int ret = pm_runtime_get_sync(drm->dev->dev); in nouveau_fbcon_open()
193 pm_runtime_put(drm->dev->dev); in nouveau_fbcon_open()
203 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_release() local
204 pm_runtime_put(drm->dev->dev); in nouveau_fbcon_release()
232 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_save_disable() local
233 if (drm->fbcon && drm->fbcon->helper.fbdev) { in nouveau_fbcon_accel_save_disable()
234 drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags; in nouveau_fbcon_accel_save_disable()
235 drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; in nouveau_fbcon_accel_save_disable()
242 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_restore() local
243 if (drm->fbcon && drm->fbcon->helper.fbdev) { in nouveau_fbcon_accel_restore()
244 drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags; in nouveau_fbcon_accel_restore()
251 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_fini() local
252 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_accel_fini()
253 if (fbcon && drm->channel) { in nouveau_fbcon_accel_fini()
258 nouveau_channel_idle(drm->channel); in nouveau_fbcon_accel_fini()
272 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_accel_init() local
273 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_accel_init()
277 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) in nouveau_fbcon_accel_init()
280 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_FERMI) in nouveau_fbcon_accel_init()
295 /* Clear the entire fbcon. The drm will program every connector in nouveau_fbcon_zfill()
314 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_create() local
315 struct nvif_device *device = &drm->client.device; in nouveau_fbcon_create()
332 ret = nouveau_gem_new(&drm->client, mode_cmd.pitches[0] * in nouveau_fbcon_create()
336 NV_ERROR(drm, "failed to allocate framebuffer\n"); in nouveau_fbcon_create()
346 NV_ERROR(drm, "failed to pin fb: %d\n", ret); in nouveau_fbcon_create()
352 NV_ERROR(drm, "failed to map fb: %d\n", ret); in nouveau_fbcon_create()
356 chan = nouveau_nofbaccel ? NULL : drm->channel; in nouveau_fbcon_create()
360 NV_ERROR(drm, "failed to map fb into chan: %d\n", ret); in nouveau_fbcon_create()
396 NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n", in nouveau_fbcon_create()
439 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_gpu_lockup() local
441 NV_ERROR(drm, "GPU lockup - switching to software fbcon\n"); in nouveau_fbcon_gpu_lockup()
452 struct nouveau_drm *drm = container_of(work, typeof(*drm), fbcon_work); in nouveau_fbcon_set_suspend_work() local
453 int state = READ_ONCE(drm->fbcon_new_state); in nouveau_fbcon_set_suspend_work()
456 pm_runtime_get_sync(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
460 nouveau_fbcon_accel_restore(drm->dev); in nouveau_fbcon_set_suspend_work()
461 drm_fb_helper_set_suspend(&drm->fbcon->helper, state); in nouveau_fbcon_set_suspend_work()
463 nouveau_fbcon_accel_save_disable(drm->dev); in nouveau_fbcon_set_suspend_work()
467 nouveau_fbcon_hotplug_resume(drm->fbcon); in nouveau_fbcon_set_suspend_work()
468 pm_runtime_mark_last_busy(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
469 pm_runtime_put_sync(drm->dev->dev); in nouveau_fbcon_set_suspend_work()
476 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_set_suspend() local
478 if (!drm->fbcon) in nouveau_fbcon_set_suspend()
481 drm->fbcon_new_state = state; in nouveau_fbcon_set_suspend()
486 schedule_work(&drm->fbcon_work); in nouveau_fbcon_set_suspend()
492 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_output_poll_changed() local
493 struct nouveau_fbdev *fbcon = drm->fbcon; in nouveau_fbcon_output_poll_changed()
514 NV_DEBUG(drm, "fbcon HPD event deferred until runtime resume\n"); in nouveau_fbcon_output_poll_changed()
516 pm_runtime_put_noidle(drm->dev->dev); in nouveau_fbcon_output_poll_changed()
528 struct nouveau_drm *drm; in nouveau_fbcon_hotplug_resume() local
532 drm = nouveau_drm(fbcon->helper.dev); in nouveau_fbcon_hotplug_resume()
538 NV_DEBUG(drm, "Handling deferred fbcon HPD events\n"); in nouveau_fbcon_hotplug_resume()
547 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_init() local
560 drm->fbcon = fbcon; in nouveau_fbcon_init()
561 INIT_WORK(&drm->fbcon_work, nouveau_fbcon_set_suspend_work); in nouveau_fbcon_init()
571 if (drm->client.device.info.ram_size <= 32 * 1024 * 1024) in nouveau_fbcon_init()
574 if (drm->client.device.info.ram_size <= 64 * 1024 * 1024) in nouveau_fbcon_init()
596 drm->fbcon = NULL; in nouveau_fbcon_init()
603 struct nouveau_drm *drm = nouveau_drm(dev); in nouveau_fbcon_fini() local
605 if (!drm->fbcon) in nouveau_fbcon_fini()
609 nouveau_fbcon_destroy(dev, drm->fbcon); in nouveau_fbcon_fini()
610 kfree(drm->fbcon); in nouveau_fbcon_fini()
611 drm->fbcon = NULL; in nouveau_fbcon_fini()