Commit 7e93a080 authored by Yan Zhao's avatar Yan Zhao Committed by Zhenyu Wang

drm/i915/gvt: add/modify interfaces for flag F_CMD_ACCESS

flag F_CMD_ACCESS represents whether an MMIO is able to be accessed by
GPU commands.
In this patch,
1. add interface to set this flag
2. rename intel_gvt_mmio_is_cmd_access() to
intel_gvt_mmio_is_cmd_accessible() and update its description message.
Reviewed-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: default avatarYan Zhao <yan.y.zhao@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200811070233.3387-1-yan.y.zhao@intel.com
parent a6c5817a
...@@ -936,7 +936,7 @@ static int cmd_reg_handler(struct parser_exec_state *s, ...@@ -936,7 +936,7 @@ static int cmd_reg_handler(struct parser_exec_state *s,
return -EFAULT; return -EFAULT;
} }
if (!intel_gvt_mmio_is_cmd_access(gvt, offset)) { if (!intel_gvt_mmio_is_cmd_accessible(gvt, offset)) {
gvt_vgpu_err("%s access to non-render register (%x)\n", gvt_vgpu_err("%s access to non-render register (%x)\n",
cmd, offset); cmd, offset);
return -EBADRQC; return -EBADRQC;
......
...@@ -594,17 +594,32 @@ static inline void intel_gvt_mmio_set_accessed( ...@@ -594,17 +594,32 @@ static inline void intel_gvt_mmio_set_accessed(
} }
/** /**
* intel_gvt_mmio_is_cmd_accessed - mark a MMIO could be accessed by command * intel_gvt_mmio_is_cmd_accessible - if a MMIO could be accessed by command
* @gvt: a GVT device * @gvt: a GVT device
* @offset: register offset * @offset: register offset
* *
* Returns:
* True if an MMIO is able to be accessed by GPU commands
*/ */
static inline bool intel_gvt_mmio_is_cmd_access( static inline bool intel_gvt_mmio_is_cmd_accessible(
struct intel_gvt *gvt, unsigned int offset) struct intel_gvt *gvt, unsigned int offset)
{ {
return gvt->mmio.mmio_attribute[offset >> 2] & F_CMD_ACCESS; return gvt->mmio.mmio_attribute[offset >> 2] & F_CMD_ACCESS;
} }
/**
* intel_gvt_mmio_set_cmd_accessible -
* mark a MMIO could be accessible by command
* @gvt: a GVT device
* @offset: register offset
*
*/
static inline void intel_gvt_mmio_set_cmd_accessible(
struct intel_gvt *gvt, unsigned int offset)
{
gvt->mmio.mmio_attribute[offset >> 2] |= F_CMD_ACCESS;
}
/** /**
* intel_gvt_mmio_is_unalign - mark a MMIO could be accessed unaligned * intel_gvt_mmio_is_unalign - mark a MMIO could be accessed unaligned
* @gvt: a GVT device * @gvt: a GVT device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment