Skip to content

Commit

Permalink
drm/i915: debug and log
Browse files Browse the repository at this point in the history
Tracked-On: OAM-121827
Signed-off-by: Xue, Bosheng <[email protected]>
  • Loading branch information
bosheng1 committed Aug 23, 2024
1 parent 2cfebbc commit bfd6a18
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 84 deletions.
24 changes: 12 additions & 12 deletions drivers/gpu/drm/i915/pxp/intel_pxp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ struct intel_pxp_session {
};

struct intel_pxp_fe {
struct drm_i915_private *i915;
bool enabled;
bool active;
struct mutex session_mutex;
int device_idx;
int device_vfid;
int max_sessions;
int avail_sessions;
struct virtio_pxp *vpxp;
spinlock_t irq_lock;
struct intel_pxp_session hwdrm_sessions[INTEL_PXP_MAX_HWDRM_SESSIONS];
u32 key_instance;
struct drm_i915_private *i915;
bool enabled;
bool active;
struct mutex session_mutex;
int device_idx;
int device_vfid;
int max_sessions;
int avail_sessions;
struct virtio_pxp *vpxp;
spinlock_t irq_lock;
struct intel_pxp_session hwdrm_sessions[INTEL_PXP_MAX_HWDRM_SESSIONS];
u32 key_instance;
struct work_struct session_work;
u32 session_events;
};
Expand Down
28 changes: 14 additions & 14 deletions drivers/gpu/drm/i915/pxp/virt/intel_pxp_fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void event_cb(int event, void *priv)
unsigned long flags;
if (!pxp)
return;
DRM_DEBUG("PXP FE: event receive: %d\n", event);
printk("PXP FE: event receive: %d\n", event);
spin_lock_irqsave(&pxp->fe.irq_lock, flags);
pxp->session_events |= event;
spin_unlock_irqrestore(&pxp->fe.irq_lock, flags);
Expand All @@ -88,7 +88,7 @@ void intel_pxp_fe_terminate(struct intel_pxp *pxp)
mutex_lock(&pxp->fe.session_mutex);
for(int index = 0; index < INTEL_PXP_MAX_HWDRM_SESSIONS; index++) {
if (pxp->fe.hwdrm_sessions[index].index > 0) {
DRM_DEBUG("%s, PXP FE: session terminate:%d\n",__FUNCTION__, index);
printk("%s, PXP FE: session terminate:%d\n",__FUNCTION__, index);
intel_pxp_fe_sm_ioctl_terminate_session(pxp, pxp->fe.hwdrm_sessions[index].drmfile, index);
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ static void pxp_fe_session_work(struct work_struct *work)
if (!events)
return;

DRM_DEBUG("PXP FE: processing event-flags 0x%08x", events);
printk("PXP FE: processing event-flags 0x%08x", events);

if (events & PXP_INVAL_REQUIRED) {
intel_pxp_invalidate(pxp_fe->i915->pxp);
Expand Down Expand Up @@ -172,15 +172,15 @@ int intel_pxp_fe_init(struct drm_i915_private *i915)
INIT_WORK(&i915->pxp->fe.session_work, pxp_fe_session_work);
vpxp = get_virtio_pxp(device_idx, device_vfid, event_cb, i915->pxp);
if (vpxp) {
DRM_INFO("PXP FE: succeed to bind virtio device\n");
DRM_INFO("PXP FE: succeed to bind virtio device, vpxp:%p\n", vpxp);
i915->pxp->fe.vpxp = vpxp;
i915->pxp->fe.enabled = true;
i915->pxp->fe.max_sessions = vpxp->sessions;
i915->pxp->fe.avail_sessions = vpxp->sessions;
}
mutex_init(&i915->pxp->fe.session_mutex);
spin_lock_init(&i915->pxp->fe.irq_lock);
DRM_INFO("PXP FE: protected content support initialized\n");
DRM_INFO("PXP FE: protected content support initialized\n");
return 0;
}

Expand Down Expand Up @@ -231,7 +231,7 @@ int intel_pxp_fe_start(struct intel_pxp *pxp)
return 0;
if (intel_pxp_is_active(pxp))
return 0;
DRM_DEBUG("%s\n",__FUNCTION__);
printk("%s\n",__FUNCTION__);
pxp_key_instance_update(pxp);

pxp->fe.active = true;
Expand All @@ -245,7 +245,7 @@ void intel_pxp_fe_end(struct intel_pxp *pxp)
return;
if (!intel_pxp_is_active(pxp))
return ;
DRM_DEBUG("%s\n",__FUNCTION__);
printk("%s\n",__FUNCTION__);
flush_work(&pxp->fe.session_work);
pxp->fe.active = false;
}
Expand Down Expand Up @@ -295,7 +295,7 @@ int intel_pxp_fe_sm_ioctl_reserve_session(struct intel_pxp *pxp, struct drm_file
ret = virtio_set_session(pxp->fe.vpxp, &params);
*pxp_tag = params.pxp_tag;
session_id = *pxp_tag & PRELIM_DRM_I915_PXP_TAG_SESSION_ID_MASK;
DRM_DEBUG("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
printk("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
if (session_id >= INTEL_PXP_MAX_HWDRM_SESSIONS || session_id <= 0) {
DRM_ERROR("PXP FE: invalid session id:%d", session_id);
return -1;
Expand Down Expand Up @@ -324,7 +324,7 @@ int intel_pxp_fe_sm_ioctl_mark_session_in_play(struct intel_pxp *pxp,
params.pxp_tag = session_id;
params.req_session_state = PRELIM_DRM_I915_PXP_REQ_SESSION_IN_PLAY;
ret = virtio_set_session(pxp->fe.vpxp, &params);
DRM_DEBUG("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
printk("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
if (ret < 0)
return ret;
pxp->fe.hwdrm_sessions[session_id].is_valid = true;
Expand All @@ -348,7 +348,7 @@ int intel_pxp_fe_sm_ioctl_terminate_session(struct intel_pxp *pxp,
params.pxp_tag = session_id;
params.req_session_state = PRELIM_DRM_I915_PXP_REQ_SESSION_TERMINATE;
ret = virtio_set_session(pxp->fe.vpxp, &params);
DRM_DEBUG("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
printk("%s, session_id:%d, ret:%d\n",__FUNCTION__, session_id, ret);
return ret;
}

Expand All @@ -368,7 +368,7 @@ int intel_pxp_fe_io_message(struct intel_pxp *pxp,
params.msg_out = (u64)msg_out;
params.msg_out_buf_size = msg_out_max_size;
ret = virtio_io_msg(pxp->fe.vpxp, &params);
DRM_DEBUG("%s, ret:%d, ret size:%d\n",__FUNCTION__, ret, params.msg_out_ret_size);
printk("%s, ret:%d, ret size:%d\n",__FUNCTION__, ret, params.msg_out_ret_size);
*msg_out_rcv_size = params.msg_out_ret_size;
return ret;
}
Expand All @@ -390,7 +390,7 @@ int intel_pxp_fe_sm_ioctl_query_pxp_tag(struct intel_pxp *pxp,
ret = virtio_query_tag(pxp->fe.vpxp, &params);
*pxp_tag = params.pxp_tag;
*session_is_alive = params.session_is_alive;
DRM_DEBUG("%s, ret:%d\n",__FUNCTION__, ret);
printk("%s, ret:%d\n",__FUNCTION__, ret);
return ret;
}

Expand Down Expand Up @@ -459,7 +459,7 @@ static bool ioctl_buffer_size_valid(u32 size)
return size > 0 && size <= SZ_64K;
}

static int
static int
intel_pxp_fe_ioctl_io_message(struct intel_pxp *pxp, struct drm_file *drmfile,
struct prelim_drm_i915_pxp_tee_io_message_params *params)
{
Expand Down Expand Up @@ -665,7 +665,7 @@ void intel_pxp_fe_close(struct intel_pxp *pxp, struct drm_file *drmfile)
mutex_lock(&pxp->fe.session_mutex);
for(index = 0; index < INTEL_PXP_MAX_HWDRM_SESSIONS; index++) {
if (pxp->fe.hwdrm_sessions[index].index > 0 && (pxp->fe.hwdrm_sessions[index].drmfile == drmfile)) {
DRM_DEBUG("%s, PXP FE: session terminate:%d\n",__FUNCTION__, index);
printk("%s, PXP FE: session terminate:%d\n",__FUNCTION__, index);
intel_pxp_fe_sm_ioctl_terminate_session(pxp, pxp->fe.hwdrm_sessions[index].drmfile, index);
}
}
Expand Down
Loading

0 comments on commit bfd6a18

Please sign in to comment.