Lines Matching refs: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);
68 struct nvif_device *device = &drm->client.device;
76 mutex_trylock(&drm->client.mutex)) {
84 mutex_unlock(&drm->client.mutex);
99 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
100 struct nvif_device *device = &drm->client.device;
108 mutex_trylock(&drm->client.mutex)) {
116 mutex_unlock(&drm->client.mutex);
131 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
132 struct nvif_device *device = &drm->client.device;
140 mutex_trylock(&drm->client.mutex)) {
148 mutex_unlock(&drm->client.mutex);
163 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
164 struct nouveau_channel *chan = drm->channel;
172 if (!mutex_trylock(&drm->client.mutex))
176 mutex_unlock(&drm->client.mutex);
190 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
191 int ret = pm_runtime_get_sync(drm->dev->dev);
193 pm_runtime_put(drm->dev->dev);
203 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
204 pm_runtime_put(drm->dev->dev);
232 struct nouveau_drm *drm = nouveau_drm(dev);
233 if (drm->fbcon && drm->fbcon->helper.fbdev) {
234 drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags;
235 drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
242 struct nouveau_drm *drm = nouveau_drm(dev);
243 if (drm->fbcon && drm->fbcon->helper.fbdev) {
244 drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags;
251 struct nouveau_drm *drm = nouveau_drm(dev);
252 struct nouveau_fbdev *fbcon = drm->fbcon;
253 if (fbcon && drm->channel) {
258 nouveau_channel_idle(drm->channel);
272 struct nouveau_drm *drm = nouveau_drm(dev);
273 struct nouveau_fbdev *fbcon = drm->fbcon;
277 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA)
280 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_FERMI)
295 /* Clear the entire fbcon. The drm will program every connector
314 struct nouveau_drm *drm = nouveau_drm(dev);
315 struct nvif_device *device = &drm->client.device;
332 ret = nouveau_gem_new(&drm->client, mode_cmd.pitches[0] *
336 NV_ERROR(drm, "failed to allocate framebuffer\n");
346 NV_ERROR(drm, "failed to pin fb: %d\n", ret);
352 NV_ERROR(drm, "failed to map fb: %d\n", ret);
356 chan = nouveau_nofbaccel ? NULL : drm->channel;
360 NV_ERROR(drm, "failed to map fb into chan: %d\n", ret);
396 NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n",
437 struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
439 NV_ERROR(drm, "GPU lockup - switching to software fbcon\n");
450 struct nouveau_drm *drm = container_of(work, typeof(*drm), fbcon_work);
451 int state = READ_ONCE(drm->fbcon_new_state);
454 pm_runtime_get_sync(drm->dev->dev);
458 nouveau_fbcon_accel_restore(drm->dev);
459 drm_fb_helper_set_suspend(&drm->fbcon->helper, state);
461 nouveau_fbcon_accel_save_disable(drm->dev);
465 nouveau_fbcon_hotplug_resume(drm->fbcon);
466 pm_runtime_mark_last_busy(drm->dev->dev);
467 pm_runtime_put_autosuspend(drm->dev->dev);
474 struct nouveau_drm *drm = nouveau_drm(dev);
476 if (!drm->fbcon)
479 drm->fbcon_new_state = state;
484 schedule_work(&drm->fbcon_work);
490 struct nouveau_drm *drm = nouveau_drm(dev);
491 struct nouveau_fbdev *fbcon = drm->fbcon;
512 NV_DEBUG(drm, "fbcon HPD event deferred until runtime resume\n");
514 pm_runtime_put_noidle(drm->dev->dev);
526 struct nouveau_drm *drm;
530 drm = nouveau_drm(fbcon->helper.dev);
536 NV_DEBUG(drm, "Handling deferred fbcon HPD events\n");
545 struct nouveau_drm *drm = nouveau_drm(dev);
558 drm->fbcon = fbcon;
559 INIT_WORK(&drm->fbcon_work, nouveau_fbcon_set_suspend_work);
569 if (drm->client.device.info.ram_size <= 32 * 1024 * 1024)
572 if (drm->client.device.info.ram_size <= 64 * 1024 * 1024)
594 drm->fbcon = NULL;
601 struct nouveau_drm *drm = nouveau_drm(dev);
603 if (!drm->fbcon)
607 nouveau_fbcon_destroy(dev, drm->fbcon);
608 kfree(drm->fbcon);
609 drm->fbcon = NULL;