Part of video hw driver update from UMG.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
DRM_AUTH),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_CREATE_UB, psb_pl_ub_create_ioctl,
DRM_AUTH),
- PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_PL_WRAP_PVR_BUF,
- psb_pl_wrap_pvr_buf_ioctl, DRM_AUTH),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_FENCE_SIGNALED,
psb_fence_signaled_ioctl, DRM_AUTH),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_TTM_FENCE_FINISH, psb_fence_finish_ioctl,
struct drm_file *file_priv);
extern int psb_pl_ub_create_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-extern int psb_pl_wrap_pvr_buf_ioctl(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
extern int psb_extension_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern int psb_ttm_global_init(struct drm_psb_private *dev_priv);
}
-int psb_pl_wrap_pvr_buf_ioctl(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
-{
- struct drm_psb_private *dev_priv = psb_priv(dev);
-
- return ttm_pl_wrap_pvr_buf_ioctl(psb_fpriv(file_priv)->tfile,
- &dev_priv->bdev, &dev_priv->ttm_lock, data);
-}
-
/**
* psb_ttm_fault - Wrapper around the ttm fault method.
*
return pl_create_buf(&cp, lock, rep);
}
-int ttm_pl_wrap_pvr_buf_ioctl(struct ttm_object_file *tfile,
- struct ttm_bo_device *bdev,
- struct ttm_lock *lock, void *data)
-{
- union ttm_pl_wrap_pvr_buf_arg *arg = data;
- struct ttm_pl_wrap_pvr_buf_req *req = &arg->req;
- struct ttm_pl_rep *rep = &arg->rep;
- struct ttm_placement pl = pvr_default_placement;
- struct pvr_buf_info buf_info;
- uint32_t pl_flags = normalize_placement_flags(req->placement);
- int ret;
- struct create_params cp = {
- .bdev = bdev,
- .bo_type = ttm_bo_type_device,
- .align = req->page_alignment,
- .placement = &pl,
- .tfile = tfile,
- .shareable = req->placement & TTM_PL_FLAG_SHARED,
- };
-
- if (!fixed_placement_valid(pl_flags))
- return -EINVAL;
-
- pl.num_placement = 1;
- pl.placement = &pl_flags;
-
- ret = pvr_lookup_dev_buf(req->handle, &buf_info);
- if (ret < 0)
- return ret;
- /*
- * We set here the ttm pages to point to the fixed pages from the
- * pvr buffer. Due to TTM_PL_FLAG_NO_SWAP set above and the
- * busy_placement settings, these will never be swapped or moved to
- * an IO region and thus never be freed before the buffer itself is
- * destroyed.
- */
- cp.pages = buf_info.pages;
- cp.size = buf_info.page_cnt;
-
- ret = pl_create_buf(&cp, lock, rep);
-
- pvr_put_dev_buf(&buf_info);
-
- return ret;
-}
-
int ttm_pl_reference_ioctl(struct ttm_object_file *tfile, void *data)
{
union ttm_pl_reference_arg *arg = data;
};
/**
- * struct ttm_pl_wrap_pvr_buf_req
- *
- * @handle: PVR buffer id
- * @placement: Flags that indicate initial acceptable
- * placement.
- *
- * Input to the TTM_WRAP_PVR_BUF ioctl.
- */
-struct ttm_pl_wrap_pvr_buf_req {
- uint32_t handle;
- uint32_t placement;
- uint32_t page_alignment;
-};
-
-/**
* struct ttm_pl_rep
*
* @gpu_offset: The current offset into the memory region used.
struct ttm_pl_rep rep;
};
-union ttm_pl_wrap_pvr_buf_arg {
- struct ttm_pl_wrap_pvr_buf_req req;
- struct ttm_pl_rep rep;
-};
-
/*
* Ioctl offsets.
*/
#define TTM_PL_WAITIDLE 0x04
#define TTM_PL_SETSTATUS 0x05
#define TTM_PL_CREATE_UB 0x06
-#define TTM_PL_WRAP_PVR_BUF 0x07
#endif
extern int ttm_pl_ub_create_ioctl(struct ttm_object_file *tfile,
struct ttm_bo_device *bdev,
struct ttm_lock *lock, void *data);
-extern int ttm_pl_wrap_pvr_buf_ioctl(struct ttm_object_file *tfile,
- struct ttm_bo_device *bdev,
- struct ttm_lock *lock, void *data);
extern int ttm_pl_reference_ioctl(struct ttm_object_file *tfile, void *data);
extern int ttm_pl_unref_ioctl(struct ttm_object_file *tfile, void *data);
extern int ttm_pl_synccpu_ioctl(struct ttm_object_file *tfile, void *data);