video: rockchip: vpu: fix the client type configure

The userspace would use the client type ioctl to make
a session work in secure mode, reuse the undefine
bits of the argument.

This patch would remove the secure mode setting from
the client type argument which was a mistake in a
previous commit, but without the secure mode applied,
nobody would know.

Change-Id: Ifaa976a0c9ab0c981b1f94f4978cd13a61adb0a7
Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
Randy Li
2019-03-21 14:21:02 +08:00
committed by Tao Huang
parent 3e4999e45b
commit f28e440e54

View File

@@ -1725,11 +1725,10 @@ static long vpu_service_ioctl(struct file *filp, unsigned int cmd,
case VPU_IOC_SET_CLIENT_TYPE: {
int secure_mode;
secure_mode = (arg & 0xffff0000) >> 16;
session->type = (enum VPU_CLIENT_TYPE)(arg & 0xffff);
secure_mode = arg >> 16;
atomic_set(&pservice->secure_mode, secure_mode);
session->type = (enum VPU_CLIENT_TYPE)arg;
session->type = (enum VPU_CLIENT_TYPE)(arg & 0xffff);
vpu_debug(DEBUG_IOCTL, "pid %d set client type %d, secure mode = %d\n",
session->pid, session->type, secure_mode);
} break;
@@ -1793,7 +1792,7 @@ static long vpu_service_ioctl(struct file *filp, unsigned int cmd,
vpu_debug(DEBUG_IOCTL, "pid %d get reg type %d\n",
session->pid, session->type);
if (atomic_read(&pservice->secure_mode) == 1) {
if (atomic_read(&pservice->secure_mode)) {
ret = wait_event_timeout(session->wait,
pservice->secure_isr,
VPU_TIMEOUT_DELAY);