aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/mdfld_device.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-05-11 06:30:53 -0400
committerDave Airlie <airlied@redhat.com>2012-05-11 12:35:49 -0400
commit8512e0748729a49d9af6693f920c1b432796fa8d (patch)
tree8d4b90a8391a99ec724f9b004da015768788f783 /drivers/gpu/drm/gma500/mdfld_device.c
parentf693dfb72db94cedd5fd2f788b4f2a7c814476de (diff)
gma500: introduce some register maps
All the conditional ugly register selection really wants to be cleaned up. Use a struct describing each pipe and its registers. This will also let us hide some of the oddments between platforms for any future merging of bits together. In particular the way the DPLL and FP registers randomly wander around. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/mdfld_device.c')
-rw-r--r--drivers/gpu/drm/gma500/mdfld_device.c80
1 files changed, 79 insertions, 1 deletions
diff --git a/drivers/gpu/drm/gma500/mdfld_device.c b/drivers/gpu/drm/gma500/mdfld_device.c
index ef71ed6a22b0..000d316c6afd 100644
--- a/drivers/gpu/drm/gma500/mdfld_device.c
+++ b/drivers/gpu/drm/gma500/mdfld_device.c
@@ -559,6 +559,84 @@ static int mdfld_power_up(struct drm_device *dev)
559 return 0; 559 return 0;
560} 560}
561 561
562/* Medfield */
563static const struct psb_offset mdfld_regmap[3] = {
564 {
565 .fp0 = MRST_FPA0,
566 .fp1 = MRST_FPA1,
567 .cntr = DSPACNTR,
568 .conf = PIPEACONF,
569 .src = PIPEASRC,
570 .dpll = MRST_DPLL_A,
571 .htotal = HTOTAL_A,
572 .hblank = HBLANK_A,
573 .hsync = HSYNC_A,
574 .vtotal = VTOTAL_A,
575 .vblank = VBLANK_A,
576 .vsync = VSYNC_A,
577 .stride = DSPASTRIDE,
578 .size = DSPASIZE,
579 .pos = DSPAPOS,
580 .surf = DSPASURF,
581 .addr = DSPABASE,
582 .status = PIPEASTAT,
583 .linoff = DSPALINOFF,
584 .tileoff = DSPATILEOFF,
585 .palette = PALETTE_A,
586 },
587 {
588 .fp0 = MDFLD_DPLL_DIV0,
589 .cntr = DSPBCNTR,
590 .conf = PIPEBCONF,
591 .src = PIPEBSRC,
592 .dpll = MDFLD_DPLL_B,
593 .htotal = HTOTAL_B,
594 .hblank = HBLANK_B,
595 .hsync = HSYNC_B,
596 .vtotal = VTOTAL_B,
597 .vblank = VBLANK_B,
598 .vsync = VSYNC_B,
599 .stride = DSPBSTRIDE,
600 .size = DSPBSIZE,
601 .pos = DSPBPOS,
602 .surf = DSPBSURF,
603 .addr = DSPBBASE,
604 .status = PIPEBSTAT,
605 .linoff = DSPBLINOFF,
606 .tileoff = DSPBTILEOFF,
607 .palette = PALETTE_B,
608 },
609 {
610 .cntr = DSPCCNTR,
611 .conf = PIPECCONF,
612 .src = PIPECSRC,
613 /* No DPLL_C */
614 .dpll = MRST_DPLL_A,
615 .htotal = HTOTAL_C,
616 .hblank = HBLANK_C,
617 .hsync = HSYNC_C,
618 .vtotal = VTOTAL_C,
619 .vblank = VBLANK_C,
620 .vsync = VSYNC_C,
621 .stride = DSPCSTRIDE,
622 .size = DSPBSIZE,
623 .pos = DSPCPOS,
624 .surf = DSPCSURF,
625 .addr = DSPCBASE,
626 .status = PIPECSTAT,
627 .linoff = DSPCLINOFF,
628 .tileoff = DSPCTILEOFF,
629 .palette = PALETTE_C,
630 },
631};
632
633static int mdfld_chip_setup(struct drm_device *dev)
634{
635 struct drm_psb_private *dev_priv = dev->dev_private;
636 dev_priv->regmap = mdfld_regmap;
637 return mid_chip_setup(dev);
638}
639
562const struct psb_ops mdfld_chip_ops = { 640const struct psb_ops mdfld_chip_ops = {
563 .name = "mdfld", 641 .name = "mdfld",
564 .accel_2d = 0, 642 .accel_2d = 0,
@@ -568,7 +646,7 @@ const struct psb_ops mdfld_chip_ops = {
568 .hdmi_mask = (1 << 1), 646 .hdmi_mask = (1 << 1),
569 .sgx_offset = MRST_SGX_OFFSET, 647 .sgx_offset = MRST_SGX_OFFSET,
570 648
571 .chip_setup = mid_chip_setup, 649 .chip_setup = mdfld_chip_setup,
572 .crtc_helper = &mdfld_helper_funcs, 650 .crtc_helper = &mdfld_helper_funcs,
573 .crtc_funcs = &psb_intel_crtc_funcs, 651 .crtc_funcs = &psb_intel_crtc_funcs,
574 652