Lines Matching refs:odev

286 	void __iomem *(*cmap_ioremap)(struct ofdrm_device *odev,
289 void (*cmap_write)(struct ofdrm_device *odev, unsigned char index,
356 static int ofdrm_device_init_pci(struct ofdrm_device *odev) in ofdrm_device_init_pci() argument
358 struct drm_device *dev = &odev->dev; in ofdrm_device_init_pci()
388 static int ofdrm_device_init_pci(struct ofdrm_device *odev) in ofdrm_device_init_pci() argument
398 static struct resource *ofdrm_find_fb_resource(struct ofdrm_device *odev, in ofdrm_find_fb_resource() argument
401 struct platform_device *pdev = to_platform_device(odev->dev.dev); in ofdrm_find_fb_resource()
424 static void __iomem *get_cmap_address_of(struct ofdrm_device *odev, struct device_node *of_node, in get_cmap_address_of() argument
427 struct drm_device *dev = &odev->dev; in get_cmap_address_of()
456 static void __iomem *ofdrm_mach64_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_mach64_cmap_ioremap() argument
460 struct drm_device *dev = &odev->dev; in ofdrm_mach64_cmap_ioremap()
474 static void ofdrm_mach64_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_mach64_cmap_write() argument
477 void __iomem *addr = odev->cmap_base + 0xcc0; in ofdrm_mach64_cmap_write()
478 void __iomem *data = odev->cmap_base + 0xcc0 + 1; in ofdrm_mach64_cmap_write()
486 static void __iomem *ofdrm_rage128_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage128_cmap_ioremap() argument
490 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage128_cmap_ioremap()
493 static void ofdrm_rage128_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage128_cmap_write() argument
496 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage128_cmap_write()
497 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage128_cmap_write()
504 static void __iomem *ofdrm_rage_m3a_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage_m3a_cmap_ioremap() argument
508 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage_m3a_cmap_ioremap()
511 static void ofdrm_rage_m3a_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage_m3a_cmap_write() argument
514 void __iomem *dac_ctl = odev->cmap_base + 0x58; in ofdrm_rage_m3a_cmap_write()
515 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage_m3a_cmap_write()
516 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage_m3a_cmap_write()
530 static void __iomem *ofdrm_rage_m3b_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_rage_m3b_cmap_ioremap() argument
534 return get_cmap_address_of(odev, of_node, 2, 0, 0x1fff); in ofdrm_rage_m3b_cmap_ioremap()
537 static void ofdrm_rage_m3b_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_rage_m3b_cmap_write() argument
540 void __iomem *dac_ctl = odev->cmap_base + 0x58; in ofdrm_rage_m3b_cmap_write()
541 void __iomem *addr = odev->cmap_base + 0xb0; in ofdrm_rage_m3b_cmap_write()
542 void __iomem *data = odev->cmap_base + 0xb4; in ofdrm_rage_m3b_cmap_write()
556 static void __iomem *ofdrm_radeon_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_radeon_cmap_ioremap() argument
560 return get_cmap_address_of(odev, of_node, 1, 0, 0x1fff); in ofdrm_radeon_cmap_ioremap()
563 static void __iomem *ofdrm_gxt2000_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_gxt2000_cmap_ioremap() argument
567 return get_cmap_address_of(odev, of_node, 0, 0x6000, 0x1000); in ofdrm_gxt2000_cmap_ioremap()
570 static void ofdrm_gxt2000_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_gxt2000_cmap_write() argument
573 void __iomem *data = ((unsigned int __iomem *)odev->cmap_base) + index; in ofdrm_gxt2000_cmap_write()
579 static void __iomem *ofdrm_avivo_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_avivo_cmap_ioremap() argument
587 cmap_base = get_cmap_address_of(odev, of_parent, 0, 0, 0x10000); in ofdrm_avivo_cmap_ioremap()
593 static void ofdrm_avivo_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_avivo_cmap_write() argument
596 void __iomem *lutsel = odev->cmap_base + AVIVO_DC_LUT_RW_SELECT; in ofdrm_avivo_cmap_write()
597 void __iomem *addr = odev->cmap_base + AVIVO_DC_LUT_RW_INDEX; in ofdrm_avivo_cmap_write()
598 void __iomem *data = odev->cmap_base + AVIVO_DC_LUT_30_COLOR; in ofdrm_avivo_cmap_write()
612 static void __iomem *ofdrm_qemu_cmap_ioremap(struct ofdrm_device *odev, in ofdrm_qemu_cmap_ioremap() argument
622 struct drm_device *dev = &odev->dev; in ofdrm_qemu_cmap_ioremap()
637 static void ofdrm_qemu_cmap_write(struct ofdrm_device *odev, unsigned char index, in ofdrm_qemu_cmap_write() argument
640 void __iomem *addr = odev->cmap_base; in ofdrm_qemu_cmap_write()
641 void __iomem *data = odev->cmap_base + 1; in ofdrm_qemu_cmap_write()
649 static void ofdrm_device_set_gamma_linear(struct ofdrm_device *odev, in ofdrm_device_set_gamma_linear() argument
652 struct drm_device *dev = &odev->dev; in ofdrm_device_set_gamma_linear()
664 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma_linear()
672 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma_linear()
678 odev->funcs->cmap_write(odev, i, i, i, i); in ofdrm_device_set_gamma_linear()
687 static void ofdrm_device_set_gamma(struct ofdrm_device *odev, in ofdrm_device_set_gamma() argument
691 struct drm_device *dev = &odev->dev; in ofdrm_device_set_gamma()
703 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
711 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
721 odev->funcs->cmap_write(odev, i, r, g, b); in ofdrm_device_set_gamma()
792 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_primary_plane_helper_atomic_update() local
797 unsigned int dst_pitch = odev->pitch; in ofdrm_primary_plane_helper_atomic_update()
798 const struct drm_format_info *dst_format = odev->format; in ofdrm_primary_plane_helper_atomic_update()
812 struct iosys_map dst = odev->screen_base; in ofdrm_primary_plane_helper_atomic_update()
832 struct ofdrm_device *odev = ofdrm_device_of_dev(dev); in ofdrm_primary_plane_helper_atomic_disable() local
833 struct iosys_map dst = odev->screen_base; in ofdrm_primary_plane_helper_atomic_disable()
836 unsigned int dst_pitch = odev->pitch; in ofdrm_primary_plane_helper_atomic_disable()
837 const struct drm_format_info *dst_format = odev->format; in ofdrm_primary_plane_helper_atomic_disable()
879 struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); in ofdrm_crtc_helper_mode_valid() local
881 return drm_crtc_helper_mode_valid_fixed(crtc, mode, &odev->mode); in ofdrm_crtc_helper_mode_valid()
914 struct ofdrm_device *odev = ofdrm_device_of_dev(crtc->dev); in ofdrm_crtc_helper_atomic_flush() local
922 ofdrm_device_set_gamma(odev, format, crtc_state->gamma_lut->data); in ofdrm_crtc_helper_atomic_flush()
924 ofdrm_device_set_gamma_linear(odev, format); in ofdrm_crtc_helper_atomic_flush()
992 struct ofdrm_device *odev = ofdrm_device_of_dev(connector->dev); in ofdrm_connector_helper_get_modes() local
994 return drm_connector_helper_get_modes_fixed(connector, &odev->mode); in ofdrm_connector_helper_get_modes()
1081 struct ofdrm_device *odev; in ofdrm_device_create() local
1099 odev = devm_drm_dev_alloc(&pdev->dev, drv, struct ofdrm_device, dev); in ofdrm_device_create()
1100 if (IS_ERR(odev)) in ofdrm_device_create()
1101 return ERR_CAST(odev); in ofdrm_device_create()
1102 dev = &odev->dev; in ofdrm_device_create()
1105 ret = ofdrm_device_init_pci(odev); in ofdrm_device_create()
1118 odev->funcs = &ofdrm_unknown_device_funcs; in ofdrm_device_create()
1121 odev->funcs = &ofdrm_mach64_device_funcs; in ofdrm_device_create()
1124 odev->funcs = &ofdrm_rage128_device_funcs; in ofdrm_device_create()
1127 odev->funcs = &ofdrm_rage_m3a_device_funcs; in ofdrm_device_create()
1130 odev->funcs = &ofdrm_rage_m3b_device_funcs; in ofdrm_device_create()
1133 odev->funcs = &ofdrm_radeon_device_funcs; in ofdrm_device_create()
1136 odev->funcs = &ofdrm_gxt2000_device_funcs; in ofdrm_device_create()
1139 odev->funcs = &ofdrm_avivo_device_funcs; in ofdrm_device_create()
1142 odev->funcs = &ofdrm_qemu_device_funcs; in ofdrm_device_create()
1186 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
1196 res = ofdrm_find_fb_resource(odev, &fb_res); in ofdrm_device_create()
1225 if (odev->funcs->cmap_ioremap) { in ofdrm_device_create()
1226 void __iomem *cmap_base = odev->funcs->cmap_ioremap(odev, of_node, fb_base); in ofdrm_device_create()
1232 odev->cmap_base = cmap_base; in ofdrm_device_create()
1240 iosys_map_set_vaddr_iomem(&odev->screen_base, screen_base); in ofdrm_device_create()
1241 odev->mode = ofdrm_mode(width, height); in ofdrm_device_create()
1242 odev->format = format; in ofdrm_device_create()
1243 odev->pitch = linebytes; in ofdrm_device_create()
1245 drm_dbg(dev, "display mode={" DRM_MODE_FMT "}\n", DRM_MODE_ARG(&odev->mode)); in ofdrm_device_create()
1271 odev->formats, ARRAY_SIZE(odev->formats)); in ofdrm_device_create()
1273 primary_plane = &odev->primary_plane; in ofdrm_device_create()
1275 odev->formats, nformats, in ofdrm_device_create()
1285 crtc = &odev->crtc; in ofdrm_device_create()
1292 if (odev->cmap_base) { in ofdrm_device_create()
1299 encoder = &odev->encoder; in ofdrm_device_create()
1307 connector = &odev->connector; in ofdrm_device_create()
1323 return odev; in ofdrm_device_create()
1349 struct ofdrm_device *odev; in ofdrm_probe() local
1354 odev = ofdrm_device_create(&ofdrm_driver, pdev); in ofdrm_probe()
1355 if (IS_ERR(odev)) in ofdrm_probe()
1356 return PTR_ERR(odev); in ofdrm_probe()
1357 dev = &odev->dev; in ofdrm_probe()
1363 color_mode = drm_format_info_bpp(odev->format, 0); in ofdrm_probe()
1365 color_mode = odev->format->depth; // can be 15 or 16 in ofdrm_probe()