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