Lines Matching refs:odev
290 void __iomem *(*cmap_ioremap)(struct ofdrm_device *odev,
293 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->sysfb.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->sysfb.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->sysfb.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->sysfb.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->sysfb.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()
652 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_set_gamma_lut() local
661 odev->funcs->cmap_write(odev, i8, r8, g8, b8); in ofdrm_set_gamma_lut()
664 static void ofdrm_device_fill_gamma(struct ofdrm_device *odev, in ofdrm_device_fill_gamma() argument
667 struct drm_device *dev = &odev->sysfb.dev; in ofdrm_device_fill_gamma()
668 struct drm_crtc *crtc = &odev->crtc; in ofdrm_device_fill_gamma()
686 static void ofdrm_device_load_gamma(struct ofdrm_device *odev, in ofdrm_device_load_gamma() argument
690 struct drm_device *dev = &odev->sysfb.dev; in ofdrm_device_load_gamma()
691 struct drm_crtc *crtc = &odev->crtc; in ofdrm_device_load_gamma()
728 struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); in ofdrm_crtc_helper_atomic_flush() local
736 ofdrm_device_load_gamma(odev, format, crtc_state->gamma_lut->data); in ofdrm_crtc_helper_atomic_flush()
738 ofdrm_device_fill_gamma(odev, format); in ofdrm_crtc_helper_atomic_flush()
820 struct ofdrm_device *odev; in ofdrm_device_create() local
840 odev = devm_drm_dev_alloc(&pdev->dev, drv, struct ofdrm_device, sysfb.dev); in ofdrm_device_create()
841 if (IS_ERR(odev)) in ofdrm_device_create()
842 return ERR_CAST(odev); in ofdrm_device_create()
843 sysfb = &odev->sysfb; in ofdrm_device_create()
847 ret = ofdrm_device_init_pci(odev); in ofdrm_device_create()
860 odev->funcs = &ofdrm_unknown_device_funcs; in ofdrm_device_create()
863 odev->funcs = &ofdrm_mach64_device_funcs; in ofdrm_device_create()
866 odev->funcs = &ofdrm_rage128_device_funcs; in ofdrm_device_create()
869 odev->funcs = &ofdrm_rage_m3a_device_funcs; in ofdrm_device_create()
872 odev->funcs = &ofdrm_rage_m3b_device_funcs; in ofdrm_device_create()
875 odev->funcs = &ofdrm_radeon_device_funcs; in ofdrm_device_create()
878 odev->funcs = &ofdrm_gxt2000_device_funcs; in ofdrm_device_create()
881 odev->funcs = &ofdrm_avivo_device_funcs; in ofdrm_device_create()
884 odev->funcs = &ofdrm_qemu_device_funcs; in ofdrm_device_create()
928 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
938 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
967 if (odev->funcs->cmap_ioremap) { in ofdrm_device_create()
968 void __iomem *cmap_base = odev->funcs->cmap_ioremap(odev, of_node, fb_base); in ofdrm_device_create()
974 odev->cmap_base = cmap_base; in ofdrm_device_create()
979 edid = display_get_edid_of(dev, of_node, odev->edid); in ofdrm_device_create()
989 if (odev->cmap_base) in ofdrm_device_create()
1019 odev->formats, ARRAY_SIZE(odev->formats)); in ofdrm_device_create()
1021 primary_plane = &odev->primary_plane; in ofdrm_device_create()
1023 odev->formats, nformats, in ofdrm_device_create()
1033 crtc = &odev->crtc; in ofdrm_device_create()
1048 encoder = &odev->encoder; in ofdrm_device_create()
1056 connector = &odev->connector; in ofdrm_device_create()
1074 return odev; in ofdrm_device_create()
1100 struct ofdrm_device *odev; in ofdrm_probe() local
1105 odev = ofdrm_device_create(&ofdrm_driver, pdev); in ofdrm_probe()
1106 if (IS_ERR(odev)) in ofdrm_probe()
1107 return PTR_ERR(odev); in ofdrm_probe()
1108 sysfb = &odev->sysfb; in ofdrm_probe()