Lines Matching refs:di

120 #define INREG16(addr)		(*((vuint16*)(di.regs + (addr))))
121 #define INREG32(addr) (*((vuint32*)(di.regs + (addr))))
123 #define OUTREG16(addr, val) (*((vuint16*)(di.regs + (addr))) = (val))
124 #define OUTREG32(addr, val) (*((vuint32*)(di.regs + (addr))) = (val))
242 InitDevice(DeviceInfo& di)
254 di.sharedArea = create_area("i810 shared info",
255 (void**) &(di.sharedInfo),
260 if (di.sharedArea < 0)
261 return di.sharedArea; // return error code
263 SharedInfo& si = *(di.sharedInfo);
268 pci_info& pciInfo = di.pciInfo;
273 strcpy(si.chipName, di.pChipInfo->chipName);
290 (void**)&di.regs);
300 di.gttArea = create_area("GTT memory", (void**) &(di.gttAddr),
304 if (di.gttArea < B_OK) {
305 TRACE("Unable to create GTT, error: 0x%" B_PRIx32 "\n", di.gttArea);
309 memset((void*)(di.gttAddr), 0, gttSize);
314 status_t status = get_memory_map((void *)(di.gttAddr),
362 DeleteAreas(DeviceInfo& di)
366 if (di.sharedArea >= 0 && di.sharedInfo != NULL) {
367 SharedInfo& si = *(di.sharedInfo);
374 if (di.gttArea >= 0)
375 delete_area(di.gttArea);
376 di.gttArea = -1;
377 di.gttAddr = (addr_t)NULL;
379 if (di.sharedArea >= 0)
380 delete_area(di.sharedArea);
381 di.sharedArea = -1;
382 di.sharedInfo = NULL;
476 DeviceInfo& di = gDeviceInfo[count];
478 const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, di.pciInfo);
483 sprintf(di.name, "graphics/" DEVICE_FORMAT,
484 di.pciInfo.vendor_id, di.pciInfo.device_id,
485 di.pciInfo.bus, di.pciInfo.device, di.pciInfo.function);
486 TRACE("init_driver() match found; name: %s\n", di.name);
488 gDeviceNames[count] = di.name;
489 di.openCount = 0; // mark driver as available for R/W open
490 di.sharedArea = -1; // indicate shared area not yet created
491 di.sharedInfo = NULL;
492 di.gttArea = -1; // indicate GTT area not yet created
493 di.gttAddr = (addr_t)NULL;
494 di.pChipInfo = pDevice;
559 DeviceInfo& di = gDeviceInfo[i];
563 if (di.openCount == 0) {
564 status = InitDevice(di);
566 DeleteAreas(di); // error occurred; delete any areas created
572 di.openCount++; // mark device open
573 *cookie = &di; // send cookie to opener
577 "open count: %" B_PRId32 "\n", status, di.openCount);
623 DeviceInfo& di = *((DeviceInfo*)dev);
631 if (di.openCount <= 1)
632 DeleteAreas(di);
634 if (di.openCount > 0)
635 di.openCount--; // mark device available
639 TRACE("exit device_free() openCount: %" B_PRId32 "\n", di.openCount);
647 DeviceInfo& di = *((DeviceInfo*)dev);
659 strncpy((char*)buffer, di.name, B_OS_NAME_LENGTH);
667 *((area_id*)buffer) = di.sharedArea;