Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau: rename nvd0_display to nv50_display to reflect reality since merge

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+268 -279
+1 -1
drivers/gpu/drm/nouveau/Makefile
··· 201 201 nouveau-y += nv04_crtc.o nv04_display.o nv04_cursor.o 202 202 203 203 # drm/kms/nv50- 204 - nouveau-y += nvd0_display.o 204 + nouveau-y += nv50_display.o 205 205 206 206 # drm/pm 207 207 nouveau-y += nouveau_pm.o nouveau_volt.o nouveau_perf.o
-7
drivers/gpu/drm/nouveau/nouveau_crtc.h
··· 82 82 return &crtc->base; 83 83 } 84 84 85 - int nv50_crtc_create(struct drm_device *dev, int index); 86 - int nv50_crtc_cursor_set(struct drm_crtc *drm_crtc, struct drm_file *file_priv, 87 - uint32_t buffer_handle, uint32_t width, 88 - uint32_t height); 89 - int nv50_crtc_cursor_move(struct drm_crtc *drm_crtc, int x, int y); 90 - 91 85 int nv04_cursor_init(struct nouveau_crtc *); 92 - int nv50_cursor_init(struct nouveau_crtc *); 93 86 94 87 #endif /* __NOUVEAU_CRTC_H__ */
+2 -2
drivers/gpu/drm/nouveau/nouveau_display.c
··· 366 366 if (nv_device(drm->device)->card_type < NV_50) 367 367 ret = nv04_display_create(dev); 368 368 else 369 - ret = nvd0_display_create(dev); 369 + ret = nv50_display_create(dev); 370 370 if (ret) 371 371 goto disp_create_err; 372 372 ··· 657 657 658 658 /* Emit a page flip */ 659 659 if (nv_device(drm->device)->card_type >= NV_50) { 660 - ret = nvd0_display_flip_next(crtc, fb, chan, 0); 660 + ret = nv50_display_flip_next(crtc, fb, chan, 0); 661 661 if (ret) { 662 662 mutex_unlock(&chan->cli->mutex); 663 663 goto fail_unreserve;
-4
drivers/gpu/drm/nouveau/nouveau_encoder.h
··· 97 97 98 98 struct nouveau_connector * 99 99 nouveau_encoder_connector_get(struct nouveau_encoder *encoder); 100 - int nv50_sor_create(struct drm_connector *, struct dcb_output *); 101 - void nv50_sor_dp_calc_tu(struct drm_device *, int, int, u32, u32); 102 - int nv50_dac_create(struct drm_connector *, struct dcb_output *); 103 - 104 100 105 101 #endif /* __NOUVEAU_ENCODER_H__ */
+7 -7
drivers/gpu/drm/nouveau/nv50_display.h
··· 31 31 #include "nouveau_crtc.h" 32 32 #include "nouveau_reg.h" 33 33 34 - int nvd0_display_create(struct drm_device *); 35 - void nvd0_display_destroy(struct drm_device *); 36 - int nvd0_display_init(struct drm_device *); 37 - void nvd0_display_fini(struct drm_device *); 34 + int nv50_display_create(struct drm_device *); 35 + void nv50_display_destroy(struct drm_device *); 36 + int nv50_display_init(struct drm_device *); 37 + void nv50_display_fini(struct drm_device *); 38 38 39 - void nvd0_display_flip_stop(struct drm_crtc *); 40 - int nvd0_display_flip_next(struct drm_crtc *, struct drm_framebuffer *, 39 + void nv50_display_flip_stop(struct drm_crtc *); 40 + int nv50_display_flip_next(struct drm_crtc *, struct drm_framebuffer *, 41 41 struct nouveau_channel *, u32 swap_interval); 42 42 43 - struct nouveau_bo *nvd0_display_crtc_sema(struct drm_device *, int head); 43 + struct nouveau_bo *nv50_display_crtc_sema(struct drm_device *, int head); 44 44 45 45 #endif /* __NV50_DISPLAY_H__ */
+1 -1
drivers/gpu/drm/nouveau/nv50_fence.c
··· 70 70 71 71 /* dma objects for display sync channel semaphore blocks */ 72 72 for (i = 0; !ret && i < dev->mode_config.num_crtc; i++) { 73 - struct nouveau_bo *bo = nvd0_display_crtc_sema(dev, i); 73 + struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i); 74 74 75 75 ret = nouveau_object_new(nv_object(chan->cli), chan->handle, 76 76 NvEvoSema0 + i, 0x003d,
+1 -1
drivers/gpu/drm/nouveau/nv84_fence.c
··· 127 127 128 128 /* dma objects for display sync channel semaphore blocks */ 129 129 for (i = 0; !ret && i < dev->mode_config.num_crtc; i++) { 130 - struct nouveau_bo *bo = nvd0_display_crtc_sema(dev, i); 130 + struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i); 131 131 132 132 ret = nouveau_object_new(nv_object(chan->cli), chan->handle, 133 133 NvEvoSema0 + i, 0x003d,
+2 -2
drivers/gpu/drm/nouveau/nvc0_fence.c
··· 115 115 int i; 116 116 117 117 for (i = 0; i < dev->mode_config.num_crtc; i++) { 118 - struct nouveau_bo *bo = nvd0_display_crtc_sema(dev, i); 118 + struct nouveau_bo *bo = nv50_display_crtc_sema(dev, i); 119 119 nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]); 120 120 } 121 121 ··· 146 146 147 147 /* map display semaphore buffers into channel's vm */ 148 148 for (i = 0; !ret && i < chan->drm->dev->mode_config.num_crtc; i++) { 149 - struct nouveau_bo *bo = nvd0_display_crtc_sema(chan->drm->dev, i); 149 + struct nouveau_bo *bo = nv50_display_crtc_sema(chan->drm->dev, i); 150 150 ret = nouveau_bo_vma_add(bo, client->vm, &fctx->dispc_vma[i]); 151 151 } 152 152
+254 -254
drivers/gpu/drm/nouveau/nvd0_display.c drivers/gpu/drm/nouveau/nv50_display.c
··· 1 - /* 1 + /* 2 2 * Copyright 2011 Red Hat Inc. 3 3 * 4 4 * Permission is hereby granted, free of charge, to any person obtaining a ··· 68 68 * EVO channel 69 69 *****************************************************************************/ 70 70 71 - struct nvd0_chan { 71 + struct nv50_chan { 72 72 struct nouveau_object *user; 73 73 u32 handle; 74 74 }; 75 75 76 76 static int 77 - nvd0_chan_create(struct nouveau_object *core, u32 bclass, u8 head, 78 - void *data, u32 size, struct nvd0_chan *chan) 77 + nv50_chan_create(struct nouveau_object *core, u32 bclass, u8 head, 78 + void *data, u32 size, struct nv50_chan *chan) 79 79 { 80 80 struct nouveau_object *client = nv_pclass(core, NV_CLIENT_CLASS); 81 81 const u32 oclass = EVO_CHAN_OCLASS(bclass, core); ··· 92 92 } 93 93 94 94 static void 95 - nvd0_chan_destroy(struct nouveau_object *core, struct nvd0_chan *chan) 95 + nv50_chan_destroy(struct nouveau_object *core, struct nv50_chan *chan) 96 96 { 97 97 struct nouveau_object *client = nv_pclass(core, NV_CLIENT_CLASS); 98 98 if (chan->handle) ··· 103 103 * PIO EVO channel 104 104 *****************************************************************************/ 105 105 106 - struct nvd0_pioc { 107 - struct nvd0_chan base; 106 + struct nv50_pioc { 107 + struct nv50_chan base; 108 108 }; 109 109 110 110 static void 111 - nvd0_pioc_destroy(struct nouveau_object *core, struct nvd0_pioc *pioc) 111 + nv50_pioc_destroy(struct nouveau_object *core, struct nv50_pioc *pioc) 112 112 { 113 - nvd0_chan_destroy(core, &pioc->base); 113 + nv50_chan_destroy(core, &pioc->base); 114 114 } 115 115 116 116 static int 117 - nvd0_pioc_create(struct nouveau_object *core, u32 bclass, u8 head, 118 - void *data, u32 size, struct nvd0_pioc *pioc) 117 + nv50_pioc_create(struct nouveau_object *core, u32 bclass, u8 head, 118 + void *data, u32 size, struct nv50_pioc *pioc) 119 119 { 120 - return nvd0_chan_create(core, bclass, head, data, size, &pioc->base); 120 + return nv50_chan_create(core, bclass, head, data, size, &pioc->base); 121 121 } 122 122 123 123 /****************************************************************************** 124 124 * DMA EVO channel 125 125 *****************************************************************************/ 126 126 127 - struct nvd0_dmac { 128 - struct nvd0_chan base; 127 + struct nv50_dmac { 128 + struct nv50_chan base; 129 129 dma_addr_t handle; 130 130 u32 *ptr; 131 131 }; 132 132 133 133 static void 134 - nvd0_dmac_destroy(struct nouveau_object *core, struct nvd0_dmac *dmac) 134 + nv50_dmac_destroy(struct nouveau_object *core, struct nv50_dmac *dmac) 135 135 { 136 136 if (dmac->ptr) { 137 137 struct pci_dev *pdev = nv_device(core)->pdev; 138 138 pci_free_consistent(pdev, PAGE_SIZE, dmac->ptr, dmac->handle); 139 139 } 140 140 141 - nvd0_chan_destroy(core, &dmac->base); 141 + nv50_chan_destroy(core, &dmac->base); 142 142 } 143 143 144 144 static int ··· 261 261 } 262 262 263 263 static int 264 - nvd0_dmac_create(struct nouveau_object *core, u32 bclass, u8 head, 264 + nv50_dmac_create(struct nouveau_object *core, u32 bclass, u8 head, 265 265 void *data, u32 size, u64 syncbuf, 266 - struct nvd0_dmac *dmac) 266 + struct nv50_dmac *dmac) 267 267 { 268 268 struct nouveau_fb *pfb = nouveau_fb(core); 269 269 struct nouveau_object *client = nv_pclass(core, NV_CLIENT_CLASS); ··· 287 287 if (ret) 288 288 return ret; 289 289 290 - ret = nvd0_chan_create(core, bclass, head, data, size, &dmac->base); 290 + ret = nv50_chan_create(core, bclass, head, data, size, &dmac->base); 291 291 if (ret) 292 292 return ret; 293 293 ··· 323 323 return ret; 324 324 } 325 325 326 - struct nvd0_mast { 327 - struct nvd0_dmac base; 326 + struct nv50_mast { 327 + struct nv50_dmac base; 328 328 }; 329 329 330 - struct nvd0_curs { 331 - struct nvd0_pioc base; 330 + struct nv50_curs { 331 + struct nv50_pioc base; 332 332 }; 333 333 334 - struct nvd0_sync { 335 - struct nvd0_dmac base; 334 + struct nv50_sync { 335 + struct nv50_dmac base; 336 336 struct { 337 337 u32 offset; 338 338 u16 value; 339 339 } sem; 340 340 }; 341 341 342 - struct nvd0_ovly { 343 - struct nvd0_dmac base; 342 + struct nv50_ovly { 343 + struct nv50_dmac base; 344 344 }; 345 345 346 - struct nvd0_oimm { 347 - struct nvd0_pioc base; 346 + struct nv50_oimm { 347 + struct nv50_pioc base; 348 348 }; 349 349 350 - struct nvd0_head { 350 + struct nv50_head { 351 351 struct nouveau_crtc base; 352 - struct nvd0_curs curs; 353 - struct nvd0_sync sync; 354 - struct nvd0_ovly ovly; 355 - struct nvd0_oimm oimm; 352 + struct nv50_curs curs; 353 + struct nv50_sync sync; 354 + struct nv50_ovly ovly; 355 + struct nv50_oimm oimm; 356 356 }; 357 357 358 - #define nvd0_head(c) ((struct nvd0_head *)nouveau_crtc(c)) 359 - #define nvd0_curs(c) (&nvd0_head(c)->curs) 360 - #define nvd0_sync(c) (&nvd0_head(c)->sync) 361 - #define nvd0_ovly(c) (&nvd0_head(c)->ovly) 362 - #define nvd0_oimm(c) (&nvd0_head(c)->oimm) 363 - #define nvd0_chan(c) (&(c)->base.base) 364 - #define nvd0_vers(c) nv_mclass(nvd0_chan(c)->user) 358 + #define nv50_head(c) ((struct nv50_head *)nouveau_crtc(c)) 359 + #define nv50_curs(c) (&nv50_head(c)->curs) 360 + #define nv50_sync(c) (&nv50_head(c)->sync) 361 + #define nv50_ovly(c) (&nv50_head(c)->ovly) 362 + #define nv50_oimm(c) (&nv50_head(c)->oimm) 363 + #define nv50_chan(c) (&(c)->base.base) 364 + #define nv50_vers(c) nv_mclass(nv50_chan(c)->user) 365 365 366 - struct nvd0_disp { 366 + struct nv50_disp { 367 367 struct nouveau_object *core; 368 - struct nvd0_mast mast; 368 + struct nv50_mast mast; 369 369 370 370 u32 modeset; 371 371 372 372 struct nouveau_bo *sync; 373 373 }; 374 374 375 - static struct nvd0_disp * 376 - nvd0_disp(struct drm_device *dev) 375 + static struct nv50_disp * 376 + nv50_disp(struct drm_device *dev) 377 377 { 378 378 return nouveau_display(dev)->priv; 379 379 } 380 380 381 - #define nvd0_mast(d) (&nvd0_disp(d)->mast) 381 + #define nv50_mast(d) (&nv50_disp(d)->mast) 382 382 383 383 static struct drm_crtc * 384 - nvd0_display_crtc_get(struct drm_encoder *encoder) 384 + nv50_display_crtc_get(struct drm_encoder *encoder) 385 385 { 386 386 return nouveau_encoder(encoder)->crtc; 387 387 } ··· 392 392 static u32 * 393 393 evo_wait(void *evoc, int nr) 394 394 { 395 - struct nvd0_dmac *dmac = evoc; 395 + struct nv50_dmac *dmac = evoc; 396 396 u32 put = nv_ro32(dmac->base.user, 0x0000) / 4; 397 397 398 398 if (put + nr >= (PAGE_SIZE / 4) - 8) { ··· 413 413 static void 414 414 evo_kick(u32 *push, void *evoc) 415 415 { 416 - struct nvd0_dmac *dmac = evoc; 416 + struct nv50_dmac *dmac = evoc; 417 417 nv_wo32(dmac->base.user, 0x0000, (push - dmac->ptr) << 2); 418 418 } 419 419 ··· 430 430 evo_sync(struct drm_device *dev) 431 431 { 432 432 struct nouveau_device *device = nouveau_dev(dev); 433 - struct nvd0_disp *disp = nvd0_disp(dev); 434 - struct nvd0_mast *mast = nvd0_mast(dev); 433 + struct nv50_disp *disp = nv50_disp(dev); 434 + struct nv50_mast *mast = nv50_mast(dev); 435 435 u32 *push = evo_wait(mast, 8); 436 436 if (push) { 437 437 nouveau_bo_wr32(disp->sync, EVO_MAST_NTFY, 0x00000000); ··· 452 452 * Page flipping channel 453 453 *****************************************************************************/ 454 454 struct nouveau_bo * 455 - nvd0_display_crtc_sema(struct drm_device *dev, int crtc) 455 + nv50_display_crtc_sema(struct drm_device *dev, int crtc) 456 456 { 457 - return nvd0_disp(dev)->sync; 457 + return nv50_disp(dev)->sync; 458 458 } 459 459 460 460 void 461 - nvd0_display_flip_stop(struct drm_crtc *crtc) 461 + nv50_display_flip_stop(struct drm_crtc *crtc) 462 462 { 463 - struct nvd0_sync *sync = nvd0_sync(crtc); 463 + struct nv50_sync *sync = nv50_sync(crtc); 464 464 u32 *push; 465 465 466 466 push = evo_wait(sync, 8); ··· 478 478 } 479 479 480 480 int 481 - nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, 481 + nv50_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, 482 482 struct nouveau_channel *chan, u32 swap_interval) 483 483 { 484 484 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); 485 - struct nvd0_disp *disp = nvd0_disp(crtc->dev); 485 + struct nv50_disp *disp = nv50_disp(crtc->dev); 486 486 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 487 - struct nvd0_sync *sync = nvd0_sync(crtc); 487 + struct nv50_sync *sync = nv50_sync(crtc); 488 488 u32 *push; 489 489 int ret; 490 490 ··· 561 561 evo_mthd(push, 0x0110, 2); 562 562 evo_data(push, 0x00000000); 563 563 evo_data(push, 0x00000000); 564 - if (nvd0_vers(sync) < NVD0_DISP_SYNC_CLASS) { 564 + if (nv50_vers(sync) < NVD0_DISP_SYNC_CLASS) { 565 565 evo_mthd(push, 0x0800, 5); 566 566 evo_data(push, nv_fb->nvbo->bo.offset >> 8); 567 567 evo_data(push, 0); ··· 589 589 * CRTC 590 590 *****************************************************************************/ 591 591 static int 592 - nvd0_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update) 592 + nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update) 593 593 { 594 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 594 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 595 595 struct nouveau_connector *nv_connector; 596 596 struct drm_connector *connector; 597 597 u32 *push, mode = 0x00; ··· 614 614 615 615 push = evo_wait(mast, 4); 616 616 if (push) { 617 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 617 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 618 618 evo_mthd(push, 0x08a0 + (nv_crtc->index * 0x0400), 1); 619 619 evo_data(push, mode); 620 620 } else 621 - if (nvd0_vers(mast) < NVE0_DISP_MAST_CLASS) { 621 + if (nv50_vers(mast) < NVE0_DISP_MAST_CLASS) { 622 622 evo_mthd(push, 0x0490 + (nv_crtc->index * 0x0300), 1); 623 623 evo_data(push, mode); 624 624 } else { ··· 637 637 } 638 638 639 639 static int 640 - nvd0_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update) 640 + nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update) 641 641 { 642 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 642 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 643 643 struct drm_display_mode *omode, *umode = &nv_crtc->base.mode; 644 644 struct drm_crtc *crtc = &nv_crtc->base; 645 645 struct nouveau_connector *nv_connector; ··· 709 709 710 710 push = evo_wait(mast, 8); 711 711 if (push) { 712 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 712 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 713 713 /*XXX: SCALE_CTRL_ACTIVE??? */ 714 714 evo_mthd(push, 0x08d8 + (nv_crtc->index * 0x400), 2); 715 715 evo_data(push, (oY << 16) | oX); ··· 732 732 evo_kick(push, mast); 733 733 734 734 if (update) { 735 - nvd0_display_flip_stop(crtc); 736 - nvd0_display_flip_next(crtc, crtc->fb, NULL, 1); 735 + nv50_display_flip_stop(crtc); 736 + nv50_display_flip_next(crtc, crtc->fb, NULL, 1); 737 737 } 738 738 } 739 739 ··· 741 741 } 742 742 743 743 static int 744 - nvd0_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) 744 + nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) 745 745 { 746 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 746 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 747 747 u32 *push, hue, vib; 748 748 int adj; 749 749 ··· 753 753 754 754 push = evo_wait(mast, 16); 755 755 if (push) { 756 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 756 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 757 757 evo_mthd(push, 0x08a8 + (nv_crtc->index * 0x400), 1); 758 758 evo_data(push, (hue << 20) | (vib << 8)); 759 759 } else { ··· 772 772 } 773 773 774 774 static int 775 - nvd0_crtc_set_image(struct nouveau_crtc *nv_crtc, struct drm_framebuffer *fb, 775 + nv50_crtc_set_image(struct nouveau_crtc *nv_crtc, struct drm_framebuffer *fb, 776 776 int x, int y, bool update) 777 777 { 778 778 struct nouveau_framebuffer *nvfb = nouveau_framebuffer(fb); 779 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 779 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 780 780 u32 *push; 781 781 782 782 push = evo_wait(mast, 16); 783 783 if (push) { 784 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 784 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 785 785 evo_mthd(push, 0x0860 + (nv_crtc->index * 0x400), 1); 786 786 evo_data(push, nvfb->nvbo->bo.offset >> 8); 787 787 evo_mthd(push, 0x0868 + (nv_crtc->index * 0x400), 3); ··· 790 790 evo_data(push, nvfb->r_format); 791 791 evo_mthd(push, 0x08c0 + (nv_crtc->index * 0x400), 1); 792 792 evo_data(push, (y << 16) | x); 793 - if (nvd0_vers(mast) > NV50_DISP_MAST_CLASS) { 793 + if (nv50_vers(mast) > NV50_DISP_MAST_CLASS) { 794 794 evo_mthd(push, 0x0874 + (nv_crtc->index * 0x400), 1); 795 795 evo_data(push, nvfb->r_dma); 796 796 } ··· 818 818 } 819 819 820 820 static void 821 - nvd0_crtc_cursor_show(struct nouveau_crtc *nv_crtc) 821 + nv50_crtc_cursor_show(struct nouveau_crtc *nv_crtc) 822 822 { 823 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 823 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 824 824 u32 *push = evo_wait(mast, 16); 825 825 if (push) { 826 - if (nvd0_vers(mast) < NV84_DISP_MAST_CLASS) { 826 + if (nv50_vers(mast) < NV84_DISP_MAST_CLASS) { 827 827 evo_mthd(push, 0x0880 + (nv_crtc->index * 0x400), 2); 828 828 evo_data(push, 0x85000000); 829 829 evo_data(push, nv_crtc->cursor.nvbo->bo.offset >> 8); 830 830 } else 831 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 831 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 832 832 evo_mthd(push, 0x0880 + (nv_crtc->index * 0x400), 2); 833 833 evo_data(push, 0x85000000); 834 834 evo_data(push, nv_crtc->cursor.nvbo->bo.offset >> 8); ··· 846 846 } 847 847 848 848 static void 849 - nvd0_crtc_cursor_hide(struct nouveau_crtc *nv_crtc) 849 + nv50_crtc_cursor_hide(struct nouveau_crtc *nv_crtc) 850 850 { 851 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 851 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 852 852 u32 *push = evo_wait(mast, 16); 853 853 if (push) { 854 - if (nvd0_vers(mast) < NV84_DISP_MAST_CLASS) { 854 + if (nv50_vers(mast) < NV84_DISP_MAST_CLASS) { 855 855 evo_mthd(push, 0x0880 + (nv_crtc->index * 0x400), 1); 856 856 evo_data(push, 0x05000000); 857 857 } else 858 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 858 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 859 859 evo_mthd(push, 0x0880 + (nv_crtc->index * 0x400), 1); 860 860 evo_data(push, 0x05000000); 861 861 evo_mthd(push, 0x089c + (nv_crtc->index * 0x400), 1); ··· 871 871 } 872 872 873 873 static void 874 - nvd0_crtc_cursor_show_hide(struct nouveau_crtc *nv_crtc, bool show, bool update) 874 + nv50_crtc_cursor_show_hide(struct nouveau_crtc *nv_crtc, bool show, bool update) 875 875 { 876 - struct nvd0_mast *mast = nvd0_mast(nv_crtc->base.dev); 876 + struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); 877 877 878 878 if (show) 879 - nvd0_crtc_cursor_show(nv_crtc); 879 + nv50_crtc_cursor_show(nv_crtc); 880 880 else 881 - nvd0_crtc_cursor_hide(nv_crtc); 881 + nv50_crtc_cursor_hide(nv_crtc); 882 882 883 883 if (update) { 884 884 u32 *push = evo_wait(mast, 2); ··· 891 891 } 892 892 893 893 static void 894 - nvd0_crtc_dpms(struct drm_crtc *crtc, int mode) 894 + nv50_crtc_dpms(struct drm_crtc *crtc, int mode) 895 895 { 896 896 } 897 897 898 898 static void 899 - nvd0_crtc_prepare(struct drm_crtc *crtc) 899 + nv50_crtc_prepare(struct drm_crtc *crtc) 900 900 { 901 901 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 902 - struct nvd0_mast *mast = nvd0_mast(crtc->dev); 902 + struct nv50_mast *mast = nv50_mast(crtc->dev); 903 903 u32 *push; 904 904 905 - nvd0_display_flip_stop(crtc); 905 + nv50_display_flip_stop(crtc); 906 906 907 907 push = evo_wait(mast, 2); 908 908 if (push) { 909 - if (nvd0_vers(mast) < NV84_DISP_MAST_CLASS) { 909 + if (nv50_vers(mast) < NV84_DISP_MAST_CLASS) { 910 910 evo_mthd(push, 0x0874 + (nv_crtc->index * 0x400), 1); 911 911 evo_data(push, 0x00000000); 912 912 evo_mthd(push, 0x0840 + (nv_crtc->index * 0x400), 1); 913 913 evo_data(push, 0x40000000); 914 914 } else 915 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 915 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 916 916 evo_mthd(push, 0x0874 + (nv_crtc->index * 0x400), 1); 917 917 evo_data(push, 0x00000000); 918 918 evo_mthd(push, 0x0840 + (nv_crtc->index * 0x400), 1); ··· 931 931 evo_kick(push, mast); 932 932 } 933 933 934 - nvd0_crtc_cursor_show_hide(nv_crtc, false, false); 934 + nv50_crtc_cursor_show_hide(nv_crtc, false, false); 935 935 } 936 936 937 937 static void 938 - nvd0_crtc_commit(struct drm_crtc *crtc) 938 + nv50_crtc_commit(struct drm_crtc *crtc) 939 939 { 940 940 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 941 - struct nvd0_mast *mast = nvd0_mast(crtc->dev); 941 + struct nv50_mast *mast = nv50_mast(crtc->dev); 942 942 u32 *push; 943 943 944 944 push = evo_wait(mast, 32); 945 945 if (push) { 946 - if (nvd0_vers(mast) < NV84_DISP_MAST_CLASS) { 946 + if (nv50_vers(mast) < NV84_DISP_MAST_CLASS) { 947 947 evo_mthd(push, 0x0874 + (nv_crtc->index * 0x400), 1); 948 948 evo_data(push, NvEvoVRAM_LP); 949 949 evo_mthd(push, 0x0840 + (nv_crtc->index * 0x400), 2); 950 950 evo_data(push, 0xc0000000); 951 951 evo_data(push, nv_crtc->lut.nvbo->bo.offset >> 8); 952 952 } else 953 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 953 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 954 954 evo_mthd(push, 0x0874 + (nv_crtc->index * 0x400), 1); 955 955 evo_data(push, nv_crtc->fb.tile_flags); 956 956 evo_mthd(push, 0x0840 + (nv_crtc->index * 0x400), 2); ··· 975 975 evo_kick(push, mast); 976 976 } 977 977 978 - nvd0_crtc_cursor_show_hide(nv_crtc, nv_crtc->cursor.visible, true); 979 - nvd0_display_flip_next(crtc, crtc->fb, NULL, 1); 978 + nv50_crtc_cursor_show_hide(nv_crtc, nv_crtc->cursor.visible, true); 979 + nv50_display_flip_next(crtc, crtc->fb, NULL, 1); 980 980 } 981 981 982 982 static bool 983 - nvd0_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, 983 + nv50_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, 984 984 struct drm_display_mode *adjusted_mode) 985 985 { 986 986 return true; 987 987 } 988 988 989 989 static int 990 - nvd0_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) 990 + nv50_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) 991 991 { 992 992 struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->fb); 993 993 int ret; ··· 1005 1005 } 1006 1006 1007 1007 static int 1008 - nvd0_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, 1008 + nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, 1009 1009 struct drm_display_mode *mode, int x, int y, 1010 1010 struct drm_framebuffer *old_fb) 1011 1011 { 1012 - struct nvd0_mast *mast = nvd0_mast(crtc->dev); 1012 + struct nv50_mast *mast = nv50_mast(crtc->dev); 1013 1013 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 1014 1014 struct nouveau_connector *nv_connector; 1015 1015 u32 ilace = (mode->flags & DRM_MODE_FLAG_INTERLACE) ? 2 : 1; ··· 1039 1039 vactive = (vactive * 2) + 1; 1040 1040 } 1041 1041 1042 - ret = nvd0_crtc_swap_fbs(crtc, old_fb); 1042 + ret = nv50_crtc_swap_fbs(crtc, old_fb); 1043 1043 if (ret) 1044 1044 return ret; 1045 1045 1046 1046 push = evo_wait(mast, 64); 1047 1047 if (push) { 1048 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 1048 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 1049 1049 evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); 1050 1050 evo_data(push, 0x00800000 | mode->clock); 1051 1051 evo_data(push, (ilace == 2) ? 2 : 0); ··· 1084 1084 } 1085 1085 1086 1086 nv_connector = nouveau_crtc_connector_get(nv_crtc); 1087 - nvd0_crtc_set_dither(nv_crtc, false); 1088 - nvd0_crtc_set_scale(nv_crtc, false); 1089 - nvd0_crtc_set_color_vibrance(nv_crtc, false); 1090 - nvd0_crtc_set_image(nv_crtc, crtc->fb, x, y, false); 1087 + nv50_crtc_set_dither(nv_crtc, false); 1088 + nv50_crtc_set_scale(nv_crtc, false); 1089 + nv50_crtc_set_color_vibrance(nv_crtc, false); 1090 + nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, false); 1091 1091 return 0; 1092 1092 } 1093 1093 1094 1094 static int 1095 - nvd0_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, 1095 + nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, 1096 1096 struct drm_framebuffer *old_fb) 1097 1097 { 1098 1098 struct nouveau_drm *drm = nouveau_drm(crtc->dev); ··· 1104 1104 return 0; 1105 1105 } 1106 1106 1107 - ret = nvd0_crtc_swap_fbs(crtc, old_fb); 1107 + ret = nv50_crtc_swap_fbs(crtc, old_fb); 1108 1108 if (ret) 1109 1109 return ret; 1110 1110 1111 - nvd0_display_flip_stop(crtc); 1112 - nvd0_crtc_set_image(nv_crtc, crtc->fb, x, y, true); 1113 - nvd0_display_flip_next(crtc, crtc->fb, NULL, 1); 1111 + nv50_display_flip_stop(crtc); 1112 + nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, true); 1113 + nv50_display_flip_next(crtc, crtc->fb, NULL, 1); 1114 1114 return 0; 1115 1115 } 1116 1116 1117 1117 static int 1118 - nvd0_crtc_mode_set_base_atomic(struct drm_crtc *crtc, 1118 + nv50_crtc_mode_set_base_atomic(struct drm_crtc *crtc, 1119 1119 struct drm_framebuffer *fb, int x, int y, 1120 1120 enum mode_set_atomic state) 1121 1121 { 1122 1122 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 1123 - nvd0_display_flip_stop(crtc); 1124 - nvd0_crtc_set_image(nv_crtc, fb, x, y, true); 1123 + nv50_display_flip_stop(crtc); 1124 + nv50_crtc_set_image(nv_crtc, fb, x, y, true); 1125 1125 return 0; 1126 1126 } 1127 1127 1128 1128 static void 1129 - nvd0_crtc_lut_load(struct drm_crtc *crtc) 1129 + nv50_crtc_lut_load(struct drm_crtc *crtc) 1130 1130 { 1131 - struct nvd0_disp *disp = nvd0_disp(crtc->dev); 1131 + struct nv50_disp *disp = nv50_disp(crtc->dev); 1132 1132 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 1133 1133 void __iomem *lut = nvbo_kmap_obj_iovirtual(nv_crtc->lut.nvbo); 1134 1134 int i; ··· 1151 1151 } 1152 1152 1153 1153 static int 1154 - nvd0_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, 1154 + nv50_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, 1155 1155 uint32_t handle, uint32_t width, uint32_t height) 1156 1156 { 1157 1157 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); ··· 1183 1183 } 1184 1184 1185 1185 if (visible != nv_crtc->cursor.visible) { 1186 - nvd0_crtc_cursor_show_hide(nv_crtc, visible, true); 1186 + nv50_crtc_cursor_show_hide(nv_crtc, visible, true); 1187 1187 nv_crtc->cursor.visible = visible; 1188 1188 } 1189 1189 ··· 1191 1191 } 1192 1192 1193 1193 static int 1194 - nvd0_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) 1194 + nv50_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) 1195 1195 { 1196 - struct nvd0_curs *curs = nvd0_curs(crtc); 1197 - struct nvd0_chan *chan = nvd0_chan(curs); 1196 + struct nv50_curs *curs = nv50_curs(crtc); 1197 + struct nv50_chan *chan = nv50_chan(curs); 1198 1198 nv_wo32(chan->user, 0x0084, (y << 16) | (x & 0xffff)); 1199 1199 nv_wo32(chan->user, 0x0080, 0x00000000); 1200 1200 return 0; 1201 1201 } 1202 1202 1203 1203 static void 1204 - nvd0_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, 1204 + nv50_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, 1205 1205 uint32_t start, uint32_t size) 1206 1206 { 1207 1207 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); ··· 1214 1214 nv_crtc->lut.b[i] = b[i]; 1215 1215 } 1216 1216 1217 - nvd0_crtc_lut_load(crtc); 1217 + nv50_crtc_lut_load(crtc); 1218 1218 } 1219 1219 1220 1220 static void 1221 - nvd0_crtc_destroy(struct drm_crtc *crtc) 1221 + nv50_crtc_destroy(struct drm_crtc *crtc) 1222 1222 { 1223 1223 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 1224 - struct nvd0_disp *disp = nvd0_disp(crtc->dev); 1225 - struct nvd0_head *head = nvd0_head(crtc); 1226 - nvd0_dmac_destroy(disp->core, &head->ovly.base); 1227 - nvd0_pioc_destroy(disp->core, &head->oimm.base); 1228 - nvd0_dmac_destroy(disp->core, &head->sync.base); 1229 - nvd0_pioc_destroy(disp->core, &head->curs.base); 1224 + struct nv50_disp *disp = nv50_disp(crtc->dev); 1225 + struct nv50_head *head = nv50_head(crtc); 1226 + nv50_dmac_destroy(disp->core, &head->ovly.base); 1227 + nv50_pioc_destroy(disp->core, &head->oimm.base); 1228 + nv50_dmac_destroy(disp->core, &head->sync.base); 1229 + nv50_pioc_destroy(disp->core, &head->curs.base); 1230 1230 nouveau_bo_unmap(nv_crtc->cursor.nvbo); 1231 1231 nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo); 1232 1232 nouveau_bo_unmap(nv_crtc->lut.nvbo); ··· 1235 1235 kfree(crtc); 1236 1236 } 1237 1237 1238 - static const struct drm_crtc_helper_funcs nvd0_crtc_hfunc = { 1239 - .dpms = nvd0_crtc_dpms, 1240 - .prepare = nvd0_crtc_prepare, 1241 - .commit = nvd0_crtc_commit, 1242 - .mode_fixup = nvd0_crtc_mode_fixup, 1243 - .mode_set = nvd0_crtc_mode_set, 1244 - .mode_set_base = nvd0_crtc_mode_set_base, 1245 - .mode_set_base_atomic = nvd0_crtc_mode_set_base_atomic, 1246 - .load_lut = nvd0_crtc_lut_load, 1238 + static const struct drm_crtc_helper_funcs nv50_crtc_hfunc = { 1239 + .dpms = nv50_crtc_dpms, 1240 + .prepare = nv50_crtc_prepare, 1241 + .commit = nv50_crtc_commit, 1242 + .mode_fixup = nv50_crtc_mode_fixup, 1243 + .mode_set = nv50_crtc_mode_set, 1244 + .mode_set_base = nv50_crtc_mode_set_base, 1245 + .mode_set_base_atomic = nv50_crtc_mode_set_base_atomic, 1246 + .load_lut = nv50_crtc_lut_load, 1247 1247 }; 1248 1248 1249 - static const struct drm_crtc_funcs nvd0_crtc_func = { 1250 - .cursor_set = nvd0_crtc_cursor_set, 1251 - .cursor_move = nvd0_crtc_cursor_move, 1252 - .gamma_set = nvd0_crtc_gamma_set, 1249 + static const struct drm_crtc_funcs nv50_crtc_func = { 1250 + .cursor_set = nv50_crtc_cursor_set, 1251 + .cursor_move = nv50_crtc_cursor_move, 1252 + .gamma_set = nv50_crtc_gamma_set, 1253 1253 .set_config = drm_crtc_helper_set_config, 1254 - .destroy = nvd0_crtc_destroy, 1254 + .destroy = nv50_crtc_destroy, 1255 1255 .page_flip = nouveau_crtc_page_flip, 1256 1256 }; 1257 1257 1258 1258 static void 1259 - nvd0_cursor_set_pos(struct nouveau_crtc *nv_crtc, int x, int y) 1259 + nv50_cursor_set_pos(struct nouveau_crtc *nv_crtc, int x, int y) 1260 1260 { 1261 1261 } 1262 1262 1263 1263 static void 1264 - nvd0_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset) 1264 + nv50_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset) 1265 1265 { 1266 1266 } 1267 1267 1268 1268 static int 1269 - nvd0_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index) 1269 + nv50_crtc_create(struct drm_device *dev, struct nouveau_object *core, int index) 1270 1270 { 1271 - struct nvd0_disp *disp = nvd0_disp(dev); 1272 - struct nvd0_head *head; 1271 + struct nv50_disp *disp = nv50_disp(dev); 1272 + struct nv50_head *head; 1273 1273 struct drm_crtc *crtc; 1274 1274 int ret, i; 1275 1275 ··· 1278 1278 return -ENOMEM; 1279 1279 1280 1280 head->base.index = index; 1281 - head->base.set_dither = nvd0_crtc_set_dither; 1282 - head->base.set_scale = nvd0_crtc_set_scale; 1283 - head->base.set_color_vibrance = nvd0_crtc_set_color_vibrance; 1281 + head->base.set_dither = nv50_crtc_set_dither; 1282 + head->base.set_scale = nv50_crtc_set_scale; 1283 + head->base.set_color_vibrance = nv50_crtc_set_color_vibrance; 1284 1284 head->base.color_vibrance = 50; 1285 1285 head->base.vibrant_hue = 0; 1286 - head->base.cursor.set_offset = nvd0_cursor_set_offset; 1287 - head->base.cursor.set_pos = nvd0_cursor_set_pos; 1286 + head->base.cursor.set_offset = nv50_cursor_set_offset; 1287 + head->base.cursor.set_pos = nv50_cursor_set_pos; 1288 1288 for (i = 0; i < 256; i++) { 1289 1289 head->base.lut.r[i] = i << 8; 1290 1290 head->base.lut.g[i] = i << 8; ··· 1292 1292 } 1293 1293 1294 1294 crtc = &head->base.base; 1295 - drm_crtc_init(dev, crtc, &nvd0_crtc_func); 1296 - drm_crtc_helper_add(crtc, &nvd0_crtc_hfunc); 1295 + drm_crtc_init(dev, crtc, &nv50_crtc_func); 1296 + drm_crtc_helper_add(crtc, &nv50_crtc_hfunc); 1297 1297 drm_mode_crtc_set_gamma_size(crtc, 256); 1298 1298 1299 1299 ret = nouveau_bo_new(dev, 8192, 0x100, TTM_PL_FLAG_VRAM, ··· 1309 1309 if (ret) 1310 1310 goto out; 1311 1311 1312 - nvd0_crtc_lut_load(crtc); 1312 + nv50_crtc_lut_load(crtc); 1313 1313 1314 1314 /* allocate cursor resources */ 1315 - ret = nvd0_pioc_create(disp->core, NV50_DISP_CURS_CLASS, index, 1315 + ret = nv50_pioc_create(disp->core, NV50_DISP_CURS_CLASS, index, 1316 1316 &(struct nv50_display_curs_class) { 1317 1317 .head = index, 1318 1318 }, sizeof(struct nv50_display_curs_class), ··· 1334 1334 goto out; 1335 1335 1336 1336 /* allocate page flip / sync resources */ 1337 - ret = nvd0_dmac_create(disp->core, NV50_DISP_SYNC_CLASS, index, 1337 + ret = nv50_dmac_create(disp->core, NV50_DISP_SYNC_CLASS, index, 1338 1338 &(struct nv50_display_sync_class) { 1339 1339 .pushbuf = EVO_PUSH_HANDLE(SYNC, index), 1340 1340 .head = index, ··· 1346 1346 head->sync.sem.offset = EVO_SYNC(1 + index, 0x00); 1347 1347 1348 1348 /* allocate overlay resources */ 1349 - ret = nvd0_pioc_create(disp->core, NV50_DISP_OIMM_CLASS, index, 1349 + ret = nv50_pioc_create(disp->core, NV50_DISP_OIMM_CLASS, index, 1350 1350 &(struct nv50_display_oimm_class) { 1351 1351 .head = index, 1352 1352 }, sizeof(struct nv50_display_oimm_class), ··· 1354 1354 if (ret) 1355 1355 goto out; 1356 1356 1357 - ret = nvd0_dmac_create(disp->core, NV50_DISP_OVLY_CLASS, index, 1357 + ret = nv50_dmac_create(disp->core, NV50_DISP_OVLY_CLASS, index, 1358 1358 &(struct nv50_display_ovly_class) { 1359 1359 .pushbuf = EVO_PUSH_HANDLE(OVLY, index), 1360 1360 .head = index, ··· 1365 1365 1366 1366 out: 1367 1367 if (ret) 1368 - nvd0_crtc_destroy(crtc); 1368 + nv50_crtc_destroy(crtc); 1369 1369 return ret; 1370 1370 } 1371 1371 ··· 1373 1373 * DAC 1374 1374 *****************************************************************************/ 1375 1375 static void 1376 - nvd0_dac_dpms(struct drm_encoder *encoder, int mode) 1376 + nv50_dac_dpms(struct drm_encoder *encoder, int mode) 1377 1377 { 1378 1378 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1379 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1379 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1380 1380 int or = nv_encoder->or; 1381 1381 u32 dpms_ctrl; 1382 1382 ··· 1390 1390 } 1391 1391 1392 1392 static bool 1393 - nvd0_dac_mode_fixup(struct drm_encoder *encoder, 1393 + nv50_dac_mode_fixup(struct drm_encoder *encoder, 1394 1394 const struct drm_display_mode *mode, 1395 1395 struct drm_display_mode *adjusted_mode) 1396 1396 { ··· 1410 1410 } 1411 1411 1412 1412 static void 1413 - nvd0_dac_commit(struct drm_encoder *encoder) 1413 + nv50_dac_commit(struct drm_encoder *encoder) 1414 1414 { 1415 1415 } 1416 1416 1417 1417 static void 1418 - nvd0_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, 1418 + nv50_dac_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, 1419 1419 struct drm_display_mode *adjusted_mode) 1420 1420 { 1421 - struct nvd0_mast *mast = nvd0_mast(encoder->dev); 1421 + struct nv50_mast *mast = nv50_mast(encoder->dev); 1422 1422 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1423 1423 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); 1424 1424 u32 *push; 1425 1425 1426 - nvd0_dac_dpms(encoder, DRM_MODE_DPMS_ON); 1426 + nv50_dac_dpms(encoder, DRM_MODE_DPMS_ON); 1427 1427 1428 1428 push = evo_wait(mast, 8); 1429 1429 if (push) { 1430 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 1430 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 1431 1431 u32 syncs = 0x00000000; 1432 1432 1433 1433 if (mode->flags & DRM_MODE_FLAG_NHSYNC) ··· 1464 1464 } 1465 1465 1466 1466 static void 1467 - nvd0_dac_disconnect(struct drm_encoder *encoder) 1467 + nv50_dac_disconnect(struct drm_encoder *encoder) 1468 1468 { 1469 1469 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1470 - struct nvd0_mast *mast = nvd0_mast(encoder->dev); 1470 + struct nv50_mast *mast = nv50_mast(encoder->dev); 1471 1471 const int or = nv_encoder->or; 1472 1472 u32 *push; 1473 1473 1474 1474 if (nv_encoder->crtc) { 1475 - nvd0_crtc_prepare(nv_encoder->crtc); 1475 + nv50_crtc_prepare(nv_encoder->crtc); 1476 1476 1477 1477 push = evo_wait(mast, 4); 1478 1478 if (push) { 1479 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 1479 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 1480 1480 evo_mthd(push, 0x0400 + (or * 0x080), 1); 1481 1481 evo_data(push, 0x00000000); 1482 1482 } else { ··· 1494 1494 } 1495 1495 1496 1496 static enum drm_connector_status 1497 - nvd0_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) 1497 + nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) 1498 1498 { 1499 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1499 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1500 1500 int ret, or = nouveau_encoder(encoder)->or; 1501 1501 u32 load = 0; 1502 1502 ··· 1508 1508 } 1509 1509 1510 1510 static void 1511 - nvd0_dac_destroy(struct drm_encoder *encoder) 1511 + nv50_dac_destroy(struct drm_encoder *encoder) 1512 1512 { 1513 1513 drm_encoder_cleanup(encoder); 1514 1514 kfree(encoder); 1515 1515 } 1516 1516 1517 - static const struct drm_encoder_helper_funcs nvd0_dac_hfunc = { 1518 - .dpms = nvd0_dac_dpms, 1519 - .mode_fixup = nvd0_dac_mode_fixup, 1520 - .prepare = nvd0_dac_disconnect, 1521 - .commit = nvd0_dac_commit, 1522 - .mode_set = nvd0_dac_mode_set, 1523 - .disable = nvd0_dac_disconnect, 1524 - .get_crtc = nvd0_display_crtc_get, 1525 - .detect = nvd0_dac_detect 1517 + static const struct drm_encoder_helper_funcs nv50_dac_hfunc = { 1518 + .dpms = nv50_dac_dpms, 1519 + .mode_fixup = nv50_dac_mode_fixup, 1520 + .prepare = nv50_dac_disconnect, 1521 + .commit = nv50_dac_commit, 1522 + .mode_set = nv50_dac_mode_set, 1523 + .disable = nv50_dac_disconnect, 1524 + .get_crtc = nv50_display_crtc_get, 1525 + .detect = nv50_dac_detect 1526 1526 }; 1527 1527 1528 - static const struct drm_encoder_funcs nvd0_dac_func = { 1529 - .destroy = nvd0_dac_destroy, 1528 + static const struct drm_encoder_funcs nv50_dac_func = { 1529 + .destroy = nv50_dac_destroy, 1530 1530 }; 1531 1531 1532 1532 static int 1533 - nvd0_dac_create(struct drm_connector *connector, struct dcb_output *dcbe) 1533 + nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe) 1534 1534 { 1535 1535 struct drm_device *dev = connector->dev; 1536 1536 struct nouveau_encoder *nv_encoder; ··· 1545 1545 encoder = to_drm_encoder(nv_encoder); 1546 1546 encoder->possible_crtcs = dcbe->heads; 1547 1547 encoder->possible_clones = 0; 1548 - drm_encoder_init(dev, encoder, &nvd0_dac_func, DRM_MODE_ENCODER_DAC); 1549 - drm_encoder_helper_add(encoder, &nvd0_dac_hfunc); 1548 + drm_encoder_init(dev, encoder, &nv50_dac_func, DRM_MODE_ENCODER_DAC); 1549 + drm_encoder_helper_add(encoder, &nv50_dac_hfunc); 1550 1550 1551 1551 drm_mode_connector_attach_encoder(connector, encoder); 1552 1552 return 0; ··· 1556 1556 * Audio 1557 1557 *****************************************************************************/ 1558 1558 static void 1559 - nvd0_audio_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode) 1559 + nv50_audio_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode) 1560 1560 { 1561 1561 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1562 1562 struct nouveau_connector *nv_connector; 1563 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1563 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1564 1564 1565 1565 nv_connector = nouveau_encoder_connector_get(nv_encoder); 1566 1566 if (!drm_detect_monitor_audio(nv_connector->edid)) ··· 1574 1574 } 1575 1575 1576 1576 static void 1577 - nvd0_audio_disconnect(struct drm_encoder *encoder) 1577 + nv50_audio_disconnect(struct drm_encoder *encoder) 1578 1578 { 1579 1579 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1580 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1580 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1581 1581 1582 1582 nv_exec(disp->core, NVA3_DISP_SOR_HDA_ELD + nv_encoder->or, NULL, 0); 1583 1583 } ··· 1586 1586 * HDMI 1587 1587 *****************************************************************************/ 1588 1588 static void 1589 - nvd0_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode) 1589 + nv50_hdmi_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode) 1590 1590 { 1591 1591 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1592 1592 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); 1593 1593 struct nouveau_connector *nv_connector; 1594 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1594 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1595 1595 const u32 moff = (nv_crtc->index << 3) | nv_encoder->or; 1596 1596 u32 rekey = 56; /* binary driver, and tegra constant */ 1597 1597 u32 max_ac_packet; ··· 1609 1609 NV84_DISP_SOR_HDMI_PWR_STATE_ON | 1610 1610 (max_ac_packet << 16) | rekey); 1611 1611 1612 - nvd0_audio_mode_set(encoder, mode); 1612 + nv50_audio_mode_set(encoder, mode); 1613 1613 } 1614 1614 1615 1615 static void 1616 - nvd0_hdmi_disconnect(struct drm_encoder *encoder) 1616 + nv50_hdmi_disconnect(struct drm_encoder *encoder) 1617 1617 { 1618 1618 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1619 1619 struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); 1620 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1620 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1621 1621 const u32 moff = (nv_crtc->index << 3) | nv_encoder->or; 1622 1622 1623 - nvd0_audio_disconnect(encoder); 1623 + nv50_audio_disconnect(encoder); 1624 1624 1625 1625 nv_call(disp->core, NV84_DISP_SOR_HDMI_PWR + moff, 0x00000000); 1626 1626 } ··· 1629 1629 * SOR 1630 1630 *****************************************************************************/ 1631 1631 static void 1632 - nvd0_sor_dpms(struct drm_encoder *encoder, int mode) 1632 + nv50_sor_dpms(struct drm_encoder *encoder, int mode) 1633 1633 { 1634 1634 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1635 1635 struct drm_device *dev = encoder->dev; 1636 - struct nvd0_disp *disp = nvd0_disp(dev); 1636 + struct nv50_disp *disp = nv50_disp(dev); 1637 1637 struct drm_encoder *partner; 1638 1638 int or = nv_encoder->or; 1639 1639 ··· 1660 1660 } 1661 1661 1662 1662 static bool 1663 - nvd0_sor_mode_fixup(struct drm_encoder *encoder, 1663 + nv50_sor_mode_fixup(struct drm_encoder *encoder, 1664 1664 const struct drm_display_mode *mode, 1665 1665 struct drm_display_mode *adjusted_mode) 1666 1666 { ··· 1680 1680 } 1681 1681 1682 1682 static void 1683 - nvd0_sor_disconnect(struct drm_encoder *encoder) 1683 + nv50_sor_disconnect(struct drm_encoder *encoder) 1684 1684 { 1685 1685 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 1686 - struct nvd0_mast *mast = nvd0_mast(encoder->dev); 1686 + struct nv50_mast *mast = nv50_mast(encoder->dev); 1687 1687 const int or = nv_encoder->or; 1688 1688 u32 *push; 1689 1689 1690 1690 if (nv_encoder->crtc) { 1691 - nvd0_crtc_prepare(nv_encoder->crtc); 1691 + nv50_crtc_prepare(nv_encoder->crtc); 1692 1692 1693 1693 push = evo_wait(mast, 4); 1694 1694 if (push) { 1695 - if (nvd0_vers(mast) < NVD0_DISP_MAST_CLASS) { 1695 + if (nv50_vers(mast) < NVD0_DISP_MAST_CLASS) { 1696 1696 evo_mthd(push, 0x0600 + (or * 0x40), 1); 1697 1697 evo_data(push, 0x00000000); 1698 1698 } else { ··· 1705 1705 evo_kick(push, mast); 1706 1706 } 1707 1707 1708 - nvd0_hdmi_disconnect(encoder); 1708 + nv50_hdmi_disconnect(encoder); 1709 1709 } 1710 1710 1711 1711 nv_encoder->last_dpms = DRM_MODE_DPMS_OFF; ··· 1713 1713 } 1714 1714 1715 1715 static void 1716 - nvd0_sor_prepare(struct drm_encoder *encoder) 1716 + nv50_sor_prepare(struct drm_encoder *encoder) 1717 1717 { 1718 - nvd0_sor_disconnect(encoder); 1718 + nv50_sor_disconnect(encoder); 1719 1719 if (nouveau_encoder(encoder)->dcb->type == DCB_OUTPUT_DP) 1720 1720 evo_sync(encoder->dev); 1721 1721 } 1722 1722 1723 1723 static void 1724 - nvd0_sor_commit(struct drm_encoder *encoder) 1724 + nv50_sor_commit(struct drm_encoder *encoder) 1725 1725 { 1726 1726 } 1727 1727 1728 1728 static void 1729 - nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode, 1729 + nv50_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode, 1730 1730 struct drm_display_mode *mode) 1731 1731 { 1732 - struct nvd0_disp *disp = nvd0_disp(encoder->dev); 1733 - struct nvd0_mast *mast = nvd0_mast(encoder->dev); 1732 + struct nv50_disp *disp = nv50_disp(encoder->dev); 1733 + struct nv50_mast *mast = nv50_mast(encoder->dev); 1734 1734 struct drm_device *dev = encoder->dev; 1735 1735 struct nouveau_drm *drm = nouveau_drm(dev); 1736 1736 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); ··· 1754 1754 proto = 0x2; 1755 1755 } 1756 1756 1757 - nvd0_hdmi_mode_set(encoder, mode); 1757 + nv50_hdmi_mode_set(encoder, mode); 1758 1758 break; 1759 1759 case DCB_OUTPUT_LVDS: 1760 1760 proto = 0x0; ··· 1806 1806 break; 1807 1807 } 1808 1808 1809 - nvd0_sor_dpms(encoder, DRM_MODE_DPMS_ON); 1809 + nv50_sor_dpms(encoder, DRM_MODE_DPMS_ON); 1810 1810 1811 - push = evo_wait(nvd0_mast(dev), 8); 1811 + push = evo_wait(nv50_mast(dev), 8); 1812 1812 if (push) { 1813 - if (nvd0_vers(mast) < NVD0_DISP_CLASS) { 1813 + if (nv50_vers(mast) < NVD0_DISP_CLASS) { 1814 1814 evo_mthd(push, 0x0600 + (nv_encoder->or * 0x040), 1); 1815 1815 evo_data(push, (depth << 16) | (proto << 8) | owner); 1816 1816 } else { ··· 1839 1839 } 1840 1840 1841 1841 static void 1842 - nvd0_sor_destroy(struct drm_encoder *encoder) 1842 + nv50_sor_destroy(struct drm_encoder *encoder) 1843 1843 { 1844 1844 drm_encoder_cleanup(encoder); 1845 1845 kfree(encoder); 1846 1846 } 1847 1847 1848 - static const struct drm_encoder_helper_funcs nvd0_sor_hfunc = { 1849 - .dpms = nvd0_sor_dpms, 1850 - .mode_fixup = nvd0_sor_mode_fixup, 1851 - .prepare = nvd0_sor_prepare, 1852 - .commit = nvd0_sor_commit, 1853 - .mode_set = nvd0_sor_mode_set, 1854 - .disable = nvd0_sor_disconnect, 1855 - .get_crtc = nvd0_display_crtc_get, 1848 + static const struct drm_encoder_helper_funcs nv50_sor_hfunc = { 1849 + .dpms = nv50_sor_dpms, 1850 + .mode_fixup = nv50_sor_mode_fixup, 1851 + .prepare = nv50_sor_prepare, 1852 + .commit = nv50_sor_commit, 1853 + .mode_set = nv50_sor_mode_set, 1854 + .disable = nv50_sor_disconnect, 1855 + .get_crtc = nv50_display_crtc_get, 1856 1856 }; 1857 1857 1858 - static const struct drm_encoder_funcs nvd0_sor_func = { 1859 - .destroy = nvd0_sor_destroy, 1858 + static const struct drm_encoder_funcs nv50_sor_func = { 1859 + .destroy = nv50_sor_destroy, 1860 1860 }; 1861 1861 1862 1862 static int 1863 - nvd0_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) 1863 + nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) 1864 1864 { 1865 1865 struct drm_device *dev = connector->dev; 1866 1866 struct nouveau_encoder *nv_encoder; ··· 1876 1876 encoder = to_drm_encoder(nv_encoder); 1877 1877 encoder->possible_crtcs = dcbe->heads; 1878 1878 encoder->possible_clones = 0; 1879 - drm_encoder_init(dev, encoder, &nvd0_sor_func, DRM_MODE_ENCODER_TMDS); 1880 - drm_encoder_helper_add(encoder, &nvd0_sor_hfunc); 1879 + drm_encoder_init(dev, encoder, &nv50_sor_func, DRM_MODE_ENCODER_TMDS); 1880 + drm_encoder_helper_add(encoder, &nv50_sor_hfunc); 1881 1881 1882 1882 drm_mode_connector_attach_encoder(connector, encoder); 1883 1883 return 0; ··· 1887 1887 * Init 1888 1888 *****************************************************************************/ 1889 1889 void 1890 - nvd0_display_fini(struct drm_device *dev) 1890 + nv50_display_fini(struct drm_device *dev) 1891 1891 { 1892 1892 } 1893 1893 1894 1894 int 1895 - nvd0_display_init(struct drm_device *dev) 1895 + nv50_display_init(struct drm_device *dev) 1896 1896 { 1897 - u32 *push = evo_wait(nvd0_mast(dev), 32); 1897 + u32 *push = evo_wait(nv50_mast(dev), 32); 1898 1898 if (push) { 1899 1899 evo_mthd(push, 0x0088, 1); 1900 1900 evo_data(push, NvEvoSync); 1901 - evo_kick(push, nvd0_mast(dev)); 1901 + evo_kick(push, nv50_mast(dev)); 1902 1902 return evo_sync(dev); 1903 1903 } 1904 1904 ··· 1906 1906 } 1907 1907 1908 1908 void 1909 - nvd0_display_destroy(struct drm_device *dev) 1909 + nv50_display_destroy(struct drm_device *dev) 1910 1910 { 1911 - struct nvd0_disp *disp = nvd0_disp(dev); 1911 + struct nv50_disp *disp = nv50_disp(dev); 1912 1912 1913 - nvd0_dmac_destroy(disp->core, &disp->mast.base); 1913 + nv50_dmac_destroy(disp->core, &disp->mast.base); 1914 1914 1915 1915 nouveau_bo_unmap(disp->sync); 1916 1916 nouveau_bo_ref(NULL, &disp->sync); ··· 1920 1920 } 1921 1921 1922 1922 int 1923 - nvd0_display_create(struct drm_device *dev) 1923 + nv50_display_create(struct drm_device *dev) 1924 1924 { 1925 1925 static const u16 oclass[] = { 1926 1926 NVE0_DISP_CLASS, ··· 1935 1935 struct nouveau_drm *drm = nouveau_drm(dev); 1936 1936 struct dcb_table *dcb = &drm->vbios.dcb; 1937 1937 struct drm_connector *connector, *tmp; 1938 - struct nvd0_disp *disp; 1938 + struct nv50_disp *disp; 1939 1939 struct dcb_output *dcbe; 1940 1940 int crtcs, ret, i; 1941 1941 ··· 1944 1944 return -ENOMEM; 1945 1945 1946 1946 nouveau_display(dev)->priv = disp; 1947 - nouveau_display(dev)->dtor = nvd0_display_destroy; 1948 - nouveau_display(dev)->init = nvd0_display_init; 1949 - nouveau_display(dev)->fini = nvd0_display_fini; 1947 + nouveau_display(dev)->dtor = nv50_display_destroy; 1948 + nouveau_display(dev)->init = nv50_display_init; 1949 + nouveau_display(dev)->fini = nv50_display_fini; 1950 1950 1951 1951 /* small shared memory area we use for notifiers and semaphores */ 1952 1952 ret = nouveau_bo_new(dev, 4096, 0x1000, TTM_PL_FLAG_VRAM, ··· 1974 1974 goto out; 1975 1975 1976 1976 /* allocate master evo channel */ 1977 - ret = nvd0_dmac_create(disp->core, NV50_DISP_MAST_CLASS, 0, 1977 + ret = nv50_dmac_create(disp->core, NV50_DISP_MAST_CLASS, 0, 1978 1978 &(struct nv50_display_mast_class) { 1979 1979 .pushbuf = EVO_PUSH_HANDLE(MAST, 0), 1980 1980 }, sizeof(struct nv50_display_mast_class), ··· 1989 1989 crtcs = 2; 1990 1990 1991 1991 for (i = 0; i < crtcs; i++) { 1992 - ret = nvd0_crtc_create(dev, disp->core, i); 1992 + ret = nv50_crtc_create(dev, disp->core, i); 1993 1993 if (ret) 1994 1994 goto out; 1995 1995 } ··· 2010 2010 case DCB_OUTPUT_TMDS: 2011 2011 case DCB_OUTPUT_LVDS: 2012 2012 case DCB_OUTPUT_DP: 2013 - nvd0_sor_create(connector, dcbe); 2013 + nv50_sor_create(connector, dcbe); 2014 2014 break; 2015 2015 case DCB_OUTPUT_ANALOG: 2016 - nvd0_dac_create(connector, dcbe); 2016 + nv50_dac_create(connector, dcbe); 2017 2017 break; 2018 2018 default: 2019 2019 NV_WARN(drm, "skipping unsupported encoder %d/%d\n", ··· 2034 2034 2035 2035 out: 2036 2036 if (ret) 2037 - nvd0_display_destroy(dev); 2037 + nv50_display_destroy(dev); 2038 2038 return ret; 2039 2039 }