FreeBSD/sys/dev/drm2/drm_bufs.c
/**
 * Specifies a low and high water mark for buffer allocation
 *
 * \param inode device inode.
 * \param file_priv DRM file private.
 * \param cmd command.
 * \param arg a pointer to a drm_buf_desc structure.
 * \return zero on success or a negative number on failure.
 *
 * Verifies that the size order is bounded between the admissible orders and
 * updates the respective drm_device_dma::bufs entry low and high water mark.
 *
 * \note This ioctl is deprecated and mostly never used.
 */
Specifies a low and high water mark for buffer allocation
\param inode device inode.
\param file_priv DRM file private.
\param cmd command.
\param arg a pointer to a drm_buf_desc structure.
\return zero on success or a negative number on failure.

Verifies that the size order is bounded between the admissible orders and
updates the respective drm_device_dma::bufs entry low and high water mark.

\note This ioctl is deprecated and mostly never used.
Specifies a low and high water mark for buffer allocation \ param inode device inode . \ param file_priv DRM file private . \ param cmd command . \ param arg a pointer to a drm_buf_desc structure . \ return zero on success or a negative number on failure . Verifies that the size order is bounded between the admissible orders and updates the respective drm_device_dma :: bufs entry low and high water mark . \ note This ioctl is deprecated and mostly never used .
int drm_markbufs(struct drm_device *dev, void *data,
		 struct drm_file *file_priv)
{
	struct drm_device_dma *dma = dev->dma;
	struct drm_buf_desc *request = data;
	int order;
	struct drm_buf_entry *entry;
	if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
		return -EINVAL;
	if (!dma)
		return -EINVAL;
	DRM_DEBUG("%d, %d, %d\n",
		  request->size, request->low_mark, request->high_mark);
	order = drm_order(request->size);
	if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
		return -EINVAL;
	entry = &dma->bufs[order];
	if (request->low_mark < 0 || request->low_mark > entry->buf_count)
		return -EINVAL;
	if (request->high_mark < 0 || request->high_mark > entry->buf_count)
		return -EINVAL;
	entry->freelist.low_mark = request->low_mark;
	entry->freelist.high_mark = request->high_mark;
	return 0;
}
int drm_markbufs ( struct drm_device * dev , void * data , struct drm_file * file_priv ) { struct drm_device_dma * dma = dev -> dma ; struct drm_buf_desc * request = data ; int order ; struct drm_buf_entry * entry ; if ( ! drm_core_check_feature ( dev , DRIVER_HAVE_DMA ) ) return - EINVAL ; if ( ! dma ) return - EINVAL ; DRM_DEBUG ( " \n " , request -> size , request -> low_mark , request -> high_mark ) ; order = drm_order ( request -> size ) ; if ( order < DRM_MIN_ORDER || order > DRM_MAX_ORDER ) return - EINVAL ; entry = & dma -> bufs [ order ] ; if ( request -> low_mark < 0 || request -> low_mark > entry -> buf_count ) return - EINVAL ; if ( request -> high_mark < 0 || request -> high_mark > entry -> buf_count ) return - EINVAL ; entry -> freelist . low_mark = request -> low_mark ; entry -> freelist . high_mark = request -> high_mark ; return 0 ; }
Specifies a low and high water mark for buffer allocation
 \param inode device inode.
Specifies a low and high water mark for buffer allocation \ param inode device inode .