Lines Matching refs:mdev
79 static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem) in mga_probe_vram() argument
91 vram_size = mdev->mc.vram_window; in mga_probe_vram()
93 if ((mdev->type == G200_EW3) && (vram_size >= 0x1000000)) { in mga_probe_vram()
124 static int mga_vram_init(struct mga_device *mdev) in mga_vram_init() argument
132 mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0); in mga_vram_init()
133 mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0); in mga_vram_init()
135 aper->ranges[0].base = mdev->mc.vram_base; in mga_vram_init()
136 aper->ranges[0].size = mdev->mc.vram_window; in mga_vram_init()
141 if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window, in mga_vram_init()
147 mem = pci_iomap(mdev->dev->pdev, 0, 0); in mga_vram_init()
151 mdev->mc.vram_size = mga_probe_vram(mdev, mem); in mga_vram_init()
153 pci_iounmap(mdev->dev->pdev, mem); in mga_vram_init()
161 struct mga_device *mdev = dev->dev_private; in mgag200_device_init() local
164 mdev->type = flags; in mgag200_device_init()
167 mdev->num_crtc = 1; in mgag200_device_init()
170 mdev->has_sdram = !(option & (1 << 14)); in mgag200_device_init()
173 mdev->rmmio_base = pci_resource_start(mdev->dev->pdev, 1); in mgag200_device_init()
174 mdev->rmmio_size = pci_resource_len(mdev->dev->pdev, 1); in mgag200_device_init()
176 if (!devm_request_mem_region(mdev->dev->dev, mdev->rmmio_base, mdev->rmmio_size, in mgag200_device_init()
182 mdev->rmmio = pcim_iomap(dev->pdev, 1, 0); in mgag200_device_init()
183 if (mdev->rmmio == NULL) in mgag200_device_init()
187 if (IS_G200_SE(mdev)) in mgag200_device_init()
188 mdev->unique_rev_id = RREG32(0x1e24); in mgag200_device_init()
190 ret = mga_vram_init(mdev); in mgag200_device_init()
194 mdev->bpp_shifts[0] = 0; in mgag200_device_init()
195 mdev->bpp_shifts[1] = 1; in mgag200_device_init()
196 mdev->bpp_shifts[2] = 0; in mgag200_device_init()
197 mdev->bpp_shifts[3] = 2; in mgag200_device_init()
209 struct mga_device *mdev; in mgag200_driver_load() local
212 mdev = devm_kzalloc(dev->dev, sizeof(struct mga_device), GFP_KERNEL); in mgag200_driver_load()
213 if (mdev == NULL) in mgag200_driver_load()
215 dev->dev_private = (void *)mdev; in mgag200_driver_load()
216 mdev->dev = dev; in mgag200_driver_load()
223 r = mgag200_mm_init(mdev); in mgag200_driver_load()
229 if (IS_G200_SE(mdev) && mdev->mc.vram_size < (2048*1024)) in mgag200_driver_load()
235 r = mgag200_modeset_init(mdev); in mgag200_driver_load()
243 &mdev->cursor.pixels_1); in mgag200_driver_load()
245 &mdev->cursor.pixels_2); in mgag200_driver_load()
246 if (!mdev->cursor.pixels_2 || !mdev->cursor.pixels_1) { in mgag200_driver_load()
247 mdev->cursor.pixels_1 = NULL; in mgag200_driver_load()
248 mdev->cursor.pixels_2 = NULL; in mgag200_driver_load()
252 mdev->cursor.pixels_current = mdev->cursor.pixels_1; in mgag200_driver_load()
253 mdev->cursor.pixels_prev = mdev->cursor.pixels_2; in mgag200_driver_load()
260 mgag200_mm_fini(mdev); in mgag200_driver_load()
269 struct mga_device *mdev = dev->dev_private; in mgag200_driver_unload() local
271 if (mdev == NULL) in mgag200_driver_unload()
273 mgag200_modeset_fini(mdev); in mgag200_driver_unload()
274 mgag200_fbdev_fini(mdev); in mgag200_driver_unload()
276 mgag200_mm_fini(mdev); in mgag200_driver_unload()