Lines Matching defs:mdev

36 	struct mga_device *mdev = to_mga_device(dev);
44 if (!mdev->display_pipe.plane.state)
47 fb = mdev->display_pipe.plane.state->fb;
87 static inline void mga_wait_vsync(struct mga_device *mdev)
102 static inline void mga_wait_busy(struct mga_device *mdev)
115 static int mgag200_g200_set_plls(struct mga_device *mdev, long clock)
117 struct drm_device *dev = &mdev->base;
128 long ref_clk = mdev->model.g200.ref_clk;
129 long p_clk_min = mdev->model.g200.pclk_min;
130 long p_clk_max = mdev->model.g200.pclk_max;
186 static int mga_g200se_set_plls(struct mga_device *mdev, long clock)
188 u32 unique_rev_id = mdev->model.g200se.unique_rev_id;
308 static int mga_g200wb_set_plls(struct mga_device *mdev, long clock)
323 if (mdev->type == G200_EW3) {
489 static int mga_g200ev_set_plls(struct mga_device *mdev, long clock)
584 static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)
597 if (mdev->type == G200_EH3) {
717 static int mga_g200er_set_plls(struct mga_device *mdev, long clock)
799 static int mgag200_crtc_set_plls(struct mga_device *mdev, long clock)
801 switch(mdev->type) {
804 return mgag200_g200_set_plls(mdev, clock);
807 return mga_g200se_set_plls(mdev, clock);
811 return mga_g200wb_set_plls(mdev, clock);
814 return mga_g200ev_set_plls(mdev, clock);
818 return mga_g200eh_set_plls(mdev, clock);
821 return mga_g200er_set_plls(mdev, clock);
828 static void mgag200_g200wb_hold_bmc(struct mga_device *mdev)
881 static void mgag200_g200wb_release_bmc(struct mga_device *mdev)
932 static void mgag200_set_startadd(struct mga_device *mdev,
935 struct drm_device *dev = &mdev->base;
960 static void mgag200_set_dac_regs(struct mga_device *mdev)
976 switch (mdev->type) {
1016 if (IS_G200_SE(mdev) &&
1019 if ((mdev->type == G200_EV ||
1020 mdev->type == G200_WB ||
1021 mdev->type == G200_EH ||
1022 mdev->type == G200_EW3 ||
1023 mdev->type == G200_EH3) &&
1030 if (mdev->type == G200_ER)
1034 static void mgag200_init_regs(struct mga_device *mdev)
1038 mgag200_set_dac_regs(mdev);
1057 if (mdev->type == G200_ER)
1060 if (mdev->type == G200_EW3)
1068 static void mgag200_set_mode_regs(struct mga_device *mdev,
1105 if (mdev->type == G200_WB || mdev->type == G200_EW3)
1149 static u8 mgag200_get_bpp_shift(struct mga_device *mdev,
1152 return mdev->bpp_shifts[format->cpp[0] - 1];
1160 static u32 mgag200_calculate_offset(struct mga_device *mdev,
1164 u8 bppshift = mgag200_get_bpp_shift(mdev, fb->format);
1174 static void mgag200_set_offset(struct mga_device *mdev,
1178 u32 offset = mgag200_calculate_offset(mdev, fb);
1191 static void mgag200_set_format_regs(struct mga_device *mdev,
1194 struct drm_device *dev = &mdev->base;
1201 bppshift = mgag200_get_bpp_shift(mdev, format);
1256 static void mgag200_g200er_reset_tagfifo(struct mga_device *mdev)
1272 static void mgag200_g200se_set_hiprilvl(struct mga_device *mdev,
1276 u32 unique_rev_id = mdev->model.g200se.unique_rev_id;
1318 static void mgag200_g200ev_set_hiprilvl(struct mga_device *mdev)
1323 static void mgag200_enable_display(struct mga_device *mdev)
1336 mga_wait_vsync(mdev);
1337 mga_wait_busy(mdev);
1351 static void mgag200_disable_display(struct mga_device *mdev)
1363 mga_wait_vsync(mdev);
1364 mga_wait_busy(mdev);
1427 struct mga_device *mdev = to_mga_device(dev);
1430 if (IS_G200_SE(mdev)) {
1431 u32 unique_rev_id = mdev->model.g200se.unique_rev_id;
1454 } else if (mdev->type == G200_WB) {
1462 } else if (mdev->type == G200_EV &&
1466 } else if (mdev->type == G200_EH &&
1470 } else if (mdev->type == G200_ER &&
1494 if ((mode->hdisplay * mode->vdisplay * (bpp/8)) > mdev->vram_fb_available) {
1523 static int mgag200_vga_connector_init(struct mga_device *mdev)
1525 struct drm_device *dev = &mdev->base;
1526 struct mga_connector *mconnector = &mdev->connector;
1564 mgag200_handle_damage(struct mga_device *mdev, struct drm_framebuffer *fb,
1567 struct drm_device *dev = &mdev->base;
1574 drm_fb_memcpy_dstclip(mdev->vram, vmap, fb, clip);
1579 mgag200_set_startadd(mdev, (u32)0);
1580 mgag200_set_offset(mdev, fb);
1590 struct mga_device *mdev = to_mga_device(dev);
1600 if (mdev->type == G200_WB || mdev->type == G200_EW3)
1601 mgag200_g200wb_hold_bmc(mdev);
1603 mgag200_set_format_regs(mdev, fb);
1604 mgag200_set_mode_regs(mdev, adjusted_mode);
1605 mgag200_crtc_set_plls(mdev, adjusted_mode->clock);
1607 if (mdev->type == G200_ER)
1608 mgag200_g200er_reset_tagfifo(mdev);
1610 if (IS_G200_SE(mdev))
1611 mgag200_g200se_set_hiprilvl(mdev, adjusted_mode, fb);
1612 else if (mdev->type == G200_EV)
1613 mgag200_g200ev_set_hiprilvl(mdev);
1615 if (mdev->type == G200_WB || mdev->type == G200_EW3)
1616 mgag200_g200wb_release_bmc(mdev);
1619 mgag200_enable_display(mdev);
1621 mgag200_handle_damage(mdev, fb, &fullscreen);
1628 struct mga_device *mdev = to_mga_device(crtc->dev);
1630 mgag200_disable_display(mdev);
1660 struct mga_device *mdev = to_mga_device(dev);
1669 mgag200_handle_damage(mdev, fb, &damage);
1703 static unsigned int mgag200_preferred_depth(struct mga_device *mdev)
1705 if (IS_G200_SE(mdev) && mdev->vram_fb_available < (2048*1024))
1711 int mgag200_modeset_init(struct mga_device *mdev)
1713 struct drm_device *dev = &mdev->base;
1714 struct drm_connector *connector = &mdev->connector.base;
1715 struct drm_simple_display_pipe *pipe = &mdev->display_pipe;
1719 mdev->bpp_shifts[0] = 0;
1720 mdev->bpp_shifts[1] = 1;
1721 mdev->bpp_shifts[2] = 0;
1722 mdev->bpp_shifts[3] = 2;
1724 mgag200_init_regs(mdev);
1736 dev->mode_config.preferred_depth = mgag200_preferred_depth(mdev);
1738 dev->mode_config.fb_base = mdev->mc.vram_base;
1742 ret = mgag200_vga_connector_init(mdev);