示例#1
0
static int via_fb_free(drm_via_mem_t * mem)
{
	drm_via_mm_t fb;
	int retval = 0;

	if (!FBHeap) {
		return -1;
	}

	fb.free = mem->index;
	fb.context = mem->context;

	if (!fb.free) {
		return -1;

	}

	via_mmFreeMem((PMemBlock) fb.free);

	if (!del_alloc_set(fb.context, VIA_MEM_VIDEO, fb.free)) {
		retval = -1;
	}

	DRM_DEBUG("free fb, free = %ld\n", fb.free);

	return retval;
}
示例#2
0
static int sis_fb_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
	drm_sis_mem_t fb;
	int retval = 0;

	if (!fb->free)
		return -EINVAL;

	if (!del_alloc_set(fb->context, VIDEO_TYPE, fb->free))
		retval = -EINVAL;
	sis_free(fb->free);

	DRM_DEBUG("free fb, offset = 0x%lx\n", fb->free);

	return retval;
}
示例#3
0
int sis_fb_free( DRM_IOCTL_ARGS )
{
	drm_sis_mem_t fb;
	int retval = 0;

	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));

	if (!fb.free)
		return DRM_ERR(EINVAL);

	if (!del_alloc_set(fb.context, VIDEO_TYPE, fb.free))
		retval = DRM_ERR(EINVAL);
	sis_free(fb.free);

	DRM_DEBUG("free fb, offset = %lu\n", fb.free);

	return retval;
}
示例#4
0
static int sis_ioctl_agp_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
	drm_sis_private_t *dev_priv = dev->dev_private;
	drm_sis_mem_t *agp = data;

	if (dev_priv == NULL || dev_priv->AGPHeap == NULL)
		return -EINVAL;

	if (!mmBlockInHeap(dev_priv->AGPHeap, (PMemBlock) agp->free))
		return -EINVAL;

	mmFreeMem((PMemBlock) agp->free);
	if (!del_alloc_set(agp->context, AGP_TYPE, agp->free))
		return -EINVAL;

	DRM_DEBUG("free agp, free = 0x%lx\n", agp->free);

	return 0;
}
示例#5
0
static int sis_fb_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
	drm_sis_private_t *dev_priv = dev->dev_private;
	drm_sis_mem_t *fb = data;

	if (dev_priv == NULL || dev_priv->FBHeap == NULL)
		return -EINVAL;

	if (!mmBlockInHeap(dev_priv->FBHeap, (PMemBlock) fb->free))
		return -EINVAL;

	if (!del_alloc_set(fb->context, VIDEO_TYPE, fb->free))
		return -EINVAL;
	mmFreeMem((PMemBlock) fb->free);

	DRM_DEBUG("free fb, free = 0x%lx\n", fb->free);

	return 0;
}
示例#6
0
int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
		  unsigned long arg)
{
  drm_sis_mem_t fb;
  int retval = 0;
    
  if (copy_from_user(&fb, (drm_sis_mem_t *)arg, sizeof(fb)))
	  return -EFAULT;
  
  if(!fb.free){
    return -1;
  }

  sis_free(fb.free);
  if(!del_alloc_set(fb.context, VIDEO_TYPE, fb.free))
    retval = -1;

  DRM_DEBUG("free fb, offset = %ld\n", fb.free);
  
  return retval;
}
示例#7
0
static int via_agp_free(drm_via_mem_t * mem)
{
	drm_via_mm_t agp;

	int retval = 0;

	agp.free = mem->index;
	agp.context = mem->context;

	if (!agp.free)
		return -1;

	via_mmFreeMem((PMemBlock) agp.free);

	if (!del_alloc_set(agp.context, VIA_MEM_AGP, agp.free)) {
		retval = -1;
	}

	DRM_DEBUG("free agp, free = %ld\n", agp.nfree);

	return retval;
}
示例#8
0
int sis_ioctl_agp_free( DRM_IOCTL_ARGS )
{
	DRM_DEVICE;
	drm_sis_private_t *dev_priv = dev->dev_private;
	drm_sis_mem_t agp;

	if (dev_priv == NULL || dev_priv->AGPHeap == NULL)
		return DRM_ERR(EINVAL);

	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_mem_t *)data, sizeof(agp));

	if (!mmBlockInHeap(dev_priv->AGPHeap, (PMemBlock)agp.free))
		return DRM_ERR(EINVAL);

	mmFreeMem((PMemBlock)agp.free);
	if (!del_alloc_set(agp.context, AGP_TYPE, agp.free))
		return DRM_ERR(EINVAL);

	DRM_DEBUG("free agp, free = 0x%lx\n", agp.free);

	return 0;
}
示例#9
0
int sis_fb_free( DRM_IOCTL_ARGS )
{
	DRM_DEVICE;
	drm_sis_private_t *dev_priv = dev->dev_private;
	drm_sis_mem_t fb;

	if (dev_priv == NULL || dev_priv->FBHeap == NULL)
		return DRM_ERR(EINVAL);

	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));

	if (!mmBlockInHeap(dev_priv->FBHeap, (PMemBlock)fb.free))
		return DRM_ERR(EINVAL);

	if (!del_alloc_set(fb.context, VIDEO_TYPE, fb.free))
		return DRM_ERR(EINVAL);
	mmFreeMem((PMemBlock)fb.free);

	DRM_DEBUG("free fb, free = 0x%lx\n", fb.free);

	return 0;
}
示例#10
0
int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
		  unsigned long arg)
{
  drm_sis_mem_t agp;
  int retval = 0;

  if(!AgpHeap)
    return -1;
    
  if (copy_from_user(&agp, (drm_sis_mem_t *)arg, sizeof(agp)))
	  return -EFAULT;
  
  if(!agp.free){
    return -1;
  }

  mmFreeMem((PMemBlock)agp.free);
  if(!del_alloc_set(agp.context, AGP_TYPE, agp.free))
    retval = -1;

  DRM_DEBUG("free agp, free = %ld\n", agp.free);
  
  return retval;
}