50 drm_gem_object_unreference_unlocked(fb->
nvbo->gem);
58 struct drm_file *file_priv,
67 .destroy = nouveau_user_framebuffer_destroy,
68 .create_handle = nouveau_user_framebuffer_create_handle,
89 if (nv_device(drm->
device)->card_type >= NV_50) {
91 if (tile_flags == 0x7a00 ||
95 if (tile_flags == 0x7000)
112 if (nv_device(drm->
device)->chipset == 0x50)
113 nv_fb->
r_format |= (tile_flags << 8);
116 if (nv_device(drm->
device)->card_type < NV_D0)
122 if (nv_device(drm->
device)->card_type >= NV_C0)
133 struct drm_file *file_priv,
137 struct drm_gem_object *
gem;
150 drm_gem_object_unreference(gem);
154 return &nouveau_fb->
base;
158 .fb_create = nouveau_user_framebuffer_create,
193 #define PROP_ENUM(p,gen,n,list) do { \
194 struct nouveau_drm_prop_enum_list *l = (list); \
196 while (l->gen_mask) { \
197 if (l->gen_mask & (1 << (gen))) \
202 p = drm_property_create(dev, DRM_MODE_PROP_ENUM, n, c); \
205 while (p && l->gen_mask) { \
206 if (l->gen_mask & (1 << (gen))) { \
207 drm_property_add_enum(p, c, l->type, l->name); \
224 ret = disp->
init(dev);
244 gpio->
irq(gpio, 0, conn->
hpd, 0xff,
true);
262 gpio->
irq(gpio, 0, conn->
hpd, 0xff,
false);
270 nouveau_display_vblank_notify(
void *
data,
int crtc)
276 nouveau_display_vblank_get(
void *
data,
int crtc)
282 nouveau_display_vblank_put(
void *
data,
int crtc)
293 u32 pclass = dev->pdev->class >> 8;
301 pdisp->
vblank.notify = nouveau_display_vblank_notify;
302 pdisp->
vblank.get = nouveau_display_vblank_get;
303 pdisp->
vblank.put = nouveau_display_vblank_put;
309 if (nv_device(drm->
device)->card_type < NV_50)
312 if (nv_device(drm->
device)->card_type < NV_D0)
336 "color vibrance", 2);
341 dev->mode_config.funcs = &nouveau_mode_config_funcs;
344 dev->mode_config.min_width = 0;
345 dev->mode_config.min_height = 0;
346 if (nv_device(drm->
device)->card_type < NV_10) {
347 dev->mode_config.max_width = 2048;
348 dev->mode_config.max_height = 2048;
350 if (nv_device(drm->
device)->card_type < NV_50) {
351 dev->mode_config.max_width = 4096;
352 dev->mode_config.max_height = 4096;
354 dev->mode_config.max_width = 8192;
355 dev->mode_config.max_height = 8192;
358 dev->mode_config.preferred_depth = 24;
359 dev->mode_config.prefer_shadow = 1;
366 if (nv_device(drm->
device)->card_type < NV_50)
369 if (nv_device(drm->
device)->card_type < NV_D0)
374 goto disp_create_err;
376 if (dev->mode_config.num_crtc) {
420 NV_INFO(drm,
"unpinning framebuffer(s)...\n");
425 if (!nouveau_fb || !nouveau_fb->
nvbo)
452 if (!nouveau_fb || !nouveau_fb->
nvbo)
465 NV_ERROR(drm,
"Could not pin/map cursor.\n");
477 nv_crtc->
lut.depth = 0;
486 nv_crtc->
cursor.set_offset(nv_crtc, offset);
498 nv_mask(device, 0x6100c0 + (crtc * 0x800), 1, 1);
516 nv_mask(device, 0x6100c0 + (crtc * 0x800), 1, 0);
526 nouveau_page_flip_reserve(
struct nouveau_bo *old_bo,
539 if (
likely(old_bo != new_bo)) {
555 nouveau_page_flip_unreserve(
struct nouveau_bo *old_bo,
562 if (
likely(old_bo != new_bo)) {
586 spin_unlock_irqrestore(&dev->event_lock, flags);
594 ret = RING_SPACE(chan, 3);
598 if (nv_device(drm->
device)->card_type < NV_C0) {
617 spin_unlock_irqrestore(&dev->event_lock, flags);
623 struct drm_pending_vblank_event *
event)
642 ret = nouveau_page_flip_reserve(old_bo, new_bo);
653 fence = new_bo->
bo.sync_obj;
661 if (nv_device(drm->
device)->card_type >= NV_50) {
662 if (nv_device(drm->
device)->card_type >= NV_D0)
672 ret = nouveau_page_flip_emit(chan, old_bo, new_bo, s, &fence);
680 nouveau_page_flip_unreserve(old_bo, new_bo, fence);
685 nouveau_page_flip_unreserve(old_bo, new_bo,
NULL);
703 if (list_empty(&fctx->
flip)) {
704 NV_ERROR(drm,
"unexpected pageflip\n");
705 spin_unlock_irqrestore(&dev->event_lock, flags);
711 struct drm_pending_vblank_event *
e = s->
event;
715 e->event.sequence = 0;
716 e->event.tv_sec = now.
tv_sec;
717 e->event.tv_usec = now.
tv_usec;
718 list_add_tail(&e->base.link, &e->base.file_priv->event_list);
727 spin_unlock_irqrestore(&dev->event_lock, flags);
739 if (nv_device(drm->
device)->card_type < NV_50) {
742 state.
x * state.
bpp / 8);
765 drm_gem_object_unreference_unlocked(bo->
gem);
781 struct drm_gem_object *gem;
786 *poffset = bo->
bo.addr_space_offset;
787 drm_gem_object_unreference_unlocked(gem);