summaryrefslogtreecommitdiff
path: root/shared
AgeCommit message (Expand)Author
2004-08-27__NO_VERSION__ hasn't been needed since 2.3 days ditch it...Dave Airlie
2004-08-26Rearrange things so that via_dma.c will compile with inline via_check_dmaJon Smirl
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-08-24This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:Erdi Chen
2004-08-23set pointers to NULL after freeing, remove some extra debuggingDave Airlie
2004-08-17Merged drmfntbl-0-0-1Dave Airlie
2004-08-17preparation patch for radeon permanent mapping registers/framebuffer makesDave Airlie
2004-08-14Add a "dev" argument to DRIVER_CTX_[CD]TOR. This will be used in anEric Anholt
2004-08-13Fix apparent copy'n'paste-o of the card attributes commit that broke theEric Anholt
2004-08-10Patch from Jon Smirl to add attribute field to the pciids, and use this forDave Airlie
2004-08-02forgot to check these in.. thanks to Jon for reminding me ..Dave Airlie
2004-07-31patch from RH xorg-x11 tree ported to drm.hDave Airlie
2004-07-31fixes for using userspace pointers found by sparse utilityDave Airlie
2004-07-29initial port of i915 to BSD, not finished doesn't work.. no idea why...Dave Airlie
2004-07-25check for __user if not there define itDave Airlie
2004-07-25sync up with current 2.6 kernel bk tree - mostly __user annotationsDave Airlie
2004-07-23Correct a couple of packet length calculations.Keith Whitwell
2004-07-20Add NULLs instead of 0 for i915Dave Airlie
2004-07-15sparse cleanups from kernel: Al ViroDave Airlie
2004-07-05align with kernelDave Airlie
2004-07-05whitespace align with kernelDave Airlie
2004-06-10i915.o drm driverKeith Whitwell
2004-06-02Added some comments copied from xf86drm.h.Ian Romanick
2004-06-01Replace size_t with an ugly, ugly hack. This was done so that code in theIan Romanick
2004-05-18fix whitespace issue in previous patchRoland Scheidegger
2004-05-18add R200_EMIT_RB3D_BLENDCOLOR state packet to support GL_EXT_blend_color,Roland Scheidegger
2004-05-14Add PCI id entry for VIA CN400 (UnichromePro) chip. XFree86 bug: ReportedErdi Chen
2004-05-11Merge from FreeBSD-current. Mostly 64-bit cleanliness fixes, but a fewEric Anholt
2004-05-11Add missing DRM_ERR()s.Eric Anholt
2004-05-09Commit sysfs and drm PCI changes for 2.6 kernelDave Airlie
2004-04-26add another tdfxDave Airlie
2004-04-21add new files to generate pci idsDave Airlie
2004-04-21centralise pci ids into one place and use scripts to generate files forDave Airlie
2004-04-121. Added a PCI ID.Thomas Hellstrom
2004-04-12Add mach64 to the trunkDave Airlie
2004-04-10white space changes to align with kernelDave Airlie
2004-04-08fix build problemAlan Hourihane
2004-04-08fixes from Linux kernelDave Airlie
2004-03-31VIA module fixes:Thomas Hellstrom
2004-03-23Merged via-1-2-0Thomas Hellstrom
2004-03-12Fixes need to clean up the mess I made with the mesa merge. This codeJon Smirl
2004-02-18Fix sisfb header location for 2.6 kernelsMichel Daenzer
2004-01-10Make sure that all state packets are handled inMichel Daenzer
2004-01-10R200_PP_CUBIC_OFFSET_F1_[0-6] state packets only contain 5 offsets, not 6Michel Daenzer
2003-12-16Don't ioremap the framebuffer area. The ioremapped area wasn't used byEric Anholt
2003-12-16Add a collection of Radeon and R128 PCI IDs, including the IGP chipsets.Eric Anholt
2003-11-05- Tie the DRM to a specific device: setunique no longer succeeds when givenEric Anholt
2003-11-05Use int64_t instead of s64 -- fixes FreeBSD compile, works on linux.Eric Anholt
2003-11-05__linux__ is spelled with a lowercase 'l'Eric Anholt
2003-11-05Repo-copy linux/drm/kernel/drm.h to shared/drm/kernel/drm.h and use it onEric Anholt
="hl opt">) DRM_SYSCTL_HANDLER_ARGS; } drm_sysctl_list[] = { {"name", drm_name_info}, {"vm", drm_vm_info}, {"clients", drm_clients_info}, {"bufs", drm_bufs_info}, }; #define DRM_SYSCTL_ENTRIES (sizeof(drm_sysctl_list)/sizeof(drm_sysctl_list[0])) struct drm_sysctl_info { struct sysctl_ctx_list ctx; char name[2]; }; int drm_sysctl_init(drm_device_t *dev) { struct drm_sysctl_info *info; struct sysctl_oid *oid; struct sysctl_oid *top, *drioid; int i; info = malloc(sizeof *info, M_DRM, M_WAITOK | M_ZERO); if ( !info ) return 1; dev->sysctl = info; /* Add the sysctl node for DRI if it doesn't already exist */ drioid = SYSCTL_ADD_NODE( &info->ctx, &sysctl__hw_children, OID_AUTO, "dri", CTLFLAG_RW, NULL, "DRI Graphics"); if (!drioid) return 1; /* Find the next free slot under hw.dri */ i = 0; SLIST_FOREACH(oid, SYSCTL_CHILDREN(drioid), oid_link) { if (i <= oid->oid_arg2) i = oid->oid_arg2 + 1; } if (i>9) return 1; /* Add the hw.dri.x for our device */ info->name[0] = '0' + i; info->name[1] = 0; top = SYSCTL_ADD_NODE( &info->ctx, SYSCTL_CHILDREN(drioid), OID_AUTO, info->name, CTLFLAG_RW, NULL, NULL); if (!top) return 1; for (i = 0; i < DRM_SYSCTL_ENTRIES; i++) { oid = SYSCTL_ADD_OID(&info->ctx, SYSCTL_CHILDREN(top), OID_AUTO, drm_sysctl_list[i].name, CTLTYPE_INT | CTLFLAG_RD, dev, 0, drm_sysctl_list[i].f, "A", NULL); if (!oid) return 1; } SYSCTL_ADD_INT(&info->ctx, SYSCTL_CHILDREN(top), OID_AUTO, "debug", CTLFLAG_RW, &drm_debug_flag, sizeof(drm_debug_flag), "Enable debugging output"); return 0; } int drm_sysctl_cleanup(drm_device_t *dev) { int error; error = sysctl_ctx_free( &dev->sysctl->ctx ); free(dev->sysctl, M_DRM); dev->sysctl = NULL; return error; } #define DRM_SYSCTL_PRINT(fmt, arg...) \ do { \ snprintf(buf, sizeof(buf), fmt, ##arg); \ retcode = SYSCTL_OUT(req, buf, strlen(buf)); \ if (retcode) \ goto done; \ } while (0) static int drm_name_info DRM_SYSCTL_HANDLER_ARGS { drm_device_t *dev = arg1; char buf[128]; int retcode; int hasunique = 0; DRM_SYSCTL_PRINT("%s 0x%x", dev->driver.name, dev2udev(dev->devnode)); DRM_LOCK(); if (dev->unique) { snprintf(buf, sizeof(buf), " %s", dev->unique); hasunique = 1; } DRM_UNLOCK(); if (hasunique) SYSCTL_OUT(req, buf, strlen(buf)); SYSCTL_OUT(req, "", 1); done: return retcode; } static int drm_vm_info DRM_SYSCTL_HANDLER_ARGS { drm_device_t *dev = arg1; drm_local_map_t *map, *tempmaps; const char *types[] = { "FB", "REG", "SHM", "AGP", "SG" }; const char *type, *yesno; int i, mapcount; char buf[128]; int retcode; /* We can't hold the lock while doing SYSCTL_OUTs, so allocate a * temporary copy of all the map entries and then SYSCTL_OUT that. */ DRM_LOCK(); mapcount = 0; TAILQ_FOREACH(map, &dev->maplist, link) mapcount++; tempmaps = malloc(sizeof(drm_local_map_t) * mapcount, M_DRM, M_NOWAIT); if (tempmaps == NULL) { DRM_UNLOCK(); return ENOMEM; } i = 0; TAILQ_FOREACH(map, &dev->maplist, link) tempmaps[i++] = *map; DRM_UNLOCK(); DRM_SYSCTL_PRINT("\nslot offset size type flags " "address mtrr\n"); for (i = 0; i < mapcount; i++) { map = &tempmaps[i]; if (map->type < 0 || map->type > 4) type = "??"; else type = types[map->type]; if (!map->mtrr) yesno = "no"; else yesno = "yes"; DRM_SYSCTL_PRINT( "%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx %s\n", i, map->offset, map->size, type, map->flags, (unsigned long)map->handle, yesno); } SYSCTL_OUT(req, "", 1); done: free(tempmaps, M_DRM); return retcode; } static int drm_bufs_info DRM_SYSCTL_HANDLER_ARGS { drm_device_t *dev = arg1; drm_device_dma_t *dma = dev->dma; drm_device_dma_t tempdma; int *templists; int i; char buf[128]; int retcode; /* We can't hold the locks around DRM_SYSCTL_PRINT, so make a temporary * copy of the whole structure and the relevant data from buflist. */ DRM_LOCK(); if (dma == NULL) { DRM_UNLOCK(); return 0; } DRM_SPINLOCK(&dev->dma_lock); tempdma = *dma; templists = malloc(sizeof(int) * dma->buf_count, M_DRM, M_NOWAIT); for (i = 0; i < dma->buf_count; i++) templists[i] = dma->buflist[i]->list; dma = &tempdma; DRM_SPINUNLOCK(&dev->dma_lock); DRM_UNLOCK(); DRM_SYSCTL_PRINT("\n o size count free segs pages kB\n"); for (i = 0; i <= DRM_MAX_ORDER; i++) { if (dma->bufs[i].buf_count) DRM_SYSCTL_PRINT("%2d %8d %5d %5d %5d %5d %5d\n", i, dma->bufs[i].buf_size, dma->bufs[i].buf_count, atomic_read(&dma->bufs[i] .freelist.count), dma->bufs[i].seg_count, dma->bufs[i].seg_count *(1 << dma->bufs[i].page_order), (dma->bufs[i].seg_count * (1 << dma->bufs[i].page_order)) * PAGE_SIZE / 1024); } DRM_SYSCTL_PRINT("\n"); for (i = 0; i < dma->buf_count; i++) { if (i && !(i%32)) DRM_SYSCTL_PRINT("\n"); DRM_SYSCTL_PRINT(" %d", templists[i]); } DRM_SYSCTL_PRINT("\n"); SYSCTL_OUT(req, "", 1); done: free(templists, M_DRM); return retcode; } static int drm_clients_info DRM_SYSCTL_HANDLER_ARGS { drm_device_t *dev = arg1; drm_file_t *priv, *tempprivs; char buf[128]; int retcode; int privcount, i; DRM_LOCK(); privcount = 0; TAILQ_FOREACH(priv, &dev->files, link) privcount++; tempprivs = malloc(sizeof(drm_file_t) * privcount, M_DRM, M_NOWAIT); if (tempprivs == NULL) { DRM_UNLOCK(); return ENOMEM; } i = 0; TAILQ_FOREACH(priv, &dev->files, link) tempprivs[i++] = *priv; DRM_UNLOCK(); DRM_SYSCTL_PRINT("\na dev pid uid magic ioctls\n"); for (i = 0; i < privcount; i++) { priv = &tempprivs[i]; DRM_SYSCTL_PRINT("%c %3d %5d %5d %10u %10lu\n", priv->authenticated ? 'y' : 'n', priv->minor, priv->pid, priv->uid, priv->magic, priv->ioctl_count); } SYSCTL_OUT(req, "", 1); done: free(tempprivs, M_DRM); return retcode; }