diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-04-01 18:22:40 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-04-01 20:18:28 -0400 |
commit | f4510a2752b75ad5847b7935b68c233cab497f97 (patch) | |
tree | 0104efe442302d22b705f34605070a009cc633c9 /drivers/gpu/drm/nouveau/dispnv04/crtc.c | |
parent | 2d82d188b2cb11b6b221eb84dda2344ef3cd1bb4 (diff) |
drm: Replace crtc fb with primary plane fb (v3)
Now that CRTC's have a primary plane, there's no need to track the
framebuffer in the CRTC. Replace all references to the CRTC fb with the
primary plane's fb.
This patch was generated by the Coccinelle semantic patching tool using
the following rules:
@@ struct drm_crtc C; @@
- (C).fb
+ C.primary->fb
@@ struct drm_crtc *C; @@
- (C)->fb
+ C->primary->fb
v3: Generate patch via coccinelle. Actual removal of crtc->fb has been
moved to a subsequent patch.
v2: Fixup several lingering crtc->fb instances that were missed in the
first patch iteration. [Rob Clark]
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv04/crtc.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv04/crtc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 1caef1fd139e..41be3424c906 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c | |||
@@ -239,7 +239,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) | |||
239 | struct drm_device *dev = crtc->dev; | 239 | struct drm_device *dev = crtc->dev; |
240 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 240 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
241 | struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; | 241 | struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; |
242 | struct drm_framebuffer *fb = crtc->fb; | 242 | struct drm_framebuffer *fb = crtc->primary->fb; |
243 | 243 | ||
244 | /* Calculate our timings */ | 244 | /* Calculate our timings */ |
245 | int horizDisplay = (mode->crtc_hdisplay >> 3) - 1; | 245 | int horizDisplay = (mode->crtc_hdisplay >> 3) - 1; |
@@ -574,7 +574,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) | |||
574 | regp->CRTC[NV_CIO_CRE_86] = 0x1; | 574 | regp->CRTC[NV_CIO_CRE_86] = 0x1; |
575 | } | 575 | } |
576 | 576 | ||
577 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] = (crtc->fb->depth + 1) / 8; | 577 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] = (crtc->primary->fb->depth + 1) / 8; |
578 | /* Enable slaved mode (called MODE_TV in nv4ref.h) */ | 578 | /* Enable slaved mode (called MODE_TV in nv4ref.h) */ |
579 | if (lvds_output || tmds_output || tv_output) | 579 | if (lvds_output || tmds_output || tv_output) |
580 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (1 << 7); | 580 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (1 << 7); |
@@ -588,7 +588,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) | |||
588 | regp->ramdac_gen_ctrl = NV_PRAMDAC_GENERAL_CONTROL_BPC_8BITS | | 588 | regp->ramdac_gen_ctrl = NV_PRAMDAC_GENERAL_CONTROL_BPC_8BITS | |
589 | NV_PRAMDAC_GENERAL_CONTROL_VGA_STATE_SEL | | 589 | NV_PRAMDAC_GENERAL_CONTROL_VGA_STATE_SEL | |
590 | NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON; | 590 | NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON; |
591 | if (crtc->fb->depth == 16) | 591 | if (crtc->primary->fb->depth == 16) |
592 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; | 592 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; |
593 | if (nv_device(drm->device)->chipset >= 0x11) | 593 | if (nv_device(drm->device)->chipset >= 0x11) |
594 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG; | 594 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG; |
@@ -609,7 +609,7 @@ static int | |||
609 | nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) | 609 | nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) |
610 | { | 610 | { |
611 | struct nv04_display *disp = nv04_display(crtc->dev); | 611 | struct nv04_display *disp = nv04_display(crtc->dev); |
612 | struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->fb); | 612 | struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->primary->fb); |
613 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 613 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
614 | int ret; | 614 | int ret; |
615 | 615 | ||
@@ -808,7 +808,7 @@ nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, uint32_t start, | |||
808 | * mark the lut values as dirty by setting depth==0, and it'll be | 808 | * mark the lut values as dirty by setting depth==0, and it'll be |
809 | * uploaded on the first mode_set_base() | 809 | * uploaded on the first mode_set_base() |
810 | */ | 810 | */ |
811 | if (!nv_crtc->base.fb) { | 811 | if (!nv_crtc->base.primary->fb) { |
812 | nv_crtc->lut.depth = 0; | 812 | nv_crtc->lut.depth = 0; |
813 | return; | 813 | return; |
814 | } | 814 | } |
@@ -832,7 +832,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
832 | NV_DEBUG(drm, "index %d\n", nv_crtc->index); | 832 | NV_DEBUG(drm, "index %d\n", nv_crtc->index); |
833 | 833 | ||
834 | /* no fb bound */ | 834 | /* no fb bound */ |
835 | if (!atomic && !crtc->fb) { | 835 | if (!atomic && !crtc->primary->fb) { |
836 | NV_DEBUG(drm, "No FB bound\n"); | 836 | NV_DEBUG(drm, "No FB bound\n"); |
837 | return 0; | 837 | return 0; |
838 | } | 838 | } |
@@ -844,8 +844,8 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
844 | drm_fb = passed_fb; | 844 | drm_fb = passed_fb; |
845 | fb = nouveau_framebuffer(passed_fb); | 845 | fb = nouveau_framebuffer(passed_fb); |
846 | } else { | 846 | } else { |
847 | drm_fb = crtc->fb; | 847 | drm_fb = crtc->primary->fb; |
848 | fb = nouveau_framebuffer(crtc->fb); | 848 | fb = nouveau_framebuffer(crtc->primary->fb); |
849 | } | 849 | } |
850 | 850 | ||
851 | nv_crtc->fb.offset = fb->nvbo->bo.offset; | 851 | nv_crtc->fb.offset = fb->nvbo->bo.offset; |
@@ -857,9 +857,9 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
857 | 857 | ||
858 | /* Update the framebuffer format. */ | 858 | /* Update the framebuffer format. */ |
859 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] &= ~3; | 859 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] &= ~3; |
860 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (crtc->fb->depth + 1) / 8; | 860 | regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (crtc->primary->fb->depth + 1) / 8; |
861 | regp->ramdac_gen_ctrl &= ~NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; | 861 | regp->ramdac_gen_ctrl &= ~NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; |
862 | if (crtc->fb->depth == 16) | 862 | if (crtc->primary->fb->depth == 16) |
863 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; | 863 | regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; |
864 | crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_PIXEL_INDEX); | 864 | crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_PIXEL_INDEX); |
865 | NVWriteRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_GENERAL_CONTROL, | 865 | NVWriteRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_GENERAL_CONTROL, |