Logo Search packages:      
Sourcecode: linux version File versions  Download package

static int drm__bufs_info ( char *  buf,
char **  start,
off_t  offset,
int  request,
int *  eof,
void *  data 
) [static]

Called when "/proc/dri/.../bufs" is read.

Parameters:
buf output buffer.
start start of output data.
offset requested start offset.
request requested number of bytes.
eof whether there is no more data to return.
data private data.
Returns:
number of written bytes.

Definition at line 357 of file drm_proc.c.

References DRM_MAX_ORDER.

Referenced by drm_bufs_info().

{
      struct drm_device *dev = (struct drm_device *) data;
      int len = 0;
      struct drm_device_dma *dma = dev->dma;
      int i;

      if (!dma || offset > DRM_PROC_LIMIT) {
            *eof = 1;
            return 0;
      }

      *start = &buf[offset];
      *eof = 0;

      DRM_PROC_PRINT(" o     size count  free    segs pages    kB\n\n");
      for (i = 0; i <= DRM_MAX_ORDER; i++) {
            if (dma->bufs[i].buf_count)
                  DRM_PROC_PRINT("%2d %8d %5d %5d %5d %5d %5ld\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_PROC_PRINT("\n");
      for (i = 0; i < dma->buf_count; i++) {
            if (i && !(i % 32))
                  DRM_PROC_PRINT("\n");
            DRM_PROC_PRINT(" %d", dma->buflist[i]->list);
      }
      DRM_PROC_PRINT("\n");

      if (len > request + offset)
            return request;
      *eof = 1;
      return len - offset;
}


Generated by  Doxygen 1.6.0   Back to index