Lines Matching refs:odev
285 void __iomem *(*cmap_ioremap)(struct ofdrm_device *odev,
288 void (*cmap_write)(struct ofdrm_device *odev, unsigned char index,
355 static int ofdrm_device_init_pci(struct ofdrm_device *odev) in ofdrm_device_init_pci() argument
357 struct drm_device *dev = &odev->dev; in ofdrm_device_init_pci()
387 static int ofdrm_device_init_pci(struct ofdrm_device *odev) in ofdrm_device_init_pci() argument
397 static struct resource *ofdrm_find_fb_resource(struct ofdrm_device *odev, in ofdrm_find_fb_resource() argument
400 struct platform_device *pdev = to_platform_device(odev->dev.dev); in ofdrm_find_fb_resource()
423 static void __iomem *get_cmap_address_of(struct ofdrm_device *odev, struct device_node *of_node, in get_cmap_address_of() argument
426 struct drm_device *dev = &odev->dev; in get_cmap_address_of()
455 static void __iomem *ofdrm_mach64_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_mach64_cmap_ioremap() argument
459 struct drm_device *dev = &odev->dev; in ofdrm_mach64_cmap_ioremap()
473 static void ofdrm_mach64_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_mach64_cmap_write() argument
476 void __iomem *addr = odev->cmap_base + 0xcc0; in ofdrm_mach64_cmap_write()
477 void __iomem *data = odev->cmap_base + 0xcc0 + 1; in ofdrm_mach64_cmap_write()
485 static void __iomem *ofdrm_rage128_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage128_cmap_ioremap() argument
489 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage128_cmap_ioremap()
492 static void ofdrm_rage128_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage128_cmap_write() argument
495 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage128_cmap_write()
496 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage128_cmap_write()
503 static void __iomem *ofdrm_rage_m3a_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage_m3a_cmap_ioremap() argument
507 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage_m3a_cmap_ioremap()
510 static void ofdrm_rage_m3a_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage_m3a_cmap_write() argument
513 void __iomem *dac_ctl = odev->cmap_base + 0x58; in ofdrm_rage_m3a_cmap_write()
514 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage_m3a_cmap_write()
515 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage_m3a_cmap_write()
529 static void __iomem *ofdrm_rage_m3b_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage_m3b_cmap_ioremap() argument
533 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage_m3b_cmap_ioremap()
536 static void ofdrm_rage_m3b_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage_m3b_cmap_write() argument
539 void __iomem *dac_ctl = odev->cmap_base + 0x58; in ofdrm_rage_m3b_cmap_write()
540 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage_m3b_cmap_write()
541 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage_m3b_cmap_write()
555 static void __iomem *ofdrm_radeon_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_radeon_cmap_ioremap() argument
559 return get_cmap_address_of(odev, of_node, 1, 0, 0x1fff); in ofdrm_radeon_cmap_ioremap()
562 static void __iomem *ofdrm_gxt2000_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_gxt2000_cmap_ioremap() argument
566 return get_cmap_address_of(odev, of_node, 0, 0x6000, 0x1000); in ofdrm_gxt2000_cmap_ioremap()
569 static void ofdrm_gxt2000_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_gxt2000_cmap_write() argument
572 void __iomem *data = ((unsigned int __iomem *)odev->cmap_base) + index; in ofdrm_gxt2000_cmap_write()
578 static void __iomem *ofdrm_avivo_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_avivo_cmap_ioremap() argument
586 cmap_base = get_cmap_address_of(odev, of_parent, 0, 0, 0x10000); in ofdrm_avivo_cmap_ioremap()
592 static void ofdrm_avivo_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_avivo_cmap_write() argument
595 void __iomem *lutsel = odev->cmap_base + AVIVO_DC_LUT_RW_SELECT; in ofdrm_avivo_cmap_write()
596 void __iomem *addr = odev->cmap_base + AVIVO_DC_LUT_RW_INDEX; in ofdrm_avivo_cmap_write()
597 void __iomem *data = odev->cmap_base + AVIVO_DC_LUT_30_COLOR; in ofdrm_avivo_cmap_write()
611 static void __iomem *ofdrm_qemu_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_qemu_cmap_ioremap() argument
621 struct drm_device *dev = &odev->dev; in ofdrm_qemu_cmap_ioremap()
636 static void ofdrm_qemu_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_qemu_cmap_write() argument
639 void __iomem *addr = odev->cmap_base; in ofdrm_qemu_cmap_write()
640 void __iomem *data = odev->cmap_base + 1; in ofdrm_qemu_cmap_write()
648 static void ofdrm_device_set_gamma_linear(struct ofdrm_device *odev, in ofdrm_device_set_gamma_linear() argument
651 struct drm_device *dev = &odev->dev; in ofdrm_device_set_gamma_linear()
663 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma_linear()
671 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma_linear()
677 odev->funcs->cmap_write(odev, i, i, i, i); in ofdrm_device_set_gamma_linear()
686 static void ofdrm_device_set_gamma(struct ofdrm_device *odev, in ofdrm_device_set_gamma() argument
690 struct drm_device *dev = &odev->dev; in ofdrm_device_set_gamma()
702 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
710 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
720 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
761 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_primary_plane_helper_atomic_check() local
783 if (new_fb->format != odev->format) { in ofdrm_primary_plane_helper_atomic_check()
788 odev->pitch, GFP_KERNEL); in ofdrm_primary_plane_helper_atomic_check()
805 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_primary_plane_helper_atomic_update() local
810 unsigned int dst_pitch = odev->pitch; in ofdrm_primary_plane_helper_atomic_update()
811 const struct drm_format_info *dst_format = odev->format; in ofdrm_primary_plane_helper_atomic_update()
825 struct iosys_map dst = odev->screen_base; in ofdrm_primary_plane_helper_atomic_update()
845 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_primary_plane_helper_atomic_disable() local
846 struct iosys_map dst = odev->screen_base; in ofdrm_primary_plane_helper_atomic_disable()
849 unsigned int dst_pitch = odev->pitch; in ofdrm_primary_plane_helper_atomic_disable()
850 const struct drm_format_info *dst_format = odev->format; in ofdrm_primary_plane_helper_atomic_disable()
892 struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); in ofdrm_crtc_helper_mode_valid() local
894 return drm_crtc_helper_mode_valid_fixed(crtc, mode, &odev->mode); in ofdrm_crtc_helper_mode_valid()
927 struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); in ofdrm_crtc_helper_atomic_flush() local
935 ofdrm_device_set_gamma(odev, format, crtc_state->gamma_lut->data); in ofdrm_crtc_helper_atomic_flush()
937 ofdrm_device_set_gamma_linear(odev, format); in ofdrm_crtc_helper_atomic_flush()
1005 struct ofdrm_device *odev = ofdrm_device_of_dev(connector->dev); in ofdrm_connector_helper_get_modes() local
1007 return drm_connector_helper_get_modes_fixed(connector, &odev->mode); in ofdrm_connector_helper_get_modes()
1094 struct ofdrm_device *odev; in ofdrm_device_create() local
1112 odev = devm_drm_dev_alloc(&pdev->dev, drv, struct ofdrm_device, dev); in ofdrm_device_create()
1113 if (IS_ERR(odev)) in ofdrm_device_create()
1114 return ERR_CAST(odev); in ofdrm_device_create()
1115 dev = &odev->dev; in ofdrm_device_create()
1118 ret = ofdrm_device_init_pci(odev); in ofdrm_device_create()
1131 odev->funcs = &ofdrm_unknown_device_funcs; in ofdrm_device_create()
1134 odev->funcs = &ofdrm_mach64_device_funcs; in ofdrm_device_create()
1137 odev->funcs = &ofdrm_rage128_device_funcs; in ofdrm_device_create()
1140 odev->funcs = &ofdrm_rage_m3a_device_funcs; in ofdrm_device_create()
1143 odev->funcs = &ofdrm_rage_m3b_device_funcs; in ofdrm_device_create()
1146 odev->funcs = &ofdrm_radeon_device_funcs; in ofdrm_device_create()
1149 odev->funcs = &ofdrm_gxt2000_device_funcs; in ofdrm_device_create()
1152 odev->funcs = &ofdrm_avivo_device_funcs; in ofdrm_device_create()
1155 odev->funcs = &ofdrm_qemu_device_funcs; in ofdrm_device_create()
1199 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
1209 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
1238 if (odev->funcs->cmap_ioremap) { in ofdrm_device_create()
1239 void __iomem *cmap_base = odev->funcs->cmap_ioremap(odev, of_node, fb_base); in ofdrm_device_create()
1245 odev->cmap_base = cmap_base; in ofdrm_device_create()
1253 iosys_map_set_vaddr_iomem(&odev->screen_base, screen_base); in ofdrm_device_create()
1254 odev->mode = ofdrm_mode(width, height); in ofdrm_device_create()
1255 odev->format = format; in ofdrm_device_create()
1256 odev->pitch = linebytes; in ofdrm_device_create()
1258 drm_dbg(dev, "display mode={" DRM_MODE_FMT "}\n", DRM_MODE_ARG(&odev->mode)); in ofdrm_device_create()
1284 odev->formats, ARRAY_SIZE(odev->formats)); in ofdrm_device_create()
1286 primary_plane = &odev->primary_plane; in ofdrm_device_create()
1288 odev->formats, nformats, in ofdrm_device_create()
1298 crtc = &odev->crtc; in ofdrm_device_create()
1305 if (odev->cmap_base) { in ofdrm_device_create()
1312 encoder = &odev->encoder; in ofdrm_device_create()
1320 connector = &odev->connector; in ofdrm_device_create()
1336 return odev; in ofdrm_device_create()
1362 struct ofdrm_device *odev; in ofdrm_probe() local
1366 odev = ofdrm_device_create(&ofdrm_driver, pdev); in ofdrm_probe()
1367 if (IS_ERR(odev)) in ofdrm_probe()
1368 return PTR_ERR(odev); in ofdrm_probe()
1369 dev = &odev->dev; in ofdrm_probe()
1375 drm_client_setup(dev, odev->format); in ofdrm_probe()